CN111158870A - Method and device for managing database - Google Patents

Method and device for managing database Download PDF

Info

Publication number
CN111158870A
CN111158870A CN201911190742.4A CN201911190742A CN111158870A CN 111158870 A CN111158870 A CN 111158870A CN 201911190742 A CN201911190742 A CN 201911190742A CN 111158870 A CN111158870 A CN 111158870A
Authority
CN
China
Prior art keywords
task
executed
execution
database
managing
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
CN201911190742.4A
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.)
Guiyang Longmaster Information and Technology Co ltd
Original Assignee
Guiyang Longmaster Information and 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 Guiyang Longmaster Information and Technology Co ltd filed Critical Guiyang Longmaster Information and Technology Co ltd
Priority to CN201911190742.4A priority Critical patent/CN111158870A/en
Publication of CN111158870A publication Critical patent/CN111158870A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Landscapes

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

Abstract

The method and the device for managing the database provided by the embodiment of the application detect whether the task is to be executed or not in a timing manner; if yes, acquiring execution information corresponding to the task to be executed, and adding the task to be executed into a task management list to be executed, wherein the execution information comprises execution time, virtual links, operation objects, operation types or operation conditions; and detecting the task management list to be executed, and executing the task to be executed according to the execution information if the current time is the execution time. According to the method and the system, the task management service for managing the database is added between the database server and the data application layer, the large-table data can be regularly cleaned to reduce the pressure of the database server, the data reading efficiency is improved, and corresponding authorities can be set to operate different requirements.

Description

