CN116755958A - Database service flow playback method, electronic equipment and storage medium - Google Patents

Database service flow playback method, electronic equipment and storage medium Download PDF

Info

Publication number
CN116755958A
CN116755958A CN202310415013.4A CN202310415013A CN116755958A CN 116755958 A CN116755958 A CN 116755958A CN 202310415013 A CN202310415013 A CN 202310415013A CN 116755958 A CN116755958 A CN 116755958A
Authority
CN
China
Prior art keywords
data
flow
source database
query
playback
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
CN202310415013.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.)
Alibaba Cloud Computing Ltd
Original Assignee
Alibaba Cloud Computing 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 Alibaba Cloud Computing Ltd filed Critical Alibaba Cloud Computing Ltd
Priority to CN202310415013.4A priority Critical patent/CN116755958A/en
Publication of CN116755958A publication Critical patent/CN116755958A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a database service flow playback method, electronic equipment and a storage medium, and relates to the technical field of databases, wherein the method comprises the following steps: determining a target flow acquisition mode corresponding to the source database in a plurality of flow acquisition modes, and acquiring service flow data of the source database based on the target flow acquisition mode; carrying out format normalization processing on the collected service flow data; and carrying out flow playback on the processed service flow data in a plurality of target databases to obtain flow playback information, wherein the flow playback information characterizes the compatibility of the source database and the target database and the query performance of the target database. In this embodiment, a plurality of flow collection modes are set, and the flow collection is performed by adopting a target collection mode corresponding to the source database, so that the method can be suitable for flow collection requirements of various databases, and can guide users to find and solve compatibility problems and performance problems of the databases, and reduce the difficulty of database migration and upgrading.

Description

