A storage engine determination method and device, electronic equipment and storage medium

By calculating the cluster center similarity between the target business and the preset business groups, a suitable storage engine is automatically selected, which solves the problem of the tedious and time-consuming process of determining the storage engine, improves efficiency and adapts to changes in the volume of business data.

CN116303354BActive Publication Date: 2026-03-31BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-10
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

The process of determining the storage engine in existing technologies is cumbersome and time-consuming, resulting in high time and labor costs and low efficiency.

Method used

By obtaining the data volume and data type of the target business, the similarity with the cluster centers of the preset business groups is calculated, thereby determining a suitable storage engine from multiple storage engines. The storage engine is selected based on the similarity of the cluster centers and the changes in the data volume.

Benefits of technology

It reduces time and labor costs, improves the efficiency of storage engine selection, and ensures that the selected storage engine can adapt to changes in the data volume of the target business and meet the needs of business development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116303354B_ABST
    Figure CN116303354B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a storage engine determination method and device, electronic equipment and storage medium, obtain a target data magnitude and a target data type of service data generated by a target service; based on the target data magnitude and the target data type, calculate the similarity between the target service and the clustering centers of a plurality of preset service groups; the plurality of service groups are obtained by clustering each sample service based on the storage engine corresponding to each sample service, the data magnitude and the data type of the service data generated by the sample service; the similarity between one sample service and the clustering center in the service group to which the sample service belongs is greater than the similarity between the sample service and the clustering center in other service groups; from the plurality of storage engines, determine the first storage engine corresponding to the service group to which the clustering center belongs and satisfying a preset condition in terms of the similarity with the target service; and determine the target storage engine corresponding to the target service based on the first storage engine, which can improve the efficiency of determining the storage engine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for determining a storage engine. Background Technology

[0002] A storage engine refers to the storage technology used to store data in a database. Different storage engines use different storage mechanisms, indexing methods, and data structures. Different databases have different storage engines. For example, MySQL (MyStructured Query Language) databases use storage engines such as Memory and BDB (Berkeley Database), while ClickHouse databases use storage engines such as Ordinary and Dictionary. When developers are developing business logic, they need to determine the storage engine corresponding to the business logic. After determining the storage engine, business logic data generated by the business logic can be stored in the corresponding database using that storage engine. Subsequently, business logic data can also be retrieved from the corresponding database using that storage engine.

[0003] In related technologies, technical personnel evaluate and analyze the business requirements, and select the appropriate storage engine based on the functionalities needed. This evaluation and analysis process is cumbersome and time-consuming. Therefore, determining the storage engine in these technologies requires significant time and manpower, resulting in low efficiency. Summary of the Invention

[0004] The purpose of this invention is to provide a storage engine determination method, apparatus, electronic device, and storage medium to improve the efficiency of storage engine determination. The specific technical solution is as follows:

[0005] In a first aspect of the present invention, a method for determining a storage engine is provided, the method comprising:

[0006] Obtain the target data volume and target data type of the business data generated by the target business;

[0007] Based on the target data volume and the target data type, the similarity between the target service and the cluster centers of multiple preset service groups is calculated; wherein, different service groups correspond to different storage engines; the multiple service groups are obtained by clustering each sample service based on the storage engine corresponding to each sample service, the data volume of the service data generated by the sample service, and the data type; the similarity between a sample service and the cluster centers in its own service group is greater than the similarity between the sample service and the cluster centers in other service groups;

[0008] From multiple storage engines, determine the storage engine corresponding to the business group to which the cluster center with similarity to the target business meets the preset conditions, and use it as the first storage engine;

[0009] Based on the first storage engine, determine the target storage engine corresponding to the target service.

[0010] Optionally, the target data volume and target data type of the business data generated by the target business include:

[0011] Based on the configuration information of the target service, determine the target data type of the service data generated by the target service;

[0012] From the structured query language (SQL) execution plan of the target business, obtain the parameter values ​​of the Number Rows field and the Data Size field to obtain the target data volume of the business data generated by the target business.

[0013] Optionally, calculating the similarity between the target service and the cluster centers of a preset set of service groups based on the target data volume and the target data type includes:

[0014] Based on the target data volume and the target data type, generate the feature vector of the target service as the target feature vector;

