CN113688182A - Database automatic switching method and device and computer readable storage medium - Google Patents

Database automatic switching method and device and computer readable storage medium Download PDF

Info

Publication number
CN113688182A
CN113688182A CN202111245121.9A CN202111245121A CN113688182A CN 113688182 A CN113688182 A CN 113688182A CN 202111245121 A CN202111245121 A CN 202111245121A CN 113688182 A CN113688182 A CN 113688182A
Authority
CN
China
Prior art keywords
database
data
visitor information
data processing
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111245121.9A
Other languages
Chinese (zh)
Inventor
周凡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Mingyuan Cloud Technology Co Ltd
Original Assignee
Shenzhen Mingyuan Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Mingyuan Cloud Technology Co Ltd filed Critical Shenzhen Mingyuan Cloud Technology Co Ltd
Priority to CN202111245121.9A priority Critical patent/CN113688182A/en
Publication of CN113688182A publication Critical patent/CN113688182A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5055Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering software capabilities, i.e. software resources associated or available to the machine

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for automatically switching databases and a computer readable storage medium, wherein the method for automatically switching the databases comprises the following steps: calling a preset database access model to monitor and acquire visitor information; performing data processing on the visitor information to obtain a data processing result; performing data analysis on the data processing result based on machine learning to obtain the resource occupancy rate of a database; calculating according to the visitor information and the database resource occupancy rate to obtain a database access pressure prediction result; performing data synchronization according to the database access pressure prediction result to obtain a data synchronization result; and automatically switching databases according to the data synchronization result. By implementing the method and the device, the bottleneck of database access can be predicted in advance, so that resource planning and dynamic capacity expansion are realized in advance, and the action of database switching can be completed under the condition that the application program is not restarted.

Description

