The invention discloses a method and a
system for asynchronous execution of
JavaScript at a
server side, and relates to the technical field of
computer software, the method comprises the following steps: constructing a multi-language runtime context
pool on the
server side based on GraalVM, and pre-compiling a script and a core class; when the script is loaded, asynchronous execution strategy parameters are injected into the corresponding isolation context; calculating the fragmentation number of the overall task submitted by the script, and carrying out overall task fragmentation; mapping the fragments to the corresponding isolation
assembly lines according to the fragment execution categories, constructing feature vectors according to the fragments in the isolation
assembly lines, calculating fragment priorities, and executing in sequence; after fragment execution is completed,
execution time delay is collected, historical time
delay prediction is updated, and when conditions are met, isolation retry is carried out, and compensation fragments are generated. Through pre-compilation, asynchronous execution strategy, adaptive fragmentation and
priority scheduling, and compensation fragmentation generation, fault self-
recovery and service continuity guarantee with low time
delay response, high scheduling flexibility and
controllability and
automation are realized.