[0015] For each business group, based on the data volume and data type of the cluster centers of that business group, a feature vector of the cluster centers is generated and used as a sample feature vector.

[0016] Calculate the similarity between the target feature vector and the sample feature vector of the cluster center of the business group to obtain the similarity between the target business and the cluster center of the business group.

[0017] Optionally, determining the storage engine corresponding to the business group to which the cluster center with similarity to the target business meets preset conditions from the plurality of storage engines, and designating it as the first storage engine, includes:

[0018] From the plurality of storage engines, determine the storage engine corresponding to the business group to which the cluster center with a similarity greater than a similarity threshold to the target business belongs, and use it as the first storage engine;

[0019] or,

[0020] Based on the order of similarity to the target business from highest to lowest, the storage engines corresponding to the business groups to which the first preset number of cluster centers belong are determined from the plurality of storage engines and are used as the first storage engines.

[0021] Optionally, before determining the target storage engine corresponding to the target service based on the first storage engine, the method further includes:

[0022] From the plurality of storage engines, a storage engine that supports the target data volume is determined as the second storage engine;

[0023] The step of determining the target storage engine corresponding to the target service based on the first storage engine includes:

[0024] The target storage engine corresponding to the target service is determined from the same storage engines in the first and second storage engines.

[0025] Optionally, determining the target storage engine corresponding to the target service from the same storage engines in the first and second storage engines includes:

[0026] When there is one identical storage engine in the first storage engine and the second storage engine, that storage engine is determined to be the target storage engine corresponding to the target service;

[0027] When there are multiple identical storage engines in the first and second storage engines, the target storage engine corresponding to the target service is determined from among these multiple storage engines.

[0028] In a second aspect of the invention, a storage engine determination apparatus is also provided, the apparatus comprising:

[0029] The acquisition module is used to acquire the target data volume and target data type of the business data generated by the target business.

[0030] The first determining module is used to calculate the similarity between the target service and the cluster centers of a plurality of preset service groups based on the target data volume and the target data type; wherein, different service groups correspond to different storage engines; the plurality of service groups are obtained by clustering each sample service based on the storage engine corresponding to each sample service, the data volume and data type of the service data generated by the sample service; the similarity between a sample service and the cluster centers in its own service group is greater than the similarity between the sample service and the cluster centers in other service groups;

[0031] The selection module is used to determine, from multiple storage engines, the storage engine corresponding to the business group to which the cluster center with similarity to the target business meets the preset conditions, and to select the first storage engine.

[0032] The second determining module is used to determine the target storage engine corresponding to the target service based on the first storage engine.

[0033] Optionally, the acquisition module is specifically used to determine the target data type of the business data generated by the target business based on the configuration information of the target business;

[0034] From the structured query language (SQL) execution plan of the target business, obtain the parameter values ​​of the Number Rows field and the Data Size field to obtain the target data volume of the business data generated by the target business.

[0035] Optionally, the first determining module is specifically used to generate a feature vector of the target service based on the target data volume and the target data type, as the target feature vector;

[0036] For each business group, based on the data volume and data type of the cluster centers of that business group, a feature vector of the cluster centers is generated and used as a sample feature vector.

[0037] Calculate the similarity between the target feature vector and the sample feature vector of the cluster center of the business group to obtain the similarity between the target business and the cluster center of the business group.

[0038] Optionally, the selection module is specifically used to determine, from the plurality of storage engines, the storage engine corresponding to the business group to which the cluster center of the target business belongs, and to which the similarity is greater than the similarity threshold, as the first storage engine;

[0039] or,

[0040] Based on the order of similarity to the target business from highest to lowest, the storage engines corresponding to the business groups to which the first preset number of cluster centers belong are determined from the plurality of storage engines and are used as the first storage engines.

[0041] Optionally, the device further includes:

[0042] The third determining module is used to determine, before the second determining module executes the determination of the target storage engine corresponding to the target service based on the first storage engine, the storage engine that supports the target data volume from the plurality of storage engines and serves as the second storage engine.

[0043] The second determining module is specifically used to determine the target storage engine corresponding to the target service from the same storage engines in the first and second storage engines.

[0044] Optionally, the second determining module is specifically used to determine that when there is one identical storage engine in the first storage engine and the second storage engine, the storage engine is the target storage engine corresponding to the target service;

