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

Method and device for implementing javascript multitasking mechanism

A multi-task and task technology, applied in the Internet field, can solve the problems of resource consumption, inconvenient fiber interaction, and inability to use the front and rear ends in a unified way, so as to eliminate compatibility problems and ensure stability.

Active Publication Date: 2019-05-17
BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] Using sub-processes in Node.js to implement multitasking consumes more resources, and the interaction between sub-processes is not convenient; using fibers requires extending node.js, and the fibers themselves use the thread implementation of the V8 system, and the interaction between fibers inconvenient
[0007] The above technologies are either limited to the browser side or to the node.js environment, and cannot be used uniformly at both ends

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 device for implementing javascript multitasking mechanism
  • Method and device for implementing javascript multitasking mechanism
  • Method and device for implementing javascript multitasking mechanism

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0018] Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the drawings, the same reference numerals are used to designate the same or similar components, although shown in different drawings. For clarity and conciseness, detailed descriptions of known functions and constructions will be omitted so as not to obscure the subject matter of the present invention.

[0019] The Javascript operating environment is based on the event loop (Event Loop) mechanism. The runtime (Runtime) gradually takes out events from the event queue and calls the corresponding event handler to execute. If there is no event, it enters the idle state.

[0020] In the embodiment of the present invention, active objects are used to simulate tasks to be executed, each active object runs in its own independent operating environment, and the active object contains all state information required for the object to run. Active o...

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

In order to solve the problem in unified use of a Javascript multitask mechanism in a front-end browser environment and a rear-end node.js environment, the invention provides a method for realizing the Javascript multitask mechanism. The method comprises the steps of: using an active object to simulate one or more tasks needed to be executed in the Javascript environment; and using an event circulation mechanism of Javascript to perform scheduling on one or more tasks simulated by the active object. With the method, the problem in unified use of the Javascript multitask mechanism in the front-end browser environment and the rear-end node.js environment can be solved.

Description

technical field [0001] The invention relates to the technical field of the Internet, and in particular to a method and equipment for realizing a Javascript multitasking mechanism. Background technique [0002] With the development of Internet technology, Javascript not only occupies the operating environment of the browser, but also develops in the back-end application of the server using node.js technology. But no matter in the browser environment or in the back-end node.js operating environment, Javascript runs in a single thread, and all tasks are executed sequentially, which is enough for early web site applications to only use Javascript to process page interaction Yes, and can bring a lot of convenience, but with the gradual popularization of rich internet applications and Javascript involving background business implementation, the Javascript multitasking mechanism becomes necessary. [0003] At present, there are some technologies in the browser side and node.js bac...

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): G06F9/48
Inventor 夏万强
Owner BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD
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