CN108737525A - A kind of Web service system based on REST frameworks - Google Patents
A kind of Web service system based on REST frameworks Download PDFInfo
- Publication number
- CN108737525A CN108737525A CN201810442275.9A CN201810442275A CN108737525A CN 108737525 A CN108737525 A CN 108737525A CN 201810442275 A CN201810442275 A CN 201810442275A CN 108737525 A CN108737525 A CN 108737525A
- Authority
- CN
- China
- Prior art keywords
- mobile terminal
- data
- web service
- rest
- database server
- 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/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0815—Network architectures or network communication protocols for network security for authentication of entities providing single-sign-on or federations
Abstract
The invention discloses a kind of Web service systems based on REST frameworks, including database server, WebService servers and mobile terminal;The database server is for storing data;The Web Service servers include REST API modules, data package module, business logic modules, data management module and log management module;The REST API modules are for describing system resource, in REST frameworks, all resources are indicated with a URI, REST API modules are the interfaces of mobile terminal and database server interaction, all service logics are called after mobile terminal is packaged, by REST API modules by mobile terminal;The data package module is for encapsulating data into object format;The business logic modules are for realizing specific service logic.
Description
Technical field
The present invention relates to a kind of Web service systems based on REST frameworks.
Background technology
It is universal with the development of mobile Internet and smart mobile phone and tablet computer, pass through the people of mobile terminal Internet access
Number is more and more, and the scale of mobile Internet rapidly increases.Therefore, for traditional application system based on PC, exploitation
The demand of its corresponding mobile version is also growing day by day.But existing system is transplanted to mobile terminal there are many problems:It moves
Dynamic terminal platform with it is traditional based on the system of PC, in system architecture, hardware platform, developing instrument etc., there are isomeries, and
The resource of mobile terminal is limited, such as battery, bandwidth, flow, memory capacity etc..
Currently, enterprise is mainly solved by Web service for heterogeneous platform interoperability and information sharing problem both at home and abroad
Certainly.But it is a large amount of including being currently included SOA (Service Oriented Architecture, Enterprise SOA)
Web service framework is all made of RPC (Remote Procedure Call, remote procedure call) style structure, big at Web grades
There is bottlenecks in autgmentability, performance etc. for the framework of RPC styles in sizable application.
Invention content
In view of the deficiencies of the prior art, the present invention provides one kind being based on REST (Representational State
Transfer, declarative state are transmitted) Web service system of framework, including database server, Web Service servers
And mobile terminal;
The database server is for storing data;
The Web Service servers include REST API modules, data package module, business logic modules, data
Management module and log management module;
The REST API modules are for describing system resource, and in REST frameworks, all resources are marked with a URI
Show, REST API modules are the interfaces of mobile terminal and database server interaction, and all service logics are sealed in mobile terminal
After installing, called by mobile terminal by REST API modules;
The data package module is for encapsulating data into object format;General Web service can encapsulate data into XML
Or JSON formats;Since XML format is more complicated, parsing cost is relatively high, and the present invention is directed mobile terminal, is moved
The resources such as bandwidth, the flow of dynamic terminal are limited, therefore the present invention encapsulates data as JSON formats;
The business logic modules are for realizing specific service logic;
The data management module is used to be managed operation, management operation packet to the data stored on database server
Include deletion, addition;
The log management module to the system log automatically formed on database server for being managed operation;
The mobile terminal includes IOS terminals and Android terminal;
The business logic modules provide the API of REST style to mobile terminal.
The mobile terminal is interacted by the way that mobile communications network is unified with Web Service servers, operating database clothes
The data being engaged in device.
Each can map as a URI operation of the data in database server, and mobile terminal passes through this
A little URI access the resource of system.For example, for login function, corresponding URI is http://192.168.1.1:
8080/DMS/user/login.json, mobile terminal are transmitted by the data in this interface access data library server
To the parameter of Web Service server JSON formats, Web Service servers are by accessing the number in database server
According to, determine whether legal user, and respond the request of mobile terminal, return to mobile terminal JSON formats as a result, example
Such as:{"result":" 1 " } indicate that the user is validated user, it can be with login system.
User is after mobile terminal sends out a request, and mobile terminal is submitted by REST API modules and asked, then Web
Service servers execute corresponding business logical operation according to the request of submission, and the result of request is then packaged into JSON
Format returns to mobile terminal, and last mobile terminal can respond the demand of user.
The data package module is used to encapsulate data into the object format of JOSN, specifies incoming parameter and output parameter
All it is application/json.
Advantageous effect:The present invention provides a kind of Web service system based on REST frameworks, which can will be based on PC
Document file management system realize corresponding letter on the two kinds of mobile terminal operating system IOS and Android platform of current main-stream
Change version so that the platform of isomery can be with sharing data resources, and use the data interchange format JSON of lightweight not
With platform swapping data, bandwidth and flow are efficiently reduced, and describes the framework of system and the key technology of realization.
Description of the drawings
The present invention is done with reference to the accompanying drawings and detailed description and is further illustrated, it is of the invention above-mentioned or
Otherwise advantage will become apparent.
Precedence diagram when Fig. 1 is present system processing business.
Specific implementation mode
The present invention will be further described with reference to the accompanying drawings and embodiments.
As shown in Figure 1, the present invention provides a kind of Web service system based on REST frameworks, including database server,
Web Service servers and mobile terminal;
The database server is for storing data;
The Web Service servers include REST API modules, data package module, business logic modules, data
Management module and log management module;
The REST API modules are for describing system resource, and in REST frameworks, all resources are marked with a URI
Show, REST API modules are the interfaces of mobile terminal and database server interaction, and all service logics are sealed in mobile terminal
After installing, called by mobile terminal by REST API modules;
The data package module is for encapsulating data into object format;General Web service can encapsulate data into XML
Or JSON formats;Since XML format is more complicated, parsing cost is relatively high, and the present invention is directed mobile terminal, is moved
The resources such as bandwidth, the flow of dynamic terminal are limited, therefore the present invention encapsulates data as JSON formats;
The business logic modules are for realizing specific service logic;
The data management module is used to be managed operation, management operation packet to the data stored on database server
Include deletion, addition;
The log management module to the system log automatically formed on database server for being managed operation;
The mobile terminal includes IOS terminals and Android terminal;
The business logic modules provide the API of REST style to mobile terminal.
The mobile terminal is interacted by the way that mobile communications network is unified with Web Service servers, operating database clothes
The data being engaged in device.
Each can map as a URI operation of the data in database server, and mobile terminal passes through this
A little URI access the resource of system.For example, for login function, corresponding URI is http://192.168.1.1:
8080/DMS/user/login.json, mobile terminal are transmitted by the data in this interface access data library server
To the parameter of Web Service server JSON formats, Web Service servers are by accessing the number in database server
According to, determine whether legal user, and respond the request of mobile terminal, return to mobile terminal JSON formats as a result, example
Such as:{"result":" 1 " } indicate that the user is validated user, it can be with login system.
User is after mobile terminal sends out a request, and mobile terminal is submitted by REST API modules and asked, then Web
Service servers execute corresponding business logical operation according to the request of submission, and the result of request is then packaged into JSON
Format returns to mobile terminal, and last mobile terminal can respond the demand of user.
The data package module is used to encapsulate data into the object format of JOSN, specifies incoming parameter and output parameter
All it is application/json.
If mobile terminal is IOS terminals, the Web service of REST style is realized by RestKit.RestKit requirements
Mobile terminal define a Model class, for storing data with processing business logic.Each key will directly map in long-range JSON
For each member variable in Model.Each corresponding model will define a corresponding Model class.
If mobile terminal is Android terminal, pass through the lower offer of org.apache.http packets
HttpGet classes etc. under HttpResponse, HttpEntity class and org.apache.http.client.methods packets
It is interacted with Web Service servers.The data of JSON formats are parsed by JSONObject and JSONArray classes, wherein
JSONObject be used for parse " name/value " to set, and JSONArray be used for analytic value ordered list.
The present invention provides a kind of Web service system based on REST frameworks, implement the technical solution method and
There are many approach, the above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.All undefined components in this embodiment can be implemented in the prior art.
Claims (7)
1. a kind of Web service system based on REST frameworks, which is characterized in that including database server, Web Service clothes
Business device and mobile terminal;
The database server is for storing data;
The Web Service servers include REST API modules, data package module, business logic modules, data management
Module and log management module;
The REST API modules are for describing system resource, and in REST frameworks, all resources are indicated with a URI,
REST API modules are the interfaces of mobile terminal and database server interaction, and all service logics are packaged in mobile terminal
Afterwards, it is called by mobile terminal by REST API modules;
The data package module is for encapsulating data into object format;
The business logic modules are for realizing specific service logic;
The data management module is used to be managed operation to the data stored on database server, and management operation includes deleting
It removes, add;
The log management module to the system log automatically formed on database server for being managed operation;
The mobile terminal includes IOS terminals and Android terminal.
2. system according to claim 1, which is characterized in that the business logic modules provide REST wind to mobile terminal
The API of lattice.
3. system according to claim 2, which is characterized in that the mobile terminal by mobile communications network it is unified with
Web Service servers interact, the data in operating database server.
4. system according to claim 3, which is characterized in that each operation to the data in database server
It can map as a URI, mobile terminal accesses the resource of system by these URI.
5. system according to claim 4, which is characterized in that user is mobile whole after mobile terminal sends out a request
Request is submitted in end by REST API modules, and then Web Service servers execute corresponding business according to the request of submission
The result of request is then packaged into JSON formats and returns to mobile terminal by logical operation, and last mobile terminal can respond user
Demand.
6. system according to claim 1, which is characterized in that the data package module is for encapsulating data into JOSN
Object format, it is application/json to specify incoming parameter and output parameter all.
7. system according to claim 6, which is characterized in that if mobile terminal is IOS terminals, pass through RestKit
It realizes that the Web service of REST style, RestKit require to define a Model class in mobile terminal, for storing data and handles
Service logic, each key will be mapped directly into each member variable in Model in long-range JSON;
If mobile terminal is Android terminal, by the lower HttpResponse provided of org.apache.http packets,
HttpGet classes under HttpEntity classes and org.apache.http.client.methods packets take with Web Service
Business device interaction parses the data of JSON formats by JSONObject and JSONArray classes, and wherein JSONObject is for solving
Analyse " name/value " to set, and JSONArray be used for analytic value ordered list.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810442275.9A CN108737525A (en) | 2018-05-10 | 2018-05-10 | A kind of Web service system based on REST frameworks |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810442275.9A CN108737525A (en) | 2018-05-10 | 2018-05-10 | A kind of Web service system based on REST frameworks |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108737525A true CN108737525A (en) | 2018-11-02 |
Family
ID=63938056
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810442275.9A Pending CN108737525A (en) | 2018-05-10 | 2018-05-10 | A kind of Web service system based on REST frameworks |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108737525A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109741229A (en) * | 2018-11-16 | 2019-05-10 | 比亚迪股份有限公司 | Management system and method applied to rail traffic |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090235349A1 (en) * | 2008-03-12 | 2009-09-17 | Intuit Inc. | Method and apparatus for securely invoking a rest api |
CN103745369A (en) * | 2014-01-14 | 2014-04-23 | 中航金网(北京)电子商务有限公司 | Data management method and data management device for spare part sale support system based on B/S (Browser/Server) architecture |
CN105516250A (en) * | 2015-11-25 | 2016-04-20 | 北京邮电大学 | Internet-of-things service invoking platform and system |
CN106155697A (en) * | 2016-07-30 | 2016-11-23 | 北京慧摩尔科技有限公司 | A kind of service-oriented Development Framework (YC Framework) |
CN107562623A (en) * | 2017-08-29 | 2018-01-09 | 郑州云海信息技术有限公司 | A kind of REST API automated testing methods and system |
-
2018
- 2018-05-10 CN CN201810442275.9A patent/CN108737525A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090235349A1 (en) * | 2008-03-12 | 2009-09-17 | Intuit Inc. | Method and apparatus for securely invoking a rest api |
CN103745369A (en) * | 2014-01-14 | 2014-04-23 | 中航金网(北京)电子商务有限公司 | Data management method and data management device for spare part sale support system based on B/S (Browser/Server) architecture |
CN105516250A (en) * | 2015-11-25 | 2016-04-20 | 北京邮电大学 | Internet-of-things service invoking platform and system |
CN106155697A (en) * | 2016-07-30 | 2016-11-23 | 北京慧摩尔科技有限公司 | A kind of service-oriented Development Framework (YC Framework) |
CN107562623A (en) * | 2017-08-29 | 2018-01-09 | 郑州云海信息技术有限公司 | A kind of REST API automated testing methods and system |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109741229A (en) * | 2018-11-16 | 2019-05-10 | 比亚迪股份有限公司 | Management system and method applied to rail traffic |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Dizdarević et al. | A survey of communication protocols for internet of things and related challenges of fog and cloud computing integration | |
CN112333227B (en) | Internet of things platform of mixed type protocol based on rule engine | |
CN101695032B (en) | Unified web client, service configuration method and system thereof | |
CN111600909A (en) | Data processing method, device, protocol conversion equipment and storage medium | |
WO2011137788A1 (en) | Device management method, middleware, and machine-to-machine communication platform, device and system | |
WO2010130165A1 (en) | Method and system for generating open telecommunication service based on internet | |
CN110769009B (en) | User identity authentication method and system | |
WO2019153492A1 (en) | Method for realizing web and native function interaction, and electronic apparatus and readable storage medium | |
CN111294235A (en) | Data processing method, device, gateway and readable storage medium | |
CN104660547B (en) | A kind of service platform for realizing telecommunication | |
CN114124929A (en) | Cross-network data processing method and device | |
CN111367685B (en) | Interface calling method and device, computer equipment and storage medium | |
Wang | Mobile cloud computing | |
CN103002047A (en) | RPC (Remote Procedure Call) type WEB SOA (Service-Oriented Architecture) method | |
CN113220481A (en) | Request processing and feedback method and device, computer equipment and readable storage medium | |
CN108737525A (en) | A kind of Web service system based on REST frameworks | |
CN112860462A (en) | Method, device and system for realizing interconnection and intercommunication of IOT platform bases | |
Kang et al. | Android RMI: a user-level remote method invocation mechanism between Android devices | |
CN109922139A (en) | The dynamic service discovery and dissemination method of heterogeneous network | |
CN113296987B (en) | Interface calling method and device for calling module, computer equipment and storage medium | |
CN112202914B (en) | Message pushing method and device | |
CN113992641A (en) | Data processing method, device, equipment and storage medium | |
Li et al. | Efficient oneM2M protocol conversion platform based on NB-IoT access | |
Bertelsen et al. | Federated publish/subscribe services | |
CN113918245A (en) | Data calling method, device, equipment and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181102 |
|
RJ01 | Rejection of invention patent application after publication |