Database service flow playback method, electronic equipment and storage medium
Technical Field
The present application relates to the field of database technologies, and in particular, to a method for playing back a database service flow, an electronic device, and a storage medium.
Background
A database is a "repository" that organizes, stores, and manages data according to a data structure. Is a collection of large amounts of data stored in a computer for a long period of time, organized, sharable, and uniformly managed. Databases include a variety of types, such as, for example, an ORACLE database, a DB2 database, a polar DB database, a MySQL database, and the like.
In the process of migrating or upgrading the database, the compatibility problem and the performance problem of the database can not be found and solved, and the difficulty of migrating and upgrading the database is improved.
Disclosure of Invention
The embodiment of the application provides a database service flow playback method, electronic equipment and a storage medium, which are used for guiding a user to find and solve compatibility problems and performance problems of a database and reducing the difficulty of database migration and upgrading.
In a first aspect, an embodiment of the present application provides a method for playing back a database service flow, including:
determining a target flow acquisition mode corresponding to the source database in a plurality of flow acquisition modes, and acquiring service flow data of the source database based on the target flow acquisition mode; carrying out format normalization processing on the collected service flow data; and carrying out flow playback on the processed service flow data in a plurality of target databases to obtain flow playback information, wherein the flow playback information characterizes the compatibility of the source database and the target database and the query performance of the target database.
In a second aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory, the processor implementing a method of any of the above when the computer program is executed.
In a third aspect, embodiments of the present application provide a computer-readable storage medium having a computer program stored therein, the computer program, when executed by a processor, implementing a method according to any one of the preceding claims.
Compared with the prior art, the application has the following advantages:
the application provides a database service flow playback method, electronic equipment and a storage medium, wherein a target flow acquisition mode corresponding to a source database is determined in a plurality of flow acquisition modes, and service flow data of the source database are acquired based on the target flow acquisition mode; secondly, carrying out format normalization processing on the collected service flow data; and finally, carrying out flow playback on the processed service flow data in a plurality of target databases to obtain flow playback information, wherein the flow playback information characterizes the compatibility of the source database and the target database and the query performance of the target database. In the embodiment, a plurality of flow acquisition modes are set, and the flow acquisition is performed by adopting the target acquisition mode corresponding to the source database, so that the flow acquisition method can be suitable for the flow acquisition requirements of various databases; because the acquired service flow data is subjected to format normalization processing, the plurality of target databases can adopt the same processing logic to carry out flow playback on the processed service flow data so as to guide a user to discover and solve the compatibility problem and the performance problem of the databases and reduce the difficulty of database migration and upgrading.
The foregoing description is only an overview of the present application, and is intended to provide a better understanding of the technical means of the present application, as it is embodied in the present specification, and is intended to provide a better understanding of the above and other objects, features and advantages of the present application, as it is embodied in the following description.
Drawings
In the drawings, the same reference numerals refer to the same or similar parts or elements throughout the several views unless otherwise specified. The figures are not necessarily drawn to scale. It is appreciated that these drawings depict only some embodiments according to the application and are not therefore to be considered limiting of its scope.
Fig. 1 is a schematic diagram of an application scenario provided by the present application;
FIG. 2 is a schematic diagram of a flow acquisition and flow playback process according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a playback report according to an embodiment of the present application;
FIG. 4 is a flowchart of a database service traffic playback method according to an embodiment of the present application;
FIG. 5 is a flow chart of obtaining service flow information using audit logs according to an embodiment of the present application;
FIG. 6 is a flowchart of obtaining service traffic information based on access logs of a source database recorded by an application program according to an embodiment of the present application;
FIG. 7 is a flow chart of a flow playback according to an embodiment of the present application;
FIG. 8 is a block diagram illustrating a database service traffic playback apparatus according to an embodiment of the present application; and
fig. 9 is a block diagram of an electronic device used to implement an embodiment of the application.
Detailed Description
Hereinafter, only certain exemplary embodiments are briefly described. As will be recognized by those skilled in the pertinent art, the described embodiments may be modified in numerous different ways without departing from the spirit or scope of the present application. Accordingly, the drawings and description are to be regarded as illustrative in nature, and not as restrictive.
In order to facilitate understanding of the technical solutions of the embodiments of the present application, the following describes related technologies of the embodiments of the present application. The following related technologies may be optionally combined with the technical solutions of the embodiments of the present application, which all belong to the protection scope of the embodiments of the present application.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region, and provide corresponding operation entries for the user to select authorization or rejection.
Fig. 1 is a schematic diagram of an application scenario of the technical scheme of the present application. As shown in fig. 1, first, after determining a target flow collection mode, flow collection is performed in a source database; secondly, carrying out format normalization processing on the collected service flow data, and unifying data standards; and finally, carrying out flow playback on the processed service flow data in a plurality of target databases to obtain flow playback information. The source data, target database may include: DB2 databases, ORACLE databases, mySQL databases, polar DB databases, RDS databases, polar DB-X databases, etc. The source database and the target database can be isomorphic databases, heterogeneous databases or databases with different versions. The database service flow playback method in the embodiment can be suitable for scenes such as heterogeneous database migration, isomorphic database migration, database version upgrading and downgrading, database preheating and the like, and has a wide application range.
Fig. 2 is a schematic diagram of a flow collection and flow playback process according to an embodiment of the present application. As shown in fig. 2, in this embodiment, the data service traffic data is a structured query language (Structured Query Language, SQL) statement. The source database may comprise any of an ORACLE database, mySQL database, RDS database. The flow collection process comprises two parts of log collection, analysis and cleaning. In the log collection portion, a plurality of traffic collection modes are set, and different source databases use different collection tools, including: 1. if the source database starts the audit log, capturing service flow data based on the audit log; 2. service traffic data may be collected based on an access log (such as the "SQL log" shown in FIG. 2) of a source database described by an application; 3. if the source database is an open source database, service traffic data can be collected in the form of network crawling data packets based on the client protocol. The service traffic data includes query data generated when accessing the database and context data corresponding to the query data, for example, SQL sentences and objects (Schema) generating the SQL sentences, time and the like.
In the analysis and cleaning part, the logs collected in the last step are analyzed and cleaned, and a final replay sample is generated for flow replay. The method specifically comprises the following steps: protocol parsing and translation: carrying out protocol analysis and conversion on the collected service flow data; generating SQL fingerprints; filtering and sequencing are carried out, unnecessary content is filtered out, and the sequency of a single connection SQL sentence is ensured; dynamic SQL assembly: analyzing and combining the collected dynamic SQL and the binding variables into an executable SQL statement; SQL cleansing and correlation: cleaning SQL sentences and correlating the SQL sentences with corresponding context data; sample SQL output: and summarizing the SQL sentences and outputting the SQL sentences according to the unified data standard.
And carrying out configuration of flow playback related information on the analyzed and cleaned data. Specifically, the playback rate is set. Playback flow rate control is performed, support 1: 1. 1: playback at N-fold speed, 1:1 is original speed playback, 1: n is the accelerated playback. Creating a replay thread pool according to the data to be parsed and cleaned: first, slicing is performed based on the attribute of sample Session information (Session): the SQL statements are grouped according to the Session identification. Secondly, creating an SQL replay thread pool based on the packet information: a playback thread pool is created according to the packet information, simulating multi-thread mode access. Again, with the flow rate controller, the speed of the flow playback is controlled according to the set playback rate.
Traffic replay is performed in a target library using a driver (java database connectivity, JDBC), which may include: mySQL database, polar db database, RDS database, or other database.
During the flow playback, a flow playback report is generated. Fig. 3 is a schematic diagram of playback reporting according to an embodiment of the present application. As shown in fig. 3, the playback report includes two parts, a global summary report and an SQL dimension detail report. The global summary report includes indicators including: number of requests, average Time consumption, number of failures, average Response Time (RT) distribution, number of successes, query-per-second (QPS), runtime, compatibility, template SQL statistics (counting the number of SQL of each type), and SQL statement query success rate. The SQL dimension detail report includes the following metrics: SQL fingerprint, QPS, request number (Requests), number of errors, average RT before and after comparison statistics, minimum RT before and after comparison statistics, maximum RT before and after comparison statistics, SQL error reporting cause statistics and compatibility intelligent modification suggestions. And carrying out SQL compatibility evaluation of the source database and the target database through the playback report, and SQL performance evaluation of the target database, and if the compatibility and the performance evaluation pass, carrying out database cut-over and migrating the data in the source database to the target database.
The embodiment of the application provides a database service flow playback method, which can be applied to computing equipment, and the computing equipment can comprise: server, user terminal, etc. FIG. 4 is a flowchart of a method for playback of database service traffic according to an embodiment of the present application, the method comprising:
step S401, determining a target flow collection mode corresponding to the source database in a plurality of flow collection modes, and collecting service flow data of the source database based on the target flow collection mode.
And configuring a plurality of flow acquisition modes, and adopting a corresponding target flow acquisition mode according to a scene corresponding to the source database. Determining a target flow acquisition mode in a plurality of flow acquisition modes according to the selection instruction; or detecting a scenario corresponding to the source database, for example, determining whether an audit log is opened, whether an application program using the source database records a source database access log, whether the source database is an open source database, and the like, and determining a target flow acquisition mode according to the scenario.
Step S402, format normalization processing is carried out on the collected service flow data.
The format normalization processing refers to processing the collected service traffic data into a unified data format, so that a plurality of target databases can adopt the same processing logic to perform traffic playback on the service traffic data.
Illustratively, the unified data format is:
{"schema":"zkk_test","session":"172.16.27.105:58952","execTime":0,"convertSqlText":"select1","startTime":1663603200306000,"user":"process_crud"}。
and step S403, performing flow playback on the processed service flow data in a plurality of target databases to obtain flow playback information, wherein the flow playback information characterizes the compatibility of the source database and the target database and the query performance of the target database.
Wherein the traffic playback information may include a traffic playback report. The source database and the target database can be isomorphic databases, heterogeneous databases or databases with different versions. The flow playback report includes a plurality of indexes for characterizing compatibility and performance, and whether the source database and the target database are compatible or not and the query performance of the target database can be determined according to the indexes in the flow playback report.
The application provides a database service flow playback method, which comprises the steps of firstly, determining a target flow acquisition mode corresponding to a source database in a plurality of flow acquisition modes, and acquiring service flow data of the source database based on the target flow acquisition mode; secondly, carrying out format normalization processing on the collected service flow data; and finally, carrying out flow playback on the processed service flow data in a plurality of target databases to obtain flow playback information, wherein the flow playback information characterizes the compatibility of the source database and the target database and the query performance of the target database. In the embodiment, a plurality of flow acquisition modes are set, and the flow acquisition is performed by adopting the target acquisition mode corresponding to the source database, so that the flow acquisition method can be suitable for the flow acquisition requirements of various databases; because the acquired service flow data is subjected to format normalization processing, the plurality of target databases can adopt the same processing logic to carry out flow playback on the processed service flow data so as to guide a user to discover and solve the compatibility problem and the performance problem of the databases and reduce the difficulty of database migration and upgrading.
In one implementation, in step S401, collecting service traffic data of a source database based on a target traffic collection mode includes: monitoring an audit log under the condition that the audit log of the source database is determined to be opened; and obtaining query data of the source database and context data corresponding to the query data based on the monitored audit log, and taking the query data and the context data as service flow data.
Wherein the audit log is an operational history of a database recorded by a database management system (DataBase Management System, DBMS), comprising: access to and modification of data, as well as time of operation, user identification, internet protocol (Internet Protocol, IP) address and type of operation, etc. According to the monitored audit log, query data and context data of the source database, for example, SQL sentences and context data of the SQL sentences, wherein the context data comprises a user name corresponding to the SQL sentences, operation time, operation type and the like, can be obtained.
In the embodiment, for the scene of opening the database audit log, service flow data is collected based on the audit log, and the method is simple to realize and convenient to operate.
In one implementation, obtaining query data of a source database and context data corresponding to the query data based on the monitored audit log includes: analyzing the monitored audit log, and filtering and sequencing analysis results to obtain query data of the source database and context data corresponding to the query data.
Specifically, the monitored audit log is analyzed, the data obtained by analysis is filtered and sequenced, and the filtering and sequencing conditions can be configured according to specific requirements, for example, a plurality of types of SQL sentences and context data are filtered out, and the sequency of the SQL sentences is ensured.
In one example, FIG. 5 is a flow chart for obtaining service traffic information using an audit log. As shown in fig. 5, firstly, an audit log is monitored, the monitored audit log is analyzed, the analysis result is filtered and ordered, for the obtained SQL statement, the encryption algorithm md5 or the cryptographic hash function sha256 is utilized to generate a unique identifier of the SQL statement as an SQL fingerprint, and then the obtained SQL statement and the context data are output as a sample SQL.
In addition to collecting traffic through database audit logs, other means may be used, see in particular the following examples:
in one implementation, collecting service traffic data of a source database based on a target traffic collection pattern includes:
and obtaining query data of the source database and context data corresponding to the query data based on the access log of the source database recorded by the application program, and taking the query data and the context data as service flow data.
In practical application, because stability problems often do not allow the audit log to be opened, service flow data is obtained by using a database access log recorded by an application program of the database under the condition that the audit log is not opened, and the database access log comprises a historical access operation record and context data aiming at the database.
The application programs can be distributed in different devices, each application program serves as a node, and service flow data and up-down query data of the source database are obtained by aggregating database access logs of the source database respectively recorded by a plurality of nodes.
In one implementation, obtaining query data of a source database and context data corresponding to the query data based on an access log of the source database recorded by an application program includes: combining dynamic query sentences recorded in an access log of a source database with corresponding binding variables to obtain executable query sentences; and taking the executable query statement and the context data recorded in the access log as the query data of the source database and the context data corresponding to the query data.
In one implementation, obtaining query data of a source database and context data corresponding to the query data based on an access log of the source database recorded by an application program includes: and taking the executable query statement and the context data recorded in the access log of the source database as the query data of the source database and the context data corresponding to the query data.
In practical application, the access logs of the source databases recorded by a plurality of application programs are aggregated to obtain dynamic query sentences and executable query sentences.
For dynamic query sentences, different executable query sentences can be obtained by combining the dynamic query sentences with different query conditions. Optionally, the dynamic query statement and the corresponding parameters are combined to obtain the executable query statement.
Exemplary, dynamic SQL statements: select from user where user _id=? Binding variable [123], then the combined executable SQL statement is: select from user where user _id=123.
In one implementation, the source database is an open source database, and based on a target traffic collection mode, collecting service traffic data of the source database includes: and acquiring service flow data of the source database in a network packet capturing mode.
In practical application, if the source database is an open source database, the network packet capturing tool can be used for capturing the flow between the application program and the source database, and the service flow is obtained in a database protocol reverse analysis mode, so that the method is not invasive to the database and can be suitable for various scenes.
In one implementation, the query data includes a plurality of types of query statements, the method further comprising: generating unique identifiers corresponding to the query sentences of the multiple types respectively; and playing back the processed service flow data in a plurality of target databases, wherein the method comprises the following steps: and carrying out flow playback on the processed service flow data in a plurality of target databases based on the unique identifiers respectively corresponding to the query sentences of the plurality of types.
Illustratively, the five types of SQL statements include: the data query language (Data Query Language, DQL) has a basic structure of query sentences consisting of SELECT clauses, FROM clauses, WHERE clauses. Through which the database operating language (Data Manipulation Language, DML) can implement basic operations on the database. The key words include: insert, delete, update, etc. The data definition language (Data Definition Language, DDL) is used to create various objects in a database, including creating, deleting, modifying structures of tables, such as tables, views, indexes, synonyms, clusters, and the like. The keywords include create, drop, alter. Transaction control language (Transaction Control Language, TCL) for rapid prototyping, script programming, GUI and testing, keywords including commit, rollback, etc. The data control language (Data Control Language, DCL) is used to grant or reclaim privileges to access the database and to control the time and effect of database manipulation transactions, to monitor the database, etc., with keys being grant, revoke, etc.
And performing parameterization processing on the executable SQL sentences to obtain dynamic SQL sentences, and generating unique identifiers corresponding to the SQL sentences of each type. And when the flow playback is carried out, playing back the SQL sentences of each type according to the unique identification.
In one example, FIG. 6 is a flow chart for obtaining service traffic information based on access logs of a source database of application records. As shown in fig. 6, first, access logs of application programs (the "application record access logs" shown in fig. 6) are acquired, each application program serves as one node, and logs of all node records are aggregated. Determining whether the SQL statement recorded in the log is dynamic SQL, if so, performing dynamic SQL assembly to obtain an executable SQL statement, and generating an SQL fingerprint; if not, an SQL fingerprint is generated for the executable SQL statement. Specifically, the encryption algorithm md5 or the cryptographic hash function sha256 is utilized to generate a unique identifier of the SQL statement as an SQL fingerprint, and then the obtained SQL statement and the context data are output as a sample SQL.
In one implementation, performing flow playback on the processed service flow data in a plurality of target databases to obtain flow playback information, where the method includes: grouping the processed service flow data according to session attributes, and creating a playback thread pool based on the grouped data; and performing flow playback on the data after the grouping by using the playback thread pool to obtain flow playback information.
The session attributes may include session category, session identification, etc. Optionally, grouping is performed according to the session identifier, when the flow playback is performed, the collected SQL sentences and the collected context data are read, the collected SQL sentences and the collected context data are mapped to corresponding threads by utilizing a hash function to perform the flow playback, a playback thread pool comprises a plurality of threads, and the number of the threads can be configured according to specific needs.
In one implementation, using a playback thread pool to perform flow playback on the data after the grouping to obtain flow playback information, including: and performing flow playback on the data after grouping according to a preset playback rate by using the playback thread pool to obtain flow playback information.
Wherein, set up the playback speed, carry on the flow rate control of playback, set up 1: 1. 1: playback at N-fold speed, 1:1 is original speed playback, 1: n is the accelerated playback. And using the playback thread pool to play back the flow according to the playback rate.
In one example, fig. 7 is a flow chart of the playback of traffic. As shown in fig. 7, firstly, the collected context data of the SQL statement (i.e., "load SQL collection content" as shown in fig. 7) is loaded, and secondly, slicing is performed based on the attribute of the Session information (Session) of the sample (i.e., the collected context data of the SQL statement), and specifically, the SQL statement is grouped according to the Session identifier. Again, a playback thread pool is created based on the packet information. And finally, performing flow rate control according to the set playback rate, performing flow playback in the target database, and generating a playback report in the playback process.
Correspondingly to the application scenario and the method of the method provided by the embodiment of the present application, the embodiment of the present application further provides a database service traffic playback device, as shown in fig. 8, which is a structural block diagram of the database service traffic playback device of an embodiment of the present application, where the device includes:
the acquisition module 801 determines a target flow acquisition mode corresponding to a source database among a plurality of flow acquisition modes, and acquires service flow data of the source database based on the target flow acquisition mode.
And a processing module 802, for performing format normalization processing on the collected service flow data.
And the playback module 803 is used for carrying out flow playback on the processed service flow data in a plurality of target databases to obtain flow playback information, wherein the flow playback information represents the compatibility of the source database and the target database and the query performance of the target database.
The application provides a database service flow playback device, which comprises the steps of firstly, determining a target flow acquisition mode corresponding to a source database in a plurality of flow acquisition modes, and acquiring service flow data of the source database based on the target flow acquisition mode; secondly, carrying out format normalization processing on the collected service flow data; and finally, carrying out flow playback on the processed service flow data in a plurality of target databases to obtain flow playback information, wherein the flow playback information characterizes the compatibility of the source database and the target database and the query performance of the target database. In the embodiment, a plurality of flow acquisition modes are set, and the flow acquisition is performed by adopting the target acquisition mode corresponding to the source database, so that the flow acquisition method can be suitable for the flow acquisition requirements of various databases; because the acquired service flow data is subjected to format normalization processing, the plurality of target databases can adopt the same processing logic to carry out flow playback on the processed service flow data so as to guide a user to discover and solve the compatibility problem and the performance problem of the databases and reduce the difficulty of database migration and upgrading.
In one implementation, the acquisition module 801, when acquiring service traffic data of the source database based on the target traffic acquisition mode, is configured to:
monitoring an audit log under the condition that the audit log of the source database is determined to be opened;
and obtaining query data of the source database and context data corresponding to the query data based on the monitored audit log, and taking the query data and the context data as service flow data.
In one implementation, the collection module 801 is configured to, when obtaining query data of the source database and context data corresponding to the query data based on the monitored audit log:
analyzing the monitored audit log, and filtering and sequencing analysis results to obtain query data of the source database and context data corresponding to the query data.
In one implementation, the acquisition module 801, when acquiring service traffic data of the source database based on the target traffic acquisition mode, is configured to:
and obtaining query data of the source database and context data corresponding to the query data based on the access log of the source database recorded by the application program, and taking the query data and the context data as service flow data.
In one implementation, the collection module 801 is configured to, when obtaining query data of a source database and context data corresponding to the query data based on an access log of the source database recorded by an application program:
combining dynamic query sentences recorded in an access log of a source database with corresponding binding variables to obtain executable query sentences;
and taking the executable query statement and the context data recorded in the access log as the query data of the source database and the context data corresponding to the query data.
In one implementation, the collection module 801 is configured to, when obtaining query data of a source database and context data corresponding to the query data based on an access log of the source database recorded by an application program:
and taking the executable query statement and the context data recorded in the access log of the source database as the query data of the source database and the context data corresponding to the query data.
In one implementation, the source database is an open source database, and the acquisition module 801 is configured to, when acquiring service traffic data of the source database based on the target traffic acquisition mode:
and acquiring service flow data of the source database in a network packet capturing mode.
In one implementation, the query data includes a plurality of types of query statements, the apparatus further operable to:
generating unique identifiers corresponding to the query sentences of the multiple types respectively;
and playing back the processed service flow data in a plurality of target databases, wherein the method comprises the following steps:
and carrying out flow playback on the processed service flow data in a plurality of target databases based on the unique identifiers respectively corresponding to the query sentences of the plurality of types.
In one implementation, the playback module 803 is configured to:
grouping the processed service flow data according to session attributes, and creating a playback thread pool based on the grouped data;
and performing flow playback on the data after the grouping by using the playback thread pool to obtain flow playback information.
In one implementation, when the playback module 803 uses the playback thread pool to perform the flow playback on the data after the packet, the playback module is configured to:
and performing flow playback on the data after grouping according to a preset playback rate by using the playback thread pool to obtain flow playback information.
The functions of each module in each device of the embodiment of the present application may be referred to the corresponding descriptions in the above methods, and have corresponding beneficial effects, which are not described herein.
Fig. 9 is a block diagram of an electronic device used to implement an embodiment of the application. As shown in fig. 9, the electronic device includes: memory 910 and processor 920, memory 910 stores a computer program executable on processor 920. The processor 920 implements the method in the above-described embodiments when executing the computer program. The number of memories 910 and processors 920 may be one or more.
The electronic device further includes:
and the communication interface 930 is used for communicating with external equipment and carrying out data interaction transmission.
If the memory 910, the processor 920, and the communication interface 930 are implemented independently, the memory 910, the processor 920, and the communication interface 930 may be connected to each other and perform communication with each other through buses. The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (Peripheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in fig. 9, but not only one bus or one type of bus.
Alternatively, in a specific implementation, if the memory 910, the processor 920, and the communication interface 930 are integrated on a chip, the memory 910, the processor 920, and the communication interface 930 may communicate with each other through internal interfaces.
The embodiment of the application provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the method provided in the embodiment of the application.
The embodiment of the application also provides a chip, which comprises a processor and is used for calling the instructions stored in the memory from the memory and running the instructions stored in the memory, so that the communication equipment provided with the chip executes the method provided by the embodiment of the application.
The embodiment of the application also provides a chip, which comprises: the input interface, the output interface, the processor and the memory are connected through an internal connection path, the processor is used for executing codes in the memory, and when the codes are executed, the processor is used for executing the method provided by the application embodiment.
It should be appreciated that the processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or any conventional processor or the like. It is noted that the processor may be a processor supporting an advanced reduced instruction set machine (Advanced RISC Machines, ARM) architecture.
Further alternatively, the memory may include a read-only memory and a random access memory. The memory may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), programmable ROM (PROM), erasable Programmable ROM (EPROM), electrically Erasable EPROM (EEPROM), or flash Memory, among others. Volatile memory can include random access memory (Random Access Memory, RAM), which acts as external cache memory. By way of example, and not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic RAM (Dynamic Random Access Memory, DRAM), synchronous DRAM (SDRAM), double Data Rate Synchronous DRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), and Direct RAM (DR RAM).
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions in accordance with the present application are fully or partially produced. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. Computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
Any process or method described in flow charts or otherwise herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process. And the scope of the preferred embodiments of the present application includes additional implementations in which functions may be performed in a substantially simultaneous manner or in an opposite order from that shown or discussed, including in accordance with the functions that are involved.
Logic and/or steps described in the flowcharts or otherwise described herein, e.g., may be considered a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the methods of the embodiments described above may be performed by a program that, when executed, comprises one or a combination of the steps of the method embodiments, instructs the associated hardware to perform the method.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules described above, if implemented in the form of software functional modules and sold or used as a stand-alone product, may also be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a magnetic or optical disk, or the like.
The above description is merely an exemplary embodiment of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think of various changes or substitutions within the technical scope of the present application, and these should be covered in the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (12)