Database automatic switching method and device and computer readable storage medium
Technical Field
The present invention relates to the field of network communication technologies, and in particular, to a method and an apparatus for automatically switching databases, and a computer-readable storage medium.
Background
In the process of accessing a webpage application program by a user, database-related operations are mainly influenced on response speed, the performance of accessing the database by the application program is improved mainly by using a database cluster and the like at present, and the resource utilization rate of the database needs to be ensured to be higher under the condition of ensuring the performance, so that the resource loss is reduced.
However, when the access amount of the database is large, the access pressure and the resource occupancy rate of the database are also increased, so that the response time is long, the response speed is slow, and further, the user is prompted to restart the web application program for access, which greatly affects the use experience of the user.
Disclosure of Invention
The invention mainly aims to provide a method and a device for automatically switching databases and a computer readable storage medium, and aims to solve the technical problem of effectively reducing the waiting time of a user when the user accesses a webpage application program so as to improve the use experience of the user.
In order to achieve the above object, the present invention provides an automatic database switching method, which includes the following steps:
calling a preset database access model to monitor and acquire visitor information;
performing data processing on the visitor information to obtain a data processing result;
performing data analysis on the data processing result based on machine learning to obtain the resource occupancy rate of a database;
calculating according to the visitor information and the database resource occupancy rate to obtain a database access pressure prediction result;
and carrying out data synchronization according to the database access pressure prediction result, acquiring a data synchronization result, and carrying out automatic database switching according to the data synchronization result.
Optionally, the step of calculating according to the visitor information and the occupancy rate of the database resource to obtain a prediction result of the database access pressure includes:
acquiring database response time contained in the visitor information within a preset time period, and calculating based on the database response time to obtain database average response time;
and calculating according to the average response time of the database and the resource occupancy rate of the database to obtain a database access pressure prediction result.
Optionally, the step of automatically switching the database according to the data synchronization result includes:
confirming whether the synchronous state of the database to be switched and the current database meets the preset standard or not;
and confirming whether the database to be switched supports the dynamic expansion of resources.
Optionally, the step of automatically switching the databases according to the data synchronization result includes:
and when the synchronous state is confirmed to meet the preset standard and the database to be switched supports dynamic capacity expansion of resources, determining that the data synchronization result is successful in synchronization, and automatically switching the database according to the data synchronization result.
Optionally, the step of calling a preset database access model to monitor and collect visitor information includes:
acquiring a data acquisition dimension, and establishing a preset database access model according to the data acquisition dimension;
and calling the preset database access model through a preset program class library to monitor and acquire visitor information corresponding to the data acquisition dimension.
Optionally, the step of performing data processing on the visitor information to obtain a data processing result includes:
and calling a data processing service to perform data cleaning and data merging on the visitor information to obtain a data processing result.
Optionally, the step of invoking the data processing service to perform data cleansing on the visitor information includes:
and calling a data processing service to perform data cleaning on invalid data which is contained in the visitor information and does not accord with the preset data rule according to a preset data rule.
Optionally, the step of invoking the data processing service to perform data merging on the visitor information includes:
and calling a data processing service to perform data merging on a plurality of pieces of data belonging to the same database request in the visitor information.
Further, to achieve the above object, the present invention also provides an apparatus comprising: a memory, a processor and a database auto-switching program stored on the memory and executable on the processor, the database auto-switching program when executed by the processor implementing the steps of the database auto-switching method as described above.
In addition, to achieve the above object, the present invention also provides a computer readable storage medium having a database automatic switching program stored thereon, which, when executed by a processor, implements the steps of the database automatic switching method as described above.
The invention provides a method and a device for automatically switching a database and a computer readable storage medium, wherein in the method for automatically switching the database, visitor information is monitored and collected by calling a preset database access model; performing data processing on the visitor information to obtain a data processing result; performing data analysis on the data processing result based on machine learning to obtain the resource occupancy rate of a database; calculating according to the visitor information and the database resource occupancy rate to obtain a database access pressure prediction result; the automatic switching of the database is carried out according to the prediction result of the database access pressure, the bottleneck of the database access can be predicted in advance, and further resource planning and dynamic capacity expansion are realized in advance, so that the database switching action can be completed by the application program under the condition of not restarting, and the repeated operation and bad experience of repeatedly restarting the application program brought to a user are avoided.
Drawings
Fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a database automatic switching method according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: a method for automatically switching databases comprises the following steps:
calling a preset database access model to monitor and acquire visitor information;
performing data processing on the visitor information to obtain a data processing result;
performing data analysis on the data processing result based on machine learning to obtain the resource occupancy rate of a database;
calculating according to the visitor information and the database resource occupancy rate to obtain a database access pressure prediction result;
and carrying out data synchronization according to the database access pressure prediction result, acquiring a data synchronization result, and carrying out automatic database switching according to the data synchronization result.
Because the related operations of the database are mainly influenced by the response speed in the process of accessing the webpage application program by the user, the performance of accessing the database by the application program is improved mainly by using a database cluster and the like at present, the resource utilization rate of the database needs to be ensured to be higher under the condition of ensuring the performance, and the resource loss is reduced.
However, when the access amount of the database is large, the access pressure and the resource occupancy rate of the database are also increased, so that the response time is long, the response speed is slow, and further, the user is prompted to restart the web application program for access, which greatly affects the use experience of the user.
The invention provides a database automatic switching method, which monitors and collects visitor information by calling a preset database access model; performing data processing on the visitor information to obtain a data processing result; performing data analysis on the data processing result based on machine learning to obtain the resource occupancy rate of a database; calculating according to the visitor information and the database resource occupancy rate to obtain a database access pressure prediction result; the automatic switching of the database is carried out according to the prediction result of the database access pressure, the bottleneck of the database access can be predicted in advance, and further resource planning and dynamic capacity expansion are realized in advance, so that the database switching action can be completed by the application program under the condition of not restarting, and the repeated operation and bad experience of repeatedly restarting the application program brought to a user are avoided.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention can be a PC, and can also be a mobile terminal device with a network connection function and a data processing function, such as a smart phone, a tablet computer, a portable computer and the like.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that may turn off the display screen and/or the backlight when the mobile terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile terminal is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer and tapping) and the like for recognizing the attitude of the mobile terminal; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a database auto-switching program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call the database auto-switching program stored in the memory 1005 and perform the following operations:
calling a preset database access model to monitor and acquire visitor information;
performing data processing on the visitor information to obtain a data processing result;
performing data analysis on the data processing result based on machine learning to obtain the resource occupancy rate of a database;
calculating according to the visitor information and the database resource occupancy rate to obtain a database access pressure prediction result;
and carrying out data synchronization according to the database access pressure prediction result, acquiring a data synchronization result, and carrying out automatic database switching according to the data synchronization result.
Further, the processor 1001 may call the database auto-switching program stored in the memory 1005, and also perform the following operations:
the step of calculating according to the visitor information and the occupancy rate of the database resources to obtain the prediction result of the database access pressure comprises the following steps:
acquiring database response time contained in the visitor information within a preset time period, and calculating based on the database response time to obtain database average response time;
and calculating according to the average response time of the database and the resource occupancy rate of the database to obtain a database access pressure prediction result.
Further, the processor 1001 may call the database auto-switching program stored in the memory 1005, and also perform the following operations:
the step of automatically switching the database according to the data synchronization result comprises the following steps:
confirming whether the synchronous state of the database to be switched and the current database meets the preset standard or not;
and confirming whether the database to be switched supports the dynamic expansion of resources.
Further, the processor 1001 may call the database auto-switching program stored in the memory 1005, and also perform the following operations:
the step of automatically switching the databases according to the data synchronization result comprises the following steps:
and when the synchronous state is confirmed to meet the preset standard and the database to be switched supports dynamic capacity expansion of resources, determining that the data synchronization result is successful in synchronization, and automatically switching the database according to the data synchronization result.
Further, the processor 1001 may call the database auto-switching program stored in the memory 1005, and also perform the following operations:
the step of calling a preset database access model to monitor and acquire visitor information comprises the following steps:
acquiring a data acquisition dimension, and establishing a preset database access model according to the data acquisition dimension;
and calling the preset database access model through a preset program class library to monitor and acquire visitor information corresponding to the data acquisition dimension.
Further, the processor 1001 may call the database auto-switching program stored in the memory 1005, and also perform the following operations:
the step of performing data processing on the visitor information to obtain a data processing result comprises:
and calling a data processing service to perform data cleaning and data merging on the visitor information to obtain a data processing result.
Further, the processor 1001 may call the database auto-switching program stored in the memory 1005, and also perform the following operations:
the step of calling the data processing service to perform data cleaning on the visitor information comprises the following steps:
and calling a data processing service to perform data cleaning on invalid data which is contained in the visitor information and does not accord with the preset data rule according to a preset data rule.
Further, the processor 1001 may call the database auto-switching program stored in the memory 1005, and also perform the following operations:
the step of calling the data processing service to perform data merging on the visitor information comprises the following steps:
and calling a data processing service to perform data merging on a plurality of pieces of data belonging to the same database request in the visitor information.
Referring to fig. 2, a first embodiment of the present invention provides an automatic database switching method, where the automatic database switching method includes:
step S10, calling a preset database access model to monitor and acquire visitor information;
it should be noted that, in this embodiment, the execution main body is a terminal device, the terminal device may be an intelligent terminal such as a PC, a smart phone, a tablet computer, and a portable computer, which has a network connection function and a data processing function, the terminal device includes some service items, the service items are programs that are automatically completed by a system and do not need to interact with a user, and the application service also runs normally when an operating system of the terminal device is in a normal running state.
In this embodiment, step S10 includes:
acquiring a data acquisition dimension, and establishing a preset database access model according to the data acquisition dimension;
and calling the preset database access model through a preset program class library to monitor and acquire visitor information corresponding to the data acquisition dimension.
In this embodiment, the data acquisition dimensions mainly include: time information (e.g., hour, minute, second, date, week corresponding to the date, holiday information corresponding to the date, etc.), browser information (e.g., kernel of the browser, operation mode of the browser, etc.), type of the written database, type of the read database, user type, response time of the database, subsystem source, menu source, etc., which are not limited in this embodiment. The preset database access model is established based on the data acquisition dimension information, and is embedded into a data acquisition service in a Software Development Kit (SDK) manner so as to realize a function of acquiring user information, wherein the SDK is the preset program class library.
It is understood that when the data collection service collects visitor information, the visitor information is reported to the data processing service via HTTP (hypertext Transfer Protocol) mode for further processing of the data.
Step S20, performing data processing on the visitor information to obtain a data processing result;
it can be understood that the data processing service performs data processing on the visitor information reported by the data acquisition service after receiving the visitor information to obtain a data processing result, and a preset database access model only limits the data acquisition dimension but not the specific format of the acquired data, and cannot judge whether the acquired data is valid, so that the data processing service is required to further process the acquired data.
In this embodiment, step S20 includes:
calling a data processing service to perform data cleaning and data merging on the visitor information to obtain a data processing result;
the step of calling the data processing service to perform data cleaning on the visitor information comprises the following steps:
calling a data processing service to perform data cleaning on invalid data which is contained in the visitor information and does not accord with the preset data rule according to a preset data rule;
the step of calling the data processing service to perform data merging on the visitor information comprises the following steps:
and calling a data processing service to perform data merging on a plurality of pieces of data belonging to the same database request in the visitor information.
It should be noted that the preset data rule is a rule used by the data processing service to determine whether data is normal or valid, and the preset data rule is included in the data processing service and can be modified by a manager according to requirements.
It can be understood that the visitor information may include some invalid data that is not compliant with the preset data rule or the data rule modified by the administrator, for example, the time information is empty, the write type is wrong, the read type is wrong, and the like, and at this time, data cleansing needs to be performed on the invalid data, that is, the invalid data information is deleted; after data cleaning is completed, data merging needs to be performed on the reserved effective data which accord with a preset data rule or a data rule modified by a manager, and since the data are acquired as single data, the data which belong to the same database request can be known according to time information, request information and the like, the total amount of the data can be effectively reduced by merging the data, and the condition that the data amount is inconsistent with the access times is avoided, so that the follow-up inaccurate prediction on the access pressure of the database is caused.
Step S30, performing data analysis on the data processing result based on machine learning to obtain the occupancy rate of database resources;
it should be noted that the machine learning includes processes of feature extraction, training, evaluation, dynamic planning, publishing, and the like, and the resource occupancy rate can be predicted by analyzing each data index in the data processing result and the existing sample in the previous machine learning, and the database resource occupancy rate obtained by data analysis is more and more accurate and effective under the continuous machine learning and sample accumulation.
Step S40, calculating according to the visitor information and the occupancy rate of the database resource to obtain a prediction result of the database access pressure;
in this embodiment, step S40 includes:
acquiring database response time contained in the visitor information within a preset time period, and calculating based on the database response time to obtain database average response time;
and calculating according to the average response time of the database and the resource occupancy rate of the database to obtain a database access pressure prediction result.
It should be noted that the preset time period may be set to 5 minutes, 10 minutes, and the like, that is, starting from the initial acquisition time, an average value of the database response time included in each preset time period is calculated to obtain an average database response time in the preset time period, and an evaluation index, that is, a database access pressure prediction result, may be obtained by dividing the obtained average database response time by the database resource occupancy rate obtained in the above step, where in a case that the database is a standard database, the lower the evaluation index is, the smaller the access pressure is, and conversely, the higher the evaluation index is, the larger the access pressure is, and the reasonable switching of the database is required.
And step S50, carrying out data synchronization according to the database access pressure prediction result, acquiring a data synchronization result, and carrying out automatic database switching according to the data synchronization result.
It is understood that when the evaluation index exceeds the preset threshold, it indicates that the current database is about to be subjected to a large access pressure, and a subsequent database request needs to be switched to another database.
In this embodiment, step S50 includes:
confirming whether the synchronous state of the database to be switched and the current database meets the preset standard or not;
and confirming whether the database to be switched supports the dynamic expansion of resources.
It should be noted that, in this embodiment, the preset standard requires that the synchronization time between different databases for performing dynamic library switching needs to be in the order of milliseconds.
It can be understood that, if the synchronization state of the database to be switched and the current database does not meet the preset standard or the database to be switched does not support dynamic capacity expansion of resources, the database to be switched cannot be used as a switching target, and other databases need to be continuously selected.
In this embodiment, step S50 includes:
and when the synchronous state is confirmed to meet the preset standard and the database to be switched supports dynamic capacity expansion of resources, determining that the data synchronization result is successful in synchronization, and automatically switching the database according to the data synchronization result.
It can be understood that, when it is determined that the synchronization state meets the preset standard, that is, the synchronization time between different databases is millisecond-level, and the database to be switched supports dynamic capacity expansion of resources, it is considered that data synchronization is successful, that is, the data synchronization meets the precondition of dynamic database switching, at this time, the initialized predicted value is completed according to the data, and in the application service, the database switching information stored in the context is dynamically switched by using the obtained predicted value information, so as to implement automatic switching of the database.
In the embodiment, a method for automatically switching databases is provided, which monitors and collects visitor information by calling a preset database access model; performing data processing on the visitor information to obtain a data processing result; performing data analysis on the data processing result based on machine learning to obtain the resource occupancy rate of a database; calculating according to the visitor information and the database resource occupancy rate to obtain a database access pressure prediction result; the automatic switching of the database is carried out according to the prediction result of the database access pressure, the bottleneck of the database access can be predicted in advance, and further resource planning and dynamic capacity expansion are realized in advance, so that the database switching action can be completed by the application program under the condition of not restarting, and the repeated operation and bad experience of repeatedly restarting the application program brought to a user are avoided.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a database automatic switching program is stored on the computer-readable storage medium, and when executed by a processor, the database automatic switching program implements the following operations:
calling a preset database access model to monitor and acquire visitor information;
performing data processing on the visitor information to obtain a data processing result;
performing data analysis on the data processing result based on machine learning to obtain the resource occupancy rate of a database;
calculating according to the visitor information and the database resource occupancy rate to obtain a database access pressure prediction result;
and carrying out data synchronization according to the database access pressure prediction result, acquiring a data synchronization result, and carrying out automatic database switching according to the data synchronization result.
Further, the automatic database switching program when executed by the processor further implements the following operations:
the step of calculating according to the visitor information and the occupancy rate of the database resources to obtain the prediction result of the database access pressure comprises the following steps:
acquiring database response time contained in the visitor information within a preset time period, and calculating based on the database response time to obtain database average response time;
and calculating according to the average response time of the database and the resource occupancy rate of the database to obtain a database access pressure prediction result.
Further, the automatic database switching program when executed by the processor further implements the following operations:
the step of automatically switching the database according to the data synchronization result comprises the following steps:
confirming whether the synchronous state of the database to be switched and the current database meets the preset standard or not;
and confirming whether the database to be switched supports the dynamic expansion of resources.
Further, the automatic database switching program when executed by the processor further implements the following operations:
the step of automatically switching the databases according to the data synchronization result comprises the following steps:
and when the synchronous state is confirmed to meet the preset standard and the database to be switched supports dynamic capacity expansion of resources, determining that the data synchronization result is successful in synchronization, and automatically switching the database according to the data synchronization result.
Further, the automatic database switching program when executed by the processor further implements the following operations:
the step of calling a preset database access model to monitor and acquire visitor information comprises the following steps:
acquiring a data acquisition dimension, and establishing a preset database access model according to the data acquisition dimension;
and calling the preset database access model through a preset program class library to monitor and acquire visitor information corresponding to the data acquisition dimension.
Further, the automatic database switching program when executed by the processor further implements the following operations:
the step of performing data processing on the visitor information to obtain a data processing result comprises:
and calling a data processing service to perform data cleaning and data merging on the visitor information to obtain a data processing result.
Further, the automatic database switching program when executed by the processor further implements the following operations:
the step of calling the data processing service to perform data cleaning on the visitor information comprises the following steps:
and calling a data processing service to perform data cleaning on invalid data which is contained in the visitor information and does not accord with the preset data rule according to a preset data rule.
Further, the automatic database switching program when executed by the processor further implements the following operations:
the step of calling the data processing service to perform data merging on the visitor information comprises the following steps:
and calling a data processing service to perform data merging on a plurality of pieces of data belonging to the same database request in the visitor information.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An automatic database switching method is characterized by comprising the following steps:
calling a preset database access model to monitor and acquire visitor information;
performing data processing on the visitor information to obtain a data processing result;
performing data analysis on the data processing result based on machine learning to obtain the resource occupancy rate of a database;
calculating according to the visitor information and the database resource occupancy rate to obtain a database access pressure prediction result;
and carrying out data synchronization according to the database access pressure prediction result, acquiring a data synchronization result, and carrying out automatic database switching according to the data synchronization result.
2. The database automatic switching method according to claim 1, wherein the step of calculating according to the visitor information and the database resource occupancy rate to obtain the database access pressure prediction result comprises:
acquiring database response time contained in the visitor information within a preset time period, and calculating based on the database response time to obtain database average response time;
and calculating according to the average response time of the database and the resource occupancy rate of the database to obtain a database access pressure prediction result.
3. The database automatic switching method according to claim 1, wherein the step of performing database automatic switching according to the data synchronization result comprises:
confirming whether the synchronous state of the database to be switched and the current database meets the preset standard or not;
and confirming whether the database to be switched supports the dynamic expansion of resources.
4. The database automatic switching method according to claim 3, wherein the step of performing database automatic switching according to the data synchronization result comprises:
and when the synchronous state is confirmed to meet the preset standard and the database to be switched supports dynamic capacity expansion of resources, determining that the data synchronization result is successful in synchronization, and automatically switching the database according to the data synchronization result.
5. The database automatic switching method according to any one of claims 1 to 4, wherein the step of calling a preset database access model to monitor and collect visitor information comprises:
acquiring a data acquisition dimension, and establishing a preset database access model according to the data acquisition dimension;
and calling the preset database access model through a preset program class library to monitor and acquire visitor information corresponding to the data acquisition dimension.
6. The database automatic switching method according to claim 5, wherein the step of performing data processing on the visitor information to obtain a data processing result comprises:
and calling a data processing service to perform data cleaning and data merging on the visitor information to obtain a data processing result.
7. The database auto-switching method of claim 6, wherein the step of invoking the data processing service to data-flush the visitor information comprises:
and calling a data processing service to perform data cleaning on invalid data which is contained in the visitor information and does not accord with the preset data rule according to a preset data rule.
8. The database auto-switching method of claim 6, wherein the step of invoking the data processing service to data-merge the visitor information comprises:
and calling a data processing service to perform data merging on a plurality of pieces of data belonging to the same database request in the visitor information.
9. An apparatus, characterized in that the apparatus comprises: memory, processor and a database auto-switching program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the database auto-switching method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a database auto-switching program, which when executed by a processor implements the steps of the database auto-switching method according to any one of claims 1 to 8.
CN202111245121.9A 2021-10-26 2021-10-26 Database automatic switching method and device and computer readable storage medium Pending CN113688182A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111245121.9A CN113688182A (en) 2021-10-26 2021-10-26 Database automatic switching method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111245121.9A CN113688182A (en) 2021-10-26 2021-10-26 Database automatic switching method and device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN113688182A true CN113688182A (en) 2021-11-23

