A method and apparatus for intelligent index recommendation in airborne database management
By training a classifier using a Naive Bayes model in the airborne database and recommending the optimal indexing method, the problem of low query efficiency in traditional airborne databases is solved, query efficiency is improved and design costs are reduced, and efficient database management is achieved.
Patent Information
- Application Number
- CN202211411062.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2042-11-11
AI Technical Summary
Traditional airborne databases have low query efficiency, which cannot meet the requirements of real-time performance and reliability, and increases the cost and technical threshold of software design and analysis.
A Naive Bayes model is used to train the classifier, and the optimal indexing method is recommended using the feature attributes of the onboard database. The method is continuously updated and improved through K-fold cross-validation. The recommendation device includes a storage module, a training module, and a recommendation module. It combines the database itself and application attributes to recommend the optimal indexing method.
It improves the query efficiency of airborne databases, lowers the technical threshold for database management designers, reduces software design and analysis costs, and enhances the efficiency of database solution design.
Smart Images

Figure CN115905222B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of airborne database technology, specifically relating to an intelligent index recommendation method and apparatus for airborne database management. Background Technology
[0002] In addition to possessing the general properties of databases (atomicity, consistency, independence, and durability), airborne databases must also meet real-time and reliability requirements. Traditional airborne embedded databases involve numerous time-consuming operations during operation, such as file read / write, data querying, computation, and exchange. As a crucial source of data for various aircraft systems, real-time and efficient querying of airborne databases is essential for the control of flight operations and the correct execution of flight missions.
[0003] Therefore, research on intelligent index recommendation methods and devices for airborne database management can lower the technical threshold for database designers, reduce software design and analysis costs, and significantly improve the efficiency of database solution design. This has important engineering significance and practical value for improving the inherent security of airborne systems. Summary of the Invention
[0004] This invention provides an intelligent index recommendation method and apparatus for airborne database management, which lowers the technical threshold for database designers, reduces software design and analysis costs, and significantly improves the efficiency of database solution design.
[0005] This invention provides, in one aspect, an intelligent index recommendation method for airborne database management, comprising:
[0006] Obtain the characteristic attributes of the database; the characteristic attributes include: database intrinsic attributes and database application attributes;
[0007] The database's feature attributes are used as input to the trained classifier to obtain the database's recommended indexing method.
[0008] The trained classifier is obtained by training the training samples using a Naive Bayes model.
[0009] Optionally, the method further includes:
[0010] After detecting that a user has modified the recommended indexing method of the database, the database and the modified indexing method are added as new samples to the training samples;
[0011] Using the K-fold cross-validation method and the updated training samples, a Naive Bayes model is used to train the latest classifier.
[0012] Optionally, the database itself includes at least one of the following attributes:
[0013] Number of database rows, number of database columns, and database storage method.
[0014] Optionally, the database application attributes include at least one of the following:
[0015] Application scenarios, equality queries, range queries, union queries, nearest-neighbor queries, source of index columns, and data types of index columns;
[0016] The application scenarios include: query only, multiple queries, other, and uncertain operations;
[0017] Equality queries include: no equality query, single-condition equality query, equality query with 2 conditions, equality query with 3 conditions, equality query with 4 conditions, equality query with 5 conditions, and equality query with 6 or more conditions.
[0018] Range queries include: no range query, single-condition range query, range query with 2 conditions, range query with 3 conditions, range query with 4 conditions, range query with 5 conditions, and range query with 6 or more conditions.
[0019] Union queries include: queries with unions and queries without unions;
[0020] Nearest search queries include: those with a nearest search function and those without a nearest search function.
[0021] The sources of indexed columns include: raw data, generated data, and data from uncertain sources;
[0022] The data types of the indexed columns include: char, int, float, double, text, image, and bit.
[0023] Optionally, the indexing method shall include at least one of the following:
[0024] Sequential query, hash index, balanced binary tree index, B / B+ tree index, T / T* tree index, R-tree index, and KD-tree index.
[0025] Another aspect of the present invention provides an intelligent index recommendation device for airborne database management, comprising: a storage module, a training module, and a recommendation module;
[0026] The recommendation module is used to obtain the feature attributes of the database; and to obtain the recommendation indexing method of the database by using the feature attributes of the database as input to the trained classifier.
[0027] The feature attributes include: database self-attributes and database application attributes; the trained classifier is trained by the training module using training samples stored in the storage module and trained using a Naive Bayes model.
[0028] Optionally, the storage module is further configured to add the database and the modified index method as new samples to the training samples after detecting that a user has modified the recommended index method of the database.
[0029] The training module is also used to train the latest classifier using the updated training samples and the K-fold cross-validation method with a Naive Bayes model.
[0030] Optionally, the database itself includes at least one of the following attributes:
[0031] Number of database rows, number of database columns, and database storage method.
[0032] Optionally, the database application attributes include at least one of the following:
[0033] Application scenarios, equality queries, range queries, union queries, nearest-neighbor queries, source of index columns, and data types of index columns;
[0034] The application scenarios include: query only, multiple queries, other, and uncertain operations;
[0035] Equality queries include: no equality query, single-condition equality query, equality query with 2 conditions, equality query with 3 conditions, equality query with 4 conditions, equality query with 5 conditions, and equality query with 6 or more conditions.
[0036] Range queries include: no range query, single-condition range query, range query with 2 conditions, range query with 3 conditions, range query with 4 conditions, range query with 5 conditions, and range query with 6 or more conditions.
[0037] Union queries include: queries with unions and queries without unions;
[0038] Nearest search queries include: those with a nearest search function and those without a nearest search function.
[0039] The sources of indexed columns include: raw data, generated data, and data from uncertain sources;
[0040] The data types of the indexed columns include: char, int, float, double, text, image, and bit.
[0041] Optionally, the indexing method shall include at least one of the following:
[0042] Sequential query, hash index, balanced binary tree index, B / B+ tree index, T / T* tree index, R-tree index, and KD-tree index.
[0043] This invention provides an intelligent index recommendation method and apparatus for airborne database management. To address the high real-time requirements of airborne database data retrieval, but the low query efficiency of traditional sequential queries or binary tree index queries, this invention uses airborne database index design data from different scenarios as samples. It employs a Naive Bayes model to mine the correlation between airborne database scenario features and the selection of the database index. Based on this correlation, it recommends the optimal indexing method for different airborne database application scenario features, establishes the database index, improves airborne database query efficiency, and enhances the mission support capabilities of the aircraft flight management system. This invention lowers the technical threshold for database management designers, reduces software design and analysis costs, and significantly improves the efficiency of database solution design. Attached Figure Description
[0044] Figure 1 A structural diagram of the intelligent index recommendation device for airborne database management provided by the present invention;
[0045] Figure 2 A flowchart of the intelligent index recommendation method for airborne database management provided by the present invention. Detailed Implementation
[0046] The method and apparatus for accessing non-volatile memory areas during the startup of aviation software provided by the present invention will be explained below with reference to the accompanying drawings.
[0047] Figure 1 A structural diagram of the intelligent index recommendation device for airborne database management provided by the present invention is shown below. Figure 1 The intelligent index recommendation device of the present invention includes: a storage module, a training module, and a recommendation module;
[0048] The inventive device includes the following parts, such as Figure 1 As shown:
[0049] 1. Storage Module: Primarily used to store training data and perform data processing. It collects real samples from various airborne databases, extracts sample attributes based on database attributes and application scenarios, and performs data preprocessing.
[0050] 2. Training Module: For the data samples, the K-fold cross-validation method is used to divide the data into training and test sets. The Naive Bayes model is used to train the training set and the test set is used for validation to obtain the trained classifier. The parameters of the classifier are then stored.
[0051] 3. Recommendation Module: Based on the trained classifier model, the new airborne database attributes are processed and input into the classifier. This recommendation module will recommend the optimal database index.
[0052] Optionally, the optimal database index recommended by this method will be directly input into the data management module of the database management system. The functions of this data management module are as follows:
[0053] Data Management Module: Based on the optimal database indexes recommended by this method and the recommendation module, software designers finalize the database indexes according to the actual situation. Based on the finalized indexes and the database attribute file, database index code is generated for use by various systems on the machine.
[0054] Optionally, the onboard database feature attributes (sample attributes) and indexes (sample labels) will be added as new samples to the storage module of this method to expand the training data scale and improve the accuracy of the classifier in the training module.
[0055] The specific steps of this invention are as follows, such as... Figure 2 As shown:
[0056] Step 1. Collect the corresponding airborne database samples.
[0057] The samples are all derived from database applications in real airborne systems.
[0058] The sample features are different database attributes and application types. The sample labels are the actual index selections, including sequential queries, hash indexes, balanced binary tree indexes, B / B+ tree indexes, T / T* tree indexes, R-tree indexes, and KD-tree indexes.
[0059] Step 2. Select feature attributes based on the real-world applications of the airborne database in the field.
[0060] Sample feature attributes include database-specific attributes and database application attributes.
[0061] The database's own attributes include the number of database rows (default no more than 100,000), the number of database columns (no more than 20), and the database storage method (memory, disk, uncertain);
[0062] Database application attributes include application scenarios (query only, multiple queries, other, uncertain), equality queries (no equality query, single-condition equality query, equality query with 2 conditions, equality query with 3 conditions, equality query with 4 conditions, equality query with 5 conditions, equality query with 6 or more conditions), range queries (no range query, single-condition range query, range query with 2 conditions, range query with 3 conditions, range query with 4 conditions, range query with 5 conditions, range query with 6 or more conditions), join queries (with join queries, without join queries), proximity queries (with proximity queries, without proximity queries), index column source (original data, generated data, uncertain), and index column data type (char, int, float, double, text, image, bit).
[0063] Step 3. Process the collected data, including handling zero values and filtering the types and numbers of data samples to prevent imbalanced samples. Divide the data into training and test sets.
[0064] Data processing includes processing data that exceeds the range, such as taking the value 100,000 if the number of rows in the database is greater than 100,000.
[0065] For certain uncertain attributes, such as queries that do exist but have an uncertain number of query conditions, they should be treated as single-condition queries. Index sources and index data types should also be treated as uncertain.
[0066] The training and test sets are divided using an N-fold cross-validation method. Initially, the samples are split into N subsets. One subset is reserved for model validation, while the other N-1 subsets are used for training. Cross-validation is repeated N times (steps 4-7), validating each subset once. The results from the N cross-validations are averaged to obtain the final validation result. Here, we choose N=5, initializing with 5 subsets and repeating cross-validation 5 times.
[0067] Let the training set be T = {(x1,y1),(x2,y2),…,(x...} N ,y N Let there be N samples, where x represents a sample feature and y represents a sample label. The joint probability distribution P(X,Y) is learned using the training set.
[0068] Step 4. Calculate the probability P(C) of each class attribute. k );
[0069] Learning the prior probability distribution P(Y=C) k ), k = 1, 2, ... K, where K = 7.
[0070] Step 5. Calculate the conditional probability P(X|C) for each feature attribute.k );
[0071] Conditional probability calculation:
[0072] P(X=x|Y=C k )=P(X (1) =x (1) ,…,X (n) =x (n) |Y=C k )
[0073] All characteristic conditions in this method are independent and identically distributed.
[0074] Assume x (j) The possible values are s j If there are m features and k categories, then the number of parameters is
[0075] Step 6. Calculate the conditional probability P(X|C) for each test sample. k )P(C k );
[0076] Given the learned P(X,Y), calculate the posterior probability distribution.
[0077]
[0078] Step 7. Select the class of the maximum value as the category to which X belongs;
[0079] Obtain the Naive Bayes classifier:
[0080]
[0081] For any C k The denominators are all the same, that is
[0082]
[0083] Step 8. Recommend the optimal database index for the new airborne database and specific application. For new airborne databases that require a recommended index type, extract the features of the new database according to the sample attributes (features) in Step 2, and construct test samples.
[0084] The test samples are input into the classifier to obtain the recommended airborne database index, which is then sent to the airborne database management system platform.
[0085] Step 9. In the airborne database management system platform, software designers select appropriate indexes based on recommended indexes and actual database applications. The system will then generate relevant database application index codes for use on the aircraft.
[0086] Optionally, the final database index selection determined in the airborne database management system will also be fed back to the storage module of the intelligent index recommendation system and stored as a real airborne navigation database sample.
[0087] This data is used for subsequent database training, enabling the system to have self-learning capabilities, continuously improving the sample database, and enhancing the recommendation capabilities of the recommendation module.
[0088] This method selects a specific indexing method, which, compared with traditional sequential queries and binary tree queries, specifically improves the query efficiency of the airborne navigation database and enhances the mission support capabilities of the aircraft flight management system.
[0089] This method is the first to use relevant features (sample attributes) and index selection (sample labels) data from real airborne navigation databases to study database index recommendation methods.
[0090] For example, the correspondence between database features obtained using the index recommendation method provided by this invention and seven recommended indexes is shown in Table 1 below.
[0091] Table 1. Correspondence between Database Features and Recommendation Index
[0092]
[0093] It is understandable that this table is derived from the results of the onboard database management intelligent index recommendation device. Different database index selections should still be obtained according to the classifier described in steps 1-7 above, and cannot be based solely on this table.
[0094] For example, according to the present invention, the sequential query index is suitable for databases with fewer than 30 rows of data, stored in an in-memory database, and can be used for equality queries, range queries, and union queries.
[0095] Hash indexes are suitable for database applications where the query type is equality lookup;
[0096] Balanced binary tree indexes are suitable for scenarios where the storage method is in-memory database, the application type is equality query, and the index column data type is numeric, character, or string data;
[0097] B-tree and B+ tree indexes are suitable for database applications involving equality queries and range queries, where the indexed columns are numeric, character, or string data types.
[0098] T-tree and T*tree indexes are suitable for scenarios where the storage method is an in-memory database, the application type is equality query and range query, and the data type of the index column is numeric, character, and string data.
[0099] R-tree indexes are suitable for database applications involving equality queries, range queries, union queries, and proximity queries (an application unique to airborne navigation databases), and for index columns containing numeric and character data.
[0100] KD-tree indexes are suitable for scenarios where the storage method is an in-memory database, the application type is equality query, union query and proximity query, and the data type of the index column is numeric and character data.
[0101] For example, this method uses airborne database index design data from different scenarios as samples, employs a Naive Bayes model to mine the correlation between airborne database scenario features and the selection of the database index, and based on this correlation, recommends the optimal indexing method for different airborne database application scenario features, establishes the database index, improves airborne database query efficiency, and enhances the mission support capabilities of the aircraft flight management system. This invention lowers the technical threshold for database management designers, reduces software design and analysis costs, and significantly improves the efficiency of database solution design.
Claims
1. A smart index recommendation method for airborne database management, characterized in that, include: Retrieve the characteristic attributes of the database; The characteristic attributes include: database inherent attributes and database application attributes; The database's feature attributes are used as input to the trained classifier to obtain the database's recommended indexing method. Based on the finalized index and database attribute files, generate database index code for use by various systems on the machine; The trained classifier is obtained by training the training samples using a Naive Bayes model. The database itself includes at least one of the following attributes: Number of database rows, number of database columns, and database storage method; The database application attribute includes at least one of the following: Application scenarios, equality queries, range queries, union queries, nearest-neighbor queries, source of index columns, and data types of index columns; The application scenarios include: query only, multiple queries, other, and uncertain operations; Equality queries include: no equality query, single-condition equality query, equality query with 2 conditions, equality query with 3 conditions, equality query with 4 conditions, equality query with 5 conditions, and equality query with 6 or more conditions. Range queries include: no range query, single-condition range query, range query with 2 conditions, range query with 3 conditions, range query with 4 conditions, range query with 5 conditions, and range query with 6 or more conditions.
2. The method according to claim 1, characterized in that, The method further includes: After detecting that a user has modified the recommended indexing method of the database, the database and the modified indexing method are added as new samples to the training samples; Using the K-fold cross-validation method and the updated training samples, a Naive Bayes model is used to train the latest classifier.
3. The method according to claim 1, characterized in that, The database application attribute includes at least one of the following: Union queries include: queries with unions and queries without unions; Nearest search queries include: those with a nearest search function and those without a nearest search function. The sources of indexed columns include: raw data, generated data, and data from uncertain sources; The data types of the indexed columns include: char, int, float, double, text, image, and bit.
4. The method according to claim 1, characterized in that, The indexing method must include at least one of the following: Sequential query, hash index, balanced binary tree index, B / B+ tree index, T / T* tree index, R-tree index, and KD-tree index.
5. An intelligent index recommendation device for airborne database management, characterized in that, include: Storage module, training module, and recommendation module; The recommendation module is used to obtain the feature attributes of the database; The database's feature attributes are used as input to the trained classifier to obtain the database's recommended indexing method. Based on the finalized index and database attribute files, generate database index code for use by various systems on the machine; The feature attributes include: database self-attributes and database application attributes; the trained classifier is obtained by training the training samples stored in the storage module using the Naive Bayes model; The database itself includes at least one of the following attributes: Number of database rows, number of database columns, and database storage method; The database application attribute includes at least one of the following: Application scenarios, equality queries, range queries, union queries, nearest-neighbor queries, source of index columns, and data types of index columns; The application scenarios include: query only, multiple queries, other, and uncertain operations; Equality queries include: no equality query, single-condition equality query, equality query with 2 conditions, equality query with 3 conditions, equality query with 4 conditions, equality query with 5 conditions, and equality query with 6 or more conditions. Range queries include: no range query, single-condition range query, range query with 2 conditions, range query with 3 conditions, range query with 4 conditions, range query with 5 conditions, and range query with 6 or more conditions.
6. The apparatus according to claim 5, characterized in that, The storage module is also used to add the database and the modified index method as new samples to the training samples after detecting that a user has modified the recommended index method of the database. The training module is also used to train the latest classifier using the updated training samples and the K-fold cross-validation method with a Naive Bayes model.
7. The apparatus according to claim 5, characterized in that, The database application attribute includes at least one of the following: Union queries include: queries with unions and queries without unions; Nearest search queries include: those with a nearest search function and those without a nearest search function. The sources of indexed columns include: raw data, generated data, and data from uncertain sources; The data types of the indexed columns include: char, int, float, double, text, image, and bit.
8. The apparatus according to claim 5, characterized in that, The indexing method must include at least one of the following: Sequential query, hash index, balanced binary tree index, B / B+ tree index, T / T* tree index, R-tree index, and KD-tree index.
Citation Information
Patent Citations
Multi-load-oriented cloud database secondary index automatic recommendation method and system
CN113360497A
Index recommendation method and device
CN113568888A