CN109240838A - Interface call method, device, computer equipment and storage medium - Google Patents

Interface call method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN109240838A
CN109240838A CN201811099024.1A CN201811099024A CN109240838A CN 109240838 A CN109240838 A CN 109240838A CN 201811099024 A CN201811099024 A CN 201811099024A CN 109240838 A CN109240838 A CN 109240838A
Authority
CN
China
Prior art keywords
interface
target
parameter
target interface
sublist
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN201811099024.1A
Other languages
Chinese (zh)
Inventor
黄荣鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Dingfeng Cattle Technology Co Ltd
Original Assignee
Shenzhen Dingfeng Cattle Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Dingfeng Cattle Technology Co Ltd filed Critical Shenzhen Dingfeng Cattle Technology Co Ltd
Priority to CN201811099024.1A priority Critical patent/CN109240838A/en
Publication of CN109240838A publication Critical patent/CN109240838A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/541Interprogram communication via adapters, e.g. between incompatible applications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the present application discloses a kind of interface call method, device, computer equipment and storage medium.This method comprises: passing through the service request parameter for obtaining service requester;Interface type is determined according to the service request parameter, is obtained from preset interface call list and is called sublist with the consistent target interface of the interface type;Sublist is called to obtain target interface parameter according to the target interface;The service request parameter is formatted according to the first default transformation rule, to generate target interface call parameters;It is called according to the target interface that the target interface call parameters characterize the target interface parameter;If calling the target interface success, the target data according to acquired in the calling target interface is sent to service requester.The interface call method, can be improved the user experience of service requester.

Description