Method and device for managing database
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and a system for managing a database.
Background
Each server terminal can keep data such as user in-out logs, consumption logs, error collection logs and the like due to service requirements, and the data volume is huge. Each functional module needs to be recorded so as to generate a statistical form to analyze data such as user tracks, consumption conditions, database errors and the like. However, a large amount of data operation generates huge pressure on a database server, and the data has certain timeliness, so that the generation of a report is basically unnecessary, and therefore, the report needs to be cleaned manually at regular intervals, but the large amount of data is deleted manually, or the database is deadlocked when the operation is performed at a peak time, so that the user experience is influenced.
Disclosure of Invention
The application provides a method and a system for managing a database, which aim to solve the problem of pressure of the existing large-batch data processing on the output of a database server.
In a first aspect, to achieve the above object, the present application provides a method for managing a database, the method comprising:
detecting whether a task is to be executed or not at regular time;
if yes, acquiring execution information corresponding to the task to be executed, and adding the task to be executed into a task management list to be executed, wherein the execution information comprises execution time, virtual links, operation objects, operation types or operation conditions;
and detecting the task management list to be executed, and executing the task to be executed according to the execution information if the current time is the execution time.
Further, the detecting the to-be-executed task management list, and if the current time is the execution time, after executing the to-be-executed task according to the execution information, further includes:
and acquiring and storing a task execution result.
Further, the operation types include: statistical data, backup data, cleaning data, export data, or retrieve data.
Further, the detecting the to-be-executed task management list, and if the current time is the execution time, executing the to-be-executed task according to the execution information includes:
establishing connection with the corresponding sub-database according to the virtual link;
generating a corresponding execution instruction according to the operation type, the operation object and the operation condition;
and sending the execution instruction to a sub-database corresponding to the virtual link.
Further, still include:
and acquiring execution information corresponding to the task to be executed configured on the Web server.
In a second aspect, to achieve the above object, the present application provides an apparatus for managing a database, the apparatus comprising:
the detection unit is used for detecting whether the task is to be executed or not at regular time;
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring execution information corresponding to a task to be executed if the task to be executed is to be executed, and adding the task to be executed into a task management list to be executed, wherein the execution information comprises execution time, virtual links, operation objects, operation types or operation conditions;
and the execution unit is used for detecting the task management list to be executed, and executing the task to be executed according to the execution information if the current time is the execution time.
Further, the obtaining unit is further configured to: and acquiring and storing a task execution result.
Further, the operation types include: statistical data, backup data, cleaning data, export data, or retrieve data.
Further, the execution unit is to:
establishing connection with the corresponding sub-database according to the virtual link;
generating a corresponding execution instruction according to the operation type, the operation object and the operation condition;
and sending the execution instruction to a sub-database corresponding to the virtual link.
Further, the obtaining unit is further configured to:
and acquiring execution information corresponding to the task to be executed configured on the Web server.
In a third aspect, to achieve the above object, the present application provides a computer-readable storage medium having stored thereon a computer program, which when executed by a processor, performs the steps of any one of the methods of managing a database of the first aspect.
In a fourth aspect, to achieve the above object, the present application provides a computer device, including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for managing a database according to any one of the first aspect when executing the computer program.
According to the technical scheme, the method and the device for managing the database provided by the embodiment of the application detect whether the task is to be executed or not in a timing mode; if yes, acquiring execution information corresponding to the task to be executed, and adding the task to be executed into a task management list to be executed, wherein the execution information comprises execution time, virtual links, operation objects, operation types or operation conditions; and detecting the task management list to be executed, and executing the task to be executed according to the execution information if the current time is the execution time. According to the method and the system, the task management service for managing the database is added between the database server and the data application layer, the large-table data can be regularly cleaned to reduce the pressure of the database server, the data reading efficiency is improved, and corresponding authorities can be set to operate different requirements.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
In order to more clearly describe the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is a schematic flow chart illustrating a method for managing a database according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of an apparatus for managing a database according to an embodiment of the present application.
Detailed Description
The features and advantages of the present application will become more apparent and appreciated from the following detailed description of the application.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
In the description of the present application, it should be noted that the terms "upper", "lower", "inner", "outer", "front", "rear", "left" and "right" and the like indicate orientations or positional relationships based on operational states of the present application, and are only used for convenience of description and simplification of description, but do not indicate or imply that the system or element being referred to must have a specific orientation, be constructed in a specific orientation, and be operated, and thus, should not be construed as limiting the present application. Furthermore, the terms "first," "second," "third," and "fourth" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Specific embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a method for managing a database according to an embodiment of the present application, where as shown in fig. 1, the method includes steps S110 to S130.
S110: and detecting whether the task is to be executed or not at regular time.
And the operator sets extremely relevant execution information of the task to be executed on a management interface of the WEB server according to specific requirements. For example, the period of minimum traffic is typically 2 a day in the morning: 00 to 6, there are fewer users dialing the system at this time, the data interaction amount is small, and in this time period, for the corresponding scheduling of different services, it is necessary to arrange corresponding execution time for other services according to the time length of the service execution, for example: 2: and (5) performing statistical scheduling at 00 points, wherein the statistical scheduling is performed in half an hour, and setting 2: scheduling of backup data is performed 40, and scheduling of cleaning data can be scheduled to be 4: 00 execution.
S120: and if so, acquiring execution information corresponding to the task to be executed, and adding the task to be executed into a task management list to be executed, wherein the execution information comprises execution time, virtual links, operation objects, operation types or operation conditions.
In specific implementation, whether a task is to be executed or not is determined through timing detection, and execution information corresponding to the task to be executed is configured on the Web server. Establishing a link with a data server through the virtual link, wherein the operation object comprises a database, a data table or data, and the operation type comprises: statistical data, backup data, cleaning data, export data, or obtain data, etc., and the operating conditions include data aging, such as three days, one month, etc.
S130: and detecting the task management list to be executed, and executing the task to be executed according to the execution information if the current time is the execution time.
The method specifically comprises the following steps:
and establishing connection with the corresponding sub-database according to the virtual link.
And generating a corresponding execution instruction according to the operation type, the operation object and the operation condition.
And sending the execution instruction to a sub-database corresponding to the virtual link.
The sub-database obtains storage data corresponding to data timeliness according to the execution instruction, and executes corresponding task operation on the obtained storage data according to the operation type, as shown in table 1:
TABLE 1 executive information
Figure BDA0002293504040000051
Further, after the data crying server finishes executing the task, the task execution result is fed back to the device for managing the database, the device for managing the database acquires and stores the task execution result, and further, the task execution result can be fed back to a management interface of the WEB server for reference of an operator, or the task execution result is stored and is called when the operator needs the task execution result.
The method for managing the database is used for regularly cleaning the large-table data to reduce the pressure of a database server, improve the efficiency of data reading, and can also set corresponding authorities to operate different requirements. Corresponding to the embodiment of the method for managing the database provided by the application, the application also provides an embodiment of a device for managing the database. Referring to fig. 2, a schematic structural diagram of a device for managing a database provided in an embodiment of the present application is shown, where the device may be disposed in a WEB server or a database server, and may also be disposed independently, and the device includes:
a detecting unit 100, configured to detect whether a task is to be executed at regular time;
an obtaining unit 200, configured to obtain, if a task is to be executed, execution information corresponding to the task to be executed, and add the task to be executed to a task to be executed management list, where the execution information includes execution time, a virtual link, an operation object, an operation type, or an operation condition;
the execution unit 300 is configured to detect the to-be-executed task management list, and execute the to-be-executed task according to the execution information if the current time is the execution time.
The obtaining unit 200 is further configured to: and acquiring and storing a task execution result.
The operation types include: statistical data, backup data, cleaning data, export data, or retrieve data.
The execution unit 300 is configured to:
establishing connection with the corresponding sub-database according to the virtual link;
generating a corresponding execution instruction according to the operation type, the operation object and the operation condition;
and sending the execution instruction to a sub-database corresponding to the virtual link.
The obtaining unit 200 is further configured to:
and acquiring execution information corresponding to the task to be executed configured on the Web server.
The method and the device for managing the database provided by the embodiment of the application detect whether the task is to be executed or not in a timing manner; if yes, acquiring execution information corresponding to the task to be executed, and adding the task to be executed into a task management list to be executed, wherein the execution information comprises execution time, virtual links, operation objects, operation types or operation conditions; and detecting the task management list to be executed, and executing the task to be executed according to the execution information if the current time is the execution time. According to the method and the system, the task management service for managing the database is added between the database server and the data application layer, the large-table data can be regularly cleaned to reduce the pressure of the database server, the data reading efficiency is improved, and corresponding authorities can be set to operate different requirements.
According to the method for managing the database, the embodiment of the application also provides a readable storage medium and a computer device. The readable storage medium has stored thereon an executable program which, when executed by the processor, implements the steps of the above-described method of managing a database; the computer device comprises a memory, a processor and an executable program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the steps of the database management method.
The present application has been described in detail with reference to specific embodiments and illustrative examples, but the description is not intended to limit the application. Those skilled in the art will appreciate that various equivalent substitutions, modifications or improvements may be made to the presently disclosed embodiments and implementations thereof without departing from the spirit and scope of the present disclosure, and these fall within the scope of the present disclosure. The protection scope of this application is subject to the appended claims.

