CN106357781A - Method and system for establishing resource service calling interface - Google Patents
Method and system for establishing resource service calling interface Download PDFInfo
- Publication number
- CN106357781A CN106357781A CN201610863752.XA CN201610863752A CN106357781A CN 106357781 A CN106357781 A CN 106357781A CN 201610863752 A CN201610863752 A CN 201610863752A CN 106357781 A CN106357781 A CN 106357781A
- Authority
- CN
- China
- Prior art keywords
- resource
- target resource
- interface
- url
- determining
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application discloses a method for establishing a resource service calling interface. The method comprises the steps of determining a target resource needing to be used for providing resource service to the outside world; determining a uniform resource locator (URL) of the target resource; establishing an REST application program interface (API) corresponding to the target resource according to the URL of the target resource and based on a Spring model-view-controller (MVC). According to the method, the target resource needing to be used for providing resource service to the outside world is firstly determined, the URL of the target resource is then determined, and the REST API corresponding to the target resource can be established according to the URL of the target resource and based on the Spring MVC. A user can call the service of the target resource by means of the REST API, so that a channel for calling the service of the target resource is provided for the user of the outside world; compared with the prior art, the method is beneficial to great increment of the utilization rate of computer resources. Furthermore, the application also discloses a system for establishing the resource service calling interface.
Description
Technical field
The present invention relates to interfacing field, particularly to a kind of resource service calling interface creation method and system.
Background technology
Currently, with the fast development of computer utility, the type and quantity of computer resource get more and more, including various
Physical resource and virtual resource.
However, while computer resource obtains rapid growth, being also fully used along with computer resource
Quagmire, many computer resources are in idle condition for a long time, cannot fully utilize.
In sum as can be seen that the utilization rate how lifting computer resource is current problem demanding prompt solution.
Content of the invention
In view of this, it is an object of the invention to provide a kind of resource service calling interface creation method and system, lifted
The utilization rate of computer resource.Its concrete scheme is as follows:
A kind of resource service calling interface creation method, comprising:
Determining needs outwardly to provide the target resource of resource service;
Determine the url of described target resource;
According to the url of described target resource, and it is based on spring mvc, create the corresponding rest of described target resource
api.
Preferably, the resource type of described target resource includes main frame and/or virtual machine and/or storage resource and/or collection
Group.
Preferably, the process of the described url determining described target resource, comprising:
Determine the uri of described target resource and determine the corresponding interface operation of described target resource;
Using described interface operation and described uri, determine the url of described target resource.
Preferably, described interface operation is get operation, post operation, put operation or the delete operation in http.
Preferably, the described process determining the corresponding interface operation of described target resource, comprising:
Create operation defined interface, by described operation defined interface, obtain the self-defining operation of user input, and
This self-defining operation is defined as described interface operation.
The present invention further correspondingly discloses a kind of resource service calling interface and creates system, comprising:
Resource determination module, needs outwardly to provide the target resource of resource service for determining;
Url determining module, for determining the url of described target resource;
Interface creation module, for the url according to described target resource, and is based on spring mvc, creates described target
Resource corresponding rest api.
Preferably, the resource type of described target resource includes main frame and/or virtual machine and/or storage resource and/or collection
Group.
Preferably, described url determining module includes:
First information determination sub-module, for determining the uri of described target resource;
Second information determination sub-module, for determining the corresponding interface operation of described target resource;
Url determination sub-module, for using described interface operation and described uri, determining the url of described target resource.
Preferably, described interface operation is get operation, post operation, put operation or the delete operation in http.
Preferably, described second information determination sub-module includes:
Interface creating unit, for creating operation defined interface;
Information acquisition unit, for by described operation defined interface, obtaining the self-defining operation of user input, and will
This self-defining operation is defined as described interface operation.
In the present invention, resource service calling interface creation method, comprising: determining needs outwardly to provide the mesh of resource service
Mark resource;Determine the url of target resource;According to the url of target resource, and it is based on spring mvc, create target resource and correspond to
Rest api.The present invention first determines the target resource needing outwardly to provide resource service, it is then determined that going out this target money
The url in source, the url then according to this target resource simultaneously combine spring mvc, can create obtain corresponding with this target resource
rest api.Because by this rest api, user can call the service of this target resource, thus providing for extraneous user
The channel of the service of invocation target resource, cannot call the situation of computer resource service with respect to the external world in prior art, this
Invention is conducive to being substantially improved the utilization rate of computer resource.
Brief description
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
Have technology description in required use accompanying drawing be briefly described it should be apparent that, drawings in the following description be only this
Inventive embodiment, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis
The accompanying drawing providing obtains other accompanying drawings.
Fig. 1 is a kind of resource service calling interface creation method flow chart disclosed in the embodiment of the present invention;
Fig. 2 is that disclosed in the embodiment of the present invention, a kind of resource service calling interface creates system structure diagram.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation description is it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of not making creative work
Embodiment, broadly falls into the scope of protection of the invention.
It is the embodiment of the invention discloses a kind of resource service calling interface creation method, shown in Figure 1, comprising:
Step s11: determining needs outwardly to provide the target resource of resource service;
Step s12: determine the url of target resource;
Step s13: according to the url of target resource, and be based on spring mvc, create the corresponding rest of target resource
api.
That is, the embodiment of the present invention is after determining the target resource needing outwardly to provide resource service, it will determine
Go out the corresponding url of this target resource (i.e. uniform resource locator, URL), then basis should
Url, and combine spring mvc, calling interface corresponding with above-mentioned target resource can be created that, i.e. rest api, by this
Rest api (rest, i.e. representational state transfer, declarative state transfer;Api, that is,
Application programming interface, application programming interface), user can call this target resource
Service is it is seen then that the embodiment of the present invention is the channel of the service that extraneous user provides invocation target resource.It is pointed out that
Above-mentioned spring mvc is belonging to the mvc framework (mvc, i.e. model view controller) in spring framework.
In addition, it is necessary to explanation, in the present embodiment, the resource type of target resource includes but is not limited to main frame and/or void
Plan machine and/or storage resource and/or cluster.That is, the target resource in the present embodiment can be host resource, virtual machine money
Source, storage resource or cluster resource.
In the embodiment of the present invention, resource service calling interface creation method, comprising: determine and need outwardly to provide resource to take
The target resource of business;Determine the url of target resource;According to the url of target resource, and it is based on spring mvc, create target money
Source corresponding rest api.The present invention first determines the target resource needing outwardly to provide resource service, it is then determined that going out this
The url of target resource, the url then according to this target resource simultaneously combine spring mvc, can create and obtain and this target resource
Corresponding restapi.Because by this rest api, user can call the service of this target resource, thus being extraneous user
Provide the channel of the service of invocation target resource, the feelings of computer resource service cannot be called with respect to the external world in prior art
Condition, the embodiment of the present invention is conducive to being substantially improved the utilization rate of computer resource.
The embodiment of the invention discloses a kind of specific resource service calling interface creation method, with respect to upper one enforcement
Example, the present embodiment has made further instruction and optimization to technical scheme.Specific:
In upper embodiment step s12, need the url of target resource is determined.In the present embodiment, above-mentioned determination mesh
The process of the url of mark resource, specifically may include that
Determine the uri (i.e. uniform resource identifier, Uniform Resource Identifier) and really of target resource
The corresponding interface operation of the resource that sets the goal, then utilizes interface operation and uri, determines the url of target resource.
Specifically, above-mentioned interface operation can (i.e. hypertext transfer protocol, hypertext passes for http
Defeated agreement) in get operation, post operation, put operation or delete operation.
Certainly, above-mentioned interface operation is except being the operation having existed in http or by User Defined
Interface operation.That is, in the present embodiment, the process of the corresponding interface operation of above-mentioned determination target resource or: create
Operation defined interface, by operating defined interface, obtains the self-defining operation of user input, and will be true for this self-defining operation
It is set to interface operation.
It is understood that the establishment process of the above-mentioned self-defining operation by user input is already present with prior art
The establishment process of interface operation is similar, specifically may be referred to the establishment process of existing interface operation in prior art, here is not
It is repeated.
It is accordingly, the embodiment of the invention also discloses a kind of resource service calling interface creates system, shown in Figure 2,
This system includes:
Resource determination module 21, needs outwardly to provide the target resource of resource service for determining;
Url determining module 22, for determining the url of target resource;
Interface creation module 23, for the url according to target resource, and is based on spring mvc, creates target resource pair
The rest api answering.
In the embodiment of the present invention, first determine the target resource needing outwardly to provide resource service, it is then determined that going out this
The url of target resource, the url then according to this target resource simultaneously combine spring mvc, can create and obtain and this target resource
Corresponding rest api.Because by this rest api, user can call the service of this target resource, thus being extraneous user
Provide the channel of the service of invocation target resource, the feelings of computer resource service cannot be called with respect to the external world in prior art
Condition, the embodiment of the present invention is conducive to being substantially improved the utilization rate of computer resource.
Specifically, the resource type of above-mentioned target resource includes main frame and/or virtual machine and/or storage resource and/or collection
Group.
In addition, above-mentioned url determining module specifically can include first information determination sub-module, the second information determination sub-module
With url determination sub-module;Wherein,
First information determination sub-module, for determining the uri of target resource;
Second information determination sub-module, for determining the corresponding interface operation of target resource;
Url determination sub-module, for using interface operation and uri, determining the url of target resource.
Wherein, above-mentioned interface operation can be the get operation in http, post operation, put operation or delete operation.
Certainly, above-mentioned interface operation is except being the operation having existed in http or by User Defined
Interface operation.That is, in the present embodiment, above-mentioned second information determination sub-module specifically can include interface creating unit and letter
Breath acquiring unit;Wherein,
Interface creating unit, for creating operation defined interface;
Information acquisition unit, for by operating defined interface, obtaining the self-defining operation of user input, and should be certainly
Defining operation is defined as interface operation.
Last in addition it is also necessary to explanation, herein, such as first and second or the like relational terms be used merely to by
One entity or operation are made a distinction with another entity or operation, and not necessarily require or imply these entities or operation
Between there is any this actual relation or order.And, term " inclusion ", "comprising" or its any other variant meaning
Covering comprising of nonexcludability, so that including a series of process of key elements, method, article or equipment not only include that
A little key elements, but also include other key elements being not expressly set out, or also include for this process, method, article or
The intrinsic key element of equipment.In the absence of more restrictions, the key element being limited by sentence "including a ...", does not arrange
Remove and also there is other identical element in the process including described key element, method, article or equipment.
Above a kind of resource service calling interface creation method provided by the present invention and system are described in detail,
Specific case used herein is set forth to the principle of the present invention and embodiment, and the explanation of above example is to use
Understand the method for the present invention and its core concept in help;Simultaneously for one of ordinary skill in the art, according to the present invention's
Thought, all will change in specific embodiments and applications, and in sum, this specification content should not be construed as
Limitation of the present invention.
Claims (10)
1. a kind of resource service calling interface creation method is it is characterised in that include:
Determining needs outwardly to provide the target resource of resource service;
Determine the url of described target resource;
According to the url of described target resource, and it is based on spring mvc, create described target resource corresponding rest api.
2. the resource service calling interface creation method according to described claim 1 is it is characterised in that described target resource
Resource type include main frame and/or virtual machine and/or storage resource and/or cluster.
3. the resource service calling interface creation method according to described claim 1 is it is characterised in that described in described determination
The process of the url of target resource, comprising:
Determine the uri of described target resource and determine the corresponding interface operation of described target resource;
Using described interface operation and described uri, determine the url of described target resource.
4. the resource service calling interface creation method according to described claim 3 is it is characterised in that described interface operation
For the get operation in http, post operation, put operation or delete operation.
5. the resource service calling interface creation method according to described claim 3 is it is characterised in that described in described determination
The process of the corresponding interface operation of target resource, comprising:
Create operation defined interface, by described operation defined interface, obtain the self-defining operation of user input, and should
Self-defining operation is defined as described interface operation.
6. a kind of resource service calling interface creates system it is characterised in that including:
Resource determination module, needs outwardly to provide the target resource of resource service for determining;
Url determining module, for determining the url of described target resource;
Interface creation module, for the url according to described target resource, and is based on spring mvc, creates described target resource
Corresponding rest api.
7. resource service calling interface according to claim 6 creates system it is characterised in that the money of described target resource
Source Type includes main frame and/or virtual machine and/or storage resource and/or cluster.
8. resource service calling interface according to claim 6 creates system it is characterised in that described url determining module
Including:
First information determination sub-module, for determining the uri of described target resource;
Second information determination sub-module, for determining the corresponding interface operation of described target resource;
Url determination sub-module, for using described interface operation and described uri, determining the url of described target resource.
9. resource service calling interface according to claim 8 creates system it is characterised in that described interface operation is
Get operation in http, post operation, put operation or delete operation.
10. resource service calling interface according to claim 8 creates system it is characterised in that described second information is true
Stator modules include:
Interface creating unit, for creating operation defined interface;
Information acquisition unit, for by described operation defined interface, obtaining the self-defining operation of user input, and should be certainly
Defining operation is defined as described interface operation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610863752.XA CN106357781A (en) | 2016-09-29 | 2016-09-29 | Method and system for establishing resource service calling interface |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610863752.XA CN106357781A (en) | 2016-09-29 | 2016-09-29 | Method and system for establishing resource service calling interface |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106357781A true CN106357781A (en) | 2017-01-25 |
Family
ID=57865663
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610863752.XA Pending CN106357781A (en) | 2016-09-29 | 2016-09-29 | Method and system for establishing resource service calling interface |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106357781A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109408218A (en) * | 2017-08-15 | 2019-03-01 | 西门子公司 | Resource transfer method and apparatus |
CN109508183A (en) * | 2018-10-22 | 2019-03-22 | 郑州云海信息技术有限公司 | REST code generating method and device in a kind of storage cluster |
CN111931087A (en) * | 2020-09-15 | 2020-11-13 | 新华三半导体技术有限公司 | Webpage request processing method and device |
US11586487B2 (en) | 2019-12-04 | 2023-02-21 | Kyndryl, Inc. | Rest application programming interface route modeling |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102938700A (en) * | 2012-10-12 | 2013-02-20 | 北京国电通网络技术有限公司 | Charging method and device for power FTTH (fiber to the home) service |
CN104615526A (en) * | 2014-12-05 | 2015-05-13 | 北京航空航天大学 | Monitoring system of large data platform |
CN105007597A (en) * | 2015-08-31 | 2015-10-28 | 河南大学 | Node packaging and accessing method of wireless sensor networks based on Restful configuration |
-
2016
- 2016-09-29 CN CN201610863752.XA patent/CN106357781A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102938700A (en) * | 2012-10-12 | 2013-02-20 | 北京国电通网络技术有限公司 | Charging method and device for power FTTH (fiber to the home) service |
CN104615526A (en) * | 2014-12-05 | 2015-05-13 | 北京航空航天大学 | Monitoring system of large data platform |
CN105007597A (en) * | 2015-08-31 | 2015-10-28 | 河南大学 | Node packaging and accessing method of wireless sensor networks based on Restful configuration |
Non-Patent Citations (2)
Title |
---|
宋涛 等: "浅谈基于Spring MVC的REST功能", 《电脑知识与技术》 * |
李延: "基于REST架构的web服务技术研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109408218A (en) * | 2017-08-15 | 2019-03-01 | 西门子公司 | Resource transfer method and apparatus |
CN109508183A (en) * | 2018-10-22 | 2019-03-22 | 郑州云海信息技术有限公司 | REST code generating method and device in a kind of storage cluster |
US11586487B2 (en) | 2019-12-04 | 2023-02-21 | Kyndryl, Inc. | Rest application programming interface route modeling |
CN111931087A (en) * | 2020-09-15 | 2020-11-13 | 新华三半导体技术有限公司 | Webpage request processing method and device |
CN111931087B (en) * | 2020-09-15 | 2021-02-05 | 新华三半导体技术有限公司 | Webpage request processing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106357781A (en) | Method and system for establishing resource service calling interface | |
CN102902537B (en) | Based on the embedded type WEB MVC Development Framework of FastCGI and html template | |
CN103685269B (en) | A kind of web browser carries out the method and system of both-way communication with server | |
CN104484216A (en) | Method and device for generating service interface document and on-line test tool | |
CN101408899A (en) | Method and apparatus for switching website multiple data sources | |
CN101894059B (en) | A kind of detection method of running status and system | |
CN103207730B (en) | One can locate pull-alongs flow process drawing generating method and process flow diagram maker | |
CN108833459A (en) | Data reporting method and terminal equipment | |
CN105718601B (en) | A kind of service dynamic integrated model and its application method | |
CN103902389A (en) | Equipment management method supporting bidirectional communication based on android platform | |
CN102004790A (en) | Method for exporting high-throughput data report | |
CN106341811A (en) | Data migration method and server | |
CN104270399A (en) | Login method and login device for application program | |
EP2480013A1 (en) | Method and system for realizing application of machine-to-machine/man terminal based on groups | |
CN103809951A (en) | Graphical service arrangement and management device based on FLEX technology | |
CN106951636A (en) | A kind of power communication static resource automatic identifying method based on AutoCAD | |
CN105825593A (en) | Locker management system for acquiring dynamic passwords based on mobile terminal | |
CN103217897A (en) | Method and system for optimizing screen refresh rate of touch-screen smart mobile terminal | |
CN107203414A (en) | The thermomigration process and device of virtual machine in a kind of isomery cpu server cluster | |
CN106982081B (en) | Bluetooth equipment information configuration method and system | |
CN106656541A (en) | Data transmission method and apparatus based on SNMP interface | |
CN112180883A (en) | Industrial equipment management method and Internet of things management platform | |
CN104932865B (en) | A kind of component agreement method for digging, apparatus and system | |
CN106571958A (en) | Method and device for building communication connection with SAP system | |
CN109246241A (en) | A kind of mobile internet service system based on LBS |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170125 |