The invention discloses a
dynamic data source configuration and automatic switching method, comprising the steps that operation interfaces are initialized through utilization of
open data sources, andusers trigger the interfaces to perform initialization through utilization of HTTP protocols; request
data source identities are intercepted through utilization of self-defined requests, request parameters of the users are searched, and corresponding
data source identity packaging is selected; data sources are selected for automatic switching through utilization of the request
data source identities, self-defined persistent layer interception is carried out, after the data sources are intercepted through the persistent layer interception, the data source identities currently cached by the users are obtained, and
database connection is switched; and the data source configuration and automatic switching are finished, and a
system sends an instruction to finish the interfaces. Through the
dynamic data configuration and automatic switching, a multiuser application
database scene of an Internet product is solved, particularly, a
dynamic maintenance function of the
system database connection is achieved, and the data source automatic switching is carried out according to user access parameters, so the abnormal hidden danger resulting from high
concurrency is avoided. The deployment flexibility is improved, and the maintenance and load cost is reduced.