Idempotence control method and device, electronic equipment and readable storage medium

A control method and idempotent technology, applied in the information field, can solve problems such as high process complexity

Active Publication Date: 2020-01-31
WUXI CHINAC DATA TECH SERVICE
View PDF13 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The purpose of the embodiment of the present application is to provide an idempotent control method, device, electronic device and readable storage medium to solve the problem in the related art that the caller needs to make at least two requests and the process complexity is high

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
  • Idempotence control method and device, electronic equipment and readable storage medium
  • Idempotence control method and device, electronic equipment and readable storage medium
  • Idempotence control method and device, electronic equipment and readable storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0058] In order to solve the problem that the caller needs to make at least two requests in the related technology, the process complexity is high, and the user experience is not good, the embodiment of this application provides an idempotent device and a server that cooperate with each other to achieve Idempotency control method. see figure 1 and figure 2 shown.

[0059] see figure 1 as shown, figure 1 A feasible idempotent control process provided for the embodiment of this application includes:

[0060] S101: When the server receives the interface request from the caller, send a token generation request to the idempotent device.

[0061] It should be noted that, in this embodiment of the application, the calling end refers to the end requesting the service, and the server end refers to the end providing the service, which is used to perform business processing on the request of the calling end. It should also be noted that, in this embodiment of the application, the ...

Embodiment 2

[0097] It should be noted that, in addition to the cooperation between the idempotent device and the server in the above-mentioned embodiment 1 to solve the problem that the caller needs to make at least two requests in the related technology, the process complexity is relatively high, and the user experience is not good. In addition, the embodiment of the present application also provides a method that can be realized only by the server, which can solve the problem that the caller needs to make at least two requests in the related technology, the process complexity is high, and the user experience is not good. The idempotent control method. see image 3 Shown:

[0098] S301: When receiving an interface request from a caller, generate a token uniquely corresponding to the interface request according to the feature information of the interface request.

[0099] It should be noted that the explanations made in the first embodiment are also applicable to the embodiment of the p...

Embodiment 3

[0108] On the basis of the first embodiment, this embodiment takes a more specific interface request idempotency control process as an example to further illustrate this application.

[0109] see Figure 4 As shown, first, the caller will send an interface request to the server, and after receiving the interface request, the server will send a token generation request carrying the interface method signature and request parameters to the idempotent device. The idempotent device generates a token corresponding to the interface request according to the interface method signature and request parameters, and judges whether the token has been stored in the database. When the token has been stored in the database, return "Do not submit repeated requests" to the server, and the server will give up the interface request after receiving this message; when the token is not stored in the database, the generated The corresponding token, interface method signature, and request parameters a...

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 provides an idempotence control method and device, electronic equipment and a readable storage medium. The idempotent device obtains feature information in an interface request sent to aserver by a calling end; and generating a token uniquely corresponding to the interface request according to the feature information of the interface request, triggering the server to perform serviceprocessing according to the interface request when the generated token does not exist, and enabling the server to give up the interface request when the generated token exists. In this way, idempotence of the interface request is effectively achieved, meanwhile, compared with the related technology, the calling end does not need to specially obtain the token once, and the process of the calling end is simplified, and the user experience is better.

Description

technical field [0001] The present application relates to the field of information technology, in particular, to an idempotent control method, device, electronic equipment and readable storage medium. Background technique [0002] With the rapid development of the Internet, more and more websites will open their own API (Application Program Interface, application program interface), how to ensure the idempotency of the API is a very important topic. [0003] The current way to ensure API idempotence is that the caller will request a token (token) from the server before requesting the API, and the server will create a token for it and store it in the cache after receiving the request. Then return the token to the caller. After the caller has the token, it generates an interface request carrying the token and sends it to the server, and the server verifies the token. If the token exists in the cache, delete the token in the cache and conduct business according to the interfac...

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 Applications(China)
IPC IPC(8): H04L29/08H04L29/06H04L9/32
CPCH04L63/0807H04L9/3247H04L67/60
Inventor 王永建
Owner WUXI CHINAC DATA TECH SERVICE
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products