Unlock instant, AI-driven research and patent intelligence for your innovation.

A way to simplify and limit concurrent ajax requests

A conversion and queue technology, applied in the field of Web program development, can solve problems such as shortage, and achieve the effect of easy processing, simple and efficient ajax request control mode

Active Publication Date: 2019-08-30
G CLOUD TECH
View PDF1 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] 1. There is a lack of a mechanism to limit concurrent ajax requests, which often requires developers to develop by themselves

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
  • A way to simplify and limit concurrent ajax requests
  • A way to simplify and limit concurrent ajax requests
  • A way to simplify and limit concurrent ajax requests

Examples

Experimental program
Comparison scheme
Effect test

Embodiment approach

[0026] The first step is to organize the ajax request queue and parameters. The parameters are as follows:

[0027]

[0028] Use the above-mentioned parameter config to call the function encapsulated in the present invention (compatible with AMD, commonJS, var and other introduction methods, described in the simplest var method) rbAjax(config).

[0029] In the second step, use config to call the internal _dequeue method, the process is as follows:

[0030] (1) Use config.queue.splice(0, config.limit) to extract the parameters of the first two ajax requests in the queue.

[0031] (2) Traverse the extracted ajax parameters and execute the following logic: merge the incoming parameters with the default parameters to obtain a final parameter cache, remove the parameters not used by $.ajax, and add ajax-id to the data passed to the server by ajax , which is the id value of the current ajax. Detect whether the ajax request that the current ajax request depends on is executed su...

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 relates to the technical field of web program development, in particular to a method for simplifying and limiting concurrent ajax requests. This method converts concurrent ajax requests into a first-in-first-out queue form, and sets a unique id for each request; takes out n ajax requests from the queue at a time and executes them, and executes the corresponding one in the queue after each ajax request is executed. method; cache the status and data of the current ajax request; after the execution of n ajax requests, continue to fetch and execute n ajax requests until all ajax requests are executed and execute the total callback. The invention solves the problems of the lack of restriction mechanism and the need to write callback methods in concurrent ajax requests, and is especially suitable for building web programs embodied by rich users.

Description

technical field [0001] The invention relates to the technical field of web program development, in particular to a method for simplifying and limiting concurrent ajax requests. Background technique [0002] In recent years, with the development of front-end technology and the emphasis on user performance of programs, the traditional B / S development model is difficult to meet the development needs of the Internet. More and more developers use javascript to build complex web programs with rich user performance. The most important method for javascript to interact with the server is ajax, and concurrent ajax requests are often encountered in complex projects. [0003] The conventional ajax request method has the following problems: [0004] 1. There is a lack of a mechanism to limit concurrent ajax requests, which often requires developers to develop by themselves. [0005] 2. To process ajax requests with dependencies, it is often necessary to write complex and difficult-to-...

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): G06F8/41G06F9/38
CPCG06F8/445G06F9/3856
Inventor 陈健豪李勇波孙傲冰季统凯
Owner G CLOUD TECH