1. A method for playback of database service traffic, the method comprising:
determining a target flow acquisition mode corresponding to a source database in a plurality of flow acquisition modes, and acquiring service flow data of the source database based on the target flow acquisition mode;
carrying out format normalization processing on the collected service flow data;
and carrying out flow playback on the processed service flow data in a plurality of target databases to obtain flow playback information, wherein the flow playback information characterizes the compatibility of the source database and the target database and the query performance of the target database.
2. The method of claim 1, wherein the collecting service traffic data of the source database based on the target traffic collection pattern comprises:
monitoring an audit log of the source database under the condition that the audit log is determined to be opened;
and obtaining query data of the source database and context data corresponding to the query data based on the monitored audit log, and taking the query data and the context data as the service flow data.
3. The method according to claim 2, wherein the obtaining query data of the source database and context data corresponding to the query data based on the monitored audit log includes:
analyzing the monitored audit log, and filtering and sequencing analysis results to obtain query data of the source database and context data corresponding to the query data.
4. The method of claim 1, wherein the collecting service traffic data of the source database based on the target traffic collection pattern comprises:
and obtaining query data of the source database and context data corresponding to the query data based on the access log of the source database recorded by the application program, and taking the query data and the context data as the service flow data.
5. The method according to claim 4, wherein the obtaining query data of the source database and context data corresponding to the query data based on the access log of the source database recorded by the application program includes:
combining the dynamic query statement recorded in the access log of the source database with the corresponding binding variable to obtain an executable query statement;
and taking the executable query statement and the context data recorded in the access log as the query data of the source database and the context data corresponding to the query data.
6. The method according to claim 4, wherein the obtaining query data of the source database and context data corresponding to the query data based on the access log of the source database recorded by the application program includes:
and taking executable query sentences and context data recorded in the access log of the source database as query data of the source database and context data corresponding to the query data.
7. The method of any of claims 1-6, wherein the source database is an open source database, and wherein the collecting service traffic data of the source database based on the target traffic collection pattern comprises:
and acquiring service flow data of the source database in a network packet capturing mode.
8. The method of any of claims 2-6, wherein the query data comprises a plurality of types of query statements, the method further comprising:
generating unique identifiers respectively corresponding to the multiple types of query sentences;
and playing back the processed service flow data in a plurality of target databases, wherein the method comprises the following steps:
and carrying out flow playback on the processed service flow data in a plurality of target databases based on the unique identifiers respectively corresponding to the query sentences of the plurality of types.
9. The method according to claim 1, wherein the performing traffic playback on the processed service traffic data in the plurality of target databases to obtain traffic playback information includes:
grouping the processed service flow data according to session attributes, and creating a playback thread pool based on the grouped data;
and carrying out flow playback on the grouped data by using the playback thread pool to obtain flow playback information.
10. The method of claim 9, wherein performing traffic playback on the packetized data using the playback thread pool to obtain traffic playback information comprises:
and carrying out flow playback on the grouped data according to a preset playback rate by using the playback thread pool to obtain flow playback information.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory, the processor implementing the method of any one of claims 1-10 when the computer program is executed.
12. A computer readable storage medium having stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-10.
CN202310415013.4A 2023-04-12 2023-04-12 Database service flow playback method, electronic equipment and storage medium Pending CN116755958A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310415013.4A CN116755958A (en) 2023-04-12 2023-04-12 Database service flow playback method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310415013.4A CN116755958A (en) 2023-04-12 2023-04-12 Database service flow playback method, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116755958A true CN116755958A (en) 2023-09-15