Claims (10)

1. A method of managing a database, the method comprising:
detecting whether a task is to be executed or not at regular time;
if yes, acquiring execution information corresponding to the task to be executed, and adding the task to be executed into a task management list to be executed, wherein the execution information comprises execution time, virtual links, operation objects, operation types or operation conditions;
and detecting the task management list to be executed, and executing the task to be executed according to the execution information if the current time is the execution time.
2. The method for managing a database according to claim 1, wherein the detecting the task-to-be-executed management list, and if the current time is the execution time, after executing the task-to-be-executed according to the execution information, further comprises:
and acquiring and storing a task execution result.
3. Method for managing a database according to claim 1 or 2, characterized in that said type of operation comprises: statistical data, backup data, cleaning data, export data, or retrieve data.
4. The method for managing database according to claim 3, wherein the detecting the task to be executed management list, and if the current time is the execution time, executing the task to be executed according to the execution information includes:
establishing connection with the corresponding sub-database according to the virtual link;
generating a corresponding execution instruction according to the operation type, the operation object and the operation condition;
and sending the execution instruction to a sub-database corresponding to the virtual link.
5. The method of managing a database of claim 2, further comprising:
and acquiring execution information corresponding to the task to be executed configured on the Web server.
6. An apparatus for managing a database, the apparatus comprising:
the detection unit is used for detecting whether the task is to be executed or not at regular time;
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring execution information corresponding to a task to be executed if the task to be executed is to be executed, and adding the task to be executed into a task management list to be executed, wherein the execution information comprises execution time, virtual links, operation objects, operation types or operation conditions;
and the execution unit is used for detecting the task management list to be executed, and executing the task to be executed according to the execution information if the current time is the execution time.
7. The apparatus for managing database according to claim 6, wherein the obtaining unit is further configured to: and acquiring and storing a task execution result.
8. The apparatus for managing a database according to claim 6 or 7, wherein the operation types include: statistical data, backup data, cleaning data, export data, or retrieve data.
9. The apparatus for managing a database of claim 8, wherein the execution unit is configured to:
establishing connection with the corresponding sub-database according to the virtual link;
generating a corresponding execution instruction according to the operation type, the operation object and the operation condition;
and sending the execution instruction to a sub-database corresponding to the virtual link.
10. The apparatus for managing a database of claim, wherein the obtaining unit is further configured to:
and acquiring execution information corresponding to the task to be executed configured on the Web server.
CN201911190742.4A 2019-11-28 2019-11-28 Method and device for managing database Pending CN111158870A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911190742.4A CN111158870A (en) 2019-11-28 2019-11-28 Method and device for managing database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911190742.4A CN111158870A (en) 2019-11-28 2019-11-28 Method and device for managing database

Publications (1)

Publication Number Publication Date
CN111158870A true CN111158870A (en) 2020-05-15

Family

ID=70556189

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911190742.4A Pending CN111158870A (en) 2019-11-28 2019-11-28 Method and device for managing database

Country Status (1)

Country Link
CN (1) CN111158870A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112306973A (en) * 2020-11-05 2021-02-02 杭州海康威视数字技术股份有限公司 Picture importing system and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112306973A (en) * 2020-11-05 2021-02-02 杭州海康威视数字技术股份有限公司 Picture importing system and method
CN112306973B (en) * 2020-11-05 2023-08-04 杭州海康威视数字技术股份有限公司 Picture importing system and method

Similar Documents

Publication Publication Date Title
CN100589418C (en) The generation method and the generation system of alarm correlation rule
CN106656536B (en) Method and equipment for processing service calling information
US8060782B2 (en) Root cause problem identification through event correlation
CN110489699B (en) Asynchronous data acquisition method and system
RU2691595C2 (en) Constructed data stream for improved event processing
JP6160064B2 (en) Application determination program, failure detection apparatus, and application determination method
JP5886712B2 (en) Efficient collection of transaction-specific metrics in a distributed environment
CN107562556B (en) Failure recovery method, recovery device and storage medium
US20140089744A1 (en) Information processing apparatus, information processing method, and recording medium
CN109871392B (en) Slow sql real-time data acquisition method under distributed application system
CN102571403A (en) Realization method and device for general data quality control adapter
CN108509326A (en) A kind of service state statistical method and system based on nginx daily records
CN105610648A (en) Operation and maintenance monitoring data collection method and server
CN101594256A (en) Disaster recovery method, device and system
CN113032252A (en) Method and device for collecting buried point data, client device and storage medium
CN117492403B (en) Large instrument operation monitoring system and method
CN111158870A (en) Method and device for managing database
JP2009181496A (en) Job processing system and job management method
CN113419872A (en) Application system interface integration system, integration method, equipment and storage medium
CN107515864B (en) Method and equipment for monitoring workflow
CN111274090A (en) Job processing method, job processing apparatus, job processing medium, and electronic device
CN110011845A (en) Log collection method and system
CN109886530A (en) The front end processor of task based access control slot leaks compensating method and system in real time
CN110888785A (en) Method and device for monitoring alarm
CN112965793A (en) Data warehouse task scheduling method and system oriented to identification analysis data

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