CN111190897B - Information processing method, information processing apparatus, storage medium, and server - Google Patents
Information processing method, information processing apparatus, storage medium, and server Download PDFInfo
- Publication number
- CN111190897B CN111190897B CN201911080345.1A CN201911080345A CN111190897B CN 111190897 B CN111190897 B CN 111190897B CN 201911080345 A CN201911080345 A CN 201911080345A CN 111190897 B CN111190897 B CN 111190897B
- Authority
- CN
- China
- Prior art keywords
- evaluation value
- value set
- information
- deviation
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the application discloses an information processing method, an information processing device, a storage medium and a server. The method comprises the following steps: calculating the discrimination evaluation value of each index when a plurality of indexes based on the database inquire the current sampling data in the database to obtain a current evaluation value set; acquiring difference information of a current evaluation value set and an initial evaluation value set; and when the difference information does not meet the preset condition, acquiring a standard evaluation value set, and determining the index statistical information of the database according to the initial evaluation value set, the current evaluation value set and the standard evaluation value set. According to the scheme, a verification mechanism is introduced, so that when the discrimination of the indexes in the database is subjected to large deviation in the front-back statistics, the final decision result is closer to the real condition, and the accuracy of index statistical information is improved; and the wrong execution plan is not adopted due to the change of the evaluation value, so that the execution efficiency of the database statement is improved.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to an information processing method, an information processing apparatus, a storage medium, and a server.
Background
In a database, an index is a separate, physical storage structure that orders values of one or more columns in a database table. It is a list of logical pointers to one or more sets of values in columns of a table and corresponding pages of data in the table that physically identify the values, and is a decentralized storage structure created to speed up the retrieval of rows of data in the table.
In the related art, index statistical information is calculated by periodically resampling. Multiple data pages in the index are randomly sampled at a time and statistics for the entire index are estimated from the data in the multiple data pages. However, since the index statistics are obtained by random sampling, the randomness thereof easily causes a large deviation between the index statistics and the actual data, and further affects the selection of the index mode. For example, selecting the index incorrectly results in slow statement execution and large resource consumption of the system, which causes business risk.
Disclosure of Invention
The embodiment of the application provides an information processing method, an information processing device, a storage medium and a server, which can improve the accuracy of index statistical information in a database.
The embodiment of the application provides an information processing method, which comprises the following steps:
calculating the discrimination evaluation value of each index when a plurality of indexes based on a database query the current sampling data in the database to obtain a current evaluation value set;
obtaining difference information of the current evaluation value set and an initial evaluation value set, wherein the initial evaluation value set comprises: when historical sampling data in the database are queried based on the plurality of indexes, the discrimination evaluation value of each index is obtained;
when the difference information does not meet the preset condition, acquiring a standard evaluation value set, wherein the standard evaluation value set comprises: when all data in a standby database corresponding to the database are queried based on the indexes, the discrimination evaluation value of each index is obtained;
and determining index statistical information of the database according to the initial evaluation value set, the current evaluation value set and the standard evaluation value set.
Correspondingly, an embodiment of the present application further provides an information processing apparatus, including:
the device comprises a calculation unit, a storage unit and a judgment unit, wherein the calculation unit is used for calculating the discrimination evaluation value of each index when a plurality of indexes based on a database inquire the current sampling data in the database to obtain a current evaluation value set;
a first obtaining unit, configured to obtain difference information between the current evaluation value set and an initial evaluation value set, where the initial evaluation value set includes: when historical sampling data in the database are inquired based on the indexes, the discrimination evaluation value of each index is evaluated;
a second obtaining unit, configured to obtain a standard evaluation value set when the difference information does not satisfy a preset condition, where the initial standard evaluation value set includes: when all data in a standby database corresponding to the database are queried based on the indexes, the discrimination evaluation value of each index is obtained;
and the processing unit is used for determining the index statistical information of the database according to the initial evaluation value set, the current evaluation value set and the standard evaluation value set.
Accordingly, the present application further provides a computer-readable storage medium, where the storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to perform the steps in the information processing method.
Accordingly, embodiments of the present application further provide a server, which includes a memory, a processor and a computer program stored in the memory and executable on the processor, where the processor executes the steps in the information processing method described above.
According to the scheme, when the current sampling data in the database is queried by calculating a plurality of indexes based on the database, the discrimination evaluation value of each index is calculated to obtain a current evaluation value set, and the difference information between the current evaluation value set and the initial evaluation value set is obtained. And when the difference information does not meet the preset condition, acquiring a standard evaluation value set, and determining the index statistical information of the database according to the initial evaluation value set, the current evaluation value set and the standard evaluation value set. According to the scheme, a verification mechanism is introduced, so that when the discrimination evaluation value of the database is subjected to large deviation in the front-back statistics, the final decision result is closer to the real condition, and the accuracy of index statistical information is improved; and the wrong execution plan can not be adopted due to the change of the evaluation value, so that the efficiency of executing the database query statement is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of an information processing method according to an embodiment of the present disclosure.
Fig. 2 is another schematic flow chart of an information processing method according to an embodiment of the present application.
Fig. 3 is an application flowchart of an information processing method provided in an embodiment of the present application.
Fig. 4 is a schematic structural diagram of an information processing apparatus according to an embodiment of the present application.
Fig. 5 is another schematic structural diagram of an information processing apparatus according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides an information processing method, an information processing device, a storage medium and a server, which can improve the accuracy of video risk assessment and the efficiency of video auditing and publishing. The following are detailed below. The order of the following examples is not intended to limit the preferred order of the examples.
In an embodiment, description will be made in terms of integration of the information processing apparatus in a server.
Referring to fig. 1, fig. 1 is a schematic flow chart of an information processing method according to an embodiment of the present disclosure. The specific flow of the information processing method may be as follows:
101. and calculating the discrimination evaluation value of each index when the current sampling data in the database is queried based on a plurality of indexes of the database to obtain a current evaluation value set.
The database is a warehouse for storing data, and can store millions, millions and billions of data. The database does not store data randomly, and has certain storage rules, otherwise, the efficiency of querying the data is low. In a database, an index is a separate, physical storage structure that orders values of one or more columns in a database table. It is a list of logical pointers to one or more sets of values in a table and corresponding pages of data in the table that physically identify the values, and is a decentralized storage structure created to speed up the retrieval of rows of data in the table.
In order to ensure the efficiency of data query, the database is provided with a plurality of indexes. Each index in the database has a different degree of distinction, which can be understood as how many different values are in the field. For example, if a value of a gender field includes male and female, the degree of distinction is 2; if the value of an age field includes 1 to 100, the degree of distinction is 100. It can be seen that the distinction between the age fields is higher than the distinction between the gender fields. The different discrimination determines the speed of locating the required data by the query statement when searching data based on the index, and the higher the discrimination is, the faster the query speed is.
The query of data in the database based on different indexes will bring corresponding execution cost. In practical application, the execution cost may be a general term of CPU/IO resources consumed by the query statement during the execution process, indexes with different execution costs are different when more CPU/IO resources are consumed, for the same query statement, the execution cost of each execution plan may be calculated by the database optimizer, and a final execution plan may be selected according to the size of the execution cost. Wherein the database optimizer is a component for query statements to execute a plan in a database.
In practical application, a unified analysis model can be established to quantify the cost of executing each operation of the plan. Within the model, the costs of various operations can be quantified and have a uniform unit of estimation. Taking an Oracle database as an example, the main consumption of query statement execution is CPU resources and IO resources. Therefore, the cost of the CPU and the IO is calculated correctly, and the execution cost of the whole database under the execution plan corresponding to different indexes can be estimated correctly.
The calculation result of the execution cost depends on the index statistical information, which is an evaluation value of the discrimination of the index. Therefore, in this embodiment, when the current sample data is queried based on the index of the database, the discrimination evaluation value of each index can be estimated from the related data obtained by screening the policy information carried in the query statement.
In particular, the Query statement may be Structured Query Language (SQL), which is a database Query and programming Language for accessing data and querying, updating, and managing a relational database system. That is, in some embodiments, the current sample data corresponds to structured query information, which at least includes: first node information and second node information. The step of calculating the discrimination evaluation value of each index when the current sample data in the database is queried based on the plurality of indexes of the database may include the following processes:
(11) Acquiring a plurality of data pages from a database based on a plurality of indexes of the database and first node information;
(12) Determining current sampling data from a plurality of data pages based on the second node information;
(13) And calculating the discrimination evaluation value according to the total amount of the data lines in the plurality of data pages and the number of the data lines of the current sampling data.
The first node information and the second node information are as follows: and inquiring the key word information of the current sampling data carried in the inquiry statement. For example, if a user is queried based on the index k1 and "age-gender" is used as the structured information, then "age" is the first node information and "gender" is the second node information; based on the index k2, a user is queried, and the 'gender-age' is used as the structured information for query, so that the 'gender' is the first node information, and the 'age' is the second node information.
In specific implementation, assuming that one index is selected, a plurality of data pages are obtained based on the current query statement and the first node information carried in the query statement. Then, a deduplication operation is performed, and relevant data, namely current sampling data, is screened out from the plurality of pieces of data in the plurality of data pages based on the second node information.
In this embodiment, when calculating the discrimination evaluation value, a ratio between the total amount of data lines (i.e. data records) in the plurality of data pages and the data line amount of the finally screened current sample data may be calculated as the discrimination evaluation value of the index. And taking the obtained difference degree evaluation values of other indexes as a reference, thereby obtaining the current evaluation value set.
In practical application, in order to avoid the disadvantage caused by the randomness of sampling, sampling evaluation can be performed based on different query statements to obtain a plurality of evaluation values of the same index under different query statements. And weighting the plurality of evaluation values to obtain weighted evaluation values, and using the weighted evaluation values as discrimination evaluation values of the index.
In this embodiment, a periodic resampling mode may be adopted, and the discrimination evaluation value of each index in the database may be re-estimated every preset time period.
102. Obtaining difference information of a current evaluation value set and an initial evaluation value set, wherein the initial evaluation value set comprises: when historical sampling data in a database is queried based on a plurality of indexes, the discrimination evaluation value of each index is evaluated.
The initial evaluation value set is a discrimination evaluation value set of each index in the current index statistical information of the database, and the initial evaluation value set is an evaluation value set determined after comparing the index statistical information after the discrimination evaluation value of each index of the database is re-evaluated last time. Specifically, the discrimination evaluation value may be an updated discrimination evaluation value after the previous re-estimation, or may be an original non-updated discrimination evaluation value. Specifically, which value is determined based on the actual alignment result after the last re-estimation.
Note that, the calculation method of the discrimination evaluation value in the initial evaluation value set is the same as the calculation method of the discrimination evaluation value in the current evaluation value set. The structured query information may be different due to the randomness of the sampling.
In some embodiments, the step of "obtaining difference information between the current evaluation value set and the initial evaluation value set" may include the following procedures:
(21) Respectively calculating the deviation degree of the discrimination evaluation value of each index in the current evaluation value set and the initial evaluation value set to obtain a first deviation value and a second deviation value;
(22) A difference between the first deviation value and the second deviation value is acquired as difference information.
In practical applications, since the data in the database may be updated at irregular time, and normal index statistics may be affected when large data update occurs, the index statistics need to be recalculated periodically to ensure that the correct index is selected. However, when the data in the database is not changed much, since the data is sampled at the time of re-estimation, the difference between the statistical information of the previous and subsequent times may be too large, which results in a large variation range of the evaluation result of the implementation cost.
For the same query statement, for each index execution plan of the database, the database optimizer (i.e., a component for executing the plan by the query statement in the database) calculates the execution cost of the index execution plan, and selects the scheme with the smallest execution cost to execute. Therefore, if the index statistics are not stable, the correct selection of the final index will be affected.
Therefore, in the present embodiment, the purpose is to ensure the stability of the index statistical information, that is, to keep the difference between the discrimination evaluation values of the plurality of indexes in the database stable, and ensure that the execution efficiency of each index is kept stable, so that the execution cost when the indexes are selected under different query statements is kept stable, and it is ensured that the best index is selected.
Specifically, the first deviation value is a deviation value between elements (i.e., discrimination evaluation values) in the current evaluation value set, and the second deviation value is a deviation value between elements (i.e., discrimination evaluation values) in the initial evaluation value set. In the present embodiment, the difference between the first deviation value and the second deviation value is calculated as the difference information between the two sets. And determining the stability of the discrimination evaluation values of the two indexes before and after according to the size of the difference information.
In some embodiments, the first deviation value and the second deviation value may be standard deviation values or variance values, which may reflect the degree of dispersion between the evaluation values in the current evaluation value set and the initial evaluation value set. If the difference of the discrete degrees between the two is small, it indicates that the discrimination evaluation value obtained by the previous and subsequent statistics is relatively stable, otherwise, it indicates that the discrimination evaluation value obtained by the previous and subsequent statistics is unstable.
103. When the difference information does not meet the preset condition, acquiring a standard evaluation value set, wherein the standard evaluation value set comprises: and when all the data in the standby database corresponding to the database are inquired based on the plurality of indexes, the discrimination evaluation value of each index is obtained.
In some embodiments, when the difference between the first deviation value and the second deviation value is greater than the preset value, it indicates that the difference between the current evaluation value and the discrete degree of the element in the initial evaluation value set is large, that is, the discrimination evaluation values obtained by twice statistics before and after are unstable, and it may be determined that the difference information does not satisfy the preset condition. When the difference value between the first deviation value and the second deviation value is smaller than or equal to a preset value, the difference between the discrete degrees of the elements in the current evaluation value and the initial evaluation value set is smaller, namely, the discrimination evaluation values obtained by two times of statistics are more stable, and at this time, it can be determined that the difference information meets the preset condition.
The preset value can be set by a data developer or a maintainer, the value of the preset value is within a reasonable range, and when the difference information is within the range, the discrimination evaluation value of the index in the database is kept stable to a certain extent.
Specifically, when the difference information does not satisfy the preset condition, it is considered that the evaluation value has a serious deviation, and at this time, accurate discrimination evaluation value statistics is initiated once. In practical applications, the accurate statistical process may use an online backup database (hot backup database or cold backup database) to perform the discrimination evaluation value statistics, so as to avoid that normal service operations are affected by the execution in the service master database.
It should be noted that the data of the backup database and the data structure of the service master database (i.e., the database in this application) need to be consistent. In specific implementation, the sampled data pages in the standby database can be set to be infinite, so that when a statistical algorithm is used for fetching the data pages, all the data pages of all indexes in the standby database can be traversed to obtain the accurate data row number and the discrimination evaluation value (namely, the standard evaluation value set) of each index. The obtained discrimination evaluation value in the standard evaluation value set can directly reflect the actual discrimination information of each index in the service master library (i.e. the database in the application).
104. And determining the index statistical information of the database according to the initial evaluation value set, the current evaluation value set and the standard evaluation value set.
Specifically, the more accurate statistical information in the previous and subsequent two statistics can be determined by comparing the difference between the initial evaluation value set and the standard evaluation value set and the difference between the current evaluation value set and the standard evaluation value set. In this embodiment, there may be a plurality of ways to determine the difference, for example, more accurate statistical information may be determined by comparing the difference of the distributed discrete degrees. Referring to fig. 2, in some embodiments, the step of "determining index statistics of the database from the initial evaluation value set, the current evaluation value set, and the standard evaluation value set" may include the following processes:
1041. calculating the deviation degrees of a plurality of evaluation values in the initial evaluation value set to obtain a first deviation value;
1042. calculating the deviation degrees of a plurality of evaluation values in the current evaluation value set to obtain a second deviation value;
1043. calculating the deviation degrees of a plurality of evaluation values in the standard evaluation value set to obtain a third deviation value;
1044. and determining index statistical information of the database according to the first deviation value, the second deviation value and the third deviation value.
The deviation degree may be a discrete degree of each element in the set, and the deviation value, i.e., a quantitative representation of the deviation degree. In particular, whether to update the index statistical information of the database may be determined based on the calculated relationship between the deviation values of the three.
In practical applications, the first deviation value, the second deviation value and the third deviation value may be variance values, or the first deviation value, the second deviation value and the third deviation value may be standard deviation values.
In some embodiments, when determining the index statistics of the database according to the first deviation value, the second deviation value, and the third deviation value, the following operations may be performed:
obtaining a difference value between the first deviation value and the third deviation value to obtain a first difference value;
obtaining a difference value between the second deviation value and the third deviation value to obtain a second difference value;
determining a target evaluation value set from the initial evaluation value set and the current evaluation value set according to the first difference value and the second difference value;
and determining index statistical information of the database based on each evaluation value in the target evaluation value set and the corresponding index thereof.
In some embodiments, when the first difference is larger than the second difference, indicating that the second deviation value is closer to the third deviation value, that is, the current evaluation value set is closer to the degree of dispersion of the elements in the standard evaluation value set, the current evaluation value set may be determined as the target evaluation value set. When the first difference is less than or equal to the second difference, indicating that the first deviation value is closer to the third deviation value, i.e., the initial evaluation value set is closer to the degree of dispersion of the elements in the standard evaluation value set, the initial evaluation value set may be determined as the target evaluation value set.
Specifically, the index statistical information is substantially determined based on the discrimination evaluation value of the index. Therefore, in determining the index statistical information, it may be obtained based on the calculated discrimination evaluation value of the index. When the difference between the current statistical information and the last statistical information is large (that is, the difference information does not satisfy the preset condition), it is necessary to determine whether the current index statistical information needs to be updated.
In some embodiments, when determining the index statistical information of the database based on the current evaluation value set and the index corresponding to the current evaluation value set, the index statistical information of the plurality of indexes of the database may be specifically updated based on each evaluation value in the current evaluation value set and the index corresponding to the evaluation value.
In practical application, the current index statistical information can be regarded as the initial evaluation value set to some extent, and the essence of the scheme is to determine whether the relationship between each evaluation value in the initial evaluation value set in the index statistical information and the corresponding index needs to be updated to the relationship between each evaluation value in the current evaluation value set and the corresponding index.
In some embodiments, when the difference information satisfies the preset condition, it indicates that the difference between the previous statistical value and the next statistical value is small, and at this time, the index statistical information of the database may be updated based on each evaluation value and its corresponding index in the current evaluation value set.
According to the information processing method provided by the embodiment of the application, when the current sampling data in the database is queried based on a plurality of indexes of the database, the discrimination evaluation value of each index is calculated to obtain the current evaluation value set, and the difference information between the current evaluation value set and the initial evaluation value set is obtained. And when the difference information does not meet the preset condition, acquiring a standard evaluation value set, and determining the index statistical information of the database according to the initial evaluation value set, the current evaluation value set and the standard evaluation value set. According to the scheme, a verification mechanism is introduced, so that when the discrimination evaluation value of the database is subjected to large deviation in the front-back statistics, the final decision result is closer to the real condition, and the accuracy of index statistical information is improved; and the wrong execution plan cannot be adopted due to the change of the evaluation value, so that the execution efficiency of the database statement is improved.
Next, the information processing method in the present application will be described in detail by taking a specific database D as an example. Referring to fig. 3, fig. 3 is a flowchart illustrating an application of an information processing method according to an embodiment of the present application.
Specifically, the row number R of the table T is defined in the database D, and the table T is provided with K indexes. Assuming that the index discrimination evaluation values are S1 Sk, a set { S1, S2, …, sk } is defined after statistical evaluation, and the standard deviation X0 of the set is calculated.
Specifically, when it is detected that the statistical information of the index of the database D needs to be estimated again, a plurality of data pages in the table T are randomly sampled based on a preset structured query statement (such as an SQL statement), and deduplication processing is performed to screen out finally required sample data from the obtained several sample data pages. For example, if the index K1 is selected, and a total of a data line records in the data page sampled by the index K1 and b data line records after deduplication, the discrimination evaluation value of the index K1 can be obtained as S1, where S1= a/b.
After re-estimating the discrimination evaluation value each time, a new standard deviation X1 is obtained according to the above method.
And calculating an absolute value T of the difference between X1 and X0, and when T exceeds a preset value T', considering that the discrimination evaluation value has serious deviation, and initiating one-time accurate discrimination evaluation value statistics.
The accurate statistical process may use an online hot standby database, or a cold standby database, which is collectively referred to as Slave. It should be noted that in this embodiment, it is necessary to keep the Slave consistent with the data and data structure of the service master library (i.e., database D), and make accurate statistics on the table T on the Salve. When the data page is read, all data pages of all indexes of the table T can be traversed, and an accurate data line number R and index discrimination evaluation values S1 to Sk are obtained. And calculating the standard deviation X2 of the accurate data set according to the method.
Finally, the magnitudes of | X2-X0| and | X2-X1| are compared, i.e., it is determined which value of X0 and X1X 2 is closer to. If the X2 is closer to the X0, the X1 is considered to be inaccurate, and the service master library keeps the current index statistical information unchanged; if X2 is closer to X1, then X0 is considered to be inaccurate, and the service master library updates the current index statistical information. Thereby maintaining the stability of the index statistics.
It should be noted that, in this embodiment, each time index statistical information is re-estimated, if the difference between the estimation result and the last estimation value is too large, accurate statistics will be initiated by using the standby database.
In order to better implement the information processing method provided by the embodiment of the present application, an embodiment of the present application further provides a device based on the information processing method. The terms are the same as those in the above-described information processing method, and details of implementation may refer to the description in the method embodiment.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an information processing apparatus according to an embodiment of the present disclosure. Wherein the information processing apparatus 400 may be integrated in a server. The information processing apparatus 400 may include a calculating unit 401, a first obtaining unit 402, a second obtaining unit 403, and a processing unit 404, and may specifically be as follows:
a calculating unit 401, configured to calculate a discrimination evaluation value of each index when querying current sample data in a database based on multiple indexes of the database, so as to obtain a current evaluation value set;
a first obtaining unit 402, configured to obtain difference information between the current evaluation value set and an initial evaluation value set, where the initial evaluation value set includes: when historical sampling data in the database are inquired based on the indexes, the discrimination evaluation value of each index is evaluated;
a second obtaining unit 403, configured to obtain a set of initial standard evaluation values when the difference information does not satisfy a preset condition, where the set of initial standard evaluation values includes: when all data in a standby database corresponding to the database are queried based on the indexes, the discrimination evaluation value of each index is obtained;
a processing unit 404, configured to determine index statistical information of the database according to the initial evaluation value set, the current evaluation value set, and the standard evaluation value set.
In some embodiments, the current sample data corresponds to query structure information, and the query structure information includes: first node information and second node information; the computing unit 401 may specifically be configured to:
acquiring a plurality of data pages from a database based on a plurality of indexes of the database and the first node information;
determining the current sample data from the plurality of data pages based on the second node information;
and calculating the discrimination evaluation value according to the total amount of the data lines in the plurality of data pages and the number of the data lines of the current sampling data.
Referring to fig. 5, in some embodiments, processing unit 404 may include:
a computing subunit 4041 operable to:
calculating the deviation degrees of a plurality of evaluation values in the initial evaluation value set to obtain a first deviation value; calculating the deviation degrees of a plurality of evaluation values in the current evaluation value set to obtain a second deviation value; calculating the deviation degrees of a plurality of evaluation values in the standard evaluation value set to obtain a third deviation value;
determining subunit 4042, configured to determine, according to the first deviation value, the second deviation value, and the third deviation value, index statistical information of the database.
In some embodiments, the determining sub-unit 4042 may be configured to:
obtaining a difference value between the first deviation value and the third deviation value to obtain a first difference value;
obtaining a difference value between the second deviation value and the third deviation value to obtain a second difference value;
determining a target evaluation value set from the initial evaluation value set and the current evaluation value set according to the first difference value and the second difference value;
and determining index statistical information of the database based on each evaluation value in the target evaluation value set and the index corresponding to the evaluation value.
In some embodiments, the determining sub-unit 4042 may be further configured to:
when the first difference value is larger than the second difference value, determining that the current evaluation value set is a target evaluation value set;
when the first difference is less than or equal to the second difference, determining the initial evaluation value set as a target evaluation value set.
In some embodiments, the first deviation value, the second deviation value and the third deviation value are variance values, or the first deviation value, the second deviation value and the third deviation value are standard deviation values.
In some embodiments, the first obtaining unit 402 may be configured to:
respectively calculating the deviation degree of the discrimination evaluation value of each index in the current evaluation value set and the initial evaluation value set to obtain a first deviation value and a second deviation value;
acquiring a difference value between the first deviation value and the second deviation value as the difference information.
With continued reference to fig. 5, in some embodiments, the information processing apparatus 400 may further include:
a first determining unit 405, configured to determine that the difference information does not satisfy a preset condition when the difference is greater than a preset value; and when the difference value is smaller than or equal to the preset value, determining that the difference information meets a preset condition.
With continued reference to fig. 5, in some embodiments, the information processing apparatus 400 may further include:
a second determining unit 406, configured to determine, when the difference information satisfies a preset condition, index statistical information of the database based on each evaluation value in the current evaluation value set and an index corresponding to the evaluation value.
In some embodiments, the second determining unit 406 may specifically be configured to:
and updating index statistical information of a plurality of indexes of the database based on each evaluation value in the current evaluation value set and the corresponding index thereof.
The information processing device provided by the embodiment of the application obtains a current evaluation value set by calculating the discrimination evaluation value of each index when a plurality of indexes based on a database query the current sampling data in the database; acquiring difference information of a current evaluation value set and an initial evaluation value set; acquiring a standard evaluation value set when the difference information does not meet a preset condition, wherein the standard evaluation value set comprises: when the data in the database is inquired based on the indexes, the discrimination evaluation value of each index is obtained; and determining the index statistical information of the database according to the initial evaluation value set, the current evaluation value set and the standard evaluation value set. According to the scheme, a verification mechanism is introduced, so that when the discrimination evaluation value of the database is subjected to large deviation in the front-back statistics, the final decision result is closer to the real condition, and the accuracy of index statistical information is improved; and the wrong execution plan is not adopted due to the change of the evaluation value, so that the execution efficiency of the database statement is improved.
The embodiment of the application further provides a server. As shown in fig. 6, the server may include components such as a Radio Frequency (RF) circuit 601, a memory 602 including one or more computer-readable storage media, an input unit 603, a display unit 604, a sensor 605, an audio circuit 606, a Wireless Fidelity (WiFi) module 607, a processor 608 including one or more processing cores, and a power supply 609. Those skilled in the art will appreciate that the server architecture shown in FIG. 6 is not meant to be limiting, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 601 may be used for receiving and transmitting signals during the process of transmitting and receiving information, and in particular, for receiving downlink information of a base station and then processing the received downlink information by the one or more processors 608; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuit 601 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuitry 601 may also communicate with networks and other devices via wireless communications.
The memory 602 may be used to store software programs and modules, and the processor 608 executes various functional applications and information processing by operating the software programs and modules stored in the memory 602. The memory 602 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like. Further, the memory 602 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 608 and the input unit 603 access to the memory 602.
The input unit 603 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in one particular embodiment, input unit 603 may include a touch-sensitive surface as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations by a user (e.g., operations by a user on or near the touch-sensitive surface using a finger, a stylus, or any other suitable object or attachment) thereon or nearby, and drive the corresponding connection device according to a predetermined program. The input unit 603 may include other input devices in addition to the touch-sensitive surface. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 604 may be used to display information input by or provided to the user and various graphical user interfaces of the server, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 604 may include a Display panel, and optionally, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay the display panel, and when a touch operation is detected on or near the touch-sensitive surface, the touch operation is transmitted to the processor 608 to determine the type of touch event, and the processor 608 then provides a corresponding visual output on the display panel according to the type of touch event. Although in FIG. 6 the touch sensitive surface and the display panel are implemented as two separate components for input and output functions, in some embodiments the touch sensitive surface may be integrated with the display panel for input and output functions.
The server may also include at least one sensor 605, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that turns off the display panel and/or the backlight when the server moves to the ear.
WiFi belongs to short distance wireless transmission technology, and the server can help the user send and receive e-mail, browse web page and access streaming media etc. through WiFi module 607, it provides wireless broadband internet access for the user. Although fig. 6 shows the WiFi module 607, it is understood that it does not belong to the essential constitution of the server, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 608 is a control center of the server, connects various parts of the entire handset by using various interfaces and lines, performs various functions of the server and processes data by operating or executing software programs and/or modules stored in the memory 602 and calling data stored in the memory 602, thereby integrally monitoring the handset. Optionally, processor 608 may include one or more processing cores; preferably, the processor 608 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 608.
The server also includes a power supply 609 (e.g., a battery) for powering the various components, which may preferably be logically connected to the processor 608 via a power management system, such that the power management system may manage charging, discharging, and power consumption. The power supply 609 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Specifically, in this embodiment, the processor 608 in the server loads the executable file corresponding to the process of one or more application programs into the memory 602 according to the following instructions, and the processor 608 runs the application programs stored in the memory 602, so as to implement various functions:
calculating the discrimination evaluation value of each index when a plurality of indexes based on a database query the current sampling data in the database to obtain a current evaluation value set;
obtaining difference information of the current evaluation value set and an initial evaluation value set, wherein the initial evaluation value set comprises: when historical sampling data in the database are queried based on the plurality of indexes, the discrimination evaluation value of each index is obtained;
when the difference information does not meet the preset condition, acquiring a standard evaluation value set, wherein the standard evaluation value set comprises: when all data in a standby database corresponding to the database are queried based on the indexes, the discrimination evaluation value of each index is obtained;
and determining index statistical information of the database according to the initial evaluation value set, the current evaluation value set and the standard evaluation value set.
According to the server provided by the embodiment of the application, by introducing a verification mechanism, when the discrimination evaluation value of the database is subjected to large deviation in the front-back statistics, the final decision result is closer to the real situation, and the accuracy of index statistical information is improved; and the wrong execution plan is not adopted due to the change of the evaluation value, so that the execution efficiency of the database statement is improved.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any one of the information processing methods provided in the embodiments of the present application. For example, the instructions may perform the steps of:
calculating the discrimination evaluation value of each index when a plurality of indexes based on a database query the current sampling data in the database to obtain a current evaluation value set;
obtaining difference information of the current evaluation value set and an initial evaluation value set, wherein the initial evaluation value set comprises: when historical sampling data in the database are inquired based on the indexes, the discrimination evaluation value of each index is evaluated;
when the difference information does not meet the preset condition, acquiring a standard evaluation value set, wherein the standard evaluation value set comprises: when all data in a standby database corresponding to the database are queried based on the indexes, the discrimination evaluation value of each index is obtained;
and determining index statistical information of the database according to the initial evaluation value set, the current evaluation value set and the standard evaluation value set.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium can execute the steps in any information processing method provided in the embodiments of the present application, beneficial effects that can be achieved by any information processing method provided in the embodiments of the present application can be achieved, and detailed descriptions are omitted here for the foregoing embodiments.
The information processing method, apparatus, storage medium, and server provided in the embodiments of the present application are described in detail above, and a specific example is applied in the present application to explain the principles and embodiments of the present application, and the description of the above embodiments is only used to help understand the method and core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (13)
1. An information processing method characterized by comprising:
determining current structured query information, the structured query information comprising at least: first node information and second node information, the first node information and the second node information being: the key word information of the current sampling data is inquired and carried in the inquiry statement;
acquiring a plurality of data pages from a database based on a plurality of indexes of the database and the first node information;
determining the current sample data from the plurality of data pages based on the second node information;
calculating the discrimination evaluation value of each index according to the total data lines in the multiple data pages and the number of the data lines of the current sampling data to obtain a current evaluation value set;
obtaining difference information of the current evaluation value set and an initial evaluation value set, wherein the initial evaluation value set comprises: when historical sampling data in the database are inquired based on the indexes, the discrimination evaluation value of each index is evaluated;
when the difference information does not meet the preset condition, acquiring a standard evaluation value set, wherein the standard evaluation value set comprises: when all data in a standby database corresponding to the database are queried based on the indexes, the discrimination evaluation value of each index is obtained;
and determining index statistical information of the database according to the initial evaluation value set, the current evaluation value set and the standard evaluation value set.
2. The information processing method of claim 1, wherein determining index statistics of the database from the initial evaluation value set, the current evaluation value set, and the standard evaluation value set comprises:
calculating the deviation degrees of a plurality of evaluation values in the initial evaluation value set to obtain a first deviation value;
calculating the deviation degrees of a plurality of evaluation values in the current evaluation value set to obtain a second deviation value;
calculating the deviation degrees of a plurality of evaluation values in the standard evaluation value set to obtain a third deviation value;
and determining index statistical information of the database according to the first deviation value, the second deviation value and the third deviation value.
3. The information processing method of claim 2, wherein determining the index statistics of the database based on the first deviation value, the second deviation value, and the third deviation value comprises:
obtaining a difference value between the first deviation value and the third deviation value to obtain a first difference value;
obtaining a difference value between the second deviation value and the third deviation value to obtain a second difference value;
determining a target evaluation value set from the initial evaluation value set and the current evaluation value set according to the first difference value and the second difference value;
and determining index statistical information of the database based on each evaluation value in the target evaluation value set and the index corresponding to the evaluation value.
4. The information processing method according to claim 3, wherein determining a target evaluation value set from the initial evaluation value set and the current evaluation value set based on a first difference value and a second difference value comprises:
when the first difference value is larger than the second difference value, determining that the current evaluation value set is a target evaluation value set;
when the first difference is less than or equal to the second difference, determining the initial evaluation value set as a target evaluation value set.
5. The information processing method according to claim 2, wherein the first deviation value, the second deviation value, and the third deviation value are variance values, or the first deviation value, the second deviation value, and the third deviation value are standard deviation values.
6. The information processing method according to claim 1, wherein acquiring disparity information of the current evaluation value set and an initial evaluation value set comprises:
respectively calculating the deviation degree of the discrimination evaluation value of each index in the current evaluation value set and the initial evaluation value set to obtain a first deviation value and a second deviation value;
acquiring a difference value between the first deviation value and the second deviation value as the difference information.
7. The information processing method according to claim 6, wherein when the difference is larger than a preset value, it is determined that the difference information does not satisfy a preset condition; and when the difference value is smaller than or equal to the preset value, determining that the difference information meets a preset condition.
8. The information processing method according to claim 1, further comprising:
and when the difference information meets a preset condition, determining index statistical information of the database based on each evaluation value in the current evaluation value set and the corresponding index thereof.
9. The information processing method of claim 8, wherein determining index statistics of the database based on each evaluation value in the current set of evaluation values and its corresponding index comprises:
and updating index statistical information of a plurality of indexes of the database based on each evaluation value in the current evaluation value set and the corresponding index thereof.
10. An information processing apparatus characterized by comprising:
a computing unit, configured to determine current structured query information, where the structured query information at least includes: first node information and second node information, the first node information and the second node information being: the key word information of the current sampling data is inquired and carried in the inquiry statement; acquiring a plurality of data pages from a database based on a plurality of indexes of the database and the first node information; determining the current sample data from the plurality of data pages based on the second node information; calculating the discrimination evaluation value of each index according to the total amount of the data lines in the plurality of data pages and the number of the data lines of the current sampling data to obtain a current evaluation value set;
a first obtaining unit, configured to obtain difference information between the current evaluation value set and an initial evaluation value set, where the initial evaluation value set includes: when historical sampling data in the database are inquired based on the indexes, the discrimination evaluation value of each index is evaluated;
a second obtaining unit, configured to obtain a standard evaluation value set when the difference information does not satisfy a preset condition, where the standard evaluation value set includes: when all data in a standby database corresponding to the database are queried based on the indexes, the discrimination evaluation value of each index is obtained;
and the processing unit is used for determining the index statistical information of the database according to the initial evaluation value set, the current evaluation value set and the standard evaluation value set.
11. The information processing apparatus according to claim 10, wherein the processing unit includes:
the calculating subunit is used for calculating the deviation degrees of a plurality of evaluation values in the initial evaluation value set to obtain a first deviation value; calculating the deviation degrees of a plurality of evaluation values in the current evaluation value set to obtain a second deviation value; calculating the deviation degrees of a plurality of evaluation values in the standard evaluation value set to obtain a third deviation value;
and the determining subunit is used for determining the index statistical information of the database according to the first deviation value, the second deviation value and the third deviation value.
12. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the information processing method according to any one of claims 1 to 9.
13. A server comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor performing the steps of the information processing method according to any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911080345.1A CN111190897B (en) | 2019-11-07 | 2019-11-07 | Information processing method, information processing apparatus, storage medium, and server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911080345.1A CN111190897B (en) | 2019-11-07 | 2019-11-07 | Information processing method, information processing apparatus, storage medium, and server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111190897A CN111190897A (en) | 2020-05-22 |
CN111190897B true CN111190897B (en) | 2023-04-18 |
Family
ID=70709120
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911080345.1A Active CN111190897B (en) | 2019-11-07 | 2019-11-07 | Information processing method, information processing apparatus, storage medium, and server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111190897B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112069175B (en) * | 2020-08-25 | 2024-03-29 | 北京五八信息技术有限公司 | Data query method and device and electronic equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6363371B1 (en) * | 1999-06-29 | 2002-03-26 | Microsoft Corporation | Identifying essential statistics for query optimization for databases |
CN109241093A (en) * | 2017-06-30 | 2019-01-18 | 华为技术有限公司 | A kind of method of data query, relevant apparatus and Database Systems |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8161038B2 (en) * | 2004-10-29 | 2012-04-17 | International Business Machines Corporation | Maintain optimal query performance by presenting differences between access plans |
CN103390066B (en) * | 2013-08-08 | 2016-02-17 | 上海新炬网络信息技术有限公司 | A kind of database overall automation optimizes prior-warning device and disposal route thereof |
CN104714984A (en) * | 2013-12-17 | 2015-06-17 | 中国移动通信集团湖南有限公司 | Database optimization method and device |
CN104182540B (en) * | 2014-09-03 | 2017-10-27 | 北京国双科技有限公司 | Index statistical information processing method and processing device in data warehouse |
US10459933B2 (en) * | 2015-09-16 | 2019-10-29 | International Business Machines Corporation | Identification and elimination of non-essential statistics for query optimization |
US11048701B2 (en) * | 2016-09-13 | 2021-06-29 | International Business Machines Corporation | Query optimization in hybrid DBMS |
CN110019218B (en) * | 2017-12-08 | 2023-08-25 | 阿里巴巴集团控股有限公司 | Data storage and query method and equipment |
CN108664635B (en) * | 2018-05-15 | 2020-12-04 | 上海达梦数据库有限公司 | Method, device, equipment and storage medium for acquiring database statistical information |
CN109408515A (en) * | 2018-11-01 | 2019-03-01 | 郑州云海信息技术有限公司 | A kind of index execution method and apparatus |
-
2019
- 2019-11-07 CN CN201911080345.1A patent/CN111190897B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6363371B1 (en) * | 1999-06-29 | 2002-03-26 | Microsoft Corporation | Identifying essential statistics for query optimization for databases |
CN109241093A (en) * | 2017-06-30 | 2019-01-18 | 华为技术有限公司 | A kind of method of data query, relevant apparatus and Database Systems |
Non-Patent Citations (2)
Title |
---|
Ohad Inbar.Graphical Representation of Statistical Information in Situations of Judgment and Decision-Making.ACM.2007,第265-268页. * |
颜勋等.内嵌式空间数据库优化器代价评估框架及实现.《武汉大学学报》.2011,第36卷(第6期),第726-730页. * |
Also Published As
Publication number | Publication date |
---|---|
CN111190897A (en) | 2020-05-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10908920B2 (en) | Method for preloading application, computer readable storage medium, and terminal device | |
EP3502880B1 (en) | Method for preloading application, storage medium, and terminal device | |
CN109947496B (en) | Application program preloading method and device, storage medium and mobile terminal | |
EP3502879B1 (en) | Method for preloading application, storage medium, and terminal device | |
CN107704070B (en) | Application cleaning method and device, storage medium and electronic equipment | |
CN113420051B (en) | Data query method and device, electronic equipment and storage medium | |
WO2022161325A1 (en) | Prompting method and electronic device | |
CN109240991B (en) | File recommendation method and device, storage medium and intelligent terminal | |
CN108595483B (en) | Data processing method and related device | |
WO2024148870A1 (en) | Frequency modulation method and apparatus, electronic device and readable storage medium | |
CN106502833B (en) | Data backup method and device | |
CN107807730B (en) | Using method for cleaning, device, storage medium and electronic equipment | |
CN111311014B (en) | Service data processing method, device, computer equipment and storage medium | |
CN114840565A (en) | Sampling query method, device, electronic equipment and computer readable storage medium | |
CN111190897B (en) | Information processing method, information processing apparatus, storage medium, and server | |
CN111314177B (en) | Work and rest time period identification method based on wireless signals and related device | |
CN117688104B (en) | Request processing method, request processing device, electronic equipment and storage medium | |
KR102343848B1 (en) | Method and operating device for searching conversion strategy using user status vector | |
CN113419795B (en) | Call relation display method and device, computer equipment and storage medium | |
CN118797118A (en) | Data screening method, device, equipment and medium | |
CN107958041B (en) | Data storage method, device, server and readable storage medium | |
CN115062875A (en) | Stock quantity prediction method, stock quantity prediction device, storage medium and electronic equipment | |
CN116126245A (en) | Data dynamic storage method and device, electronic equipment and storage medium | |
CN113378035A (en) | Label management method, label management device, server and computer storage medium | |
CN117234137A (en) | MCU clock frequency switching circuit, MCU and electronic equipment |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20231010 Address after: 100086 Beijing Haidian District Zhichun Road 49 No. 3 West 309 Patentee after: TENCENT CLOUD COMPUTING (BEIJING) Co.,Ltd. Address before: 518057 Tencent Building, No. 1 High-tech Zone, Nanshan District, Shenzhen City, Guangdong Province, 35 floors Patentee before: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd. |
|
TR01 | Transfer of patent right |