[0045] When there are multiple identical storage engines in the first and second storage engines, the target storage engine corresponding to the target service is determined from among these multiple storage engines.

[0046] In another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and the computer program, when executed by a processor, implements any of the storage engine determination methods described above.

[0047] In another aspect of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the storage engine determination methods described above.

[0048] This invention provides a storage engine determination method, which involves: obtaining the target data volume and target data type of the business data generated by a target business; calculating the similarity between the target business and the cluster centers of multiple preset business groups based on the target data volume and target data type; different business groups corresponding to different storage engines; the multiple business groups being obtained by clustering each sample business based on the storage engine corresponding to each sample business, the data volume and data type of the business data generated by the sample business; a sample business having a greater similarity to the cluster centers in its own business group than the sample business having a greater similarity to the cluster centers in other business groups; determining the storage engine corresponding to the business group to which the cluster center with a similarity to the target business satisfies the preset conditions from the multiple storage engines, and using it as the first storage engine; and determining the target storage engine corresponding to the target business based on the first storage engine.

[0049] Based on the above processing, the target storage engine can be determined according to the target data volume and data type of the target business, eliminating the need for technical personnel to evaluate and analyze the business, reducing time and labor costs, and improving the efficiency of determining the storage engine. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.

[0051] Figure 1 This is a flowchart of the first storage engine determination method provided in the embodiments of the present invention;

[0052] Figure 2This is a flowchart of the second storage engine determination method provided in this embodiment of the invention;

[0053] Figure 3 This is a flowchart of the third storage engine determination method provided in this embodiment of the invention;

[0054] Figure 4 This is a flowchart of the fourth storage engine determination method provided in this embodiment of the invention;

[0055] Figure 5 This is a structural diagram of a storage engine determination device provided in an embodiment of the present invention;

[0056] Figure 6 This is a structural diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0057] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention.

[0058] In related technologies, technical personnel evaluate and analyze the business needs, selecting the appropriate storage engine based on the required functionalities. However, as the business grows, the volume of data generated may increase significantly, potentially rendering the initially chosen storage engine inadequate for the current data volume. Furthermore, the evaluation and analysis process by technical personnel is cumbersome and time-consuming. Therefore, determining the storage engine in these technologies requires substantial time and manpower, resulting in low efficiency.

[0059] To address the aforementioned problems, embodiments of the present invention provide a storage engine determination method. This method is applied to an electronic device, which can be a server. The electronic device can acquire the target data volume and target data type of the business data generated by the target business. Based on the target data volume and target data type, it calculates the similarity between the target business and the cluster centers of multiple preset business groups. From the multiple storage engines, it determines the first storage engine corresponding to the business group to which the cluster center whose similarity to the target business meets preset conditions is located. Furthermore, based on the first storage engine, it determines the target storage engine corresponding to the target business.

[0060] Based on the above processing, the target storage engine can be determined according to the target data volume and data type of the target business. This eliminates the need for technical personnel to evaluate and analyze the business, reducing time and labor costs and improving the efficiency of storage engine selection. Furthermore, the similarity between the sample business and the target business meets preset conditions, indicating that the data volume changes of the target business and the sample business are quite similar during their development. The storage engine corresponding to the sample business is selected based on the changes in data volume during the sample business's development. If the storage engine corresponding to the sample business can adapt to the development of the sample business, then the first storage engine can adapt to the development of the target business. Therefore, the target storage engine determined based on the first storage engine can also adapt to the development of the target business, meaning that the target storage engine can support the data volume of the target business at different stages and meet the development needs of the target business.

[0061] See Figure 1 , Figure 1 A flowchart of a storage engine determination method provided in an embodiment of the present invention, the method may include the following steps:

[0062] S101: Obtain the target data volume and target data type of the business data generated by the target business.

[0063] S102: Based on the target data volume and target data type, calculate the similarity between the target business and the cluster centers of multiple preset business groups.

[0064] Different business groups correspond to different storage engines; multiple business groups are obtained by clustering each sample business based on the storage engine corresponding to each sample business, the data volume and data type of the business data generated by the sample business; the similarity between a sample business and the cluster center in its business group is greater than the similarity between the sample business and the cluster centers in other business groups.