Interface call method, device, computer equipment and storage medium
Technical field
The invention belongs to field of computer technology more particularly to a kind of interface call method, device, computer equipment and deposit Storage media.
Background technique
With advances in technology with the development of society, cooperation between enterprises relationship is also increasingly closer.Typically, a side Enterprise needs the related adequate and systematic service of another party enterprise in the main business that it is managed.For example, first enterprise is managed at it It in the scope of business, there are when verifying demand, needs to verify the relevant information of client, such as the identity information of client is carried out Verifying, and the verifying work of identity information is usually to go to execute by second enterprise, Ji Yi enterprise provides an interface and gives first enterprise, first enterprise Industry is as service requester, and second enterprise is as interface provider, and first enterprise is by calling the interface to obtain corresponding data.? In practical operation, because will lead to interface malloc failure malloc the problems such as Network Abnormal.In the prior art, if calling interface fails, lead to It is often to be handled by repeatedly re-calling the mechanism of the interface.Because the duration of Network Abnormal is uncertain, use The mechanism repeatedly re-called cannot not only obtain data, also will increase the load pressure of interface service, when directly resulting in long Between cannot respond to the requested data of service requester, cause the user experience of service requester poor.
Summary of the invention
This application provides a kind of interface call method, device, computer equipment and storage mediums, can promote service request The user experience of side.
In a first aspect, this application provides a kind of interface call methods comprising:
Obtain the service request parameter of service requester;
Interface type is determined according to the service request parameter, is obtained and the interface type from preset interface call list Accordant interface calls sublist, and the preset interface call list includes that multiple interfaces sorted out according to interface type call son Table, it includes multiple interface parameters for being provided with priority orders that each interface, which calls sublist,;
Sublist is called to obtain target interface parameter according to the target interface, the target interface parameter is target interface tune With the interface parameters of highest priority in the interface parameters not being acquired in sublist;
The service request parameter is formatted according to the first default transformation rule, to generate target interface calling Parameter;
It is called according to the target interface that the target interface call parameters characterize the target interface parameter;
If calling the target interface success, the target data according to acquired in the calling target interface is sent to clothes Be engaged in requesting party.
Second aspect, this application provides a kind of interface calling devices comprising:
First acquisition unit, for obtaining the service request parameter of service requester;
Second acquisition unit, for determining interface type according to the service request parameter, from preset interface call list It obtains and calls sublist with the consistent target interface of the interface type, the preset interface call list includes multiple according to interface class The interface that type is sorted out calls sublist, and it includes multiple interface ginsengs for being provided with priority orders that each interface, which calls sublist, Number;
Third acquiring unit, for calling sublist to obtain target interface parameter according to the target interface, the target is connect Mouth parameter is the interface parameters that target interface calls highest priority in the interface parameters not being acquired in sublist;
First format conversion unit turns for carrying out format to the service request parameter according to the first default transformation rule It changes, to generate target interface call parameters;
Call unit, the target for being characterized according to the target interface call parameters to the target interface parameter connect Mouth is called;
Transmission unit, if for calling the target interface success, by the mesh according to acquired in the calling target interface Mark data are sent to service requester.
The third aspect, the application provide a kind of computer equipment again, including memory, processor and are stored in described deposit On reservoir and the computer program that can run on the processor, the processor realize this when executing the computer program The described in any item interface call methods provided are provided.
Fourth aspect, present invention also provides a kind of storage mediums, wherein the storage medium is stored with computer program, The computer program includes program instruction, and described program instruction makes the processor execute the application when being executed by a processor The described in any item interface call methods provided.
The application provides a kind of interface call method, device, computer equipment and storage medium.The interface call method, By the service request parameter for obtaining service requester;Interface type is determined according to the service request parameter, from preset interface It is obtained in call list and calls sublist with the consistent target interface of the interface type;Sublist is called to obtain according to the target interface Target interface parameter;The service request parameter is formatted according to the first default transformation rule, is connect with generating target Mouth call parameters;It is adjusted according to the target interface that the target interface call parameters characterize the target interface parameter With;If calling the target interface success, the target data according to acquired in the calling target interface is sent to service and is asked The side of asking.The interface call method proposed using the application, can promote the user experience of service requester.
Detailed description of the invention
Technical solution in order to illustrate the embodiments of the present invention more clearly, below will be to needed in embodiment description Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, general for this field For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is the schematic flow diagram for the interface call method that the embodiment of the present application proposes;
Fig. 2 is the schematic flow diagram for the interface call method that the another embodiment of the application proposes;
Fig. 3 is the schematic flow diagram for the interface call method that the another embodiment of the application proposes;
Fig. 4 is the schematic flow diagram for the interface call method that another embodiment of the application proposes;
Fig. 5 is the schematic flow diagram for the interface call method that the application another embodiment proposes;
Fig. 6 is the schematic flow diagram for the interface calling device that the embodiment of the present application proposes;
Fig. 7 is the schematic flow diagram for the interface calling device that the another embodiment of the application proposes;
Fig. 8 is the schematic flow diagram for the interface calling device that the another embodiment of the application proposes;
Fig. 9 is the schematic flow diagram for the interface calling device that another embodiment of the application proposes;
Figure 10 is the schematic flow diagram for the interface calling device that the application another embodiment proposes;
Figure 11 is the schematic block diagram for the computer equipment that the embodiment of the present application proposes.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " and "comprising" instruction Described feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precluded Body, step, operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this present specification merely for the sake of description specific embodiment And be not intended to limit the application.As present specification and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in present specification and the appended claims is Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
Referring to Fig. 1, Fig. 1 is the schematic flow diagram of interface call method provided by the embodiments of the present application.The interface tune It can be used in server with method.As shown in Figure 1, the interface call method includes the following steps S110~S160:
S110, the service request parameter for obtaining service requester.
Service requester sends different service request parameters according to the type of required service, and such as ID card verification is taken Business, the service request parameter are ID card verification service request parameter, which includes identity The information such as card number, User ID and password.It, can be convenient for according to the service by obtaining the service request parameter of service requester Data needed for required parameter obtains service requester.
Referring to Fig. 5, in one embodiment, after the step S110, the method also includes:
S110a, parameter verification is carried out to the service request parameter.
The parameter verification includes that must fill out the verification of parameter non-empty and legitimacy verifies.For example, for ID card verification service, In the ID card verification service request parameter, identification card number is that must fill out parameter, and for Chinese mainlander, identification card number Digit be 18.By carrying out parameter verification to service request parameter, it is pre- to can determine whether the service request parameter meets If condition, if in acquired ID card verification service request parameter, identification card number be empty or identification card number digit not Meet 18, that is, is considered as parameter verification failure, it can be by sending the prompting message of parameter verification failure to service requester;Phase Instead, if the digit of the identification card number meets 18, it is considered as parameter verification success.
Referring to Fig. 5, in one embodiment, after the step S110a, the method also includes:
If the success of S110b, the parametric test, carries out authentication verification to the service request parameter;
If the service request parameter authentication verifies successfully, execution is described to determine interface class according to the service request parameter The step of type, i.e. step S120.
It can determine whether the service requester has access right by authentication verification.It is corresponding by allocating in advance User ID and password give service requester, after obtaining service request parameter transmitted by the service requester, to user ID and password are verified respectively, if the User ID and password meet preset condition, that is, are considered as authentication and are verified successfully, otherwise regard For authentication verification failure.It, can be by sending the prompting message for authenticating verification failure to service requester if authentication verification failure.
S120, interface type is determined according to the service request parameter, obtains from preset interface call list and is connect with described The consistent target interface of mouthful type calls sublist, and the preset interface call list includes multiple being sorted out according to interface type Interface calls sublist, and it includes multiple interface parameters for being provided with priority orders that each interface, which calls sublist,.
By being parsed to service request parameter, it may be determined that with interface type corresponding to the service request parameter, Such as ID card verification service request parameter, then interface type is ID card verification interface.It is stored in the server pre- If interface call list, the preset interface call list includes that multiple interfaces sorted out according to interface type call sublist, often It includes multiple interface parameters for being provided with priority orders that one interface, which calls sublist,.For example, the preset interface call list Sublist and credit card validation interface is called to call sublist including ID card verification interface, then the ID card verification interface calls son Table is to call sublist with the consistent target interface of the interface type.It, can by distinct interface parameter setting priority orders The data-handling capacity and service ability of interface provider are distinguished, it for example, can data-handling capacity is strong and service energy Higher priority is arranged in the good interface of power, and the weak interface setting with service ability difference of ability of data processing is lower preferential Grade.
S130, sublist is called to obtain target interface parameter according to the target interface, the target interface parameter is target Interface calls the interface parameters of highest priority in the interface parameters not being acquired in sublist.
For example, it includes following 3 interface parameters that the ID card verification interface, which calls sublist, and each interface parameters is provided with Priority as follows:
Interface parameters is A, priority 1;
Interface parameters is B, priority 2;
Interface parameters is C, priority 3.
It is found that the interface parameters of highest priority is A, and the interface parameters of lowest priority is C.It is excellent by obtaining highest The interface parameters of first grade is called acquisition data with the interface characterized for the interface parameters.
S140, the service request parameter is formatted according to the first default transformation rule, is connect with generating target Mouth call parameters.
In order to be called to target interface corresponding to the target interface parameter, service request parameter need to be carried out Format conversion, to generate the target interface call parameters for meeting target interface agreement.
S150, it is adjusted according to the target interface that the target interface call parameters characterize the target interface parameter With.
By obtaining target interface call parameters, to the target interface characterized with search target interface parameter, adjusted With in order to obtain the requested data of service requester.
Referring to Fig. 2, in one embodiment, after the step S150, the method also includes:
S150a, judge to call whether the target interface succeeds.
In invocation target interface, there is situations such as because of Network Abnormal and invocation target interface is caused to fail.Therefore, it needs Whether the calling target interface is successfully judged.
It, will be according to calling target data acquired in the target interface to send out if S160, calling target interface success It send to service requester.
If the success of invocation target interface, can obtain target data, by the way that target data is back to the service requester, To achieve the purpose that respond the service request of service requester.
Referring to Fig. 3, in one embodiment, the step S160 includes:
If S161, calling the target interface success, accounting module is called, charging letter is generated according to the accounting module Breath.
Typically, to computing resource spent by the service for checking credentials and other costs, service requester need to pay correlation Expense.In the present embodiment, if the target interface success is called to generate charge information by calling accounting module.
S162, the charge information is sent to the service requester, obtains payment information.
After generating the charge information, the charge information is sent to the service requester, is asked in order to service Expense needed for service request is known in the side of asking, and take corresponding paying behaviors.
If S163, the payment information are payment successful information, the target data is sent to service requester.
If acquired payment information is payment successful information, i.e., the described service requester pays scheduled expense, can The target data is sent to the service requester.
Referring to Fig. 4, in one embodiment, the step S163 includes:
If S1630, the payment information are payment successful information, according to the second default transformation rule to the target data It formats, to generate format conversion data.
Typically, the target data for calling different interfaces to be returned be on format it is different, for the ease of clothes Business requesting party obtains the data of same format, can format to target data, generate corresponding format conversion data.
S1631, the format conversion data is sent to service requester.
After being formatted to target data, by the way that the format conversion data is fed back to the service request Side, so that service requester gets data corresponding with service request parameter.
Referring to Fig. 2, in one embodiment, after the step S150, the interface call method further include:
If S170, the target interface is called to fail, judge whether the target interface parameter is the target interface tune With the interface parameters of the lowest priority of sublist.
In being called according to priority orders pair interface corresponding with interface parameters, if current target interface is called to lose Lose, by judge target interface parameter whether be the lowest priority that the target interface calls sublist interface parameters, so as to In taking corresponding step according to judging result.
In the present embodiment, if the target interface parameter is not the lowest priority that the target interface calls sublist Interface parameters is back to described the step of calling sublist to obtain target interface parameter according to the target interface, i.e. step S130. Also that is, obtaining the interface parameters of next priority.
Referring to Fig. 2, in one embodiment, after the step S170, the interface call method further include:
If S180, the target interface parameter are the interface parameters for the lowest priority that the target interface calls sublist, Miscue message is sent to the service requester.
In the present embodiment, if the target interface parameter is the interface parameters of lowest priority, i.e., suitable according to priority Sequence calls the total interface parameter in sublist to the target interface, has all carried out corresponding call operation, can not still get Target data then sends miscue message to the service requester.
The embodiment of the present application also provides a kind of interface calling device, and the interface calling device is any one of aforementioned for executing Interface call method.Referring to Fig. 6, Fig. 6 is the schematic block diagram of interface calling device provided by the embodiments of the present application.Such as figure Shown in 6, the interface calling device 300 includes: first acquisition unit 310, second acquisition unit 320, third acquiring unit 330, the first format conversion unit 340, call unit 350 and transmission unit 360.
First acquisition unit 310, for obtaining the service request parameter of service requester.
The parameter verification includes that must fill out the verification of parameter non-empty and legitimacy verifies.For example, for ID card verification service, In the ID card verification service request parameter, identification card number is that must fill out parameter, and for Chinese mainlander, identification card number Digit be 18.By carrying out parameter verification to service request parameter, it is pre- to can determine whether the service request parameter meets If condition, if in acquired ID card verification service request parameter, identification card number be empty or identification card number digit not Meet 18, that is, is considered as parameter verification failure, it can be by sending the prompting message of parameter verification failure to service requester;Phase Instead, if the digit of the identification card number meets 18, it is considered as parameter verification success.
Second acquisition unit 320, for determining interface type according to the service request parameter, from preset interface call list Middle acquisition calls sublist with the consistent target interface of the interface type, and the preset interface call list includes multiple according to interface The interface that type is sorted out calls sublist, and it includes multiple interfaces for being provided with priority orders that each interface, which calls sublist, Parameter.
By being parsed to service request parameter, it may be determined that with interface type corresponding to the service request parameter, Such as ID card verification service request parameter, then interface type is ID card verification interface.It is stored in the server pre- If interface call list, the preset interface call list includes that multiple interfaces sorted out according to interface type call sublist, often It includes multiple interface parameters for being provided with priority orders that one interface, which calls sublist,.For example, the preset interface call list Sublist and credit card validation interface is called to call sublist including ID card verification interface, then the ID card verification interface calls son Table is to call sublist with the consistent target interface of the interface type.It, can by distinct interface parameter setting priority orders The data-handling capacity and service ability of interface provider are distinguished, it for example, can data-handling capacity is strong and service energy Higher priority is arranged in the good interface of power, and the weak interface setting with service ability difference of ability of data processing is lower preferential Grade.
Third acquiring unit 330, for calling sublist to obtain target interface parameter, the target according to the target interface Interface parameters is the interface parameters that target interface calls highest priority in the interface parameters not being acquired in sublist.
For example, it includes following 3 interface parameters that the ID card verification interface, which calls sublist, and each interface parameters is provided with Priority as follows:
Interface parameters is A, priority 1;
Interface parameters is B, priority 2;
Interface parameters is C, priority 3.
It is found that the interface parameters of highest priority is A, and the interface parameters of lowest priority is C.It is excellent by obtaining highest The interface parameters of first grade is called acquisition data with the interface characterized for the interface parameters.
First format conversion unit 340, for being carried out according to the first default transformation rule to by the service request parameter Format conversion, to generate target interface call parameters.
In order to be called to target interface corresponding to the target interface parameter, service request parameter need to be carried out Format conversion, to generate the target interface call parameters for meeting target interface agreement.
Call unit 350, the mesh for being characterized according to the target interface call parameters to the target interface parameter Tag splice mouth is called.
By obtaining target interface call parameters, to the target interface characterized with search target interface parameter, adjusted With in order to obtain the requested data of service requester.
Transmission unit 360, if for calling the target interface success, it will be according to acquired in the calling target interface Target data is sent to service requester.
If the success of invocation target interface, can obtain target data, by the way that target data is back to the service requester, To achieve the purpose that respond the service request of service requester.
Referring to Fig. 7, Fig. 7 is the schematic block diagram for the interface calling device that the another embodiment of the application provides.Such as Fig. 7 institute Show, the interface calling device 300 includes: first acquisition unit 310, second acquisition unit 320, third acquiring unit 330, One format conversion unit 340, call unit 350, the first judging unit 350a, transmission unit 360, second judgment unit 370 with And prompt unit 380.Wherein, first acquisition unit 310, second acquisition unit 320, third acquiring unit 330, the first format turn Unit 340, call unit 350 and transmission unit 360 are changed, is had been described in the above-described embodiments, details are not described herein again.Below First judging unit 350a, second judgment unit 370 and prompt unit 380 are described.
First judging unit 350a calls whether the target interface succeeds for judging.
In invocation target interface, there is situations such as because of Network Abnormal and invocation target interface is caused to fail.Therefore, it needs Whether the calling target interface is successfully judged.
Second judgment unit 370, if for calling the target interface to fail, judge the target interface parameter whether be The target interface calls the interface parameters of the lowest priority of sublist.
In being called according to priority orders pair interface corresponding with interface parameters, if current target interface is called to lose Lose, by judge target interface parameter whether be the lowest priority that the target interface calls sublist interface parameters, so as to In taking corresponding step according to judging result.In the present embodiment, if the target interface parameter is not the target interface The interface parameters of the lowest priority of sublist is called, the function of executing third acquiring unit 330 is returned, it is next excellent in order to obtain The interface parameters of first grade.
Prompt unit 380, if being the lowest priority that the target interface calls sublist for the target interface parameter Interface parameters, send miscue message to the service requester.
In the present embodiment, if the target interface parameter is the interface parameters of lowest priority, i.e., suitable according to priority Sequence calls the total interface parameter in sublist to the target interface, has all carried out corresponding call operation, can not still get Target data then sends miscue message to the service requester.
Referring to Fig. 8, Fig. 8 is the schematic block diagram for the interface calling device that the another embodiment of the application provides.Such as Fig. 8 institute Show, the interface calling device 300 includes: first acquisition unit 310, second acquisition unit 320, third acquiring unit 330, One format conversion unit 340, call unit 350 and transmission unit 360, wherein the transmission unit 360 includes Charging Detail Record unit 361, payment information acquiring unit 362 and target data transmission unit 363.Wherein, first acquisition unit 310, second obtains Unit 320, third acquiring unit 330, the first format conversion unit 340, call unit 350 and transmission unit 360, above-mentioned It is had been described in embodiment, details are not described herein again.Below to Charging Detail Record unit 361, payment information acquiring unit 362 and number of targets It is described according to transmission unit 363.
Charging Detail Record unit 361, if accounting module is called, according to the accounting module for calling the target interface success Generate charge information.
Typically, to computing resource spent by the service for checking credentials and other costs, service requester need to pay correlation Expense.In the present embodiment, if the target interface success is called to generate charge information by calling accounting module.
Payment information acquiring unit 362 obtains payment letter for the charge information to be sent to the service requester Breath.
After generating the charge information, the charge information is sent to the service requester, is asked in order to service Expense needed for service request is known in the side of asking, and take corresponding paying behaviors.
Target data transmission unit 363 sends out the target data if being payment successful information for the payment information It send to service requester.
If acquired payment information is payment successful information, i.e., the described service requester pays scheduled expense, can The target data is sent to the service requester.
Referring to Fig. 9, Fig. 9 is the schematic block diagram for the interface calling device that another embodiment of the application provides.Such as Fig. 9 institute Show, the interface calling device 300 includes: first acquisition unit 310, second acquisition unit 320, third acquiring unit 330, One format conversion unit 340, call unit 350 and transmission unit 360, wherein the transmission unit 360 includes Charging Detail Record unit 361, payment information acquiring unit 362 and target data transmission unit 363, the target data transmission unit 363 include the Two format conversion units 3630 and data transmission unit 3631.Wherein, first acquisition unit 310, second acquisition unit 320, Three acquiring units 330, the first format conversion unit 340, call unit 350, transmission unit 360, Charging Detail Record unit 361, payment letter Acquiring unit 362 and target data transmission unit 363 are ceased, is had been described in the above-described embodiments, details are not described herein again.Below Second format conversion unit 3630 and data transmission unit 3631 are described.
Second format conversion unit 3630, if being payment successful information for the payment information, according to second default turn It changes rule to format the target data, to generate format conversion data.
Typically, the target data for calling different interfaces to be returned be on format it is different, for the ease of clothes Business requesting party obtains the data of same format, can format to target data, generate corresponding format conversion data.
Data transmission unit 3631, for the format conversion data to be sent to service requester.
After being formatted to target data, by the way that the format conversion data is fed back to the service request Side, so that service requester gets data corresponding with service request parameter.
Referring to Fig. 10, Figure 10 is the schematic block diagram for the interface calling device that the application another embodiment provides.Such as figure Shown in 10, the interface calling device 300 includes: first acquisition unit 310, parameter verification unit 310a, authentication verification unit 310b, second acquisition unit 320, third acquiring unit 330, the first format conversion unit 340, call unit 350 and transmission Unit 360.Wherein, first acquisition unit 310, second acquisition unit 320, third acquiring unit 330, the first format conversion unit 340, call unit 350 and transmission unit 360, have been described, details are not described herein again in the above-described embodiments.Below to parameter Verification unit 310a and authentication verification unit 310b are described.
Parameter verification unit 310a, for carrying out parameter verification to the service request parameter.
The parameter verification includes that must fill out the verification of parameter non-empty and legitimacy verifies.For example, for ID card verification service, In the ID card verification service request parameter, identification card number is that must fill out parameter, and for Chinese mainlander, identification card number Digit be 18.By carrying out parameter verification to service request parameter, it is pre- to can determine whether the service request parameter meets If condition, if in acquired ID card verification service request parameter, identification card number be empty or identification card number digit not Meet 18, that is, is considered as parameter verification failure, it can be by sending the prompting message of parameter verification failure to service requester;Phase Instead, if the digit of the identification card number meets 18, it is considered as parameter verification success.
Verification unit 310b is authenticated, if carrying out authentication school to the service request parameter for parameter verification success It tests, if service request parameter authentication verifies successfully, execution is described to determine interface type according to the service request parameter Step.
It can determine whether the service requester has access right by authentication verification.It is corresponding by allocating in advance User ID and password give service requester, after obtaining service request parameter transmitted by the service requester, to user ID and password are verified respectively, if the User ID and password meet preset condition, that is, are considered as authentication and are verified successfully, otherwise regard For authentication verification failure.It, can be by sending the prompting message for authenticating verification failure to service requester if authentication verification failure.
Figure 11 is please referred to, Figure 11 is the schematic block diagram of computer equipment provided by the embodiments of the present application.The computer is set Standby 400 equipment can be terminal.
Refering to fig. 11, which includes processor 402, memory and the net connected by system bus 401 Network interface 405, wherein memory may include non-volatile memory medium 403 and built-in storage 404.
The non-volatile memory medium 403 can storage program area 4031 and computer program 4032.The computer program 4032 include program instruction, which is performed, and processor 402 may make to execute a kind of interface call method.
The processor 402 supports the operation of entire computer equipment 400 for providing calculating and control ability.
The built-in storage 404 provides environment for the operation of the computer program 4032 in non-volatile memory medium 403, should When computer program 4032 is executed by processor 402, processor 402 may make to execute a kind of interface call method.
The network interface 405 such as sends the task dispatching of distribution for carrying out network communication.Those skilled in the art can manage It solves, structure shown in Figure 11, only the block diagram of part-structure relevant to application scheme, is not constituted to the application side The restriction for the computer equipment 400 that case is applied thereon, specific computer equipment 400 may include more than as shown in the figure Or less component, perhaps combine certain components or with different component layouts.
Wherein, the processor 402 is for running computer program 4032 stored in memory, to realize following function Can: obtain the service request parameter of service requester;Interface type is determined according to the service request parameter, from preset interface tune Sublist is called with the interface type accordant interface with obtaining in table, the preset interface call list includes multiple according to interface The interface that type is sorted out calls sublist, and it includes multiple interfaces for being provided with priority orders that each interface, which calls sublist, Parameter;Sublist is called to obtain target interface parameter according to the target interface, the target interface parameter is target interface calling The interface parameters of highest priority in the interface parameters not being acquired in sublist;According to the first default transformation rule to the service Required parameter formats, to generate target interface call parameters;According to the target interface call parameters to the mesh The target interface that mark interface parameters is characterized is called;It, will be according to the calling target if calling the target interface success Target data acquired in interface is sent to service requester.
In one embodiment, processor 402 joins the target interface according to the target interface call parameters in execution It after several characterized target interfaces are called, also implements function such as: if the target interface is called to fail, described in judgement Target interface parameter whether be the lowest priority that the target interface calls sublist interface parameters;If the target interface ginseng Number is not the interface parameters for the lowest priority that the target interface calls sublist, is back to described according to the target interface tune The step of obtaining target interface parameter with sublist.
In one embodiment, if processor 402 calls the target interface to fail in execution, judge the target interface ginseng Number whether be the lowest priority that the target interface calls sublist interface parameters after, also implement function such as: if described Target interface parameter is the interface parameters for the lowest priority that the target interface calls sublist, sends miscue message to institute State service requester.
It in one embodiment, will be according to the calling target if processor 402 calls the target interface success in execution Target data acquired in interface is sent to service requester, is implemented as follows function: if calling the target interface success, Accounting module is called, charge information is generated according to the accounting module;The charge information is sent to the service requester, Obtain payment information;If the payment information is payment successful information, the target data is sent to service requester.
In one embodiment, if processor 402 is executing the payment information for payment successful information, by the number of targets According to service requester is sent to, it is implemented as follows function: default according to second if the payment information is payment successful information Transformation rule formats the target data, to generate format conversion data;The format conversion data is sent To service requester.
In one embodiment, processor 402 is also realized such as after executing the service request parameter for obtaining service requester Lower function: parameter verification is carried out to the service request parameter.
In one embodiment, processor 402 is also realized after executing to service request parameter progress parameter verification Following function: if parameter verification success, carries out authentication verification to the service request parameter;If the service request parameter Authentication verifies successfully, executes described the step of determining interface type according to the service request parameter.
It should be appreciated that in the embodiment of the present application, processor 402 can be central processing unit (Central Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic Device, discrete gate or transistor logic, discrete hardware components etc..Wherein, general processor can be microprocessor or Person's processor is also possible to any conventional processor etc..
A kind of storage medium is provided in another embodiment of the application.The storage medium can be computer-readable storage Medium.The storage medium is stored with computer program, and wherein computer program includes program instruction.The program instruction is by processor So that processor is executed following procedure when execution: obtaining the service request parameter of service requester;According to the service request parameter It determines interface type, is obtained from preset interface call list and call sublist with the interface type accordant interface, it is described default Interface call list includes that multiple interfaces sorted out according to interface type call sublist, and each interface calling sublist includes Multiple interface parameters for being provided with priority orders;Sublist is called to obtain target interface parameter according to the target interface, it is described Target interface parameter is the interface parameters that target interface calls highest priority in the interface parameters not being acquired in sublist;According to First default transformation rule formats the service request parameter, to generate target interface call parameters;According to institute The target interface that target interface call parameters characterize the target interface parameter is stated to be called;If the target is called to connect The target data according to acquired in the calling target interface is sent to service requester by mouth success.
In one embodiment, which is executed by processor in one embodiment, which is held by processor Row, also execution following procedure: if the target interface is called to fail, judge whether the target interface parameter is that the target connects Mouth calls the interface parameters of the lowest priority of sublist;If the target interface parameter is not that the target interface calls sublist The interface parameters of lowest priority is back to the step for calling sublist to obtain target interface parameter according to the target interface Suddenly.
In one embodiment, it calls the target interface to fail if the program instruction is executed by processor, judges the mesh Mark interface parameters whether be the lowest priority that the target interface calls sublist interface parameters after, also execute following journey Sequence: it if the target interface parameter is the interface parameters for the lowest priority that the target interface calls sublist, sends mistake and mentions Show message to the service requester.
It in one embodiment, will be according to calling if the program instruction, which is executed by processor, calls the target interface success Target data acquired in the target interface is sent to service requester, specifically executes following procedure: if calling the target Interface success, calls accounting module, generates charge information according to the accounting module;The charge information is sent to the clothes Be engaged in requesting party, obtains payment information;If the payment information is payment successful information, the target data is sent to service and is asked The side of asking.
In one embodiment, if the program instruction is executed by processor the payment information for payment successful information, by institute It states target data and is sent to service requester, specifically execute following procedure: if the payment information is payment successful information, according to Second default transformation rule formats the target data, to generate format conversion data;The format is converted Data are sent to service requester.
In one embodiment, which is executed by processor after the service request parameter for obtaining service requester, It also executes following procedure: parameter verification is carried out to the service request parameter.
In one embodiment, the program instruction be executed by processor to the service request parameter carry out parameter verification it Afterwards, following procedure is also executed: if parameter verification success, carries out authentication verification to the service request parameter;If the clothes Business required parameter authentication verifies successfully, executes described the step of determining interface type according to the service request parameter.
The storage medium can be USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), magnetic disk or The various media that can store program code such as person's CD.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware With the interchangeability of software, each exemplary composition and step are generally described according to function in the above description.This A little functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Specially Industry technical staff can use different methods to achieve the described function each specific application, but this realization is not It is considered as beyond scope of the present application.
In several embodiments provided herein, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, the apparatus embodiments described above are merely exemplary.For example, the division of each unit, only Only a kind of logical function partition, there may be another division manner in actual implementation.Such as multiple units or components can be tied Another system is closed or is desirably integrated into, or some features can be ignored or not executed.Step in the embodiment of the present application method Suddenly it can be sequentially adjusted, merged and deleted according to actual needs.
Unit in the embodiment of the present application device can be combined, divided and deleted according to actual needs.In addition, at this Apply for that each functional unit in each embodiment can integrate in one processing unit, is also possible to the independent physics of each unit In the presence of being also possible to two or more units and be integrated in one unit.Above-mentioned integrated unit can both use hardware Form realize, can also realize in the form of software functional units.If the integrated unit is with SFU software functional unit Form realize and when sold or used as an independent product, can store in one storage medium.Based on this understanding, The technical solution of the application substantially whole or portion of the part that contributes to existing technology or the technical solution in other words Dividing can be embodied in the form of software products, which is stored in a storage medium, including several Instruction is used so that computer equipment (can be personal computer, terminal or the network equipment an etc.) execution the application is each The all or part of the steps of a embodiment the method.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications or replace It changes, these modifications or substitutions should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with right It is required that protection scope subject to.