Family

ID=78587977

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111245121.9A Pending CN113688182A (en) 2021-10-26 2021-10-26 Database automatic switching method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113688182A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010072083A1 (en) * 2008-12-23 2010-07-01 中兴通讯股份有限公司 Web application based database system and data management method therof
CN103713981A (en) * 2013-12-31 2014-04-09 国网山东省电力公司 Database server performance detection and early warning method
CN106657186A (en) * 2015-10-30 2017-05-10 宁波轩悦行电动汽车服务有限公司 Hardware load balancing method for electric vehicle time-sharing leasing system
WO2018077079A1 (en) * 2016-10-31 2018-05-03 阿里巴巴集团控股有限公司 Application capacity enlargement method, apparatus and system
CN110413676A (en) * 2019-07-25 2019-11-05 中国工商银行股份有限公司 The access method and its device of database, electronic equipment and medium
CN111291021A (en) * 2020-01-21 2020-06-16 北京奇艺世纪科技有限公司 Database management method and device, electronic equipment and storage medium
CN112328573A (en) * 2020-11-03 2021-02-05 杭州朗澈科技有限公司 Database migration method and system in kubernets cluster

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010072083A1 (en) * 2008-12-23 2010-07-01 中兴通讯股份有限公司 Web application based database system and data management method therof
CN103713981A (en) * 2013-12-31 2014-04-09 国网山东省电力公司 Database server performance detection and early warning method
CN106657186A (en) * 2015-10-30 2017-05-10 宁波轩悦行电动汽车服务有限公司 Hardware load balancing method for electric vehicle time-sharing leasing system
WO2018077079A1 (en) * 2016-10-31 2018-05-03 阿里巴巴集团控股有限公司 Application capacity enlargement method, apparatus and system
CN110413676A (en) * 2019-07-25 2019-11-05 中国工商银行股份有限公司 The access method and its device of database, electronic equipment and medium
CN111291021A (en) * 2020-01-21 2020-06-16 北京奇艺世纪科技有限公司 Database management method and device, electronic equipment and storage medium
CN112328573A (en) * 2020-11-03 2021-02-05 杭州朗澈科技有限公司 Database migration method and system in kubernets cluster

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
吴伶琳: "《软件测试技术任务驱动式教程》", 30 June 2017 *
周静 等: "《基于Hadoop的大数据平台构建》", 30 November 2018 *
陈金窗: "《Prometheus监控技术与实践》", 31 March 2020 *