[0065] S103: From multiple storage engines, determine the storage engine corresponding to the business group to which the cluster center with similarity to the target business meets the preset conditions, and use it as the first storage engine.

[0066] S104: Based on the first storage engine, determine the target storage engine corresponding to the target service.

[0067] Based on the storage engine determination method provided in this invention, the target storage engine can be determined according to the target data volume and data type of the target business. This eliminates the need for technical personnel to evaluate and analyze the business, reducing time and labor costs and improving the efficiency of storage engine determination. Furthermore, if the similarity between the sample business and the target business meets a preset condition, it indicates that the data volume changes of the target business and the sample business are quite similar during their development. Since the storage engine corresponding to the sample business is selected based on the data volume changes during its development, and the storage engine corresponding to the sample business can adapt to the development of the sample business, then the first storage engine can adapt to the development of the target business. Therefore, the target storage engine determined based on the first storage engine can also adapt to the development of the target business, meaning that the target storage engine can support the data volume of the target business at different stages and meet the development needs of the target business.

[0068] Regarding step S101, the target service can be any service provided by the electronic device, such as a video service. When acquiring the target data volume and target data type of the service data generated by the target service, the electronic device can also acquire the functional requirements of the target service.

[0069] The functional requirements of the target business are: the functions that the database used to store the business data generated by the target business (which can be called target business data) needs to support.

[0070] The target business data refers to the data generated during the operation of the target business. The target data volume indicates the size of the target business data. The target data type indicates the type of the target business data.

[0071] For example, if the target service is a video service, and users upload videos to their electronic devices when using this service, then the target service data could include: the target service's operation logs, and the target service's business information. The business information includes: user information of the users who uploaded videos, records of user-uploaded videos, and the videos uploaded by the users.

[0072] Accordingly, if the target business data includes: the operation logs of the target business and the records of user-uploaded videos, then the target data type is an aggregate type; if the target business data includes: user information of users who upload videos and the videos uploaded by users, then the target data type is a detail type.

[0073] If a user needs to be able to query the records of videos uploaded by a user within a certain period of time, the database needs to support list query functionality; if a user needs to be able to query which videos have been uploaded, the database needs to support detailed query functionality.

[0074] In some embodiments, Figure 1Based on this, see Figure 2 Step S101 may include the following steps:

[0075] S1011: Based on the configuration information of the target service, determine the target data type of the business data generated by the target service.

[0076] S1012: Obtain the parameter values ​​of the Number Rows field and the DataSize field from the SQL execution plan of the target business to get the target data volume of the business data generated by the target business.

[0077] The configuration information of the target service is configured by technical personnel during the development of the target service. This configuration information records the functions the target service provides to users and the business data involved. Therefore, electronic devices can obtain the configuration information of the target service and, based on the functions provided to users recorded in the configuration information, determine the target functional requirements of the target service; and, based on the business data involved in the target service recorded in the configuration information, determine the target data type of the target business data generated by the target service.

[0078] The SQL (Structured Query Language) execution plan for the target business is as follows: the execution rules of the SQL statements for the target business, such as the execution order of the SQL statements, which SQL statements use indexes, and which SQL statements perform full table scans during the execution of the SQL statements.

[0079] The SQL statement for the target business is a programming language used to store and retrieve the target business data generated by the target business.

[0080] The electronic device can acquire the SQL statement of the target business and process it using the Explain function to obtain the SQL execution plan. Then, from the Output section of the SQL execution plan, it retrieves the value of the Number Rows field, which represents the number of rows in the data table used to store the target business data. The electronic device also retrieves the value of the Data Size field from the SQL execution plan, which represents the number of columns in each row of the data table. Finally, based on the values ​​of the Number Rows and Data Size fields, it determines the target data volume of the target business data generated.

[0081] Regarding step S102, the storage engine refers to the storage technology used to store data in the database. Different storage engines use different storage mechanisms, indexing methods, and data structures. Different databases have different storage engines. For example, the storage engines for MySQL (My Structured Query Language) include Memory and BDB (Berkeley Database), while the storage engines for ClickHouse include Ordinary and Dictionary. The storage engines for Druid include the Kylin storage engine.