Claims (10)

1. a kind of interface call method characterized by comprising
Obtain the service request parameter of service requester;
Interface type is determined according to the service request parameter, is obtained from preset interface call list consistent with the interface type Target interface call sublist, the preset interface call list includes that multiple interfaces for being sorted out according to interface type call son Table, it includes multiple interface parameters for being provided with priority orders that each interface, which calls sublist,;
Sublist is called to obtain target interface parameter according to the target interface, the target interface parameter is that target interface calls son The interface parameters of highest priority in the interface parameters not being acquired in table;
The service request parameter is formatted according to the first default transformation rule, calls ginseng to generate target interface Number;
It is called according to the target interface that the target interface call parameters characterize the target interface parameter;
If calling the target interface success, the target data according to acquired in the calling target interface is sent to service and is asked The side of asking.
2. interface call method according to claim 1, which is characterized in that join in described called according to the target interface After several target interfaces characterized to the target interface parameter are called, the method also includes:
If the target interface is called to fail, judge whether the target interface parameter is that the target interface calls sublist most The interface parameters of low priority;
If the target interface parameter is not the interface parameters for the lowest priority that the target interface calls sublist, it is back to institute State the step of calling sublist to obtain target interface parameter according to the target interface.
3. interface call method according to claim 2, which is characterized in that if calling the target interface to lose described Lose, judge the target interface parameter whether be the lowest priority that the target interface calls sublist interface parameters after, The method also includes:
If the target interface parameter is the interface parameters for the lowest priority that the target interface calls sublist, sends mistake and mention Show message to the service requester.
4. interface call method according to claim 1, which is characterized in that if described call the target interface success, The target data according to acquired in the calling target interface is sent to service requester, comprising:
If calling the target interface success, accounting module is called, charge information is generated according to the accounting module;
The charge information is sent to the service requester, obtains payment information;
If the payment information is payment successful information, the target data is sent to service requester.
5. interface call method according to claim 4, which is characterized in that if the payment information is to pay the fees successfully The target data is sent to service requester by information, comprising:
If the payment information is payment successful information, format is carried out to the target data according to the second default transformation rule and is turned It changes, to generate format conversion data;
The format conversion data is sent to service requester.
6. interface call method according to claim 1, which is characterized in that asked in the service for obtaining service requester After seeking parameter, the method also includes:
Parameter verification is carried out to the service request parameter.
7. interface call method according to claim 6, which is characterized in that carried out described to the service request parameter After parameter verification, the method also includes:
If the parameter verification success, carries out authentication verification to the service request parameter;
If the service request parameter authentication verifies successfully, execution is described to determine interface type according to the service request parameter Step.
8. a kind of interface calling device characterized by comprising
First acquisition unit, for obtaining the service request parameter of service requester;
Second acquisition unit is obtained from preset interface call list for determining interface type according to the service request parameter Call sublist with the consistent target interface of the interface type, the preset interface call list include it is multiple according to interface type into The interface that row is sorted out calls sublist, and it includes multiple interface parameters for being provided with priority orders that each interface, which calls sublist,;
Third acquiring unit, for calling sublist to obtain target interface parameter, the target interface ginseng according to the target interface Number is the interface parameters that target interface calls highest priority in the interface parameters not being acquired in sublist;
First format conversion unit, for being formatted according to the first default transformation rule to the service request parameter, To generate target interface call parameters;
Call unit, target interface for being characterized according to the target interface call parameters to the target interface parameter into Row calls;
Transmission unit, if for calling the target interface success, by the number of targets according to acquired in the calling target interface According to being sent to service requester.
9. a kind of computer equipment, including memory, processor and it is stored on the memory and can be on the processor The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 7 when executing the computer program Any one of interface call method.
10. a kind of storage medium, which is characterized in that the storage medium is stored with computer program, the computer program packet Program instruction is included, described program instruction executes the processor such as any one of claim 1-7 The interface call method.
CN201811099024.1A 2018-09-20 2018-09-20 Interface call method, device, computer equipment and storage medium Withdrawn CN109240838A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811099024.1A CN109240838A (en) 2018-09-20 2018-09-20 Interface call method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811099024.1A CN109240838A (en) 2018-09-20 2018-09-20 Interface call method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN109240838A true CN109240838A (en) 2019-01-18