Family

ID=87953967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310415013.4A Pending CN116755958A (en) 2023-04-12 2023-04-12 Database service flow playback method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116755958A (en)

Similar Documents

Publication Publication Date Title
WO2020233367A1 (en) Blockchain data storage and query method, apparatus and device, and storage medium
WO2020238066A1 (en) Software pressure test method and apparatus, and storage medium and server
US8239369B2 (en) Method and apparatus for enhancing performance of database and environment thereof
CN111159706A (en) Database security detection method, device, equipment and storage medium
US11334474B2 (en) Fast change impact analysis tool for large-scale software systems
US8417690B2 (en) Automatically avoiding unconstrained cartesian product joins
US9355152B2 (en) Non-exclusionary search within in-memory databases
WO2021259217A1 (en) Data association query method and apparatus, and device and storage medium
CN111459698A (en) Database cluster fault self-healing method and device
CN115203750B (en) Hive data authority control and security audit method and system based on Hive plug-in
CN108268468B (en) Big data analysis method and system
CN112988782A (en) Hive-supported interactive query method and device and storage medium
Svajlenko et al. Big data clone detection using classical detectors: an exploratory study
CN114328759A (en) Data construction and management method and terminal of data warehouse
CN114422564A (en) Audit tracing method and device for access data, computer equipment and storage medium
CN111026709A (en) Data processing method and device based on cluster access
CN114969441A (en) Knowledge mining engine system based on graph database
CN114238379A (en) Report query method and system based on SQL generator
CN111435327B (en) Log record processing method, device and system
CN111522870A (en) Database access method, middleware and readable storage medium
CN116755958A (en) Database service flow playback method, electronic equipment and storage medium
CN114328577A (en) Data query method and device
CN114528313A (en) Data processing method and device and electronic equipment
CN111159214B (en) API access method and device, electronic equipment and storage medium
KR100906449B1 (en) Database tool identifying apparatus and method thereof

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