[0082] A sample service refers to a service developed by technical personnel over a historical period. The storage engine corresponding to a sample service is the database storage engine used to store the business data generated by that sample service. The storage engine for a sample service is selected based on the changes in the data volume during the sample service's development.

[0083] The multiple business groups are obtained by clustering each sample business based on the storage engine corresponding to each sample business, the data volume and data type of the business data generated by the sample business.

[0084] In one implementation, for each sample service, the electronic device generates a feature vector for that sample service based on the storage engine corresponding to that sample service, the data volume and data type of the service data generated by the sample service.

[0085] In another implementation, the electronic device can also obtain the functional requirements of the sample service. Then, the electronic device can generate the feature vector of the sample service based on the storage engine, functional requirements, data volume and data type of the service data generated by the sample service.

[0086] Furthermore, electronic devices can cluster each sample service based on k-means (k-means clustering algorithm) and the feature vectors of each sample service to obtain multiple service groups.

[0087] A sample service has a higher similarity to the cluster centers within its own service group than it has to the cluster centers within other service groups. Different service groups correspond to different storage engines, while sample services within a single service group share the same storage engine.

[0088] In some embodiments, Figure 1 Based on this, see Figure 3Step S102 may include the following steps:

[0089] S1021: Based on the target data volume and target data type, generate the feature vector of the target business as the target feature vector.

[0090] S1022: For each business group, based on the data volume and data type of the cluster center of the business group, generate the feature vector of the cluster center of the business group as the sample feature vector.

[0091] S1023: Calculate the similarity between the target feature vector and the sample feature vector of the cluster center of the business group to obtain the similarity between the target business and the cluster center of the business group.

[0092] Electronic devices can generate target feature vectors for target services based on the storage engine corresponding to the target service, the data volume and data type of the business data generated by the target service.

[0093] Alternatively, electronic devices can generate target feature vectors for the target business based on the target functional requirements, target data volume, and target data type of the target business.

[0094] For example, electronic devices can use the word2vec (word to vector) algorithm to process the target functional requirements, target data volume, and target data type of the target business to obtain the target feature vector of the target business.

[0095] For each service group, the electronic device generates a sample feature vector of the cluster center of the service group based on the data volume and data type of the cluster center.

[0096] Alternatively, the electronic device can generate sample feature vectors for the cluster centers of the business group based on the functional requirements, data volume, and data type of the cluster centers.

[0097] For example, electronic devices can use the word2vec algorithm to process the functional requirements, data volume, and data type of the cluster centers of the business group to obtain the sample feature vector of the cluster centers of the business group.

[0098] Furthermore, the electronic device calculates the similarity between the target feature vector and the sample feature vector of the cluster center of the service group based on a preset similarity algorithm, thereby obtaining the similarity between the target service and the cluster center of the service group. The preset similarity algorithm can be cosine similarity algorithm or Euclidean distance, etc.

[0099] Based on the above processing, a selection case for each storage engine chosen within a historical time period is stored in the database. Each selection case is a single sample data point used for cluster analysis. Then, by combining these historical sample business storage engine selection cases, cluster analysis can be performed to obtain a clustering model, which represents multiple business groups. Furthermore, based on the similarity between the cluster centers of the business groups and the target business, the target storage engine corresponding to the target business is determined. The determined target storage engine can support the data volume of the target business at different stages, meeting the development needs of the target business.

[0100] Regarding step S103, in one implementation, the preset condition is: the similarity to the target business is greater than a similarity threshold. The similarity threshold can be set by technical personnel based on experience; for example, the similarity threshold can be 0.6, or the similarity threshold can be 0.7.

[0101] Accordingly, step S103 may include the following steps: from multiple storage engines, determine the storage engine corresponding to the business group to which the cluster center with a similarity greater than the similarity threshold to the target business belongs, and use it as the first storage engine.

[0102] In another implementation, the preset condition is: based on the degree of similarity to the target business from highest to lowest, the items are ranked within a preset number. The preset number can be set by technical personnel based on experience; for example, the preset number can be 1, or it can be 3, but it is not limited to these.

[0103] Accordingly, step S103 may include the following steps: determining the storage engine corresponding to the business group to which the first preset number of cluster centers belong from multiple storage engines in descending order of similarity to the target business, and using it as the first storage engine.