Family

ID=65059834

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811099024.1A Withdrawn CN109240838A (en) 2018-09-20 2018-09-20 Interface call method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109240838A (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109872146A (en) * 2019-02-17 2019-06-11 北京意锐新创科技有限公司 Third party's interface call method and system based on two dimension code reading device
CN109933587A (en) * 2019-02-26 2019-06-25 厦门市美亚柏科信息股份有限公司 Data processing method, device, system and storage medium based on catalogue registration
CN110213290A (en) * 2019-06-14 2019-09-06 无锡华云数据技术服务有限公司 Data capture method, API gateway and storage medium
CN110300165A (en) * 2019-06-26 2019-10-01 北京字节跳动网络技术有限公司 A kind of call method of function program, device, equipment and storage medium
CN111131414A (en) * 2019-12-11 2020-05-08 拉扎斯网络科技(上海)有限公司 Back-end platform, service calling method, first service module and server
CN111405051A (en) * 2020-03-20 2020-07-10 北京百度网讯科技有限公司 Processing method, device and equipment of Application Programming Interface (API) information
CN111552578A (en) * 2020-04-30 2020-08-18 成都新潮传媒集团有限公司 Third-party interface calling method and device
CN111722947A (en) * 2020-06-28 2020-09-29 深圳壹账通智能科技有限公司 Service calling method and system
CN111767091A (en) * 2020-07-01 2020-10-13 百度在线网络技术(北京)有限公司 Method and device for acquiring user information by applet, electronic equipment and storage medium
WO2020228292A1 (en) * 2019-05-13 2020-11-19 平安科技(深圳)有限公司 Data submission request processing method, apparatus and computer device
CN111984713A (en) * 2020-06-29 2020-11-24 五八到家有限公司 Data processing method, device, equipment and storage medium
CN112101949A (en) * 2020-09-18 2020-12-18 支付宝(杭州)信息技术有限公司 Safe service request processing method and device
CN112261075A (en) * 2020-09-07 2021-01-22 上海泛微软件有限公司 Network request processing method, device, equipment and computer readable storage medium
CN112468557A (en) * 2020-11-16 2021-03-09 北京百度网讯科技有限公司 Method, device, gateway and storage medium for providing network service
CN112651843A (en) * 2020-12-30 2021-04-13 中国平安人寿保险股份有限公司 Method and device for controlling product delivery mode, computer equipment and storage medium
CN112860463A (en) * 2021-03-22 2021-05-28 平安商业保理有限公司 Service request forwarding method and device, computer equipment and readable storage medium
CN113590234A (en) * 2021-07-12 2021-11-02 远光软件股份有限公司 Method, device and equipment for automatically acquiring data and storage medium
CN113806037A (en) * 2021-07-14 2021-12-17 远光软件股份有限公司 Service calling method and device, storage medium and electronic equipment

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109872146A (en) * 2019-02-17 2019-06-11 北京意锐新创科技有限公司 Third party's interface call method and system based on two dimension code reading device
CN109933587A (en) * 2019-02-26 2019-06-25 厦门市美亚柏科信息股份有限公司 Data processing method, device, system and storage medium based on catalogue registration
CN109933587B (en) * 2019-02-26 2023-04-11 厦门市美亚柏科信息股份有限公司 Data processing method, device and system based on directory registration and storage medium
WO2020228292A1 (en) * 2019-05-13 2020-11-19 平安科技(深圳)有限公司 Data submission request processing method, apparatus and computer device
CN110213290A (en) * 2019-06-14 2019-09-06 无锡华云数据技术服务有限公司 Data capture method, API gateway and storage medium
CN110300165A (en) * 2019-06-26 2019-10-01 北京字节跳动网络技术有限公司 A kind of call method of function program, device, equipment and storage medium
CN110300165B (en) * 2019-06-26 2021-11-12 北京字节跳动网络技术有限公司 Method, device and equipment for calling functional program and storage medium
CN111131414A (en) * 2019-12-11 2020-05-08 拉扎斯网络科技(上海)有限公司 Back-end platform, service calling method, first service module and server
CN111131414B (en) * 2019-12-11 2022-05-24 拉扎斯网络科技(上海)有限公司 Back-end platform, service calling method, first service module and server
CN111405051A (en) * 2020-03-20 2020-07-10 北京百度网讯科技有限公司 Processing method, device and equipment of Application Programming Interface (API) information
CN111405051B (en) * 2020-03-20 2022-04-22 北京百度网讯科技有限公司 Processing method, device and equipment of Application Programming Interface (API) information
CN111552578A (en) * 2020-04-30 2020-08-18 成都新潮传媒集团有限公司 Third-party interface calling method and device
CN111552578B (en) * 2020-04-30 2023-08-04 成都新潮传媒集团有限公司 Third party interface calling method and device
CN111722947A (en) * 2020-06-28 2020-09-29 深圳壹账通智能科技有限公司 Service calling method and system
CN111984713A (en) * 2020-06-29 2020-11-24 五八到家有限公司 Data processing method, device, equipment and storage medium
CN111767091A (en) * 2020-07-01 2020-10-13 百度在线网络技术(北京)有限公司 Method and device for acquiring user information by applet, electronic equipment and storage medium
CN111767091B (en) * 2020-07-01 2023-12-05 百度在线网络技术(北京)有限公司 Method, device, electronic equipment and storage medium for acquiring user information by applet
CN112261075A (en) * 2020-09-07 2021-01-22 上海泛微软件有限公司 Network request processing method, device, equipment and computer readable storage medium
CN112101949A (en) * 2020-09-18 2020-12-18 支付宝(杭州)信息技术有限公司 Safe service request processing method and device
CN112468557A (en) * 2020-11-16 2021-03-09 北京百度网讯科技有限公司 Method, device, gateway and storage medium for providing network service
CN112651843A (en) * 2020-12-30 2021-04-13 中国平安人寿保险股份有限公司 Method and device for controlling product delivery mode, computer equipment and storage medium
CN112860463A (en) * 2021-03-22 2021-05-28 平安商业保理有限公司 Service request forwarding method and device, computer equipment and readable storage medium
CN113590234A (en) * 2021-07-12 2021-11-02 远光软件股份有限公司 Method, device and equipment for automatically acquiring data and storage medium
CN113806037A (en) * 2021-07-14 2021-12-17 远光软件股份有限公司 Service calling method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN109240838A (en) Interface call method, device, computer equipment and storage medium
CN108596619B (en) Transaction method, device, central node and system for blockchain system
CN108197944B (en) Resource transaction method and device based on block chain technology
US20180137496A1 (en) Information processing device and information processing method
CN109064146B (en) Digital currency transaction method, equipment, system, terminal and client wallet
US8321498B2 (en) Policy interface description framework
CN110599323B (en) Resource processing method and processing equipment
CN110049048B (en) Data access method, equipment and readable medium for government affair public service
CN109787976A (en) Information updating method, device, computer equipment and storage medium
CN108460272A (en) Change of secret code method, apparatus, terminal device and storage medium
CN104850990A (en) Payment method and system thereof, key terminal and key support system
CN111553667A (en) Transaction method, gateway device, payment platform, merchant device and transaction system
CN110378695A (en) Bank card payment method, device, equipment and computer storage medium
CN109787975A (en) Identity identifying method, device, computer equipment and storage medium
CN108650098A (en) The method and device of User Defined verification mode
CN107682376A (en) Air control data interactive method and device
CN110348827A (en) The direct-connected method of medium and small bank, minuscule-type-enterprise and relevant device based on third-party application
CN111340635A (en) Data checking method, equipment, server and readable storage medium
US20100222022A1 (en) Communication method, communication system and access method to service provider base
CN105279414A (en) Verification device based on fingerprint application and verification method based on fingerprint application
US11950173B2 (en) Method of determining shared service index based on shared service of communication credential
CN113988844A (en) Service subscription method, device and system
KR102107454B1 (en) System for multiplication of financial payment networks, method for financial services using the same and computer program for the same
CN116071070A (en) Resource transfer method and related device
CN115203666A (en) Identity authentication method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20190118