Similar Documents

Publication Publication Date Title
EP3570163A1 (en) Method for launching application, storage medium, and terminal
EP3575963A2 (en) Method for preloading application, storage medium, and terminal
CN111263176B (en) Loading method, device, terminal, server and storage medium for live broadcast room page
CN108401026B (en) Block chain-based data storage method, system and computer-readable storage medium
CN110020293B (en) Multimedia data display method, device and storage medium
CN110222288B (en) Page display method, device and storage medium
CN110825458A (en) Background application cleaning method and device and computer readable storage medium
CN109215640B (en) Speech recognition method, intelligent terminal and computer readable storage medium
US10466894B2 (en) Method, device, storage medium and mobile terminal for recognizing an off-screen gesture
CN108763297B (en) Webpage resource processing method and device and mobile terminal
CN107918509B (en) Software shortcut prompt setting method and device and readable storage medium
CN108363793B (en) Webpage application access method and device, storage medium and electronic equipment
CN111898053A (en) Page browsing method, device, equipment and computer readable storage medium
CN109669402B (en) Abnormity monitoring method, device, apparatus and computer readable storage medium
CN111858383A (en) Mobile APP data point burying method and system, terminal equipment and storage medium
CN107707602B (en) Data communication processing terminal, method and computer readable storage medium
CN109684156B (en) Monitoring method, device, terminal and storage medium based on mixed mode application
CN113688182A (en) Database automatic switching method and device and computer readable storage medium
CN110134463B (en) Data processing method, device, equipment and machine readable medium
CN108771526B (en) Washing method, dishwasher, and computer-readable storage medium
CN112332996B (en) Terminal distribution network method, device, equipment and computer readable storage medium
CN109032651B (en) Application updating method, intelligent terminal and computer readable storage medium
CN113138763A (en) Page construction method, device, equipment and computer readable storage medium
CN113934618A (en) Interface test case generation method, device, generator and readable storage medium
CN112987597A (en) FSU control method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20211123