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

Front-end multi-process calculation method and system based on Web Worker

A computing method and multi-process technology, applied in the Internet field, can solve the problems of long execution time, stuck, and other programs cannot be executed.

Pending Publication Date: 2022-06-07
杭州笨马网络技术有限公司
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The above-mentioned prior art has the following technical problems: no matter through algorithm optimization or data optimization, it will always enter the main thread of javascript execution, resulting in the inability to execute other programs
Even if the asynchronous solution is used, in the asynchronous execution, there will still be a problem that the execution takes too long to cause a freeze, because other programs need to wait when the main thread is always executed.

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
  • Front-end multi-process calculation method and system based on Web Worker

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0023] The following description serves to disclose the invention to enable those skilled in the art to practice the invention. The preferred embodiments described below are given by way of example only, and other obvious modifications will occur to those skilled in the art. The basic principles of the invention defined in the following description may be applied to other embodiments, variations, improvements, equivalents, and other technical solutions without departing from the spirit and scope of the invention.

[0024] It should be understood that the term "a" should be understood as "at least one" or "one or more", that is, in one embodiment, the number of an element may be one, while in another embodiment, the number of the element may be one. The number may be plural, and the term "one" should not be understood as a limitation on the number.

[0025] please combine figure 1 The invention discloses a front-end multi-process computing method and system based on Web Worke...

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 front-end multi-process calculation method and system based on Web Worker, and the method comprises the steps: judging whether a current thread is started or not, and transmitting parameters to a background thread in the starting process to create a Worker thread if the current thread is started; calculating data of the currently started threads, and assigning names to each started thread for searching a corresponding relation in a plurality of threads in the background; obtaining the context and access parameters of the execution content of the current thread, and setting a success callback and an error callback; searching the named thread, and binding the named thread with the corresponding context, the access parameter, the successful callback and the wrong callback; and calling corresponding data to successfully callback or falsely callback to a main thread according to a background multi-thread execution result. According to the method and the system, the phenomena of main thread waiting and page false death in the process of executing big data calculation by a javascript single thread can be solved by utilizing multiple threads of a browser, so that the main thread does not need to be blocked.

Description

technical field [0001] The invention relates to the field of Internet technology, in particular to a front-end multi-process computing method and system based on Web Worker Background technique [0002] At present, the front-end of the existing technology needs to deal with the actual DOM due to the particularity of the operating mechanism. Therefore, according to the application scenario, when creating a js oracle, it is determined by innate conditions that it is a single-threaded language, which also leads to the need to use the front-end for large data operations. A performance bottleneck occurs. In order to solve this problem, we can use the multi-threaded mechanism and communication of the browser to effectively solve the phenomenon that the front-end single-threaded computing will cause the page to freeze or freeze. Web Workers provide an easy way for web content to run scripts in a background thread. And a separately opened thread will perform tasks independently an...

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): G06F9/448G06F9/50G06F9/48
CPCG06F9/449G06F9/5038G06F9/4881Y02D10/00
Inventor 张万里
Owner 杭州笨马网络技术有限公司
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