[0104] When the preset number is 1, that is, from multiple business groups, the business group with the highest similarity to the target business is determined, and this business group is the business group to which the target business belongs. Correspondingly, the target business has a high similarity to the sample businesses in its business group, and therefore, the storage engine corresponding to the business group to which the target business belongs is determined as the first storage engine.

[0105] In one implementation, the electronic device can randomly select a storage engine from the first storage engines as the target storage engine corresponding to the target service.

[0106] In another implementation, Figure 1 Based on this, see Figure 4 Before step S104, the method may further include the following steps:

[0107] S105: From multiple storage engines, determine the storage engine that supports the target data volume and use it as the second storage engine.

[0108] Accordingly, step S104 may include the following steps:

[0109] S1041: Determine the target storage engine corresponding to the target service from the same storage engines in the first and second storage engines.

[0110] In one implementation, the electronic device can calculate the target data volume of the target business data generated by the target business based on the parameter values ​​of the Number Rows field and the Data Size field. Then, the electronic device can determine a second storage engine from multiple storage engines that supports the target data volume.

[0111] In another implementation, the electronic device can determine the storage engine that supports the corresponding number of rows from multiple storage engines based on the parameter value of the Number Rows field. Then, the electronic device can determine the second storage engine from the selected storage engines that supports the target data volume.

[0112] After identifying the first and second storage engines, if the first and second storage engines contain the same storage engine, it indicates the existence of a storage engine capable of adapting to changes in data volume during the development of the target business and meeting its functional requirements. Subsequently, the electronic device determines the target storage engine corresponding to the target business from among the identical storage engines in the first and second storage engines.

[0113] For example, the set of first storage engines is denoted as T1, and the set of second storage engines is denoted as T2. The electronic device determines the intersection of T1 and T2 to obtain the storage engines that are the same in the first and second storage engines. Then, from the intersection of T1 and T2, the target storage engine corresponding to the target service is determined.

[0114] In some embodiments, step S1041 may include the following steps:

[0115] Step 1: If there is one identical storage engine in the first storage engine and the second storage engine, determine that storage engine as the target storage engine corresponding to the target business.

[0116] Step 2: When there are multiple identical storage engines in the first and second storage engines, determine the target storage engine corresponding to the target service from among these multiple storage engines.

[0117] Electronic devices can randomly select one storage engine from the same storage engines in the first and second storage engines as the target storage engine corresponding to the target service.

[0118] Alternatively, the electronic device may select the storage engine corresponding to the business group to which the cluster center with the highest similarity to the target business belongs from the same storage engines in the first and second storage engines, and use it as the target storage engine for the target business.

[0119] In some embodiments, if there is no identical storage engine between the first storage engine and the second storage engine, indicating that there is no storage engine that can adapt to changes in the data volume of the target business during its development and meet the functional requirements of the target business, the electronic device can display the target functional requirements, target data volume, and target data type of the target business to the technicians, who can then evaluate and analyze the target functional requirements, target data volume, and target data type of the target business to determine the target storage engine corresponding to the target business.

[0120] and Figure 1 For the corresponding method implementation examples, see [link to relevant documentation]. Figure 5 , Figure 5 This is a structural diagram of a storage engine determination device provided in an embodiment of the present invention. The device includes:

[0121] The acquisition module 501 is used to acquire the target data volume and target data type of the business data generated by the target business.

[0122] The first determining module 502 is used to calculate the similarity between the target service and the cluster centers of a plurality of preset service groups based on the target data volume and the target data type; wherein, different service groups correspond to different storage engines; the plurality of service groups are obtained by clustering each sample service based on the storage engine corresponding to each sample service, the data volume and data type of the service data generated by the sample service; the similarity between a sample service and the cluster centers in its own service group is greater than the similarity between the sample service and the cluster centers in other service groups;

[0123] The selection module 503 is used to determine, from multiple storage engines, the storage engine corresponding to the business group to which the cluster center with similarity to the target business meets the preset conditions, and to select the first storage engine.

[0124] The second determining module 504 is used to determine the target storage engine corresponding to the target service based on the first storage engine.

[0125] Optionally, the acquisition module 501 is specifically used to determine the target data type of the business data generated by the target business based on the configuration information of the target business;

[0126] From the structured query language (SQL) execution plan of the target business, obtain the parameter values ​​of the Number Rows field and the Data Size field to obtain the target data volume of the business data generated by the target business.

