Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method and system for applying for external services based on redis web service

A service request and service response technology, applied in the computer field, can solve the problems of complex deployment of external services on the Web platform, achieve the effects of reducing communication overhead, reducing maintenance costs, and ensuring timeliness

Active Publication Date: 2020-11-17
WUHAN GREENET INFORMATION SERVICE
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] Aiming at the above defects or improvement needs of the prior art, the present invention provides a method for applying for external services based on Redis-based WebService, the purpose of which is to provide a non-blocking based simple service Remotely call the service solution, thus solving the complex technical problem of obtaining external service deployment on the Web platform in the prior art

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and system for applying for external services based on redis web service
  • Method and system for applying for external services based on redis web service
  • Method and system for applying for external services based on redis web service

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0047] Such as figure 1 As shown, it is an implementation scenario of the technical solution in the embodiment of the present invention, the front end (such as a browser) requests an external service through a backend server (Web server), and a Redis database is deployed between the backend server and the external service unit, the described The Redis database is used to establish and maintain a Redis cache queue, and a Redis cache queue corresponds to a service request and a service response between a backend server and an external service unit. The service request and service response are stored in the Redis cache queue, and the service request and service response are arranged in parity, so that the element in the queue can be judged whether it is a service request or a service response by the length of the queue.

Embodiment 2

[0049] Such as figure 2 As shown, the embodiment of the present invention provides a method for applying for an external service based on a Redis-based Web Service, including:

[0050] S1. The front-end sends an external service request to the back-end server, returns and sets the service response query time;

[0051] When a user needs to request the service of an external service unit, he can use Ajax to send a service request to the back-end server through the front-end (such as a web browser), and when the service request is sent, it can return (usually immediately return) and timed, that is, set the service Response query time, when the set service response query time is reached, the front-end uses Ajax to send a query request to the back-end server to drive the back-end server to query and return the service response result.

[0052] S2. The backend server receives the external service request sent by the front end, and judges whether the length of the corresponding Red...

Embodiment 3

[0065] Taking the odd elements in the queue representing service requests and the even elements representing service responses as an example, the process of request initiation and result response of the method of the present invention will be described below.

[0066] Such as image 3As shown, it is a schematic diagram of the process of initiating a service request in the embodiment of the present invention. The front-end sends a service request, returns and sets the timing; after the back-end server receives the service request, it adds a service request to the cache queue, and if the queue length is an even number, it adds. If it is an odd number it is not added. For example, the queue length in the figure is 2 (even number), at this time, the service request req can be added, and the queue length becomes 3 (odd number) after adding, at this time, the external service unit reads the service request req.

[0067] Such as Figure 4 As shown, it is a schematic diagram of the ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for applying for an external service based on a Redis-based Web Service, comprising: a front end sends an external service request to a back-end server, returns and sets a service response query time; the back-end server judges whether the length of the corresponding Redis cache queue is Add timing corresponding to the request, if so, add the external service request to the end of the Redis cache queue; the external service unit judges whether the length of the Redis cache queue corresponds to the request reading sequence, and if so, read the external service request, and add the service response result to the end of the Redis cache queue; when the service response query time is reached, the front end sends a query request to determine whether the length of the Redis cache queue corresponds to the response read sequence, and if so Read the service response result at the end of the Redis cache queue. The present invention can realize the interaction between the local web server and the external service components, the realization method is simple, and it is more suitable for the simple external service interaction.

Description

technical field [0001] The invention belongs to the field of computer technology, and more specifically relates to a method and system for applying for external services based on Redis-based WebService. Background technique [0002] Web Service is a platform-independent, low-coupling, self-contained, programmable Web-based application that can be described, published, discovered, coordinated, and configured using the open Extensible Markup Language (eXtensible Markup Language, XML) standard These applications are used to develop distributed interoperable applications. Web Service technology enables different applications running on different machines to exchange data or integrate without additional, specialized third-party software or hardware. Applications implemented according to the Web Service specification can exchange data with each other regardless of the language, platform or internal protocol they use. Web Service is a self-describing and self-contained available ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): H04L29/08H04L12/863
CPCH04L47/6255H04L67/02H04L67/62H04L67/568
Inventor 张骞
Owner WUHAN GREENET INFORMATION SERVICE
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products