The invention discloses a JS-based execution context acquisition method. The method comprises the following steps: intercepting an asynchronous code; after the asynchronous code is intercepted, calling a wrapping function, storing a current execution context based on an internal variable in the wrapping function, and returning an internal function; after the package function is called, executing the asynchronous code; when an asynchronous event of the asynchronous code is triggered, pressing an internal function into an execution stack, and reading an internal variable through the internal function to form a closure; reading the saved execution context based on the closure. By intercepting the asynchronous code, storing a current execution context through a wrapping function before executing the asynchronous code, and then executing the asynchronous code, when the asynchronous event is triggered, the internal function is used for reading an internal variable for storing an execution context to form a closed packet, and based on the closed packet, it can be guaranteed that a correct context is read. The invention further provides a device, equipment and a storage medium, which also have the above beneficial effects.