[0127] Optionally, the first determining module 502 is specifically used to generate a feature vector of the target service based on the target data volume and the target data type, as the target feature vector;

[0128] For each business group, based on the data volume and data type of the cluster centers of that business group, a feature vector of the cluster centers is generated and used as a sample feature vector.

[0129] Calculate the similarity between the target feature vector and the sample feature vector of the cluster center of the business group to obtain the similarity between the target business and the cluster center of the business group.

[0130] Optionally, the selection module 503 is specifically used to determine, from the plurality of storage engines, the storage engine corresponding to the business group to which the cluster center of the target business belongs, is greater than the similarity threshold, and to serve as the first storage engine;

[0131] or,

[0132] Based on the order of similarity to the target business from highest to lowest, the storage engines corresponding to the business groups to which the first preset number of cluster centers belong are determined from the plurality of storage engines and are used as the first storage engines.

[0133] Optionally, the device further includes:

[0134] The third determining module is used to determine, before the second determining module 504 executes the determination of the target storage engine corresponding to the target service based on the first storage engine, the storage engine that supports the target data volume from the plurality of storage engines and serves as the second storage engine.

[0135] The second determining module 504 is specifically used to determine, from the plurality of storage engines, a storage engine that supports the target data volume level, as the second storage engine;

[0136] The target storage engine corresponding to the target service is determined from the same storage engines in the first and second storage engines.

[0137] Optionally, the second determining module 504 is specifically used to determine that when there is one identical storage engine in the first storage engine and the second storage engine, the storage engine is the target storage engine corresponding to the target service;

[0138] When there are multiple identical storage engines in the first and second storage engines, the target storage engine corresponding to the target service is determined from among these multiple storage engines.

[0139] Based on the storage engine determination device provided in this embodiment of the invention, the target storage engine corresponding to the target service can be determined based on the target functional requirements, target data volume, and target data type of the target service. This eliminates the need for technical personnel to evaluate and analyze the service, reducing time and labor costs and improving the efficiency of storage engine determination. Furthermore, if the similarity between the sample service and the target service meets a preset condition, it indicates that the data volume changes of the target service and the sample service are quite similar during their development. Since the storage engine corresponding to the sample service is selected based on the data volume changes during the sample service's development, and the storage engine corresponding to the sample service can adapt to the development of the sample service, then the first storage engine can adapt to the development of the target service. Therefore, the target storage engine determined based on the first storage engine can also adapt to the development of the target service, meaning that the target storage engine can support the data volume of the target service at different stages and meet the development needs of the target service.

[0140] This invention also provides an electronic device, such as... Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603, and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.

[0141] Memory 603 is used to store computer programs;

[0142] When processor 601 executes a program stored in memory 603, it performs the following steps:

[0143] Obtain the target data volume and target data type of the business data generated by the target business;

[0144] Based on the target data volume and the target data type, the similarity between the target service and the cluster centers of multiple preset service groups is calculated; wherein, different service groups correspond to different storage engines; the multiple service groups are obtained by clustering each sample service based on the storage engine corresponding to each sample service, the data volume of the service data generated by the sample service, and the data type; the similarity between a sample service and the cluster centers in its own service group is greater than the similarity between the sample service and the cluster centers in other service groups;

[0145] From multiple storage engines, determine the storage engine corresponding to the business group to which the cluster center with similarity to the target business meets the preset conditions, and use it as the first storage engine;

[0146] Based on the first storage engine, determine the target storage engine corresponding to the target service.

[0147] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not indicate that there is only one bus or one type of bus.

[0148] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0149] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0150] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0151] In another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the storage engine determination method described in any of the above embodiments.

[0152] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the storage engine determination methods described in the above embodiments.

[0153] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0154] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0155] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, electronic devices, computer-readable storage media, and computer program products are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0156] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.

Claims

1. A storage engine determination method, characterized by, The method comprises: obtaining a target data magnitude and a target data type of service data generated by a target service; based on the target data magnitude and the target data type, calculating the similarity of the target service and the cluster centers of a plurality of preset service groups; wherein different service groups correspond to different storage engines; the plurality of service groups are obtained by clustering each sample service based on the storage engine corresponding to each sample service, the data magnitude and the data type of the service data generated by the sample service; the similarity of a sample service and the cluster center in the service group to which the sample service belongs is greater than the similarity of the sample service and the cluster centers in other service groups; from the plurality of storage engines, determine the storage engine corresponding to the service group to which the cluster center with a similarity satisfying a preset condition of the target service belongs as the first storage engine; based on the first storage engine, determine the target storage engine corresponding to the target service; before the determination of the target storage engine corresponding to the target service based on the first storage engine, the method further comprises: from the plurality of storage engines, determine the storage engine supporting the target data magnitude as the second storage engine; the determination of the target storage engine corresponding to the target service based on the first storage engine comprises: from the same storage engine in the first storage engine and the second storage engine, determine the target storage engine corresponding to the target service.

2. The method of claim 1, wherein, The method comprises: based on the configuration information of the target service, determine the target data type of the service data generated by the target service; from the structured query language (SQL) execution plan of the target service, obtain the parameter value of the Number Rows field and the parameter value of the Data Size field to obtain the target data magnitude of the service data generated by the target service.

3. The method of claim 1, wherein, The method comprises: based on the target data magnitude and the target data type, generate the feature vector of the target service as the target feature vector; for each service group, based on the data magnitude and the data type of the cluster center of the service group, generate the feature vector of the cluster center of the service group as the sample feature vector; calculate the similarity of the target feature vector and the sample feature vector of the cluster center of the service group to obtain the similarity of the target service and the cluster center of the service group.

4. The method of claim 1, wherein, The method comprises: from the plurality of storage engines, determine the storage engine corresponding to the service group to which the cluster center with a similarity greater than a similarity threshold of the target service belongs as the first storage engine; or, Determine, from the multiple storage engines, a storage engine corresponding to a service group to which a preset number of cluster centers of the target service belong, as a first storage engine, in an order from large to small of similarity to the target service.

5. The method of claim 1, wherein, The determining, from the same storage engine of the first storage engine and the second storage engine, the target storage engine corresponding to the target service comprises: When the same storage engine of the first storage engine and the second storage engine is one, determine the storage engine as the target storage engine corresponding to the target service; When the same storage engine of the first storage engine and the second storage engine is multiple, determine the target storage engine corresponding to the target service from the multiple storage engines.

6. A storage engine determination apparatus, characterized by comprising: The apparatus comprises: An acquisition module configured to acquire a target data magnitude and a target data type of service data generated by a target service; A first determination module configured to calculate similarity of the target service to cluster centers of a preset plurality of service groups based on the target data magnitude and the target data type, wherein different service groups correspond to different storage engines, and the plurality of service groups are obtained by clustering each sample service based on a storage engine corresponding to the sample service, a data magnitude, and a data type of service data generated by the sample service, and similarity of one sample service to a cluster center in a service group to which the sample service belongs is greater than similarity of the sample service to cluster centers in other service groups; A selection module configured to determine, from a plurality of storage engines, a storage engine corresponding to a service group to which a cluster center of the target service satisfying a preset condition belongs, as a first storage engine; A second determination module configured to determine, based on the first storage engine, a target storage engine corresponding to the target service; The apparatus further comprises: A third determination module configured to, before the second determination module determines, based on the first storage engine, the target storage engine corresponding to the target service, determine, from the plurality of storage engines, a storage engine supporting the target data magnitude, as a second storage engine; The second determination module is specifically configured to determine, from the same storage engine of the first storage engine and the second storage engine, the target storage engine corresponding to the target service.

7. The apparatus of claim 6, wherein, The acquisition module is specifically configured to determine the target data type of service data generated by the target service based on configuration information of the target service. Obtain a parameter value of a Number Rows field and a parameter value of a Data Size field from a structured query language (SQL) execution plan of the target service to obtain a target data magnitude of service data generated by the target service.

8. An electronic device, comprising: The apparatus comprises a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus. The memory is configured to store a computer program. The processor is configured to execute the program stored on the memory to implement the method steps of any one of claims 1-5.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps in any one of claims 1-5.

Citation Information

Patent Citations

  • Text clustering method and device

    CN110019802A

  • Data storage method and device based on multiple storage devices

    CN112711384A

  • Chip-based data storage method and system and storage medium

    CN115421672A