The application discloses an HTTP request scheduling method and
system. The scheduling method establishes a global request dispatcher independent of a page instance in a
JavaScript engine of an embedded device to centrally manage the HTTP request life cycle. A request description block carrying a page
handle is generated in response to a script layer request and is added to a
message queue for
processing according to a scheduling strategy. When the request is completed, the native layer checks the validity of the page
handle, and the
callback is executed only when the page
handle is valid, thereby avoiding wild pointers and
system crashes caused by
data transmission to a released page. For a download request, the dispatcher calls a power-off resume transmission interface, and the device automatically resumes the download progress according to a
temporary file after resetting, thereby ensuring the reliability of large
data transmission. The method decouples the request from the page life cycle, solves the problem of interrupt loss caused by page closing, and significantly improves the
system stability and efficiency.