CN107423041A - Method and apparatus for realizing application programming interface configuration and calling - Google Patents
Method and apparatus for realizing application programming interface configuration and calling Download PDFInfo
- Publication number
- CN107423041A CN107423041A CN201710200552.0A CN201710200552A CN107423041A CN 107423041 A CN107423041 A CN 107423041A CN 201710200552 A CN201710200552 A CN 201710200552A CN 107423041 A CN107423041 A CN 107423041A
- Authority
- CN
- China
- Prior art keywords
- parameter
- configuration
- configuration parameters
- information
- initial configuration
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4488—Object-oriented
- G06F9/449—Object-oriented method invocation or resolution
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer And Data Communications (AREA)
Abstract
The purpose of the application is to provide a kind of method and apparatus for being used to realize application programming interface configuration and call,By obtaining the initial configuration parameters generated based on recyclable configuration information,For the parameter for performing and needing a basic logic or multiple basic logics to combine in batches,The parameter of batch can merge into some logics are understandable and the simple initial configuration parameters of configuration based on recyclable configuration information,Realize the planarization process of complex parameters,And recurrence can be carried out to generate multiple configuration parameters for the initial configuration parameters of cyclical patterns to parameter type in configuration phase,Call request is reassembled as to the parameter format that can be identified of the recalls information access product side of rear end parameter format,So as to simplify complicated business scenario A PI configuration process,Reduce the use cost that API complexity enters ginseng,And it can be reported an error according to design parameter mistake,And then lift the experience of api interface.
Description
Technical field
The application is related to computer realm, more particularly to a kind of is used for what is realized application programming interface configuration and call
Technology.
Background technology
API gateway is responsible for API (Application Programming Interface, application programming interface)
Protocol conversion, signature authentication, parameter processing and security protection;User call the application programming interface when need to be passed into
Join information (API enters ginseng), the API that complexity need to be passed to for complicated business scenario enters ginseng, such as:Json, the API clothes of access gateway
Business supplier is parsed into the parameter format of rear end based on entering to join information.
During using API to carry out some complicated business scene, generally require to be passed to a complex parameters.Such as:One complexity
Inquiry, user needs the querying condition specified according to oneself to inquire about some business, or batch addition, deletes a product
With needing to use complex parameters during the relation of another product, many puzzlements are at the same time also brought.
Exemplified by the API of polylith hard disk is once added to server, every piece of disk has three attribute size (capacity), type
(type), name (Disk name), prior art mainly have two kinds:
Scheme one, complex parameters are directly passed to by user, such as:{"Disks":[{"Disk":"1","name":" first piece
Disk ", " size ":"20G","type":" cloud disk " }, { " Disk ":"2","name":" second piece of disk ", " size ":"
50G","type":" temporary disc " }] }
Its shortcoming is:Need to explain that Json assembly rules guides user uses in detail, explain that cost is high;User needs to manage
The assembly rule of API complex parameters is solved, understanding cost is high;Due to being that a parameter has been passed to multiple values, so user is assembled wrong
Mistake, the problem of API can not be prompted precisely.Receive after mistake returns, it is necessary to which user checks whole Json, friendly is poor, mistake
It is high to investigate cost.Such as:It can only prompt wrong in this Json of user, the type error of second piece of disk can not be prompted.
Scheme two, access product configuration by complex parameters be split as it is multiple for users to use:disk.1.name、
Disk.1.type, disk.1.size, disk.2.name, disk.2.type, disk.2.size, its shortcoming are:Access product
Square deployment cost is high, not easy care;Access product side's operation system is it is understood that relation between each parameter.
The content of the invention
The purpose of the application be to provide it is a kind of configure it is simple, flexibly, easily extension and user is readily understood, the application journey that easily uses
The implementation method and equipment that sequence DLL is configured and called.
According to the one side of the application, there is provided a kind of side for being used to realize application programming interface configuration and call
Method, wherein, methods described includes:
Obtain the initial configuration parameters based on the generation of recyclable configuration information;
Based on the configuration parameter of initial configuration parameters generation application programming, wherein, it is circulation by parameter type
The multiple configuration parameters of initial configuration parameters recursive generation of type;
When receiving call request, based on the corresponding configuration parameter, the call request is parsed and recombinated,
To generate the recalls information of rear end parameter format.
According to further aspect of the application, there is provided a kind of to be used for what is realized application programming interface configuration and call
Equipment, wherein, the equipment includes:
Acquisition device, for obtaining the initial configuration parameters based on the generation of recyclable configuration information;
Configuration device, for the configuration parameter based on initial configuration parameters generation application programming, wherein, it will join
Several classes of types are the multiple configuration parameters of initial configuration parameters recursive generation of cyclical patterns;
Calling device, for when receiving call request, based on the corresponding configuration parameter, entering to the call request
Row parsing and restructuring, to generate the recalls information of rear end parameter format.
Present invention also provides a kind of equipment for being used to realize application programming interface configuration and call, the equipment bag
Include:
Processor;
And it is arranged to store the memory of computer executable instructions, the executable instruction makes institute when executed
State processor:Obtain the initial configuration parameters based on the generation of recyclable configuration information;Should based on initial configuration parameters generation
With the configuration parameter of programming, wherein, parameter type is multiple described for the initial configuration parameters recursive generation of cyclical patterns
Configuration parameter;When receiving call request, based on the corresponding configuration parameter, the call request is parsed and again
Group, to generate the recalls information of rear end parameter format.
Compared with prior art, application programming interface configuration and calling are realized according to embodiments herein
Method and apparatus, by obtain based on recyclable configuration information generate initial configuration parameters, for batch perform and need
The parameter for wanting a basic logic or multiple basic logics to combine, the parameter of batch can be merged based on recyclable configuration information
For some logics are understandable and the simple initial configuration parameters of configuration, the planarization process of complex parameters is realized, and in configuration phase,
Recurrence can be carried out to generate multiple configuration parameters for the initial configuration parameters of cyclical patterns to parameter type, please by calling
The parameter format that can be identified for the recalls information access product side for being reassembled as rear end parameter format is sought, configuration parameter is easy to user
Understand and use, its logic is simple, is easy to adjust or extends, and flexibility is strong, is configured so as to simplify complicated business scenario A PI
Journey, reduce the use cost that API complexity enters ginseng.
Brief description of the drawings
By reading the detailed description made to non-limiting example made with reference to the following drawings, the application's is other
Feature, objects and advantages will become more apparent upon:
One kind that Fig. 1 shows to be provided on one side according to the application is used to realize application programming interface configuration and called
Method schematic flow sheet;
Fig. 2 is shown according to being provided in the application one embodiment in step s 2 when initial configuration parameters are cyclical patterns
The schematic flow sheet of Shi Shengcheng configuration parameters;
Fig. 3 is shown according to being provided in the application another embodiment in step s 2 when initial configuration parameters are circulation class
The schematic flow sheet of configuration parameter is generated during type;
Fig. 4 shows to be used to realize that application programming interface configures according to one kind that one preferred embodiment of the application provides
With the schematic flow sheet of the method for calling;
Fig. 5 shows the step S3 provided according to one preferred embodiment of the application schematic flow sheet;
One kind that Fig. 6 shows to be provided on one side according to the application is used to realize application programming interface configuration and called
Equipment structural representation;
Fig. 7 shows the structural representation according to the configuration device provided in the application one embodiment;
Fig. 8 shows the structural representation according to the configuration device provided in the application another embodiment;
Fig. 9 shows to be used to realize that application programming interface configures according to one kind that one preferred embodiment of the application provides
With the structural representation of the equipment of calling;
Figure 10 shows the structural representation of the calling device provided according to one preferred embodiment of the application.
Same or analogous reference represents same or analogous part in accompanying drawing.
Embodiment
The application is described in further detail below in conjunction with the accompanying drawings.
One kind that Fig. 1 shows to be provided on one side according to the application is used to realize application programming interface configuration and called
Method schematic flow sheet, wherein, methods described includes:Step S1, step S2 and step S3.
In the step S1, the initial configuration parameters based on the generation of recyclable configuration information are obtained;In the step S2
In, based on the configuration parameter of initial configuration parameters generation application programming, wherein, it is cyclical patterns by parameter type
The multiple configuration parameters of initial configuration parameters recursive generation;In the step S3, when receiving call request, based on phase
The configuration parameter is answered, the call request is parsed and recombinated, to generate the recalls information of rear end parameter format.
In the step S1, the initial configuration parameters based on the generation of recyclable configuration information are obtained;Here, described follow
Ring configuration information is the configuration rule of generation initial configuration parameters, and the recyclable configuration information is predetermined, it is preferable that clothes
Business access side is based on the recyclable configuration information, specifies configuration file of the generation with corresponding initial configuration parameters, equipment
Respective profiles are obtained, and corresponding initial configuration parameters are obtained from the configuration file.
Wherein, the initial configuration parameters can have one or more, it is preferable that be generated based on recyclable configuration information
Configuration file there are multiple level nodes, each level node has one or more initial configuration parameters, therefore, not at the same level
Multiple initial configuration parameters of other node have multiple combinations relation.
The initial configuration parameters mainly include:Configuration parameter title (name), configuration parameter call title
(tagName), parameter type (type), wherein, the parameter type includes cyclical patterns (type=RepeatList) and non-
Cyclical patterns, for the initial configuration parameters of cyclical patterns, the initial configuration parameters also include:Loop configuration identifies (type
=RepeatList), cycle-index (maxNumber), configuration continuity (Sequence).Based on the initial configuration parameters,
It may determine whether to carry out circular recursion, the number of circular recursion and the successional setting of configuration.Used in subsequent step S2
Recursive mode generates configuration parameter, and for the initial configuration parameters of acyclic type, configuration is directly generated in subsequent step S2
Parameter.
Moreover it is preferred that the initial configuration parameters also include following at least any one:Parameter position information
(tagPosition), school inspection information (Required), rear end parameter format (invokeDataType), subordinate's parameter type
(subtype), parameter information (indexName), for generating the correlation attribute information of configuration information.
Table one shown in specific scene embodiment, the function example explanation of each information of the initial configuration parameters
Citing, certainly, those skilled in the art it should be understood that the example in the name of the initial configuration parameters and its explanation only
For citing, it can realize that the name of the information or parameter of identical function and the example belong to the thought range of the application.
Table one
Further, in the step S2, the configuration ginseng based on initial configuration parameters generation application programming
Number, wherein, by the multiple configuration parameters of initial configuration parameters recursive generation that parameter type is cyclical patterns.In the step
In S2, enter ginseng form according to different initial configuration parameters, carry out different configurations, and generate different corresponding configuration ginsengs
Number.
Here, when the initial configuration parameters are cyclical patterns, the initial configuration parameters include:Loop configuration identifies
(type=RepeatList), cycle-index (maxNumber), configuration continuity (Sequence).Based on the initial configuration
Parameter, it may be determined that whether carry out circular recursion, the number of circular recursion and the successional setting of configuration.
In addition, the configuration parameter includes configuration related names and correlation attribute information, wherein, configure related names and phase
The information content that attribute information is closed with corresponding initial configuration information is corresponding.
Fig. 2 is shown according to being provided in the application one embodiment in step s 2 when initial configuration parameters are cyclical patterns
The schematic flow sheet of Shi Shengcheng configuration parameters.With reference to Fig. 2, when whether the parameter type of the initial configuration parameters is cyclical patterns
When, the step S2 includes step S21, step S22 and step S23.
Wherein, in the step S21, judge whether the initial configuration parameters have loop configuration mark (type=
RepeatList), if so, then judging the parameter type of the initial configuration parameters for cyclical patterns;In the step S22,
Based on the cycle-index (maxNumber), the multiple configuration parameters of recursive generation;In the step S23, based on the configuration
Continuity information (Sequence), the continuous sexual intercourse of multiple configuration parameters is determined, when judging that user calls API, be passed to
Parameter whether must be continuous.Wherein, serial relation can just verify when user initiates and called.Therefore, can be according to specific ginseng
Wrong report mistake is miscounted, and then lifts the experience of api interface.
Specifically, it is initial for initial configuration parameters of the initial configuration parameters including present node and its downstream site
The situation of configuration parameter, in the step S22, based on subordinate's parameter name, downstream site is judged whether, when depositing
In downstream site, then the initial configuration parameters of initial configuration parameters corresponding to downstream site and present node are passed
It is grouped into closing, to generate the configuration parameter of multiple combinations.Such as the parameter call of the initial configuration parameters obtained based on present node
Title includes Disk, and cycle-index 2, it has two downstream sites, the parameter call of the initial configuration parameters of downstream site
Title is respectively Size and Type, then joins the initial configuration of initial configuration parameters corresponding to downstream site and present node
Number carries out recurrence combination, tetra- combinations of generation Disk.1.Size, Disk.1.Type, Disk.2.Size and Disk.2.Type
Configuration parameter.
Further, if the initial configuration information of downstream site is cyclical patterns, in the step S22, it is based on
The configuration information of downstream site generates multiple configuration parameters, then by multiple initial configuration parameters of downstream site with it is currently multiple
Initial configuration parameters carry out recurrence combination according to this, for example, the parameter call name of the initial configuration parameters obtained based on present node
Title includes Disk, and cycle-index 2, it has the entitled Size of the parameter call of the initial configuration parameters of downstream site, circulation
Number is 2, then carries out recurrence combination, generates Disk.1.Size.1, Disk.1.Size.2, Disk.2.Size.1,
The configuration parameter of Disk.2.Size.2 some combinations.
Can be the initial configuration ginseng of at least one downstream site in addition, when having two or more downstream site arranged side by side
Number is cyclical patterns, and the combining form of the acyclic type of initial configuration parameters of at least one downstream site, for example, based on working as
The parameter call title for the initial configuration parameters that front nodal point obtains includes Disk, and cycle-index 2, it has two arranged side by side one
The entitled Size of parameter call of the initial configuration parameters of individual downstream site, cycle-index 2, another downstream site it is initial
The entitled Type of parameter call of configuration parameter, acyclic type, then recurrence combination is carried out, generates Disk.1.Size.1,
Disk.1.Size.2, Disk.2.Size.1, Disk.2.Size.2, Disk.1.Type, Disk.2.Type some combinations
Configuration parameter.
Fig. 3 is shown according to being provided in the application another embodiment in step s 2 when initial configuration parameters are circulation class
The schematic flow sheet of configuration parameter is generated during type.Further, on the basis of the step S2 shown in Fig. 2, the step S2 is also wrapped
Include step S24.Wherein, in the step S24, the parameter type of the initial configuration parameters is judged for cyclical patterns, if not
It is then to generate configuration parameter based on the initial configuration parameters.
Correspondingly, in the step S24, when initial configuration parameters including present node initial configuration parameters and
Its downstream site initial configuration parameters, then based on subordinate's parameter name, downstream site is judged whether, if so, then will
The initial configuration parameters of initial configuration parameters corresponding to downstream site and present node are combined, at least one to generate
The configuration parameter of combination.Such as the parameter call title of the initial configuration parameters of present node includes Disk, it has under two
Level node, the parameter call title of initial configuration parameters is respectively Size and Type, then by initial configuration corresponding to downstream site
The initial configuration parameters of parameter and present node carry out recurrence combination, generate Disk.Size, two combinations of Disk.Type
Configuration parameter.
In addition, the parameter type of the initial configuration parameters based on downstream site, and carry out recurrence according to this or non-recursive group
The mode of conjunction can include the mode that the embodiment of the step S22 describes, and for simplicity, be contained in by reference
This, repeats no more.
Fig. 4 shows to be used to realize that application programming interface configures according to one kind that one preferred embodiment of the application provides
With the schematic flow sheet of the method for calling.On the basis of Fig. 1, methods described also includes step S4, by the generated configuration
Parameter read-in gateway caches device, and in subsequent step S2, invoked procedure is performed by the gateway caches device of equipment.
Here, the combination for the configuration parameter that the application is generated based on the initial configuration parameters is to be based on call parameters title
The circulation restructuring of certain number is carried out, if call parameters title is different, need to be defined according to different configuration parameters, such as:
Disk.n.Type, Instance.n.Type are, it is necessary to define two different XXX. [n] .YYY [m] configuration parameter.
Further, in the step S3, when equipment receives the call request of user's transmission, according to matching somebody with somebody accordingly
Parameter is put, the call request is parsed and recombinated, to generate the recalls information of rear end parameter format.
Fig. 5 shows the step S3 provided according to one preferred embodiment of the application schematic flow sheet.Wherein, the step
S3 includes:Step S31, step S32 and step S33;
In the step S31, the call request is parsed, acquisition is at least one to be entered to join information, and enters to join letter to described
Breath carries out school inspection;In the step S32, search and enter to join the corresponding configuration parameter of information with described;In the step S33
In, based on the corresponding configuration parameter, enter to join information and recombinate to described, to generate the recalls information of rear end parameter format.
Further, in the step S31 to it is described enter join information carry out school inspection include it is following at least any one:When obtaining
Take it is multiple it is described enter to join information, to it is multiple it is described enter to join information and carry out repeated school inspection, such as:User request the ginseng that enters be,
Disk.1=100&Disk.1=300 is then considered as parameter repetition;Parametric continuity information based on configuration parameter, enter to join to described
Information carries out parametric continuity school inspection.Here, the parametric continuity information of the configuration parameter is based on the initial configuration parameters
Parametric continuity information corresponding generate.In addition, also including entering to join information progress security school inspection to described, and then improve API
The security of interface.
Further, in the step S32, equipment enters to join the prefix information of information and matching somebody with somebody for configuration parameter based on described
Put parameter call title to be matched, to find the corresponding configuration parameter.
Wherein, in a preferred embodiment, the step S31~step S33 is held by the API gateway buffer storage in equipment
OK.
Preferably, in the step S4, the generated configuration parameter is write into gateway caches, by the gateway caches
Based on the configuration parameter, the call request is parsed and recombinated.Rear end parameter format after restructuring can be accessed
Product side obtains and effectively identified.
Gather concrete scene example below, methods described is described further.
In a specific Scene case, in the step S1, obtain first based on the generation of recyclable configuration information
Configuration file one:
The configuration parameter that above-mentioned configuration file is generated represents that user can be passed to 5 pieces of disks (Disk).
Then, in the step S1, based on the content of above-mentioned configuration file one, the initial configuration for obtaining present node is joined
Number includes:Name=" disks " represents that configuration parameter title (i.e. access product side's parameter name) is disks, tagName="
It is Disk that Disk ", which represents that configuration parameter calls title (the displaying title i.e. to user), and tagPosition=" Query " is represented
In the URL of HTTP request, required=" true " represents to need school to examine whether the node has value, type=" parameter
RepeatList " represents that this configuration parameter has loop configuration mark, and invokeDataType=" Map " represents bottom (access
Side) data format that receives be map (figure) form, subName=" disk " and subType=" String " expressions be not no under it
Level node, indexName=" diskIndex " represent the value that the value that user transmits n/m is disk, and maxNumber=" 5 " is represented
Cycle-index is 5.
Then, in step s 2, Disk.1, Disk.2, Disk.3, Disk.4 are generated based on the initial configuration parameters,
Disk.1, Disk.5, five configuration parameters and its correlation attribute information, wherein, correlation attribute information is believed with corresponding initial configuration
The information content of breath is corresponding.
In step s3, the form for entering to join information that receiving user can input is XXX. [n], for example, when user's input
Entering to join information includes:Disk.1=abc&Disk.2=dji&Disk.3=mfi.
Then, in the step S3, the equipment finds the configuration parameter generated based on configuration file one, and is based on
The configuration parameter is parsed and recombinated to the call request, and the recalls information of the rear end parameter format of generation is as follows:
In another specific Scene case, in the step S1, obtain generated based on recyclable configuration information first
Configuration file two:
Above-mentioned configuration file represents that user can be passed to the size (Size) and type (Type) of 5 pieces of disks (Disk).
In the step S1, based on the content of above-mentioned configuration file two, the initial configuration parameters of present node include:
Name=" disks " represents that configuration parameter title (i.e. access product side's parameter name) is disks, tagName=" Disk " table
It is Disk to show that configuration parameter calls title (the displaying title i.e. to user), and tagPosition=" Query " represents that parameter exists
In the URL of HTTP request, required=" false " represents that being not required to school examines whether the node has value, type="
RepeatList " represents that this configuration parameter has loop configuration mark, and sequence=" true " represents to need school inspection user to transmit
The continuity of parameter, invokeDataType=" Map " represent that the data format that bottom (access side) receives is map (figure) lattice
Formula, indexName=" diskIndex " represent the value that the value that user transmits n/m is disk, and maxNumber=" 5 " represents circulation
Number is 5.The initial configuration parameters of first downstream site include:Name=" size " represents the configuration of first downstream site
Parameter name is size, and tagName=" Size " represents that the configuration parameter of first downstream site calls entitled Size, type
=" Integer " represents that the type of this configuration parameter is integer (acyclic type), and name=" type " represents first
The configuration parameter entitled type, tagName=" Size " of downstream site represent that the configuration parameter of first downstream site calls
Entitled Type, represent that type=" String " represents that the type of configuration parameter is character string (acyclic type).
Then, in step s 2, Disk.1.Size, Disk.2.Size are generated based on the initial configuration parameters,
Disk.3.Size, Disk.4.Size, Disk.5.Size, Disk.1.Type, Disk.2.Type, Disk.3.Type,
Disk.4.Type, Disk.5.Type configuration parameter and its correlation attribute information, wherein, correlation attribute information with it is corresponding initial
The information content of configuration information is corresponding.
In step s3, the form for entering to join information that user can input is XXX. [n] .YYY, for example, when user's input
Entering to join information includes:
Disk.1.Size=100&Disk.2.Size=200&Disk.1.Type=HHD&Disk.2.T ype=SSD.
Then, in the step S3, the equipment finds the configuration parameter generated based on configuration file two, and is based on
The configuration parameter is parsed and recombinated to the call request, and the recalls information of the rear end parameter format of generation is as follows:
In a specific Scene case, in the step S1, obtain first based on the generation of recyclable configuration information
Configuration file three:
Above-mentioned configuration file represents that user can be passed to 5 kinds of sizes (Size) and 5 types of 5 pieces of disks (Disk)
(Type)。
In the step S1, based on the content of above-mentioned configuration file three, the initial configuration parameters of present node include:
Name=" disks " represents that configuration parameter title (i.e. access product side's parameter name) is disks, tagName=" Disk " table
It is Disk to show that configuration parameter calls title (the displaying title i.e. to user), and tagPosition=" Query " represents that parameter exists
In the URL of HTTP request, type=" RepeatList " represents that this configuration parameter has loop configuration mark, sequence="
False " expressions need the continuous of school inspection user's Transfer Parameters, and required=" false " represents that being not required to school examines whether the node has
Value, invokeDataType=" Map " represent that the data format of bottom (access side) reception is map (figure) form, indexName
=" diskIndex " represents the value that the value that user transmits n/m is disk, and maxNumber=" 5 " represents that cycle-index is 5.First
The initial configuration parameters of individual downstream site include:Name=" size " represents that the configuration parameter of first downstream site is entitled
Size, tagName=" Size " represent that the configuration parameter of first downstream site calls entitled Size, type="
RepeatList " represents that this configuration parameter has loop configuration mark, subType=" String " and subName=" size "
Represent that, without its downstream site, indexName=" sizeIndex " represents the value that the value that user transmits n/m is size,
MaxNumber=" 5 " represents that cycle-index is 5;The initial configuration parameters of second downstream site include:Name=" types "
Represent matching somebody with somebody for configuration parameter entitled types, tagName=" Type " second downstream site of expression of second downstream site
Put parameter call entitled Type, type=" RepeatList " and represent that this configuration parameter has loop configuration mark, subType
=" String " and subName=" type " represents to represent user without its downstream site, indexName=" typeIndex "
The value for transmitting n/m is size value, and maxNumber=" 5 " represents that cycle-index is 5.
Then, in step s 2, Disk.1.Size.1~Disk.5.Size.1 is generated based on the initial configuration parameters,
Disk.1.Size.2~Disk.5.Size.2, Disk.1.Size.3~Disk.5.Size.3, Disk.1.Size.4~
Disk.5.Size.4, Disk.1.Size.5~Disk.5.Size.5, Disk.1.Type.1~Disk.5.Type.1,
Disk.1.Type.2~Disk.5.Type.2, Disk.1.Type.3~Disk.5.Type.3, Disk.1.Type.4~
Disk.5.Type.4, Disk.1.Type.5~Disk.5.Type.5 configuration parameter and its correlation attribute information, wherein, phase
The information content that attribute information is closed with corresponding initial configuration information is corresponding.
In step s3, the form for entering to join information that user can input is XXX. [n] .YYY [m], for example, when user inputs
Enter to join information and include:
Disk.1.size.1=100&Disk.1.size.2=300&Disk.1.size.3=500&
Disk.2.size.1=300&Disk.2.size.2=400&Disk.2.size.3=700&Di sk.3.size.1=900&
Disk.3.size.2=1000&Disk.3.size.3=600,
Then, in the step S3, the equipment finds the configuration parameter generated based on configuration file two, and is based on
The configuration parameter is parsed and recombinated to the call request, and the recalls information of the rear end parameter format of generation is as follows:
In another specific Scene case, in the step S1, obtain generated based on recyclable configuration information first
Configuration file four:
In the step S1, based on above-mentioned configuration file four, the initial configuration parameters of present node include:Name="
Filter " represents that configuration parameter title (i.e. access product side's parameter name) is filter, and tagName=" Filter " represents to match somebody with somebody
It is Filter to put parameter call title (the displaying title i.e. to user), and tagPosition=" Query " represents parameter in HTTP
In the URL of request, type=" RepeatList " represents that this configuration parameter has loop configuration mark, sequence=" true "
The continuity for needing school to examine user's Transfer Parameters is represented, invokeDataType=" json " represents the number that bottom (access side) receives
It is json forms according to form, indexName=" filterItem " represents the value that the value that user transmits n/m is filterItem,
MaxNumber=" 5 " represents that cycle-index is 5.The initial configuration parameters of first subordinate's section include:Point name=" key " table
Show that the configuration parameter entitled key, tagName=" Key " of first downstream site represent the configuration ginseng of first downstream site
Number calls entitled Key, type=" String " to represent that the type of this configuration parameter is character string (acyclic type), second
The initial configuration parameters of subordinate's section include:Name=" value " represents that the configuration parameter of first downstream site is entitled
Value, tagName=" Value " represent that the configuration parameter of first downstream site calls entitled Type, type="
RepeatList " represents that this configuration parameter has loop configuration mark, and indexName=" valueItem " represents that user transmits
N/m value be filterItem value, maxNumber=" 5 " represent cycle-index be 5, subName=" subValue " and
SubType=" String " is represented without the downstream site without its downstream site.
Then, in step s 2, Filter.1.Key~Filter.5.Key is generated based on the initial configuration parameters,
Filter.1.Value.1~Filter.5.Value.1, Filter.2.Value.1~Filter.2.Value.5,
Filter.3.Value.1~Filter.3.Value.5, Filter.4.Value.1~Filter.4.Value.5,
Filter.5.Value.1~Filter.5.Value.5 configuration parameter and its correlation attribute information, wherein, association attributes letter
Cease corresponding with the information content of corresponding initial configuration information.
In step s 2, the form for entering to join information that user can input is XXX. [n] .YYY or XXX. [n] .YYY. [m],
Such as Filter.1.Key, Filter.1.Value.1, Filter.1.Value.2 etc..
For example, it is when receiving the call request that user is passed to:
Filter.1.Key=weather&Value.1=beijing&Value.2=shanghai&Fi lter.2.Key
=map&Value=Qingdao,
In the step S2, the equipment finds the configuration parameter generated based on configuration file four, and based on described
Configuration parameter is parsed and recombinated to the call request, and the recalls information of the rear end parameter format of generation is as follows:
Those skilled in the art are it should be understood that call request that above-mentioned configuration file, user are passed to and based on tune
Content with the recalls information of the rear end parameter format of request generation is citing, to help to understand present invention purpose,
The recalls information of other configuration files formed based on the present application thought, call request and rear end parameter format, is existed
Within the scope of the application is claimed.
One kind that Fig. 6 shows to be provided on one side according to the application is used to realize application programming interface configuration and called
Equipment structural representation, wherein, the equipment includes:Acquisition device 1, configuration device 2 and calling device 3.
The acquisition device 1 obtains the initial configuration parameters based on the generation of recyclable configuration information;The configuration device 2,
Based on the configuration parameter of initial configuration parameters generation application programming, wherein, it is the first of cyclical patterns by parameter type
The multiple configuration parameters of beginning configuration parameter recursive generation;The calling device 3, when receiving call request, based on corresponding
The configuration parameter, the call request is parsed and recombinated, to generate the recalls information of rear end parameter format.
Constantly worked between above-mentioned each device, here, it will be understood by those skilled in the art that " lasting " refers to
Each device is stated to require in real time or according to the mode of operation of setting or real-time adjustment respectively.
The acquisition device 1 obtains the initial configuration parameters based on the generation of recyclable configuration information;It is here, described recyclable
Configuration information is the configuration rule of generation initial configuration parameters, and the recyclable configuration information is predetermined, it is preferable that service
Access side is based on the recyclable configuration information, specifies configuration file of the generation with corresponding initial configuration parameters, and equipment obtains
Respective profiles are taken, and corresponding initial configuration parameters are obtained from the configuration file.
Wherein, the initial configuration parameters can have one or more, it is preferable that be generated based on recyclable configuration information
Configuration file there are multiple level nodes, each level node has one or more initial configuration parameters, therefore, not at the same level
Multiple initial configuration parameters of other node have multiple combinations relation.
The initial configuration parameters mainly include:Configuration parameter title (name), configuration parameter call title
(tagName), parameter type (type), wherein, the parameter type includes cyclical patterns (type=RepeatList) and non-
Cyclical patterns, for the initial configuration parameters of cyclical patterns, the initial configuration parameters also include:Loop configuration identifies (type
=RepeatList), cycle-index (maxNumber), configuration continuity (Sequence).Based on the initial configuration parameters,
It may determine whether to carry out circular recursion, the number of circular recursion and the successional setting of configuration.The configuration device 2 uses
Recursive mode generates configuration parameter, and for the initial configuration parameters of acyclic type, the follow-up configuration device 2 directly generates
Configuration parameter.
Moreover it is preferred that the initial configuration parameters also include following at least any one:Parameter position information
(tagPosition), school inspection information (Required), rear end parameter format (invokeDataType), subordinate's parameter type
(subtype), parameter information (indexName), for generating the correlation attribute information of configuration information.
Table one shown in specific scene embodiment, the function example explanation of each information of the initial configuration parameters
Citing, certainly, those skilled in the art it should be understood that the example in the name of the initial configuration parameters and its explanation only
For citing, it can realize that the name of the information or parameter of identical function and the example belong to the thought range of the application.
Further, configuration parameter of the configuration device 2 based on initial configuration parameters generation application programming,
Wherein, the multiple configuration parameters of initial configuration parameters recursive generation by parameter type for cyclical patterns.The configuration device 2
Enter ginseng form according to different initial configuration parameters, carry out different configurations, and generate different corresponding configuration parameters.
Here, when the initial configuration parameters are cyclical patterns, the initial configuration parameters include:Loop configuration identifies
(type=RepeatList), cycle-index (maxNumber), configuration continuity (Sequence).Based on the initial configuration
Parameter, it may be determined that whether carry out circular recursion, the number of circular recursion and the successional setting of configuration.
In addition, the configuration parameter includes configuration related names and correlation attribute information, wherein, configure related names and phase
The information content that attribute information is closed with corresponding initial configuration information is corresponding.
Fig. 7 shows the structural representation according to the configuration device provided in the application one embodiment.With reference to Fig. 7,
When whether the parameter type of the initial configuration parameters is cyclical patterns, the configuration device 2 includes judging unit 21, recurrence
Unit 22 and determining unit 23.
Wherein, the judging unit 21 judges whether the initial configuration parameters have loop configuration mark (type=
RepeatList), if so, then judging the parameter type of the initial configuration parameters for cyclical patterns;The base of recursive unit 22
In the cycle-index (maxNumber), the multiple configuration parameters of recursive generation;It is continuous that the determining unit 23 is based on the configuration
Property information (Sequence), determines the continuous sexual intercourse of multiple configuration parameters, this configuration decides whether the company that user is passed to
Continuous property, it is considered as continuously if that asks enters ginseng for Disk.1=100&Disdk.2=300, and asks Disk.1=200&
Disk.3=100 can be considered as discontinuous.Wherein, continuous sexual intercourse can only verify when user asks API.Therefore can basis
Design parameter mistake reports an error, and then lifts the experience of api interface.
Specifically, it is initial for initial configuration parameters of the initial configuration parameters including present node and its downstream site
The situation of configuration parameter, the recursive unit 22 includes the first subelement (not shown) and the second subelement (not shown), described
First subelement is based on subordinate's parameter name, judges whether downstream site, when downstream site be present, then described
The initial configuration parameters of initial configuration parameters corresponding to downstream site and present node are carried out recurrence combination by two subelements,
To generate the configuration parameter of multiple combinations.
Such as the parameter call title of the initial configuration parameters obtained based on present node includes Disk, cycle-index 2,
It has two downstream sites, and the parameter call title of the initial configuration parameters of downstream site is respectively Size and Type, then will
The initial configuration parameters of initial configuration parameters corresponding to downstream site and present node carry out recurrence combination, generation
The configuration parameter of tetra- combinations of Disk.1.Size, Disk.1.Type, Disk.2.Size and Disk.2.Type.
Further, if the initial configuration information of downstream site is cyclical patterns, the recursive unit 22 is based on down
The configuration information of level node generates multiple configuration parameters, then by multiple initial configuration parameters of downstream site with it is current it is multiple just
Beginning configuration parameter carries out recurrence combination according to this, for example, the parameter call title of the initial configuration parameters obtained based on present node
Including Disk, cycle-index 2, it has the entitled Size of the parameter call of the initial configuration parameters of downstream site, circulation time
Number is 2, then carries out recurrence combination, generates Disk.1.Size.1, Disk.1.Size.2, Disk.2.Size.1,
The configuration parameter of Disk.2.Size.2 some combinations.
Can be the initial configuration ginseng of at least one downstream site in addition, when having two or more downstream site arranged side by side
Number is cyclical patterns, and the combining form of the acyclic type of initial configuration parameters of at least one downstream site, for example, based on working as
The parameter call title for the initial configuration parameters that front nodal point obtains includes Disk, and cycle-index 2, it has two arranged side by side one
The entitled Size of parameter call of the initial configuration parameters of individual downstream site, cycle-index 2, another downstream site it is initial
The entitled Type of parameter call of configuration parameter, acyclic type, then recurrence combination is carried out, generates Disk.1.Size.1,
Disk.1.Size.2, Disk.2.Size.1, Disk.2.Size.2, Disk.1.Type, Disk.2.Type some combinations
Configuration parameter.
Fig. 8 is shown according to being provided in the application one embodiment in the configuration device when initial configuration parameters is follow
The structural representation of configuration parameter is generated during style type.Further, on the basis of the configuration device 2 shown in Fig. 7, institute
Stating configuration device 2 also includes generation unit 24.Wherein, the generation unit 24 judges the parameter type of the initial configuration parameters
For cyclical patterns, if it is not, then based on initial configuration parameters generation configuration parameter.
Correspondingly, the generation unit 24 initial configuration parameters including present node initial configuration parameters and its
In the case of downstream site initial configuration parameters, including the 3rd subelement (not shown) and the 4th subelement (not shown), described
Three subelements are based on subordinate's parameter name, judge whether downstream site, if so, then the 4th subelement is by subordinate
The initial configuration parameters of initial configuration parameters corresponding to node and present node are combined, to generate at least one combination
Configuration parameter.Such as the parameter call title of the initial configuration parameters of present node includes Disk, it has Liang Ge subordinates section
Point, the parameter call title of initial configuration parameters is respectively Size and Type, then by initial configuration parameters corresponding to downstream site
Recurrence combination is carried out with the initial configuration parameters of present node, generates Disk.Size, two combinations of Disk.Type are matched somebody with somebody
Put parameter.
In addition, the parameter type of the initial configuration parameters based on downstream site, and carry out recurrence according to this or non-recursive group
The mode of conjunction can include the mode that the embodiment of the recursive unit 22 describes, and for simplicity, include by reference
In this, repeat no more.
Further, Fig. 9 shows to be used to realize that application program is compiled according to one kind that one preferred embodiment of the application provides
The structural representation for the equipment that journey interface is configured and called.The calling device is preferably gateway caches device, then Fig. 6's
On the basis of, methods described also includes writing station 4, for the generated configuration parameter to be write into gateway caches device 3 ', and
Invoked procedure is performed by the gateway caches device of equipment.
Here, the combination for the configuration parameter that the application is generated based on the initial configuration parameters is to be based on call parameters title
The circulation restructuring of certain number is carried out, if call parameters title is different, need to be defined according to different configuration parameters, such as:
Disk.n.Type, Instance.n.Type are, it is necessary to define two different XXX. [n] .YYY [m] configuration parameter.
Further, the calling device 3 is joined when receiving the call request of user's transmission according to corresponding configuration
Number, is parsed and is recombinated to the call request, to generate the recalls information of rear end parameter format.
Figure 10 shows the structural representation of the calling device provided according to one preferred embodiment of the application.Wherein, it is described
Calling device 3 includes:Resolution unit 31, searching unit 32 and recomposition unit 33;
The resolution unit 31 parses the call request, and acquisition is at least one to be entered to join information, and enters to join information to described
Carry out school inspection;The searching unit 32 is searched to enter to join the corresponding configuration parameter of information with described;The base of recomposition unit 33
In the corresponding configuration parameter, enter to join information and recombinate to described, to generate the recalls information of rear end parameter format.
Further, the resolution unit 31 includes:6th subelement (not shown) and the 7th subelement (not shown).Its
In, the 6th subelement when obtain it is multiple it is described enter to join information, to it is multiple it is described enter to join information and carry out repeated school inspection, such as:
The ginseng that enters of user's request is Disk.1=100&Disk.1=200, then can be considered as repeating;7th subelement is based on configuration
The parametric continuity information of parameter, enter to join information progress parametric continuity school inspection to described.Here, the parameter of the configuration parameter
Parametric continuity information of the continuity information based on the initial configuration parameters is corresponding to be generated.
Further, the searching unit 32 based on it is described enter join information prefix information and configuration parameter configuration parameter
Title is called to be matched, to find the corresponding configuration parameter.
Wherein, in a preferred embodiment, the calling device is preferably API gateway buffer storage.Then corresponding institute
Stating equipment also includes:Writing station 4, for the generated configuration parameter to be write into gateway caches device.Rear end after restructuring
Parameter format can be obtained by access product side and effectively identified.
Gather concrete scene example below, methods described is described further.
In a specific Scene case, the acquisition device 1 obtains matching somebody with somebody based on the generation of recyclable configuration information first
Put file one:
The configuration parameter that above-mentioned configuration file is generated represents that user can be passed to 5 pieces of disks (Disk).
Then, content of the acquisition device 1 based on above-mentioned configuration file one, the initial configuration parameters of present node are obtained
Including:Name=" disks " represents that configuration parameter title (i.e. access product side's parameter name) is disks, tagName="
It is Disk that Disk ", which represents that configuration parameter calls title (the displaying title i.e. to user), and tagPosition=" Query " is represented
In the URL of HTTP request, required=" true " represents to need school to examine whether the node has value, type=" parameter
RepeatList " represents that this configuration parameter has loop configuration mark, and invokeDataType=" Map " represents bottom (access
Side) data format that receives be map (figure) form, subName=" disk " and subType=" String " expressions be not no under it
Level node, indexName=" diskIndex " represent the value that the value that user transmits n/m is disk, and maxNumber=" 5 " is represented
Cycle-index is 5.
Then, the configuration device 2 is based on the initial configuration parameters generation Disk.1, Disk.2, Disk.3,
Disk.4, Disk.1, Disk.5, five configuration parameters and its correlation attribute information, wherein, correlation attribute information with it is corresponding initial
The information content of configuration information is corresponding.
The form for entering to join information that the calling device 3 receives user and can inputted is XXX. [n], for example, when user inputs
Enter to join information and include:Disk.1=abc&Disk.2=dji&Disk.3=mfi.
Then, the calling device 3 finds the configuration parameter generated based on configuration file one, and is joined based on the configuration
Several that the call request is parsed and recombinated, the recalls information of the rear end parameter format of generation is as follows:
In another specific Scene case, the acquisition device 1 obtains based on the generation of recyclable configuration information first
Configuration file two:
Above-mentioned configuration file represents that user can be passed to the size (Size) and type (Type) of 5 pieces of disks (Disk).
Content of the acquisition device 1 based on above-mentioned configuration file two, the initial configuration parameters of present node include:Name="
Disks " represents that configuration parameter title (i.e. access product side's parameter name) is disks, and tagName=" Disk " represents configuration ginseng
It is Disk that number, which calls title (the displaying title i.e. to user), and tagPosition=" Query " represents parameter in HTTP request
In URL, required=" false " represents that being not required to school examines whether the node has value, and type=" RepeatList " represents that this matches somebody with somebody
Putting parameter has loop configuration mark, and sequence=" true " represents to need the continuity of school inspection user's Transfer Parameters,
InvokeDataType=" Map " represents that the data format of bottom (access side) reception is map (figure) form, indexName="
DiskIndex " represents the value that the value that user transmits n/m is disk, and maxNumber=" 5 " represents that cycle-index is 5.First
The initial configuration parameters of downstream site include:Name=" size " represents that the configuration parameter of first downstream site is entitled
Size, tagName=" Size " represent that the configuration parameter of first downstream site calls entitled Size, type="
Integer " represents that the type of this configuration parameter is integer (acyclic type), and name=" type " represents first subordinate
The configuration parameter entitled type, tagName=" Size " of node represent that the configuration parameter of first downstream site calls title
For Type, represent that type=" String " represents that the type of configuration parameter is character string (acyclic type).
Then, the configuration device 2 is based on the initial configuration parameters generation Disk.1.Size, Disk.2.Size,
Disk.3.Size, Disk.4.Size, Disk.5.Size, Disk.1.Type, Disk.2.Type, Disk.3.Type,
Disk.4.Type, Disk.5.Type configuration parameter and its correlation attribute information, wherein, correlation attribute information with it is corresponding initial
The information content of configuration information is corresponding.
The form for entering to join information that the user of calling device 3 can input is XXX. [n] .YYY, for example, when user inputs
Enter to join information and include:
Disk.1.Size=100&Disk.2.Size=200&Disk.1.Type=HHD&Disk.2.T ype=SSD.
Then, the calling device 3 finds the configuration parameter generated based on configuration file two, and is joined based on the configuration
Several that the call request is parsed and recombinated, the recalls information of the rear end parameter format of generation is as follows:
In a specific Scene case, the acquisition device 1 obtains matching somebody with somebody based on the generation of recyclable configuration information first
Put file three:
Above-mentioned configuration file represents that user can be passed to 5 kinds of sizes (Size) and 5 types of 5 pieces of disks (Disk)
(Type)。
Content of the acquisition device 1 based on above-mentioned configuration file three, the initial configuration parameters of present node include:name
=" disks " represents that configuration parameter title (i.e. access product side's parameter name) is disks, and tagName=" Disk " represents to match somebody with somebody
It is Disk to put parameter call title (the displaying title i.e. to user), and tagPosition=" Query " represents that parameter please in HTTP
In the URL asked, type=" RepeatList " represents that this configuration parameter has loop configuration mark, sequence=" false "
Representing to need the continuous of school inspection user's Transfer Parameters, required=" false " represents that being not required to school examines whether the node has value,
InvokeDataType=" Map " represents that the data format of bottom (access side) reception is map (figure) form, indexName="
DiskIndex " represents the value that the value that user transmits n/m is disk, and maxNumber=" 5 " represents that cycle-index is 5.First
The initial configuration parameters of downstream site include:Name=" size " represents that the configuration parameter of first downstream site is entitled
Size, tagName=" Size " represent that the configuration parameter of first downstream site calls entitled Size, type="
RepeatList " represents that this configuration parameter has loop configuration mark, subType=" String " and subName=" size "
Represent that, without its downstream site, indexName=" sizeIndex " represents the value that the value that user transmits n/m is size,
MaxNumber=" 5 " represents that cycle-index is 5;The initial configuration parameters of second downstream site include:Name=" types "
Represent matching somebody with somebody for configuration parameter entitled types, tagName=" Type " second downstream site of expression of second downstream site
Put parameter call entitled Type, type=" RepeatList " and represent that this configuration parameter has loop configuration mark, subType
=" String " and subName=" type " represents to represent user without its downstream site, indexName=" typeIndex "
The value for transmitting n/m is size value, and maxNumber=" 5 " represents that cycle-index is 5.
Then, the configuration device 2 be based on the initial configuration parameters generation Disk.1.Size.1~
Disk.5.Size.1, Disk.1.Size.2~Disk.5.Size.2, Disk.1.Size.3~Disk.5.Size.3,
Disk.1.Size.4~Disk.5.Size.4, Disk.1.Size.5~Disk.5.Size.5, Disk.1.Type.1~
Disk.5.Type.1, Disk.1.Type.2~Disk.5.Type.2, Disk.1.Type.3~Disk.5.Type.3,
Disk.1.Type.4~Disk.5.Type.4, Disk.1.Type.5~Disk.5.Type.5 configuration parameter and its related category
Property information, wherein, correlation attribute information is corresponding with the information content of corresponding initial configuration information.
The form for entering to join information that the user of calling device 3 can input is XXX. [n] .YYY [m], for example, when user is defeated
Enter enter to join information includes:
Disk.1.size.1=100&Disk.1.size.2=300&Disk.1.size.3=500&
Disk.2.size.1=300&Disk.2.size.2=400&Disk.2.size.3=700&Di sk.3.size.1=900&
Disk.3.size.2=1000&Disk.3.size.3=600,
Then, the calling device 3 finds the configuration parameter generated based on configuration file two, and is joined based on the configuration
Several that the call request is parsed and recombinated, the recalls information of the rear end parameter format of generation is as follows:
In another specific Scene case, the acquisition device 1 obtains based on the generation of recyclable configuration information first
Configuration file four:
The acquisition device 1, based on above-mentioned configuration file four, the initial configuration parameters of present node include:Name="
Filter " represents that configuration parameter title (i.e. access product side's parameter name) is filter, and tagName=" Filter " represents to match somebody with somebody
It is Filter to put parameter call title (the displaying title i.e. to user), and tagPosition=" Query " represents parameter in HTTP
In the URL of request, type=" RepeatList " represents that this configuration parameter has loop configuration mark, sequence=" true "
The continuity for needing school to examine user's Transfer Parameters is represented, invokeDataType=" json " represents the number that bottom (access side) receives
It is json forms according to form, indexName=" filterItem " represents the value that the value that user transmits n/m is filterItem,
MaxNumber=" 5 " represents that cycle-index is 5.The initial configuration parameters of first subordinate's section include:Point name=" key " table
Show that the configuration parameter entitled key, tagName=" Key " of first downstream site represent the configuration ginseng of first downstream site
Number calls entitled Key, type=" String " to represent that the type of this configuration parameter is character string (acyclic type), second
The initial configuration parameters of subordinate's section include:Name=" value " represents that the configuration parameter of first downstream site is entitled
Value, tagName=" Value " represent that the configuration parameter of first downstream site calls entitled Type, type="
RepeatList " represents that this configuration parameter has loop configuration mark, and indexName=" valueItem " represents that user transmits
N/m value be filterItem value, maxNumber=" 5 " represent cycle-index be 5, subName=" subValue " and
SubType=" String " is represented without the downstream site without its downstream site.
Then, the configuration device 2 is based on initial configuration parameters generation Filter.1.Key~Filter.5.Key,
Filter.1.Value.1~Filter.5.Value.1, Filter.2.Value.1~Filter.2.Value.5,
Filter.3.Value.1~Filter.3.Value.5, Filter.4.Value.1~Filter.4.Value.5,
Filter.5.Value.1~Filter.5.Value.5 configuration parameter and its correlation attribute information, wherein, association attributes letter
Cease corresponding with the information content of corresponding initial configuration information.
The form for entering to join information that the user of calling device 3 can input is XXX. [n] .YYY or XXX. [n] .YYY.
[m], such as Filter.1.Key, Filter.1.Value.1, Filter.1.Value.2 etc..
For example, it is when receiving the call request that user is passed to:
Filter.1.Key=weather&Value.1=beijing&Value.2=shanghai&Fi lter.2.Key
=map&Value=Qingdao,
The calling device 3 finds the configuration parameter generated based on configuration file four, and is based on the configuration parameter pair
The call request is parsed and recombinated, and the recalls information of the rear end parameter format of generation is as follows:
Those skilled in the art are it should be understood that call request that above-mentioned configuration file, user are passed to and based on tune
Content with the recalls information of the rear end parameter format of request generation is citing, to help to understand present invention purpose,
The recalls information of other configuration files formed based on the present application thought, call request and rear end parameter format, is existed
Within the scope of the application is claimed.
In addition, the embodiment of the present application additionally provide it is a kind of be used for realize application programming interface configuration and call set
Standby, the equipment includes:
Processor;
And it is arranged to store the memory of computer executable instructions, the executable instruction makes institute when executed
State processor:Obtain the initial configuration parameters based on the generation of recyclable configuration information;Should based on initial configuration parameters generation
With the configuration parameter of programming, wherein, parameter type is multiple described for the initial configuration parameters recursive generation of cyclical patterns
Configuration parameter;When receiving call request, based on the corresponding configuration parameter, the call request is parsed and again
Group, to generate the recalls information of rear end parameter format.
With prior art, application programming interface configures realizing according to embodiments herein and that calls sets
It is standby, by obtaining the initial configuration parameters generated based on recyclable configuration information, for performing and needing one in batches substantially
Logic or the parameter of multiple basic logics combination, can merge into some logics based on recyclable configuration information by the parameter of batch
The understandable and simple initial configuration parameters of configuration, realize the planarization process of complex parameters, and in configuration phase, can be to parameter
Type carries out recurrence to generate multiple configuration parameters for the initial configuration parameters of cyclical patterns, after call request is reassembled as
The parameter format that can be identified of the recalls information access product side of parameter format is held, configuration parameter is easy to user and understands and make
With its logic is simple, is easy to adjust or extends, and flexibility is strong, so as to simplify complicated business scenario A PI configuration process, reduces API
Complexity enters the use cost of ginseng, and can be reported an error according to design parameter mistake, and then lifts the experience of api interface.
It should be noted that the application can be carried out in the assembly of software and/or software and hardware, for example, can adopt
With application specific integrated circuit (ASIC), general purpose computer or any other realized similar to hardware device.In one embodiment
In, the software program of the application can realize steps described above or function by computing device.Similarly, the application
Software program (including related data structure) can be stored in computer readable recording medium storing program for performing, for example, RAM memory,
Magnetically or optically driver or floppy disc and similar devices.In addition, some steps or function of the application can employ hardware to realize, example
Such as, coordinate as with processor so as to perform the circuit of each step or function.
In addition, the part of the application can be applied to computer program product, such as computer program instructions, when its quilt
When computer performs, by the operation of the computer, it can call or provide according to the present processes and/or technical scheme.
And the programmed instruction of the present processes is called, it is possibly stored in fixed or moveable recording medium, and/or pass through
Broadcast or the data flow in other signal bearing medias and be transmitted, and/or be stored according to described program instruction operation
In the working storage of computer equipment.Here, including a device according to one embodiment of the application, the device includes using
Memory in storage computer program instructions and processor for execute program instructions, wherein, when the computer program refers to
When order is by the computing device, method and/or skill of the plant running based on foregoing multiple embodiments according to the application are triggered
Art scheme.
It is obvious to a person skilled in the art that the application is not limited to the details of above-mentioned one exemplary embodiment, Er Qie
In the case of without departing substantially from spirit herein or essential characteristic, the application can be realized in other specific forms.Therefore, no matter
From the point of view of which point, embodiment all should be regarded as exemplary, and be nonrestrictive, scope of the present application is by appended power
Profit requires rather than described above limits, it is intended that all in the implication and scope of the equivalency of claim by falling
Change is included in the application.Any reference in claim should not be considered as to the involved claim of limitation.This
Outside, it is clear that the word of " comprising " one is not excluded for other units or step, and odd number is not excluded for plural number.That is stated in device claim is multiple
Unit or device can also be realized by a unit or device by software or hardware.The first, the second grade word is used for table
Show title, and be not offered as any specific order.
Claims (23)
1. a kind of method for being used to realize application programming interface configuration and call, wherein, methods described includes:
Obtain the initial configuration parameters based on the generation of recyclable configuration information;
Based on the configuration parameter of initial configuration parameters generation application programming, wherein, it is cyclical patterns by parameter type
The multiple configuration parameters of initial configuration parameters recursive generation;
When receiving call request, based on the corresponding configuration parameter, the call request is parsed and recombinated, with life
Into the recalls information of rear end parameter format.
2. according to the method for claim 1, wherein, the initial configuration parameters include:
Configuration parameter title, configuration parameter based on the generation of recyclable configuration information call title and parameter type, wherein, it is described
Parameter type includes cyclical patterns and acyclic type.
3. the method according to claim 11, wherein, when whether the parameter type of the initial configuration parameters is cyclical patterns
When, the initial configuration parameters also include:
Loop configuration mark, cycle-index and configuration continuity information based on the generation of recyclable configuration information.
4. the method according to claim 11, wherein, the initial configuration parameters recurrence by parameter type for cyclical patterns
Generating multiple configuration parameters includes:
Judge whether the initial configuration parameters include the loop configuration and identify, if so, then judging the initial configuration parameters
Parameter type be cyclical patterns;
Based on the cycle-index, the multiple configuration parameters of recursive generation;
Based on the configuration continuity information, the continuous sexual intercourse of multiple configuration parameters is determined.
5. according to the method for claim 4, wherein, the initial configuration parameters include the initial configuration parameters of present node
And its downstream site initial configuration parameters, the multiple configuration parameters of recursive generation include:
Based on subordinate's parameter name, downstream site is judged whether, if so, then obtaining the initial configuration ginseng of downstream site
Number;
The initial configuration parameters of the initial configuration parameters of the downstream site and present node are subjected to recurrence combination, with life
Into the configuration parameter of multiple combinations.
6. the method according to claim 11, wherein, the initial configuration parameters recurrence by parameter type for cyclical patterns
Generating multiple configuration parameters includes:
The parameter type of the initial configuration parameters is judged for cyclical patterns, if it is not, then being given birth to based on the initial configuration parameters
Into configuration parameter.
7. according to the method for claim 6, wherein, the initial configuration parameters include the initial configuration parameters of present node
And its downstream site initial configuration parameters, also included based on initial configuration parameters generation configuration parameter:
Based on subordinate's parameter name, downstream site is judged whether, if so, then obtaining the initial configuration ginseng of downstream site
Number;
The initial configuration parameters of the initial configuration parameters of the downstream site and present node are combined, to generate extremely
The configuration parameter of a few combination.
8. method according to any one of claim 1 to 7, wherein, the initial configuration parameters are at least appointed including following
One:
Parameter position information, school inspection information, rear end parameter format, subordinate's parameter type, parameter information.
9. the method according to claim 11, wherein, it is described when receiving call request, based on the corresponding configuration ginseng
Number, is parsed and is recombinated to the call request, included with generating the recalls information of rear end parameter format:
Receive and parse through the call request, obtain it is at least one enters to join information, and enter to join information and carry out school inspection to described;
Search and enter to join the corresponding configuration parameter of information with described;
Based on the corresponding configuration parameter, enter to join information and recombinate to described, to generate the recalls information of rear end parameter format.
10. according to the method for claim 9, wherein, it is described to enter to join information and carry out school inspection and include following at least appointing to described
One:
When obtain it is multiple it is described enter to join information, described enter to join information and carry out repeated school inspection to multiple;
Parametric continuity information based on configuration parameter, enter to join information progress parametric continuity school inspection to described.
11. method according to any one of claim 1 to 10, wherein, methods described also includes:
By the generated configuration parameter write-in gateway caches device.
12. a kind of equipment for being used to realize application programming interface configuration and call, wherein, the equipment includes:
Acquisition device, for obtaining the initial configuration parameters based on the generation of recyclable configuration information;
Configuration device, for the configuration parameter based on initial configuration parameters generation application programming, wherein, by parameter class
Type is the multiple configuration parameters of initial configuration parameters recursive generation of cyclical patterns;
Calling device, for when receiving call request, based on the corresponding configuration parameter, being solved to the call request
Analysis and restructuring, to generate the recalls information of rear end parameter format.
13. equipment according to claim 12, wherein, the initial configuration parameters include:
Configuration parameter title, configuration parameter based on the generation of recyclable configuration information call title and parameter type, wherein, it is described
Parameter type includes cyclical patterns and acyclic type.
14. equipment according to claim 13, wherein, when whether the parameter type of the initial configuration parameters is circulation class
During type, the initial configuration parameters also include:
Loop configuration mark, cycle-index and configuration continuity information based on the generation of recyclable configuration information.
15. equipment according to claim 14, wherein, the configuration device includes:
Judging unit, identified for judging whether the initial configuration parameters include the loop configuration, if so, described in then judging
The parameter type of initial configuration parameters is cyclical patterns;
Recursive unit, for based on the cycle-index, the multiple configuration parameters of recursive generation;
Determining unit, for based on the configuration continuity information, determining the continuous sexual intercourse of multiple configuration parameters.
16. equipment according to claim 15, wherein, the initial configuration that the initial configuration parameters include present node is joined
Number and its downstream site initial configuration parameters, the recursive unit include:
First subelement, for based on subordinate's parameter name, downstream site being judged whether, if so, then obtaining subordinate
The initial configuration parameters of node;
Second subelement, for the initial configuration parameters of the initial configuration parameters of the downstream site and present node to be entered
Row recurrence combination, to generate the configuration parameter of multiple combinations.
17. equipment according to claim 13, wherein, the configuration device includes:
Generation unit, for judging the parameter type of the initial configuration parameters for cyclical patterns, if it is not, then based on described first
Beginning configuration parameter generates configuration parameter.
18. equipment according to claim 17, wherein, the initial configuration that the initial configuration parameters include present node is joined
Number and its downstream site initial configuration parameters, the generation unit include:
3rd subelement, for based on subordinate's parameter name, downstream site being judged whether, if so, then obtaining subordinate
The initial configuration parameters of node;
4th subelement, for the initial configuration parameters of the initial configuration parameters of the downstream site and present node to be entered
Row combination, to generate the configuration parameter of at least one combination.
19. the equipment according to any one of claim 12 or 18, wherein, the initial configuration parameters are also included below extremely
It is any one of few:
Parameter position information, school inspection information, rear end parameter format, subordinate's parameter type, parameter information.
20. equipment according to claim 11, wherein, the calling device includes:
Resolution unit, for parsing the call request, obtain it is at least one enters to join information, and enter to join information and carry out school to described
Inspection;
Searching unit, enter to join the corresponding configuration parameter of information with described for searching;
Recomposition unit, for based on the corresponding configuration parameter, enter to join information and recombinate to described, to generate rear end parameter lattice
The recalls information of formula.
21. equipment according to claim 20, wherein, the resolution unit includes following at least any one:
6th subelement, for when obtain it is multiple it is described enter to join information, described enter to join information and carry out repeated school inspection to multiple;
7th subelement, for the parametric continuity information based on configuration parameter, enter to join information progress parametric continuity to described
Examine in school.
22. the equipment according to any one of claim 12 to 21, wherein, the calling device is:Gateway caches device;
The equipment also includes:Writing station, for the generated configuration parameter to be write into gateway caches device.
23. a kind of equipment for being used to realize application programming interface configuration and call, wherein, the equipment includes:
Processor;
And it is arranged to store the memory of computer executable instructions, the executable instruction makes the place when executed
Manage device:Obtain the initial configuration parameters based on the generation of recyclable configuration information;Journey is applied based on initial configuration parameters generation
The configuration parameter of sequence programming, wherein, by the multiple configurations of initial configuration parameters recursive generation that parameter type is cyclical patterns
Parameter;When receiving call request, based on the corresponding configuration parameter, the call request is parsed and recombinated, with
Generate the recalls information of rear end parameter format.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610196603 | 2016-03-31 | ||
CN2016101966032 | 2016-03-31 |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107423041A true CN107423041A (en) | 2017-12-01 |
CN107423041B CN107423041B (en) | 2021-05-07 |
Family
ID=60423149
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710200552.0A Active CN107423041B (en) | 2016-03-31 | 2017-03-29 | Method and apparatus for implementing application programming interface configuration and invocation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107423041B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110111203A (en) * | 2019-05-05 | 2019-08-09 | 北京阿尔山金融科技有限公司 | Batch process, device and the electronic equipment of business datum |
CN112631694A (en) * | 2020-12-11 | 2021-04-09 | 远光软件股份有限公司 | API (application programming interface) packaging calling method and system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5701408A (en) * | 1995-07-10 | 1997-12-23 | International Business Machines Corporation | Method for testing computer operating or application programming interfaces |
CN102521120A (en) * | 2011-11-16 | 2012-06-27 | 中国民航信息网络股份有限公司 | Software automation test system and method |
CN102546259A (en) * | 2012-01-20 | 2012-07-04 | 中兴通讯股份有限公司 | Interface parameter transmission method and device adopting same |
CN103164270A (en) * | 2011-12-12 | 2013-06-19 | 阿里巴巴集团控股有限公司 | Java system application programming interface calling method and system using the same |
CN103345420A (en) * | 2013-06-03 | 2013-10-09 | 百度在线网络技术(北京)有限公司 | Method for massively calling API interfaces, system for massively calling API interfaces and device for massively calling API interfaces |
-
2017
- 2017-03-29 CN CN201710200552.0A patent/CN107423041B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5701408A (en) * | 1995-07-10 | 1997-12-23 | International Business Machines Corporation | Method for testing computer operating or application programming interfaces |
CN102521120A (en) * | 2011-11-16 | 2012-06-27 | 中国民航信息网络股份有限公司 | Software automation test system and method |
CN103164270A (en) * | 2011-12-12 | 2013-06-19 | 阿里巴巴集团控股有限公司 | Java system application programming interface calling method and system using the same |
CN102546259A (en) * | 2012-01-20 | 2012-07-04 | 中兴通讯股份有限公司 | Interface parameter transmission method and device adopting same |
CN103345420A (en) * | 2013-06-03 | 2013-10-09 | 百度在线网络技术(北京)有限公司 | Method for massively calling API interfaces, system for massively calling API interfaces and device for massively calling API interfaces |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110111203A (en) * | 2019-05-05 | 2019-08-09 | 北京阿尔山金融科技有限公司 | Batch process, device and the electronic equipment of business datum |
CN112631694A (en) * | 2020-12-11 | 2021-04-09 | 远光软件股份有限公司 | API (application programming interface) packaging calling method and system |
CN112631694B (en) * | 2020-12-11 | 2023-08-11 | 远光软件股份有限公司 | API (application program interface) encapsulation calling method and system |
Also Published As
Publication number | Publication date |
---|---|
CN107423041B (en) | 2021-05-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20220035600A1 (en) | API Specification Generation | |
CN103002415B (en) | A kind of method and apparatus by short message sending identifying code | |
EP3674914A1 (en) | Multi-party data joint query method, device, server and storage medium | |
US20160162602A1 (en) | Methods and apparatus for proximally informed database searches | |
CN106789227B (en) | A kind of internet behavior analysis method and internet behavior analytical equipment | |
US20120310963A1 (en) | Apparatus and method of searching and visualizing instance path | |
Wang et al. | Discover community leader in social network with PageRank | |
CN110888672B (en) | Expression engine implementation method and system based on metadata architecture | |
CN107423041A (en) | Method and apparatus for realizing application programming interface configuration and calling | |
CN102982034B (en) | The searching method and search system of Internet website information | |
CN105978852A (en) | Network equipment access history information determination method, equipment and switch | |
CN105335466A (en) | Audio data retrieval method and apparatus | |
CN103902429B (en) | The method of early warning, server and system is carried out in automatic test | |
US20190018875A1 (en) | Method for backfilling graph structure and articles comprising the same | |
CN108683651A (en) | A kind of single-point logging method, server-side and system | |
CN103957245B (en) | Internet data acquisition methods and device | |
CN107733709A (en) | Date storage method, device and electronic equipment | |
CN103902715B (en) | IP range lookup method and apparatus | |
CN108369590A (en) | For commending system, the devices and methods therefor for instructing Self-Service to analyze | |
CN105512020B (en) | Test method and device | |
CN103457957B (en) | A kind of network penetration test macro and method with adaptation function | |
CN103686668A (en) | Data updating method, system and device | |
CN106254575B (en) | A kind of method and apparatus of determining user identifier | |
US9536199B1 (en) | Recommendations based on device usage | |
Li et al. | Effects of measurement dependence on generalized Clauser-Horne-Shimony-Holt Bell test in the single-run and multiple-run scenarios |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |