CN116610707A - Method and device for determining execution time of database operation task and electronic equipment - Google Patents

Method and device for determining execution time of database operation task and electronic equipment Download PDF

Info

Publication number
CN116610707A
CN116610707A CN202210122817.0A CN202210122817A CN116610707A CN 116610707 A CN116610707 A CN 116610707A CN 202210122817 A CN202210122817 A CN 202210122817A CN 116610707 A CN116610707 A CN 116610707A
Authority
CN
China
Prior art keywords
time
task
database operation
operation task
database
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
CN202210122817.0A
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.)
NetsUnion Clearing Corp
Original Assignee
NetsUnion Clearing Corp
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 NetsUnion Clearing Corp filed Critical NetsUnion Clearing Corp
Priority to CN202210122817.0A priority Critical patent/CN116610707A/en
Publication of CN116610707A publication Critical patent/CN116610707A/en
Pending legal-status Critical Current

Links

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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The disclosure provides a method and a device for determining execution time of database operation tasks and electronic equipment, and relates to the technical field of computers. The specific implementation scheme is as follows: when a database operation task is sent to a database server, acquiring a first time as a task starting time through a system clock; when an execution result of the database operation task returned by the database server is received, acquiring a second time as a task ending time through the system clock; and determining the total execution time of the database operation task according to the task starting time and the task ending time. Therefore, the total execution time of the database operation task is accurately determined by using the system clock, and conditions are provided for optimizing the database system parameters and guaranteeing the service continuity.

Description

Method and device for determining execution time of database operation task and electronic equipment
Technical Field
The disclosure relates to the field of computer technology, and in particular relates to a method and a device for determining execution time of database operation tasks and electronic equipment.
Background
SQL (Structured Query Language ), is a database query and programming language used to access data and query, update, and manage relational database systems. Currently, for an online SQL database system, a system administrator often needs to connect to an SQL database server through a client to execute an SQL database operation task corresponding to an SQL statement.
With the popularization of solid state disk and the optimization and development of database systems, the execution time of operation tasks of databases such as SQL databases is greatly optimized, microsecond-level response can be achieved, the execution time of the database operation tasks is accurately determined, and the method has important significance for optimizing database system parameters and guaranteeing service continuity.
Disclosure of Invention
The disclosure provides a method, a device, an electronic device, a storage medium and a computer program product for determining execution time of a database operation task, so as to solve the technical problem that the execution time of the database operation task cannot be accurately determined in the related art, and thus the requirements of optimizing database system parameters and guaranteeing service continuity cannot be met.
According to an aspect of the present disclosure, there is provided a method for determining execution time of a database operation task, including: when a database operation task is sent to a database server, acquiring a first time as a task starting time through a system clock; when an execution result of the database operation task returned by the database server is received, acquiring a second time as a task ending time through the system clock; and determining the total execution time of the database operation task according to the task starting time and the task ending time.
According to another aspect of the present disclosure, there is provided a determining apparatus for determining a database operation task execution time, for implementing the method for determining a database operation task execution time according to the first aspect.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of determining database operation task execution time of the first aspect.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method of determining the database operation task execution time of the first aspect as described above.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of determining the execution time of database operations tasks of the first aspect as described above.
According to the technical scheme provided by the embodiment of the application, when the database operation task is sent to the database server, the first time is obtained through the system clock and is used as the task starting time, when the execution result of the database operation task returned by the database server is received, the second time is obtained through the system clock and is used as the task ending time, and the total execution time of the database operation task is determined according to the task starting time and the task ending time. Therefore, the total execution time of the database operation task is accurately determined by using the system clock, and conditions are provided for optimizing the database system parameters and guaranteeing the service continuity.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow diagram of a method of determining a database operation task execution time according to an embodiment of the present disclosure;
FIG. 2 is a flow diagram of a method of determining a database operation task execution time according to an embodiment of the present disclosure;
FIG. 3 is a flow diagram of a method of determining a database operation task execution time according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a configuration of a determination device of a database operation task execution time according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a configuration of a determination device of a database operation task execution time according to an embodiment of the present disclosure;
FIG. 6 is a block diagram of an electronic device for implementing a method of determining a database operation task execution time in accordance with an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It can be understood that with the popularization of the solid state disk and the optimization and development of the database system, the execution time of the database operation task is greatly optimized, taking the SQL database operation task as an example, the SQL database server can respond to the SQL database operation task in microsecond level, however, when the execution time of the SQL database operation task is determined, a hardware clock is adopted, the precision of the clock can only reach 10 milliseconds, and the execution time of the SQL database operation task cannot be accurately determined, so that the requirements of optimizing the database system parameters and guaranteeing the service continuity cannot be met.
The application aims at the technical problem and provides a method, a device, electronic equipment, a storage medium and a computer program product for determining the execution time of a database operation task.
The method for determining the execution time of the database operation task provided by the application comprises the steps of acquiring a first time as a task start time through a system clock when the database operation task is sent to a database server, acquiring a second time as a task end time through the system clock when an execution result of the database operation task returned by the database server is received, and determining the total execution time of the database operation task according to the task start time and the task end time. Therefore, the total execution time of the database operation task is accurately determined by using the system clock, and conditions are provided for optimizing the database system parameters and guaranteeing the service continuity.
The method, apparatus, electronic device, storage medium and computer program product for determining the execution time of database operation tasks according to embodiments of the present application are described below with reference to the accompanying drawings.
First, referring to fig. 1, a method for determining execution time of a database operation task according to an embodiment of the present application will be described in detail.
FIG. 1 is a flow chart of a method for determining execution time of database operation tasks according to an embodiment of the application. It should be noted that, in the method for determining the execution time of the database operation task provided in this embodiment, the execution body is a determining device for determining the execution time of the database operation task, which may be an electronic device or may be configured in the electronic device, so as to accurately determine the total execution time of the database operation task, and provide conditions for optimizing the database system parameters and guaranteeing the service continuity. The embodiment of the present application will be described taking an example in which the determination device is configured in an electronic apparatus. The electronic device may specifically be a client connected to the database server.
As shown in fig. 1, the method for determining the execution time of the database operation task may include the following steps:
s101, when a database operation task is sent to a database server, acquiring a first time as a task starting time through a system clock.
The database operation task may include a structured query request, or may include other requests, which is not limited in this aspect of the present application.
The system clock may be a system clock of the LINUX operating system, or may be another system clock capable of achieving microsecond precision or higher precision, which is not limited in the present application.
The first time is the time when the determining device sends the database operation task to the database server.
In the embodiment of the application, the determining device can send the database operation task to be executed to the database server, and when sending the database operation task to the database server, the determining device can acquire the first time through the system clock, and the first time is taken as the task starting time of the database operation task.
S103, when receiving the execution result of the database operation task returned by the database server, acquiring a second time as a task ending time through a system clock.
The second time is the time when the determining device receives the execution result of the database operation task returned by the database server.
In the embodiment of the application, the database server can execute the database operation task after acquiring the database operation task, and returns the execution result to the determining device after the execution of the database operation task is completed to obtain the execution result. Correspondingly, when the determining device receives the execution result of the database operation task returned by the database server, the second time can be obtained through the system clock, and the second time is used as the task ending time of the database operation task.
S105, determining the total execution time of the database operation task according to the task starting time and the task ending time.
In the embodiment of the present application, the determining means may determine the difference between the task end time and the task start time as the total execution time of the database operation task.
The clock precision of the system clock can reach microsecond or higher, so that the total execution time of the database operation task with the total execution time in microsecond can be accurate through the system clock, and conditions are provided for optimizing the system parameters of the database and guaranteeing the service continuity.
According to the method for determining the execution time of the database operation task, when the database operation task is sent to the database server, the first time is obtained through the system clock to serve as the task starting time, when the execution result of the database operation task returned by the database server is received, the second time is obtained through the system clock to serve as the task ending time, and the total execution time of the database operation task is determined according to the task starting time and the task ending time. Therefore, the total execution time of the database operation task is accurately determined by using the system clock, and conditions are provided for optimizing the database system parameters and guaranteeing the service continuity.
From the above analysis, in the embodiment of the present application, the total execution time of the database operation task may be accurately determined by the system clock, and in a possible implementation manner, the total execution time of the database operation task may also be determined by selecting whether the system clock or the hardware clock is used as needed. The method for determining the execution time of the database operation task according to the embodiment of the present application is further described below with reference to fig. 2.
Fig. 2 is a flowchart of a method for determining execution time of a database operation task according to an embodiment of the present application.
As shown in fig. 2, the method for determining the execution time of the database operation task includes the following steps:
s201, when a database operation task is sent to a database server, the numerical value of a system time switch variable is obtained.
Wherein the system time switch variable is used to characterize whether the system time is needed to determine the total execution time of the database operation task.
In an exemplary embodiment, system time switch variables may be assigned as desired. When the value of the system time switch variable is a first preset value, the total execution time of the database operation task is required to be determined through a system clock; and when the value of the system time switch variable is a second preset value, the total execution time of the database operation task needs to be determined through a hardware clock.
The first preset value and the second preset value may be set arbitrarily according to needs, for example, the first preset value may be set to 1, and the second preset value may be set to 0.
The hardware clock may be a hardware clock of the LINUX operating system, or may be another hardware clock, which is not limited in this aspect of the present application.
In the embodiment of the present application, the determining means may send the database operation task to be executed to the database server, and the determining means may acquire the value of the system time switch variable when sending the database operation task to the database server.
In an embodiment of the present application, the value of the system time switch variable may be stored in a preset location, so that the determining device may read the value of the system time switch variable from the preset location when sending the database operation task to the database server. The preset position can be set arbitrarily according to the requirement, and the application is not limited to this.
It should be noted that the above-mentioned manner of obtaining the value of the system time switch variable is merely illustrative, and in practical application, the value of the system time switch variable may be obtained by any other manner, and the present application is not limited to the manner of obtaining the value of the system time switch variable.
S203, when the value of the system time switch variable is a first preset value, the first time is obtained as the task starting time through the system clock.
The first time is the time when the determining device sends the database operation task to the database server.
S205, when receiving the execution result of the database operation task returned by the database server, acquiring a second time as a task ending time through a system clock.
The second time is the time when the determining device receives the execution result of the database operation task returned by the database server.
S207, determining the total execution time of the database operation task according to the task start time and the task end time.
In the embodiment of the application, when the value of the system time switch variable is a first preset value, the determining device can acquire the first time through the system clock, the first time is taken as the task start time of the database operation task, and when the execution result of the database operation task returned by the database server is received, the second time is acquired through the system clock, the second time is taken as the task end time of the database operation task, and further the determining device can determine the difference value between the task end time and the task start time as the total execution time of the database operation task.
S209, when the value of the system time switch variable is a second preset value, the first time and the second time are acquired through the hardware clock.
In the embodiment of the application, when the value of the system time switch variable is a second preset value, the determining device can acquire the first time through the hardware clock, take the first time as the task starting time, and acquire the second time through the hardware clock when receiving the execution result of the database operation task returned by the database server, take the second time as the task ending time, so that the determining device can determine the difference value between the task ending time and the task starting time as the total execution time of the database operation task.
After the determining device determines the total execution time of the database operation task, the determining device can further display the total execution time through the display screen, so that a database system administrator can optimize the database system parameters according to the total execution time of the database operation task, and further, the service continuity is guaranteed.
According to the method for determining the execution time of the database operation task, when the database operation task is sent to the database server, the numerical value of the system time switch variable is obtained, when the numerical value of the system time switch variable is a first preset value, the first time is obtained as the task starting time through the system clock, when the execution result of the database operation task returned by the database server is received, the second time is obtained as the task ending time through the system clock, the total execution time of the database operation task is determined according to the task starting time and the task ending time, and when the numerical value of the system time switch variable is a second preset value, the first time and the second time are obtained through the hardware clock, so that the total execution time of the database operation task is accurately determined by flexibly utilizing the system clock or the hardware clock according to requirements, and conditions are provided for optimizing the system parameters of the database and guaranteeing the service continuity.
As can be seen from the above analysis, in the embodiment of the present application, the total execution time of the database operation task may be accurately determined by the system clock, and in one possible implementation manner, the total execution time determined by the system clock may also be accurately adjusted, and the method for determining the execution time of the database operation task provided in the embodiment of the present application is described in detail below with reference to fig. 3.
FIG. 3 is a flow chart of a method for determining execution time of database operation tasks according to an embodiment of the application. As shown in fig. 3, the method for determining the execution time of the database operation task may include:
s301, when a database operation task is sent to a database server, a first time is obtained through a system clock as a task starting time.
The database operation task may include a structured query request, or may include other requests, which is not limited in this aspect of the present application.
S303, when receiving the execution result of the database operation task returned by the database server, acquiring a second time as a task ending time through a system clock.
S305, acquiring a difference value between the task ending time and the task starting time according to the task starting time and the task ending time.
The implementation process and principle of S301-S305 may refer to the description of the foregoing embodiments, which is not repeated herein.
S307, when the difference value is larger than a third preset value, carrying out unit conversion on the difference value according to a conversion strategy corresponding to the third preset value, and determining the difference value after unit conversion as the total execution time.
The third preset value may be set according to clock accuracy of the system clock.
In an exemplary embodiment, when the clock precision of the system clock is microsecond, the third preset value may be set to 1000 microseconds, and accordingly, the conversion policy corresponding to the third preset value may be to convert the unit of the difference between the task end time and the task start time into milliseconds.
In an exemplary embodiment, after the determining device obtains the task start time and the task end time, a difference between the task end time and the task start time may be obtained according to the task start time and the task end time, and when the difference is greater than a third preset value, the difference may be subjected to unit conversion according to a conversion policy corresponding to the third preset value, and then the difference after unit conversion is determined as the total execution time of the database operation task.
For example, assuming that the third preset value is 1000 microseconds, the third preset value corresponds to a conversion strategy that converts the unit of the difference into milliseconds, when the difference between the task ending time and the task starting time is 1200 microseconds, the unit conversion may be performed for 1200 microseconds, and the conversion of 1200 microseconds into 1.2 milliseconds, and then determine 1.2 milliseconds as the total execution time of the database operation task.
It should be noted that, when the difference is not greater than the third preset value, the determining device may not perform unit conversion on the difference, and directly determine the difference as the total execution time of the database operation task.
According to the method for determining the execution time of the database operation task, when the database operation task is sent to the database server, the first time is obtained through the system clock to serve as the task starting time, when the execution result of the database operation task returned by the database server is received, the second time is obtained through the system clock to serve as the task ending time, the difference between the task ending time and the task starting time is obtained according to the task starting time and the task ending time, when the difference is larger than a third preset value, unit conversion is carried out on the difference according to a conversion strategy corresponding to the third preset value, and the difference after unit conversion is determined to be the total execution time. Therefore, the method and the system realize the accurate determination of the total execution time of the database operation task through the system clock, provide conditions for optimizing the system parameters of the database and guaranteeing the service continuity, and realize the automatic adjustment of the accuracy of the total execution time according to the total execution time when the total execution time of the database operation task is determined through the system clock.
Corresponding to the method for determining the execution time of the database operation task provided by the foregoing embodiment, an embodiment of the present application further provides a device for determining the execution time of the database operation task, and since the device for determining the execution time of the database operation task provided by the embodiment of the present application corresponds to the method for determining the execution time of the database operation task provided by the foregoing embodiment, implementation of the method for determining the execution time of the database operation task is also applicable to the device for determining the execution time of the database operation task provided by the present embodiment, which is not described in detail in the present embodiment. Fig. 4 is a schematic structural diagram of a device for determining execution time of database operation task according to an embodiment of the present application. The determining device of the database operation task execution time can be configured in the electronic equipment.
As shown in fig. 4, the determining apparatus 400 for determining the execution time of the database operation task may include: a first acquisition module 410, a second acquisition module 420, and a determination module 430.
A first obtaining module 410, configured to obtain, when sending a database operation task to a database server, a first time as a task start time through a system clock;
a second obtaining module 420, configured to obtain, when receiving an execution result of the database operation task returned by the database server, a second time as a task end time through the system clock;
the determining module 430 is configured to determine a total execution time of the database operation task according to the task start time and the task end time.
In one embodiment of the present application, as shown in fig. 5, the determining apparatus 400 for determining the execution time of the database operation task may further include:
a third obtaining module 440, configured to obtain a value of the system time switch variable;
correspondingly, the first obtaining module 410 is specifically configured to:
when the value of the system time switch variable is a first preset value, the first time is obtained through the system clock and is used as the task starting time.
In one embodiment of the present application, the third obtaining module 440 is specifically configured to:
and reading the value of the system time switch variable from a preset position.
In one embodiment of the present application, as shown in fig. 5, the determining apparatus 400 for determining the execution time of the database operation task may further include:
and a fourth obtaining module 450, configured to obtain the first time and the second time through the hardware clock when the value of the system time switch variable is a second preset value.
In one embodiment of the present application, the determining module 430 is specifically configured to:
acquiring a difference value between the task ending time and the task starting time;
and when the difference value is larger than a third preset value, carrying out unit conversion on the difference value according to a conversion strategy corresponding to the third preset value, and determining the difference value after unit conversion as the total execution time.
In one embodiment of the present application, when the third preset value is 1000 microseconds, the third preset value corresponds to a conversion strategy that converts the units of the difference value into milliseconds.
In one embodiment of the application, the database manipulation task described above includes a structured query request.
According to the determining device for the execution time of the database operation task, when the database operation task is sent to the database server, the first time is obtained through the system clock to serve as the task starting time, when the execution result of the database operation task returned by the database server is received, the second time is obtained through the system clock to serve as the task ending time, and the total execution time of the database operation task is determined according to the task starting time and the task ending time. Therefore, the total execution time of the database operation task is accurately determined by using the system clock, and conditions are provided for optimizing the database system parameters and guaranteeing the service continuity.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 6 illustrates a schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device 600 may also represent various forms of mobile apparatuses, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing apparatuses. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the electronic device 600 includes a computing unit 601 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 can also be stored. The computing unit 601, ROM 602, and RAM 603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
A number of components in the electronic device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information/data with other devices through a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the respective methods and processes described above, such as a method of determining the database operation task execution time. For example, in some embodiments, the method of determining database operation task execution time may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the above-described method of determining the database operation task execution time may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the method of determining database operation task execution time in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may also be a server of a distributed system or a server that incorporates a blockchain.
According to an embodiment of the present disclosure, there is also provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method for determining the database operation task execution time according to any one of the preceding embodiments.
According to an embodiment of the present disclosure, there is also provided a computer program product including a computer program which, when executed by a processor, implements the method for determining the execution time of a database operation task as described in any of the foregoing embodiments.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (10)

1. A method for determining execution time of a database operation task, comprising:
when a database operation task is sent to a database server, acquiring a first time as a task starting time through a system clock;
when an execution result of the database operation task returned by the database server is received, acquiring a second time as a task ending time through the system clock;
and determining the total execution time of the database operation task according to the task starting time and the task ending time.
2. The method of claim 1, further comprising, prior to said obtaining the first time by the system clock as a task start time:
acquiring a numerical value of a system time switch variable;
correspondingly, the acquiring the first time by the system clock as the task starting time includes:
and when the value of the system time switch variable is a first preset value, acquiring the first time as the task starting time through a system clock.
3. The method of claim 2, wherein the obtaining the value of the system time switch variable comprises:
and reading the numerical value of the system time switch variable from a preset position.
4. The method as recited in claim 2, further comprising:
and when the value of the system time switch variable is a second preset value, acquiring the first time and the second time through a hardware clock.
5. The method of claim 1, wherein determining the total execution time of the database operation task based on the task start time and the task end time comprises:
acquiring a difference value between the task ending time and the task starting time;
and when the difference value is larger than a third preset value, carrying out unit conversion on the difference value according to a conversion strategy corresponding to the third preset value, and determining the difference value after unit conversion as the total execution time.
6. The method of claim 5, wherein when the third preset value is 1000 microseconds, the third preset value corresponds to a conversion strategy that converts units of the difference into milliseconds.
7. The method of any of claims 1-6, wherein the database operation task comprises a structured query request.
8. A database operation task execution time determining device, characterized by being configured to implement the method according to any one of claims 1-7.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; it is characterized in that the method comprises the steps of,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-7.
CN202210122817.0A 2022-02-09 2022-02-09 Method and device for determining execution time of database operation task and electronic equipment Pending CN116610707A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210122817.0A CN116610707A (en) 2022-02-09 2022-02-09 Method and device for determining execution time of database operation task and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210122817.0A CN116610707A (en) 2022-02-09 2022-02-09 Method and device for determining execution time of database operation task and electronic equipment

Publications (1)

Publication Number Publication Date
CN116610707A true CN116610707A (en) 2023-08-18

Family

ID=87680548

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210122817.0A Pending CN116610707A (en) 2022-02-09 2022-02-09 Method and device for determining execution time of database operation task and electronic equipment

Country Status (1)

Country Link
CN (1) CN116610707A (en)

Similar Documents

Publication Publication Date Title
CN112540806B (en) Method and device for rendering small program page, electronic equipment and storage medium
CN113986788B (en) Data processing method and device, chip, electronic equipment and medium
CN115686850A (en) Spark-based target task processing method and device and electronic equipment
CN114861039B (en) Parameter configuration method, device, equipment and storage medium of search engine
CN113377809A (en) Data processing method and apparatus, computing device, and medium
CN114417780B (en) State synchronization method and device, electronic equipment and storage medium
CN116860751A (en) Data processing method and device, electronic equipment and storage medium
CN116610707A (en) Method and device for determining execution time of database operation task and electronic equipment
CN115309730A (en) Data auditing method and device, electronic equipment and storage medium
CN114896322A (en) JSON (Java Server object notation) -based configuration data conversion method, device, equipment and medium
CN115469561A (en) Simulation test method and device, electronic device and storage medium
CN114138358A (en) Application program starting optimization method, device, equipment and storage medium
CN112905270A (en) Workflow implementation method, device, platform, electronic equipment and storage medium
CN116095198B (en) Intelligent construction method and system for laboratory data center
CN113360258B (en) Data processing method, device, electronic equipment and storage medium
CN116821046B (en) Automatic synchronization method, device, equipment and medium for data among heterogeneous units
CN115455029A (en) Battery replacement data acquisition method and device, electronic equipment and storage medium
CN118467335A (en) Information processing method and device
CN117608944A (en) Method and device for calculating weight migration volume ratio, electronic equipment and storage medium
CN115730000A (en) Medical data integration method, device, equipment and medium based on data lake
CN116627924A (en) Data reading method, system, device and readable storage medium
CN117806619A (en) Data processing method, device, electronic equipment and medium
CN116775065A (en) Application upgrading method and device of slave controller, electronic equipment and storage medium
CN117193726A (en) Parallel design method and device of software, electronic equipment and medium
CN115857987A (en) Configuration file updating method and device, electronic equipment and 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