[go: up one dir, main page]

CN108108384B - A data storage method and device - Google Patents

A data storage method and device Download PDF

Info

Publication number
CN108108384B
CN108108384B CN201611070058.9A CN201611070058A CN108108384B CN 108108384 B CN108108384 B CN 108108384B CN 201611070058 A CN201611070058 A CN 201611070058A CN 108108384 B CN108108384 B CN 108108384B
Authority
CN
China
Prior art keywords
database
stored
data
test
determining
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
Application number
CN201611070058.9A
Other languages
Chinese (zh)
Other versions
CN108108384A (en
Inventor
陈洪岭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
Research Institute of China Mobile Communication Co Ltd
Original Assignee
Research Institute of China Mobile Communication Co Ltd
China Mobile Communications Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Research Institute of China Mobile Communication Co Ltd, China Mobile Communications Corp filed Critical Research Institute of China Mobile Communication Co Ltd
Priority to CN201611070058.9A priority Critical patent/CN108108384B/en
Publication of CN108108384A publication Critical patent/CN108108384A/en
Application granted granted Critical
Publication of CN108108384B publication Critical patent/CN108108384B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种数据存储方法及装置,该方法包括:针对当前待存储数据,从所述待存储数据中提取设定数量的数据作为测试数据;根据预先设定的性能要求,确定对待存储数据库进行测试的测试类型;根据所述测试类型及所述测试数据,对每个待存储数据库进行测试,确定每个待存储数据库对应的测试参数;根据所述每个待存储数据库对应的测试参数及所述预先设定的性能要求,确定目标数据库,并将所述待存储数据存储到所述目标数据库中。用以解决现有技术中选取的存储待存储数据的数据库不合理,不能满足用户对于存储待存储数据的数据库性能的要求,影响了用户的体验的问题。

Figure 201611070058

The invention discloses a data storage method and device. The method includes: extracting a set amount of data from the to-be-stored data as test data for current data to be stored; The test type for the database to be tested; according to the test type and the test data, test each database to be stored, and determine the test parameters corresponding to each database to be stored; according to the test parameters corresponding to each database to be stored and the preset performance requirements, determine a target database, and store the data to be stored in the target database. It is used to solve the problem that the database selected in the prior art for storing the data to be stored is unreasonable, cannot meet the user's requirements for the performance of the database storing the data to be stored, and affects the user's experience.

Figure 201611070058

Description

一种数据存储方法及装置A data storage method and device

技术领域technical field

本发明涉及数据存储技术领域,特别涉及一种数据存储方法及装置。The present invention relates to the technical field of data storage, and in particular, to a data storage method and device.

背景技术Background technique

随着信息技术的飞速发展,数据呈现爆炸态势,需要存储的数据量也越来越大,数据类型也越来越复杂。面对海量的数据,单一的数据库已经无法满足所有数据的存储需要了,现有存储技术在进行数据存储时,一般会设置有多个数据库,当当前进行数据存储的数据库存满数据后,再启动下一个数据库进行数据的存储。With the rapid development of information technology, data is exploding, the amount of data that needs to be stored is also increasing, and the data types are becoming more and more complex. In the face of massive data, a single database can no longer meet the storage needs of all data. When the existing storage technology is used for data storage, multiple databases are generally set up. When the current database for data storage is full of data, the Start the next database for data storage.

然而,现有技术中在接收到待存储的数据后,是按照数据库的存储顺序进行数据的存储的,未考虑到当前的存储环境要求,及用户对待存储数据存储时的性能要求,因此现有技术中的数据存储方法造成了选取的数据库不合理,不能满足用户及存储环境对于存储待存储数据的数据库的性能要求,影响了用户的体验。However, in the prior art, after the data to be stored is received, the data is stored according to the storage sequence of the database, without considering the current storage environment requirements and the performance requirements of the user when storing the stored data, so the existing The data storage method in the technology causes the selected database to be unreasonable, cannot meet the performance requirements of the user and the storage environment for the database for storing the data to be stored, and affects the user's experience.

发明内容SUMMARY OF THE INVENTION

本发明提供一种数据存储方法及装置,用以解决现有技术中选取的存储待存储数据的数据库不合理,不能满足用户对于存储待存储数据的数据库的性能要求,影响了用户的体验的问题。The present invention provides a data storage method and device, which are used to solve the problem that the database selected in the prior art for storing data to be stored is unreasonable, cannot meet the user's performance requirements for the database to be stored, and affects the user's experience. .

为达到上述目的,本发明实施例公开了一种数据存储方法,应用于电子设备,所述方法包括:In order to achieve the above purpose, an embodiment of the present invention discloses a data storage method, which is applied to an electronic device, and the method includes:

针对当前待存储数据,从所述待存储数据中提取设定数量的数据作为测试数据;For the current data to be stored, extract a set amount of data from the data to be stored as test data;

根据预先设定的性能要求,确定对待存储数据库进行测试的测试类型;According to the preset performance requirements, determine the test type to be tested against the database to be stored;

根据所述测试类型及所述测试数据,对每个待存储数据库进行测试,确定每个待存储数据库对应的测试参数;According to the test type and the test data, test each database to be stored, and determine the test parameters corresponding to each database to be stored;

根据所述每个待存储数据库对应的测试参数及所述预先设定的性能要求,确定目标数据库,并将所述待存储数据存储到所述目标数据库中。According to the test parameters corresponding to each database to be stored and the preset performance requirements, a target database is determined, and the data to be stored is stored in the target database.

进一步地,所述根据预先设定的性能要求,确定对待存储数据库进行测试的测试类型之前,所述方法还包括:Further, before determining the test type to be tested on the database to be stored according to the preset performance requirements, the method further includes:

根据所述待存储数据的类型及每个存储数据库针对的数据类型,选取与所述待存储数据的类型相对应的数据库作为待存储数据库。According to the type of the data to be stored and the data type for each storage database, a database corresponding to the type of the data to be stored is selected as the database to be stored.

进一步地,所述性能要求包括:Further, the performance requirements include:

加载性能优先、存储效率优先、查询性能优先。Load performance priority, storage efficiency priority, query performance priority.

进一步地,所述根据预先设定的性能要求,确定对待存储数据库进行测试的测试类型包括:Further, determining the test type to be tested on the database to be stored according to the preset performance requirements includes:

如果所述预先设定的性能要求为加载性能优先或存储效率优先,确定对所述待存储数据库进行加载测试;If the preset performance requirement prioritizes loading performance or storage efficiency, determining to perform a load test on the database to be stored;

如果所述预先设定的性能要求为查询性能优先,确定对所述待存储数据库进行查询测试。If the preset performance requirement prioritizes query performance, it is determined to perform a query test on the database to be stored.

进一步地,如果测试类型为加载测试,所述根据所述测试类型及所述测试数据,对每个待存储数据库进行测试,确定每个待存储数据库对应的测试参数包括:Further, if the test type is a loading test, according to the test type and the test data, each database to be stored is tested, and the test parameters corresponding to each database to be stored are determined to include:

控制每个所述待存储数据库加载所述测试数据,确定每个所述待存储数据库加载所述测试数据的加载时间、占用的存储空间和CPU的平均利用率。Control each of the to-be-stored databases to load the test data, and determine the load time, occupied storage space, and average CPU utilization of each of the to-be-stored databases to load the test data.

进一步地,如果测试类型为查询测试,所述根据所述测试类型及所述测试数据,对每个待存储数据库进行测试,确定每个待存储数据库对应的测试参数包括:Further, if the test type is a query test, the test is performed on each database to be stored according to the test type and the test data, and the test parameters corresponding to each database to be stored are determined to include:

在每个所述待存储数据库中查询所述测试数据中每条数据,确定每个待存储数据库对所述测试数据中每条数据进行查询的平均响应时间、平均网络数据传输量和CPU平均利用率。Query each piece of data in the test data in each of the to-be-stored databases, and determine the average response time, average network data transmission volume, and average CPU utilization of each to-be-stored database for querying each piece of data in the test data Rate.

进一步地,如果所述预先设定的性能要求为加载性能优先,所述根据所述每个待存储数据库对应的测试参数及所述预先设定的性能要求,确定目标数据库包括:Further, if the preset performance requirement prioritizes loading performance, determining the target database according to the test parameters corresponding to each to-be-stored database and the preset performance requirement includes:

针对每个待存储数据库,确定该待存储数据库加载所述测试数据对应的加载时间、占用的存储空间和CPU的平均利用率的第一乘积结果;For each database to be stored, determine the first product result of the load time corresponding to the test data loaded into the database to be stored, the occupied storage space and the average utilization rate of the CPU;

将所述第一乘积结果按照从大到小的顺序排序,选取第一乘积结果较小的第一设定数量的待存储数据库作为第一候选数据库;Sort the first product results in descending order, and select a first set number of databases to be stored with smaller first product results as the first candidate database;

将所述第一候选数据库中加载时间最小的待存储数据库确定为目标数据库。The database to be stored with the smallest loading time among the first candidate databases is determined as the target database.

进一步地,如果所述预先设定的性能要求为存储效率优先,所述根据所述每个待存储数据库对应的测试参数及所述预先设定的性能要求,确定目标数据库包括:Further, if the preset performance requirement is storage efficiency priority, determining the target database according to the test parameters corresponding to each database to be stored and the preset performance requirement includes:

针对每个待存储数据库,确定该待存储数据库加载所述测试数据对应的加载时间、占用的存储空间和CPU的平均利用率的第一乘积结果;For each database to be stored, determine the first product result of the load time corresponding to the test data loaded into the database to be stored, the occupied storage space and the average utilization rate of the CPU;

将所述第一乘积结果按照从大到小的顺序排序,选取第一乘积结果较小的第二设定数量的待存储数据库作为第二候选数据库;Sort the first product results in descending order, and select a second set number of databases to be stored with smaller first product results as the second candidate database;

将所述第二候选数据库中占用的存储空间最小的待存储数据库确定为目标数据库。The database to be stored with the smallest storage space occupied in the second candidate database is determined as the target database.

进一步地,如果所述预先设定的性能要求为查询性能优先,所述根据所述每个待存储数据库对应的测试参数及所述预先设定的性能要求,确定目标数据库包括:Further, if the preset performance requirement is query performance priority, determining the target database according to the test parameters corresponding to each to-be-stored database and the preset performance requirement includes:

针对每个待存储数据库,确定该待存储数据库中对所述测试数据中每条数据进行查询对应的平均响应时间、平均网络数据传输量和CPU平均利用率的第二乘积结果;For each database to be stored, determine the second product result of the average response time, the average network data transmission volume and the average CPU utilization rate corresponding to the query of each piece of data in the test data in the database to be stored;

将所述第二乘积结果按照从大到小的顺序排序,选取第二乘积结果较小的第三设定数量的待存储数据库作为第三候选数据库;Sort the second product results in descending order, and select a third set number of databases to be stored with smaller second product results as the third candidate database;

将所述第三候选数据库中平均响应时间最小的待存储数据库确定为目标数据库。The database to be stored with the smallest average response time among the third candidate databases is determined as the target database.

本发明实施例公开了一种数据存储装置,应用于电子设备,该装置包括:The embodiment of the present invention discloses a data storage device, which is applied to electronic equipment, and the device includes:

提取模块,用于针对当前待存储数据,从所述待存储数据中提取设定数量的数据作为测试数据;an extraction module, for extracting a set amount of data from the data to be stored as test data for the current data to be stored;

第一确定模块,用于根据预先设定的性能要求,确定对待存储数据库进行测试的测试类型;The first determination module is used to determine the test type to be tested on the database to be stored according to the preset performance requirements;

第二确定模块,用于根据所述测试类型及所述测试数据,对每个待存储数据库进行测试,确定每个待存储数据库对应的测试参数;The second determination module is used to test each database to be stored according to the test type and the test data, and determine the test parameters corresponding to each database to be stored;

第三确定模块,用于根据所述每个待存储数据库对应的测试参数及所述预先设定的性能要求,确定目标数据库,并将所述待存储数据存储到所述目标数据库中。The third determining module is configured to determine a target database according to the test parameters corresponding to each database to be stored and the preset performance requirements, and store the data to be stored in the target database.

进一步地,所述装置还包括:Further, the device also includes:

选取模块,用于根据所述待存储数据的类型及每个存储数据库针对的数据类型,选取与所述待存储数据的类型相对应的数据库作为待存储数据库。The selecting module is configured to select the database corresponding to the type of the data to be stored as the database to be stored according to the type of the data to be stored and the data type for each storage database.

进一步地,所述第一确定模块,具体用于如果所述预先设定的性能要求为加载性能优先或存储效率优先,确定对所述待存储数据库进行加载测试;如果所述预先设定的性能要求为查询性能优先,确定对所述待存储数据库进行查询测试。Further, the first determining module is specifically configured to determine to perform a load test on the to-be-stored database if the preset performance requirement is priority on loading performance or priority on storage efficiency; It is required that the query performance is given priority, and it is determined to perform a query test on the database to be stored.

进一步地,所述第二确定模块,具体用于如果测试类型为加载测试,控制每个所述待存储数据库加载所述测试数据,确定每个所述待存储数据库加载所述测试数据的加载时间、占用的存储空间和CPU的平均利用率。Further, the second determination module is specifically configured to control each of the to-be-stored databases to load the test data if the test type is a load test, and to determine the loading time for each of the to-be-stored databases to load the test data , occupied storage space and average CPU utilization.

进一步地,所述第二确定模块,具体用于如果测试类型为查询测试,在每个所述待存储数据库中查询所述测试数据中每条数据,确定每个待存储数据库对所述测试数据中每条数据进行查询的平均响应时间、平均网络数据传输量和CPU平均利用率。Further, the second determination module is specifically used to query each piece of data in the test data in each of the databases to be stored if the test type is a query test, and to determine that each database to be stored is responsible for the test data. Average response time, average network data transfer volume, and average CPU utilization for each piece of data in the query.

进一步地,所述第三确定模块,具体用于如果所述预先设定的性能要求为加载性能优先,针对每个待存储数据库,确定该待存储数据库加载所述测试数据对应的加载时间、占用的存储空间和CPU的平均利用率的第一乘积结果;将所述第一乘积结果按照从大到小的顺序排序,选取第一乘积结果较小的第一设定数量的待存储数据库作为第一候选数据库;将所述第一候选数据库中加载时间最小的待存储数据库确定为目标数据库。Further, the third determining module is specifically configured to determine, for each database to be stored, the loading time and occupation of the test data corresponding to the database to be stored if the preset performance requirement is priority for loading performance. The first product result of the storage space and the average utilization rate of the CPU; sort the first product results in descending order, and select the first set number of databases to be stored with smaller first product results as the first A candidate database; the database to be stored with the smallest loading time among the first candidate databases is determined as the target database.

进一步地,所述第三确定模块,具体用于如果所述预先设定的性能要求为存储效率优先,针对每个待存储数据库,确定该待存储数据库加载所述测试数据对应的加载时间、占用的存储空间和CPU的平均利用率的第一乘积结果;将所述第一乘积结果按照从大到小的顺序排序,选取第一乘积结果较小的第二设定数量的待存储数据库作为第二候选数据库;将所述第二候选数据库中占用的存储空间最小的待存储数据库确定为目标数据库。Further, the third determining module is specifically configured to determine, for each database to be stored, the loading time and occupation of the test data corresponding to the database to be stored if the preset performance requirement is storage efficiency priority. The first product result of the storage space and the average utilization rate of the CPU; the first product result is sorted in descending order, and the second set number of databases to be stored where the first product result is smaller is selected as the first product result. Two candidate databases; the database to be stored that occupies the smallest storage space in the second candidate database is determined as the target database.

进一步地,所述第三确定模块,具体用于如果所述预先设定的性能要求为查询性能优先,针对每个待存储数据库,确定该待存储数据库中对所述测试数据中每条数据进行查询对应的平均响应时间、平均网络数据传输量和CPU平均利用率的第二乘积结果;将所述第二乘积结果按照从大到小的顺序排序,选取第二乘积结果较小的第三设定数量的待存储数据库作为第三候选数据库;将所述第三候选数据库中平均响应时间最小的待存储数据库确定为目标数据库。Further, the third determination module is specifically configured to, for each database to be stored, determine that each piece of data in the test data is to be performed in the database to be stored if the preset performance requirement is query performance priority. Query the second product result of the corresponding average response time, average network data transmission volume, and average CPU utilization; sort the second product results in descending order, and select the third device with the smaller second product result. A certain number of databases to be stored are used as third candidate databases; the database to be stored with the smallest average response time among the third candidate databases is determined as the target database.

本发明实施例公开了一种数据存储方法及装置,该方法包括:针对当前待存储数据,从所述待存储数据中提取设定数量的数据作为测试数据;根据预先设定的性能要求,确定对待存储数据库进行测试的测试类型;根据所述测试类型及所述测试数据,对每个待存储数据库进行测试,确定每个待存储数据库对应的测试参数;根据所述每个待存储数据库对应的测试参数及所述预先设定的性能要求,确定目标数据库,并将所述待存储数据存储到所述目标数据库中。由于本发明实施例中,在待存储的数据中提取设定数量的数据作为测试数据,根据预先设定的性能要求,采用对应的测试类型,对每个待存储数据库进行测试,从而根据每个待存储数据库对应的测试参数,确定目标数据库,因此选择的目标数据库是满足当前性能要求的数据库,从而使数据的存储更加的合理,并提高了用户的体验。The embodiment of the present invention discloses a data storage method and device. The method includes: for the current data to be stored, extracting a set amount of data from the to-be-stored data as test data; according to a preset performance requirement, determining The test type for testing the database to be stored; according to the test type and the test data, each database to be stored is tested, and the test parameters corresponding to each database to be stored are determined; according to the corresponding test parameters of each database to be stored Test parameters and the preset performance requirements, determine a target database, and store the data to be stored in the target database. Because in the embodiment of the present invention, a set amount of data is extracted from the data to be stored as test data, and according to the preset performance requirements, the corresponding test type is used to test each database to be stored, so that according to each The test parameters corresponding to the database to be stored determine the target database. Therefore, the selected target database is a database that meets the current performance requirements, thereby making data storage more reasonable and improving user experience.

附图说明Description of drawings

图1为本发明实施例1提供的一种数据存储过程示意图;1 is a schematic diagram of a data storage process according to Embodiment 1 of the present invention;

图2为本发明实施例2提供的一种数据存储过程示意图;2 is a schematic diagram of a data storage process according to Embodiment 2 of the present invention;

图3为本发明实施例4提供的一种数据存储过程示意图;3 is a schematic diagram of a data storage process according to Embodiment 4 of the present invention;

图4为本发明实施例5提供的一种数据存储过程示意图;4 is a schematic diagram of a data storage process according to Embodiment 5 of the present invention;

图5为本发明实施例6提供的一种数据存储过程示意图;5 is a schematic diagram of a data storage process according to Embodiment 6 of the present invention;

图6为本发明实施例7提供的一种数据存储装置结构示意图。FIG. 6 is a schematic structural diagram of a data storage device according to Embodiment 7 of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

实施例1:Example 1:

图1为本发明实施例提供的一种数据存储过程示意图,该过程包括:FIG. 1 is a schematic diagram of a data storage process provided by an embodiment of the present invention, and the process includes:

S101:针对当前待存储数据,从所述待存储数据中提取设定数量的数据作为测试数据。S101: For the current data to be stored, extract a set amount of data from the data to be stored as test data.

本发明实施例提供的数据存储方法,应用于电子设备,该电子设备可以为个人电脑、平板电脑,也可以是服务器等设备。The data storage method provided by the embodiment of the present invention is applied to an electronic device, and the electronic device may be a personal computer, a tablet computer, or a server and other devices.

具体的,针对当前待存储的数据,从待存储的数据中提取设定数量的数据作为测试数据,该设定数量可以为5条、10条等,例如:当前待存储的数据中共包含100条数据,设定数量为10条,从待存储的数据中随机提取10条数据作为测试数据,当然该设定数量也可以是提取所述待存储数据的比例值,例如:接收到的待存储的数据中共包含100条数据,设定数量为待存储数据的10%的数据,从待存储的数据中随机提取10%的数据,即随机提取10条数据作为测试数据。Specifically, for the current data to be stored, a set amount of data is extracted from the data to be stored as test data, and the set number can be 5, 10, etc. For example, the current data to be stored contains a total of 100 pieces of data Data, the set number is 10, and 10 pieces of data are randomly extracted from the data to be stored as test data. Of course, the set number can also be the ratio of extracting the data to be stored, for example: the received data to be stored The data contains a total of 100 pieces of data, the set quantity is 10% of the data to be stored, and 10% of the data is randomly extracted from the data to be stored, that is, 10 pieces of data are randomly extracted as test data.

在本发明实施例中,从所述待存储数据中随机提取设定数量的数据作为测试数据是现有技术,在本发明实施例中不再进行赘述。In the embodiment of the present invention, randomly extracting a set amount of data from the to-be-stored data as the test data is the prior art, which is not repeated in the embodiment of the present invention.

S102:根据预先设定的性能要求,确定对待存储数据库进行测试的测试类型。S102: Determine a test type to be tested for the database to be stored according to a preset performance requirement.

数据库是按照数据结构来组织、存储和管理数据的仓库。不同类型的或者同类型不同架构的数据库之间,因为数据库的架构不同、存储数据的结构不同,不同的数据库在对相同的数据进行加载或者读取时,加载时间、读取时间、内存的占用率等参数也会存在不同。A database is a warehouse that organizes, stores, and manages data according to data structures. Between databases of different types or different architectures of the same type, because the architecture of the database is different and the structure of the stored data is different, when different databases load or read the same data, the load time, read time, and memory usage are different. Parameters such as rate will also be different.

在本发明实施例中,电子设备中保存有多种性能要求,当接收到待存储数据时,电子设备可以根据当前的存储环境、待存储数据中包含的数据条数进行对性能要求的选择,例如:如果待存储数据库的存储空间快要被占满时,选择的性能要求为存储效率优先,从而达到尽量减少数据的存储空间的目的,如果待存储数据的条数超过设定阈值后,选择的性能要求为查询性能优先,从而达到提高数据查询效率的目标,当然也可以是用户根据需求来选择性能要求。每种性能要求都对应着一种测试类型,例如:性能要求为查询性能优先对应着查询测试、性能要求为读取时内存性能优先对应着读取测试。In the embodiment of the present invention, a variety of performance requirements are stored in the electronic device. When receiving data to be stored, the electronic device can select the performance requirements according to the current storage environment and the number of data pieces contained in the data to be stored, For example, if the storage space of the database to be stored is about to be filled up, the selected performance requirement is storage efficiency first, so as to achieve the purpose of minimizing the storage space of data. If the number of data to be stored exceeds the set threshold, the selected The performance requirements are given priority to query performance, so as to achieve the goal of improving data query efficiency. Of course, users can also choose performance requirements according to their needs. Each performance requirement corresponds to a type of test. For example, if the performance requirement is query performance priority, it corresponds to the query test, and if the performance requirement is read memory performance priority, it corresponds to the read test.

具体的,根据预先设定的性能要求,确定对待存储数据库进行测试的测试类型,例如:预先设定的性能要求为读取时内存性能优先,确定对待存储数据库进行读取测试。Specifically, the test type to be tested for the database to be stored is determined according to a preset performance requirement. For example, the preset performance requirement is that memory performance is prioritized during reading, and it is determined to perform a read test on the database to be stored.

S103:根据所述测试类型及所述测试数据,对每个待存储数据库进行测试,确定每个待存储数据库对应的测试参数。S103: Test each database to be stored according to the test type and the test data, and determine test parameters corresponding to each database to be stored.

具体的,所述测试参数为根据所述测试类型及所述测试数据,对每个待存储的数据库进行测试时该待存储数据库所在的电子设备的运行参数,该运行参数可以反映数据库在对该测试数据进行相应的操作时,对电子设备的性能的影响。Specifically, the test parameter is the operation parameter of the electronic device where the database to be stored is located when each database to be stored is tested according to the test type and the test data, and the operation parameter can reflect that the database is running on the database to be stored. The influence on the performance of electronic equipment when the corresponding operation is performed on the test data.

测试参数例如可以为:中央处理器(Central Processing Unit,CPU)平均使用率、内存平均占用量等参数。如果所述测试类型为读取测试、待存储的数据库包括数据库A、数据库B、数据库C、数据库D,将所述测试数据分别存入数据库A、数据库B、数据库C、数据库D,记录数据库A、数据库B、数据库C、数据库D读取所述测试数据对应的读取时间、内存占用量、CPU平均使用量等参数。The test parameters may be, for example, parameters such as the average usage rate of a central processing unit (Central Processing Unit, CPU), the average occupancy of memory, and the like. If the test type is a read test, and the database to be stored includes database A, database B, database C, and database D, store the test data in database A, database B, database C, and database D respectively, and record database A. , database B, database C, and database D to read parameters such as the reading time, memory occupancy, and average CPU usage corresponding to the test data.

S104:根据所述每个待存储数据库对应的测试参数及所述预先设定的性能要求,确定目标数据库,并将所述待存储数据存储到所述目标数据库中。S104: Determine a target database according to the test parameters corresponding to each to-be-stored database and the preset performance requirements, and store the to-be-stored data in the target database.

具体的,可以根据预先设定的性能要求对所述每个待存储数据库对应的测试参数中特定的参数进行比较,确定目标数据库,例如:待存储的数据库包括数据库A、数据库B、数据库C,数据库A对应的参数为读取时间1秒、CPU平均利用率10%、内存占用量30M,数据库B对应的参数为读取时间2秒、CPU平均利用率15%、内存占用量30M,数据库C对应的参数为读取时间2.5秒、CPU平均利用率10%、内存占用量30M,预先设定的性能要求为读取时间优先,选取数据库A、数据库B、数据库C分别对应的读取时间进行比较,确定读取时间最小的数据库A作为目标数据库。Specifically, specific parameters in the test parameters corresponding to each of the databases to be stored can be compared according to preset performance requirements to determine the target database. For example, the databases to be stored include database A, database B, and database C. The parameters corresponding to database A are read time 1 second, average CPU utilization 10%, memory usage 30M, database B corresponding parameters are read time 2 seconds, average CPU utilization 15%, memory usage 30M, database C The corresponding parameters are the read time of 2.5 seconds, the average CPU utilization rate of 10%, and the memory footprint of 30M. The preset performance requirements are read time priority. Select the read times corresponding to database A, database B, and database C respectively. Compare and determine the database A with the smallest read time as the target database.

当然,也可以是根据预先设定的性能要求对所述每个待存储数据库对应的测试参数进行综合比较,确定目标数据库,例如:待存储的数据库包括数据库A、数据库B、数据库C,数据库A对应的参数为读取时间1秒、CPU平均利用率10%、内存占用量30M,数据库B对应的参数为读取时间2秒、CPU平均利用率15%、内存占用量30M,数据库C对应的参数为读取时间2.5秒、CPU平均利用率10%、内存占用量30M,预先设定的性能要求为读取时间优先,分别对数据库A、数据库B、数据库C对应的测试参数的乘积进行比较,确定所述测试参数的乘积最小的数据库A作为目标数据库。Of course, it is also possible to comprehensively compare the test parameters corresponding to each of the databases to be stored according to the preset performance requirements to determine the target database, for example: the databases to be stored include database A, database B, database C, and database A The corresponding parameters are the read time of 1 second, the average CPU utilization rate of 10%, and the memory usage of 30M. The parameters corresponding to database B are the read time of 2 seconds, the average CPU utilization rate of 15%, and the memory usage of 30M. Database C corresponds to The parameters are the read time of 2.5 seconds, the average CPU utilization rate of 10%, and the memory footprint of 30M. The preset performance requirements are read time priority. Compare the products of the test parameters corresponding to database A, database B, and database C respectively. , and determine the database A with the smallest product of the test parameters as the target database.

由于本发明实施例中,在待存储的数据中提取设定数量的数据作为测试数据,根据预先设定的性能要求,采用对应的测试类型,对每个待存储数据库进行测试,从而根据每个待存储数据库对应的测试参数,确定目标存储数据库,因此选择的目标存储数据库是满足当前性能要求的数据库,从而使数据的存储更加的合理,并提高了用户的体验。Because in the embodiment of the present invention, a set amount of data is extracted from the data to be stored as test data, and according to the preset performance requirements, the corresponding test type is used to test each database to be stored, so that according to each The test parameters corresponding to the database to be stored determine the target storage database. Therefore, the selected target storage database is a database that meets the current performance requirements, thereby making data storage more reasonable and improving user experience.

实施例2:Example 2:

为了准确的确定出进行数据存储的目标数据库,在上述实施例的基础上,在本发明实施例中,所述根据预先设定的性能要求,确定对待存储数据库进行测试的测试类型之前,所述方法还包括:In order to accurately determine the target database for data storage, on the basis of the above embodiments, in this embodiment of the present invention, before determining the test type to be tested on the database to be stored according to the preset performance requirements, the Methods also include:

根据所述待存储数据的类型及每个存储数据库针对的数据类型,选取与所述待存储数据的类型相对应的数据库作为待存储数据库。According to the type of the data to be stored and the data type for each storage database, a database corresponding to the type of the data to be stored is selected as the database to be stored.

根据数据库的架构不同,数据库包括:键值存储数据库、文档型数据库、列存储数据库和图数据库,其中,键值存储数据库主要会使用到一个哈希表,这个哈希表中有一个特定的键和一个指针指向特定的数据,该类数据库的优势在于简单、易部署,典型的键值存储数据库包括:Redis、Memcached、Dynamo、Voldemort、LevelDB,该类型的数据库主要针对的数据类型包括结构化的配置型数据、日志型数据等;列存储数据库通常是用来应对分布式存储的海量数据,键仍然存在,但是列存储数据库的特点是指向了多个列,典型的列存储数据库包括:HBase、Cassandra,该类型的数据库主要针对的数据类型包括账单型数据、详单型数据等;图数据库同其他行列以及刚性结构的数据库不同,图数据库是使用灵活的图形模型,并且能够扩展到多个服务器上,典型的图数据库包括Neo4J、Infinite Graph、OrientDB,该类型的数据库主要针对的数据类型包括社交型数据、关系型数据等;文档型数据库的数据结构要求不严格,表结构可变,不需要像关系型数据库一样需要预先定义表结构,典型的文档型数据库包括MongoDB、CouchDB,该类型的数据库主要针对的数据类型包括网站型数据、缓存型数据等。Depending on the architecture of the database, the database includes: key-value storage database, document database, column storage database and graph database. Among them, the key-value storage database mainly uses a hash table, which has a specific key in the hash table. and a pointer to specific data. The advantage of this type of database is that it is simple and easy to deploy. Typical key-value storage databases include: Redis, Memcached, Dynamo, Voldemort, and LevelDB. Configuration data, log data, etc. Column storage databases are usually used to deal with massive data stored in distributed storage. The keys still exist, but the characteristics of column storage databases are that they point to multiple columns. Typical column storage databases include: HBase, Cassandra, this type of database mainly targets data types including billing data, detailed data, etc. Graph databases are different from other row-column and rigid-structured databases. Graph databases use a flexible graph model and can be extended to multiple servers. On the other hand, typical graph databases include Neo4J, Infinite Graph, and OrientDB. The data types of this type of database mainly include social data, relational data, etc.; the data structure requirements of document databases are not strict, and the table structure is variable. Like relational databases, the table structure needs to be pre-defined. Typical document databases include MongoDB and CouchDB. This type of database mainly targets data types including website data and cached data.

因为每个数据库针对的数据类型不同,选取的待存储的数据库针对的数据类型与待存储的数据类型相对应,才能更好的满足用户对于待存储数据存储时对存储性能的要求,充分发挥待存储数据库的性能。对待存储数据类型的识别是现有技术在本发明实施例中不再进行赘述。Because each database targets different data types, the selected data type to be stored corresponds to the data type to be stored, so as to better meet the user's requirements for storage performance when storing the data to be stored, and give full play to the storage performance. Storage database performance. The identification of the type of data to be stored is in the prior art, and will not be described repeatedly in this embodiment of the present invention.

具体的,根据所述待存储数据的类型及每个存储数据库针对的数据类型,选取与所述待存储数据的类型相对应的数据库作为待存储数据库。例如:待存储数据的类型是账单型数据,选取针对账单型数据的数据库HBase、Cassandra作为待存储数据库。Specifically, according to the type of the data to be stored and the data type for each storage database, a database corresponding to the type of the data to be stored is selected as the database to be stored. For example, the type of data to be stored is billing data, and the databases HBase and Cassandra for billing data are selected as the databases to be stored.

图2为本发明实施例提供的一种数据存储过程示意图,该过程包括:2 is a schematic diagram of a data storage process provided by an embodiment of the present invention, and the process includes:

S201:针对当前待存储数据,从所述待存储数据中提取设定数量的数据作为测试数据。S201: For the current data to be stored, extract a set amount of data from the data to be stored as test data.

S202:根据所述待存储数据的类型及每个存储数据库针对的数据类型,选取与所述待存储数据的类型相对应的数据库作为待存储数据库。S202: According to the type of the data to be stored and the data type for each storage database, select a database corresponding to the type of the data to be stored as the database to be stored.

S203:根据预先设定的性能要求,确定对待存储数据库进行测试的测试类型。S203: Determine the test type to be tested for the database to be stored according to the preset performance requirements.

S204:根据所述测试类型及所述测试数据,对每个待存储数据库进行测试,确定每个待存储数据库对应的测试参数。S204: Test each database to be stored according to the test type and the test data, and determine test parameters corresponding to each database to be stored.

S205:根据所述每个待存储数据库对应的测试参数及所述预先设定的性能要求,确定目标数据库,并将所述待存储数据存储到所述目标数据库中。S205: Determine a target database according to the test parameters corresponding to each to-be-stored database and the preset performance requirements, and store the to-be-stored data in the target database.

上述步骤中S202与S201中从所述待存储数据中提取设定数量的数据作为测试数据的过程,前后顺序可以不限制,可以先选取与所述待存储数据的类型相对应的数据库作为待存储数据库,也可以先从所述待存储数据中提取设定数量的数据作为测试数据。In the above-mentioned steps S202 and S201, the process of extracting a set amount of data from the data to be stored as the test data, the order before and after can be unlimited, and the database corresponding to the type of the data to be stored can be selected as the data to be stored. The database can also extract a set amount of data from the to-be-stored data as test data.

实施例3:Example 3:

在本发明实施例中,所述性能要求包括:In this embodiment of the present invention, the performance requirements include:

加载性能优先、存储效率优先、查询性能优先。Load performance priority, storage efficiency priority, query performance priority.

加载性能优先指在选择目标数据库时,需要优先考虑数据库的加载性能;存储效率优先指在选择目标数据库时,需要优先考虑数据库的存储效率;查询性能优先指在选择目标数据库时,需要考虑数据库的查询性能。Loading performance priority means that when selecting the target database, the load performance of the database needs to be given priority; storage efficiency priority means that when selecting the target database, the storage efficiency of the database needs to be given priority; query performance priority means that when selecting the target database, the database storage efficiency needs to be considered query performance.

为了了解每个待存储数据库的相应性能要求,需要对待测试数据库进行相应测试,因为每种性能要求不同,因此对待测试数据库进行的测试的测试类型也不同的。具体的,在本发明实施例中,所述根据预先设定的性能要求,确定对待存储数据库进行测试的测试类型包括:In order to understand the corresponding performance requirements of each database to be stored, it is necessary to perform corresponding tests on the database to be tested. Because each performance requirement is different, the types of tests performed on the database to be tested are also different. Specifically, in the embodiment of the present invention, determining the test type to be tested on the database to be stored according to the preset performance requirements includes:

如果所述预先设定的性能要求为加载性能优先或存储效率优先,确定对所述待存储数据库进行加载测试;If the preset performance requirement prioritizes loading performance or storage efficiency, determining to perform a load test on the database to be stored;

如果所述预先设定的性能要求为查询性能优先,确定对所述待存储数据库进行查询测试。If the preset performance requirement prioritizes query performance, it is determined to perform a query test on the database to be stored.

具体的,如果预先设定的性能要求为加载性能优先或者存储效率优先,说明用户对待存储数据库加载待存储数据的加载性能或存储性能要求更高,为了确定待存储数据库的加载性能和存储性能,需要对待存储数据库进行加载测试。Specifically, if the preset performance requirement is priority for loading performance or storage efficiency, it means that the user has higher requirements for loading performance or storage performance when loading the data to be stored in the database to be stored. In order to determine the loading performance and storage performance of the database to be stored, Need to load test the database to be stored.

如果预先设定的性能要求为查询性能优先,说明用户对待存储数据库查询待存储数据的查询性能要求更高,需要对待存储数据库进行查询测试。If the preset performance requirement is query performance priority, it means that the user has higher query performance requirements for querying the to-be-stored data in the stored database, and it is necessary to perform a query test on the to-be-stored database.

实施例4:Example 4:

为了准确的选取满足预先设定的性能要求的目标数据库,在上述各实施例的基础上,在本发明实施例中,如果预先设定的性能要求为加载性能优先,确定的测试类型为加载测试,所述根据所述测试类型及所述测试数据,对每个待存储数据库进行测试,确定每个待存储数据库对应的测试参数包括:In order to accurately select a target database that satisfies the preset performance requirements, on the basis of the above embodiments, in this embodiment of the present invention, if the preset performance requirements are loading performance priority, the determined test type is loading test , the test is performed on each database to be stored according to the test type and the test data, and the test parameters corresponding to each database to be stored are determined to include:

控制每个所述待存储数据库加载所述测试数据,确定每个所述待存储数据库加载所述测试数据的加载时间、占用的存储空间和CPU的平均利用率。Control each of the to-be-stored databases to load the test data, and determine the load time, occupied storage space, and average CPU utilization of each of the to-be-stored databases to load the test data.

具体的,控制每个所述待存储数据库加载所述测试数据,因为测试数据中可能包含多条数据,因此针对每个待存储数据库,统计该待存储数据库在加载测试数据的过程中的加载时间、CPU的平均利用率,并确定该测试数据在该待存储数据库中占用的存储空间的大小。Specifically, each of the to-be-stored databases is controlled to load the test data, because the test data may contain multiple pieces of data, so for each to-be-stored database, the loading time of the to-be-stored database in the process of loading the test data is counted , the average utilization rate of the CPU, and determine the size of the storage space occupied by the test data in the database to be stored.

如果预先设定的性能要求为加载性能优先,采用测试数据对每个待存储数据库进行加载测试,获取了待测试数据库的测试数据后,所述根据所述每个待存储数据库对应的测试参数及所述预先设定的性能要求,确定目标数据库包括:If the preset performance requirement is that the loading performance is the priority, use the test data to perform a load test on each database to be stored, and after obtaining the test data of the database to be tested, according to the test parameters corresponding to each database to be stored and The preset performance requirements and determining the target database include:

针对每个待存储数据库,确定该待存储数据库加载所述测试数据对应的加载时间、占用的存储空间和CPU的平均利用率的第一乘积结果;For each database to be stored, determine the first product result of the load time corresponding to the test data loaded into the database to be stored, the occupied storage space and the average utilization rate of the CPU;

将所述第一乘积结果按照从大到小的顺序排序,选取第一乘积结果较小的第一设定数量的待存储数据库作为第一候选数据库;Sort the first product results in descending order, and select a first set number of databases to be stored with smaller first product results as the first candidate database;

将所述第一候选数据库中加载时间最小的待存储数据库确定为目标数据库。The database to be stored with the smallest loading time among the first candidate databases is determined as the target database.

具体的,在本发明实施例中在确定目标数据库时,针对每个待存储数据库,确定该待存储数据库加载所述测试数据对应的加载时间、占用的存储空间和CPU的平均利用率的第一乘积结果,将所述第一乘积结果按照从大到小排序,选取第一乘积结果较小的第一设定数量的待存储数据库作为第一候选数据库,即选取加载所述测试数据消耗资源较小的第一设定数量的待存储数据库作为第一候选数据库,该设定数量可以为2、3、5等。在加载所述测试数据的消耗资源较小的第一候选数据库中,选取加载时间最小的待存储数据库,作为目标数据库。例如:待存储数据库A对应第一乘积结果为2、待存储数据库B对应第一乘积结果为2.1、待存储数据库C对应第一乘积结果为2.5、待存储数据库D对应第一乘积结果为3,第一设定数量为2,将待存储数据库A、待存储数据库B、待存储数据库C、待存储数据库D对应的第一乘积结果按从大到小排序,选取所述第一乘积结果较小的待存储数据库A、待存储数据库B作为第一候选数据库,而待存储数据库A、待存储数据库B对应的加载时间分别为0.1秒、0.11秒,选取加载时间最小的待存储数据库A作为目标数据库。Specifically, in the embodiment of the present invention, when determining the target database, for each database to be stored, determine the first of the load time, the storage space occupied, and the average utilization rate of the CPU corresponding to the database to be stored when loading the test data. Product results, sort the first product results in descending order, and select a first set number of databases to be stored with a smaller first product result as the first candidate database, that is, selecting and loading the test data consumes less resources. A small first set number of databases to be stored is used as the first candidate database, and the set number may be 2, 3, 5, and so on. Among the first candidate databases that consume less resources for loading the test data, a database to be stored with the shortest loading time is selected as the target database. For example: the result of the first product corresponding to the database A to be stored is 2, the result of the first product corresponding to the database B to be stored is 2.1, the result of the first product corresponding to the database C to be stored is 2.5, and the result of the first product corresponding to the database D to be stored is 3, The first set number is 2, and the first product results corresponding to the database A to be stored, the database B to be stored, the database C to be stored, and the database D to be stored are sorted in descending order, and the first product result is selected to be smaller The database A to be stored and database B to be stored are taken as the first candidate database, and the corresponding loading times of database A to be stored and database B to be stored are 0.1 seconds and 0.11 seconds respectively, and database A to be stored with the smallest loading time is selected as the target database .

图3为本发明实施例提供的一种数据存储过程示意图,该过程包括:3 is a schematic diagram of a data storage process provided by an embodiment of the present invention, and the process includes:

S301:针对当前待存储数据,从所述待存储数据中提取设定数量的数据作为测试数据。S301: For the current data to be stored, extract a set amount of data from the data to be stored as test data.

S302:根据所述待存储数据的类型及每个存储数据库针对的数据类型,选取与所述待存储数据的类型相对应的数据库作为待存储数据库。S302: According to the type of the data to be stored and the data type for each storage database, select a database corresponding to the type of the data to be stored as the database to be stored.

S303:如果预先设定的性能要求为加载性能优先,控制每个所述待存储数据库加载所述测试数据,确定每个所述待存储数据库加载所述测试数据的加载时间、占用的存储空间和CPU的平均利用率。S303: If the preset performance requirement is that the loading performance is the priority, control each of the to-be-stored databases to load the test data, and determine the load time, occupied storage space and Average CPU utilization.

S304:针对每个待存储数据库,确定该待存储数据库加载所述测试数据对应的加载时间、占用的存储空间和CPU的平均利用率的第一乘积结果。S304: For each database to be stored, determine a first product result of the loading time corresponding to loading the test data in the database to be stored, the occupied storage space and the average utilization rate of the CPU.

S305:将所述第一乘积结果按照从大到小的顺序排序,选取第一乘积结果较小的第一设定数量的待存储数据库作为第一候选数据库。S305: Sort the first product results in descending order, and select a first set number of databases to be stored with smaller first product results as the first candidate database.

S306:将所述第一候选数据库中加载时间最小的待存储数据库确定为目标数据库,并将所述待存储数据存储到所述目标数据库中。S306: Determine the to-be-stored database with the smallest loading time among the first candidate databases as the target database, and store the to-be-stored data in the target database.

上述步骤中S302与S301中从所述待存储数据中提取设定数量的数据作为测试数据的过程,前后顺序可以不限制,可以先选取与所述待存储数据的类型相对应的数据库作为待存储数据库,也可以先从所述待存储数据中提取设定数量的数据作为测试数据。In the above steps, in S302 and S301, the process of extracting a set amount of data from the data to be stored is used as the test data. The sequence before and after is not limited, and the database corresponding to the type of the data to be stored can be selected first as the data to be stored. The database can also extract a set amount of data from the to-be-stored data as test data.

实施例5:Example 5:

为了准确的选取满足预先设定的性能要求的目标数据库,在上述各实施例的基础上,在本发明实施例中,如果预先设定的性能要求为存储效率,确定测试类型为加载测试,所述根据所述测试类型及所述测试数据,对每个待存储数据库进行测试,确定每个待存储数据库对应的测试参数包括:In order to accurately select a target database that satisfies the preset performance requirements, on the basis of the above embodiments, in this embodiment of the present invention, if the preset performance requirement is storage efficiency, the test type is determined to be a load test, so According to the test type and the test data, each database to be stored is tested, and the test parameters corresponding to each database to be stored are determined to include:

控制每个所述待存储数据库加载所述测试数据,确定每个所述待存储数据库加载所述测试数据的加载时间、占用的存储空间和CPU的平均利用率。Control each of the to-be-stored databases to load the test data, and determine the load time, occupied storage space, and average CPU utilization of each of the to-be-stored databases to load the test data.

具体的,控制每个所述待存储数据库加载所述测试数据,因为测试数据中可能包含多条数据,因此针对每个待存储数据库,统计该待存储数据库在加载测试数据的过程中的加载时间、CPU的平均利用率,并确定该测试数据在该待存储数据库中占用的存储空间的大小。Specifically, each of the to-be-stored databases is controlled to load the test data, because the test data may contain multiple pieces of data, so for each to-be-stored database, the loading time of the to-be-stored database in the process of loading the test data is counted , the average utilization rate of the CPU, and determine the size of the storage space occupied by the test data in the database to be stored.

如果预先设定的性能要求为加载性能优先,采用测试数据对每个待存储数据库进行加载测试,获取了待测试数据库的测试数据后,所述根据所述每个待存储数据库对应的测试参数及所述预先设定的性能要求,确定目标数据库包括:If the preset performance requirement is that the loading performance is the priority, use the test data to perform a load test on each database to be stored, and after obtaining the test data of the database to be tested, according to the test parameters corresponding to each database to be stored and The preset performance requirements and determining the target database include:

针对每个待存储数据库,确定该待存储数据库加载所述测试数据对应的加载时间、占用的存储空间和CPU的平均利用率的第一乘积结果;For each database to be stored, determine the first product result of the load time corresponding to the test data loaded into the database to be stored, the occupied storage space and the average utilization rate of the CPU;

将所述第一乘积结果按照从大到小的顺序排序,选取第一乘积结果较小的第二设定数量的待存储数据库作为第二候选数据库;Sort the first product results in descending order, and select a second set number of databases to be stored with smaller first product results as the second candidate database;

将所述第二候选数据库中占用的存储空间最小的待存储数据库确定为目标数据库。The database to be stored with the smallest storage space occupied in the second candidate database is determined as the target database.

具体的,在本发明实施例中在确定目标数据库时针对每个待存储数据库,确定该待存储数据库加载所述测试数据对应的加载时间、占用的存储空间和CPU的平均利用率的第一乘积结果,将所述第一乘积结果按照从大到小排序,选取第一乘积结果较小的第二设定数量的待存储数据库作为第二候选数据库,即选取加载所述测试数据消耗资源较小的第二设定数量的待存储数据库作为第二候选数据库,该设定数量可以为2、3、5等。在加载所述测试数据的消耗资源较小的第二候选数据库中,选取占用的存储空间最小的待存储数据库,作为目标数据库。例如:待存储数据库A对应第一乘积结果为2、待存储数据库B对应第一乘积结果为2.1、待存储数据库C对应第一乘积结果为2.5、待存储数据库D对应第一乘积结果为3,第二设定数量为2,将待存储数据库A、待存储数据库B、待存储数据库C、待存储数据库D对应的第一乘积结果按从大到小排序,选取所述第一乘积结果较小的待存储数据库A、待存储数据库B作为第二候选数据库,而待存储数据库A、待存储数据库B对应的占用存储空间分别为600字节、550字节,选取占用存储空间最小的待存储数据库B作为目标数据库。Specifically, in the embodiment of the present invention, when determining the target database, for each database to be stored, determine the first product of the load time corresponding to loading the test data in the database to be stored, the occupied storage space and the average utilization rate of the CPU As a result, the first product results are sorted in descending order, and the second set number of databases to be stored with smaller first product results are selected as the second candidate database, that is, the resource consumption of loading the test data is less. The second set number of databases to be stored is used as the second candidate database, and the set number can be 2, 3, 5, etc. In the second candidate database that consumes less resources for loading the test data, the database to be stored with the smallest occupied storage space is selected as the target database. For example: the result of the first product corresponding to the database A to be stored is 2, the result of the first product corresponding to the database B to be stored is 2.1, the result of the first product corresponding to the database C to be stored is 2.5, and the result of the first product corresponding to the database D to be stored is 3, The second set number is 2, the first product results corresponding to the database A to be stored, the database B to be stored, the database C to be stored, and the database D to be stored are sorted in descending order, and the first product result is selected to be smaller The to-be-stored database A and the to-be-stored database B are used as the second candidate database, and the occupied storage space corresponding to the to-be-stored database A and the to-be-stored database B are 600 bytes and 550 bytes respectively, and the database to be stored with the smallest occupied storage space is selected. B as the target database.

图4为本发明实施例提供的一种数据存储过程示意图,该过程包括:4 is a schematic diagram of a data storage process provided by an embodiment of the present invention, and the process includes:

S401:针对当前待存储数据,从所述待存储数据中提取设定数量的数据作为测试数据。S401: For the current data to be stored, extract a set amount of data from the data to be stored as test data.

S402:根据所述待存储数据的类型及每个存储数据库针对的数据类型,选取与所述待存储数据的类型相对应的数据库作为待存储数据库。S402: According to the type of the data to be stored and the data type for each storage database, select a database corresponding to the type of the data to be stored as the database to be stored.

S403:如果预先设定的性能要求为存储效率,控制每个所述待存储数据库加载所述测试数据,确定每个所述待存储数据库加载所述测试数据的加载时间、占用的存储空间和CPU的平均利用率。S403: If the preset performance requirement is storage efficiency, control each of the to-be-stored databases to load the test data, and determine the load time, occupied storage space and CPU for loading the test data from each of the to-be-stored databases average utilization.

S404:针对每个待存储数据库,确定该待存储数据库加载所述测试数据对应的加载时间、占用的存储空间和CPU的平均利用率的第一乘积结果。S404: For each database to be stored, determine a first product result of the loading time corresponding to loading the test data in the database to be stored, the occupied storage space, and the average utilization rate of the CPU.

S405:将所述第一乘积结果按照从大到小的顺序排序,选取第一乘积结果较小的第二设定数量的待存储数据库作为第二候选数据库。S405: Sort the first product results in descending order, and select a second set number of databases to be stored with smaller first product results as second candidate databases.

S406:将所述第二候选数据库中占用的存储空间最小的待存储数据库确定为目标数据库,并将所述待存储数据存储到所述目标数据库中。S406: Determine the database to be stored with the smallest storage space occupied in the second candidate database as the target database, and store the data to be stored in the target database.

上述步骤中S402与S401中从所述待存储数据中提取设定数量的数据作为测试数据的过程,前后顺序可以不限制,可以先选取与所述待存储数据的类型相对应的数据库作为待存储数据库,也可以先从所述待存储数据中提取设定数量的数据作为测试数据。In the above steps S402 and S401, the process of extracting a set amount of data from the data to be stored as the test data, the order before and after can be unlimited, and the database corresponding to the type of the data to be stored can be selected as the data to be stored. The database can also extract a set amount of data from the to-be-stored data as test data.

实施例6:Example 6:

为了准确的选取满足预先设定的性能要求的目标数据库,在上述各实施例的基础上,在本发明实施例中,如果预先设定的性能要求为查询性能优先,确定测试类型为查询测试,所述根据所述测试类型及所述测试数据,对每个待存储数据库进行测试,确定每个待存储数据库对应的测试参数包括:In order to accurately select the target database that meets the preset performance requirements, on the basis of the above embodiments, in this embodiment of the present invention, if the preset performance requirements are query performance priority, the test type is determined to be query test, According to the test type and the test data, each database to be stored is tested, and the test parameters corresponding to each database to be stored are determined to include:

在每个所述待存储数据库中查询所述测试数据中每条数据,确定每个待存储数据库对所述测试数据中每条数据进行查询的平均响应时间、平均网络数据传输量和CPU平均利用率。Query each piece of data in the test data in each of the to-be-stored databases, and determine the average response time, average network data transmission volume, and average CPU utilization of each to-be-stored database for querying each piece of data in the test data Rate.

具体的,因为测试数据中可能包含多条数据,因此在每个待存储数据库,中查询所述测试数据中每条数据,统计该待存储数据库中查询所述测试数据中每条数据过程中的平均响应时间、平均网络数据传输量和CPU平均利用率。Specifically, because the test data may contain multiple pieces of data, each piece of data in the test data is queried in each database to be stored, and the data in the process of querying each piece of data in the test data in the database to be stored is counted. Average response time, average network data transfer, and average CPU utilization.

如果预先设定的性能要求为查询性能优先,采用测试数据对每个待存储数据库进行查询测试,获取了待测试数据库的测试数据后,所述根据所述每个待存储数据库对应的测试参数及所述预先设定的性能要求,确定目标数据库包括:If the preset performance requirement is query performance priority, use the test data to perform a query test on each database to be stored, and after obtaining the test data of the database to be tested, the test parameters corresponding to each database to be stored and The preset performance requirements and determining the target database include:

针对每个待存储数据库,确定该待存储数据库中对所述测试数据中每条数据进行查询对应的平均响应时间、平均网络数据传输量和CPU平均利用率的第二乘积结果;For each database to be stored, determine the second product result of the average response time, the average network data transmission volume and the average CPU utilization rate corresponding to the query of each piece of data in the test data in the database to be stored;

将所述第二乘积结果按照从大到小的顺序排序,选取第二乘积结果较小的第三设定数量的待存储数据库作为第三候选数据库;Sort the second product results in descending order, and select a third set number of databases to be stored with smaller second product results as the third candidate database;

将所述第三候选数据库中平均响应时间最小的待存储数据库确定为目标数据库。The database to be stored with the smallest average response time among the third candidate databases is determined as the target database.

具体的,在本发明实施例中在确定目标数据库时,针对每个待存储数据库,确定该待存储数据库中对所述测试数据中每条数据进行查询对应的平均响应时间、平均网络数据传输量和CPU平均利用率的第二乘积结果,将所述第二乘积结果按照从大到小排序,选取第二乘积结果较小的第三设定数量的待存储数据库最为第三候选数据库,即选取查询所述测试数据中每条数据消耗的平均资源较小的第三设定数量的待存储数据库作为第三候选数据库,该设定数量可以为2、3、5等。在查询所述测试数据中每条数据消耗的平均资源较小第三候选数据库中,选取平均响应时间最小的数据库,作为目标数据库。例如:待存储数据库A对应第二乘积结果为3、待存储数据库B对应第二乘积结果为2.8、待存储数据库C对应第二乘积结果为2.6、待存储数据库D对应第二乘积结果为2.5,第三设定数量为2,将待存储数据库A、待存储数据库B、待存储数据库C、待存储数据库D对应的第二乘积结果按从大到小排序,选取所述第二乘积结果较小的待存储数据库C、待存储数据库D作为第三候选数据库,而待存储数据库C、待存储数据库D对应的平均响应时间分别为0.11秒、0.1秒,选取平均响应时间最小的待存储数据库D作为目标数据库。Specifically, in the embodiment of the present invention, when determining the target database, for each database to be stored, the average response time and the average network data transmission volume corresponding to the query for each piece of data in the test data in the database to be stored are determined. and the second product result of the average CPU utilization rate, sort the second product results in descending order, and select the third set number of databases to be stored with smaller second product results as the third candidate database, that is, select A third set number of databases to be stored with a smaller average resource consumption per piece of data in the test data is queried as a third candidate database, and the set number may be 2, 3, 5, or the like. In querying the third candidate database where the average resource consumption of each piece of data in the test data is smaller, the database with the smallest average response time is selected as the target database. For example: the result of the second product corresponding to the database A to be stored is 3, the result of the second product corresponding to the database B to be stored is 2.8, the result of the second product corresponding to the database C to be stored is 2.6, and the result of the second product corresponding to the database D to be stored is 2.5, The third set number is 2, the second product results corresponding to the to-be-stored database A, the to-be-stored database B, the to-be-stored database C, and the to-be-stored database D are sorted in descending order, and the second product result is selected to be smaller The database C to be stored and the database D to be stored are taken as the third candidate database, and the average response times corresponding to the database C to be stored and the database D to be stored are 0.11 seconds and 0.1 seconds respectively, and the database D to be stored with the smallest average response time is selected as target database.

图5为本发明实施例提供的一种数据存储过程示意图,该过程包括:5 is a schematic diagram of a data storage process provided by an embodiment of the present invention, and the process includes:

S501:针对当前待存储数据,从所述待存储数据中提取设定数量的数据作为测试数据。S501: For the current data to be stored, extract a set amount of data from the data to be stored as test data.

S502:根据所述待存储数据的类型及每个存储数据库针对的数据类型,选取与所述待存储数据的类型相对应的数据库作为待存储数据库。S502: According to the type of the data to be stored and the data type for each storage database, select a database corresponding to the type of the data to be stored as the database to be stored.

S503:如果预先设定的性能要求为查询性能优先,在每个所述待存储数据库中查询所述测试数据中每条数据,确定每个待存储数据库对所述测试数据中每条数据进行查询的平均响应时间、平均网络数据传输量和CPU平均利用率。S503: If the preset performance requirement is query performance priority, query each piece of data in the test data in each of the databases to be stored, and determine that each database to be stored is queried for each piece of data in the test data average response time, average network data transfer volume, and average CPU utilization.

S504:针对每个待存储数据库,确定该待存储数据库中对所述测试数据中每条数据进行查询对应的平均响应时间、平均网络数据传输量和CPU平均利用率的第二乘积结果。S504: For each database to be stored, determine the second product result of the average response time, the average network data transmission amount, and the average CPU utilization rate corresponding to the query for each piece of data in the test data in the database to be stored.

S505:将所述第二乘积结果按照从大到小的顺序排序,选取第二乘积结果较小的第三设定数量的待存储数据库作为第三候选数据库。S505: Sort the second product results in descending order, and select a third set number of databases to be stored with smaller second product results as the third candidate database.

S506:将所述第三候选数据库中平均响应时间最小的待存储数据库确定为目标数据库,并将所述待存储数据存储到所述目标数据库中。S506: Determine the database to be stored with the smallest average response time in the third candidate database as the target database, and store the data to be stored in the target database.

上述步骤中S502与S501中从所述待存储数据中提取设定数量的数据作为测试数据的过程,前后顺序可以不限制,可以先选取与所述待存储数据的类型相对应的数据库作为待存储数据库,也可以先从所述待存储数据中提取设定数量的数据作为测试数据。In the above steps, in S502 and S501, the process of extracting a set amount of data as the test data from the data to be stored, the order before and after is not limited, and the database corresponding to the type of the data to be stored can be selected as the data to be stored. The database can also extract a set amount of data from the to-be-stored data as test data.

实施例7:Example 7:

图6为本发明实施例提供的一种数据存储装置结构示意图,该装置包括:6 is a schematic structural diagram of a data storage device according to an embodiment of the present invention, where the device includes:

提取模块61,用于针对当前待存储数据,从所述待存储数据中提取设定数量的数据作为测试数据;The extraction module 61 is used for extracting a set amount of data as test data from the data to be stored for the current data to be stored;

第一确定模块63,用于根据预先设定的性能要求,确定对待存储数据库进行测试的测试类型;The first determination module 63 is configured to determine the test type to be tested on the database to be stored according to the preset performance requirements;

第二确定模块64,用于根据所述测试类型及所述测试数据,对每个待存储数据库进行测试,确定每个待存储数据库对应的测试参数;The second determination module 64 is configured to test each database to be stored according to the test type and the test data, and determine the test parameters corresponding to each database to be stored;

第三确定模块65,用于根据所述每个待存储数据库对应的测试参数及所述预先设定的性能要求,确定目标数据库,并将所述待存储数据存储到所述目标数据库中。The third determining module 65 is configured to determine a target database according to the test parameters corresponding to each database to be stored and the preset performance requirements, and store the data to be stored in the target database.

所述装置还包括:The device also includes:

选取模块62,用于根据所述待存储数据的类型及每个存储数据库针对的数据类型,选取与所述待存储数据的类型相对应的数据库作为待存储数据库。The selecting module 62 is configured to select a database corresponding to the type of the data to be stored as the database to be stored according to the type of the data to be stored and the data type for each storage database.

所述第一确定模块63,具体用于如果所述预先设定的性能要求为加载性能优先或存储效率优先,确定对所述待存储数据库进行加载测试;如果所述预先设定的性能要求为查询性能优先,确定对所述待存储数据库进行查询测试。The first determining module 63 is specifically configured to determine to perform a load test on the to-be-stored database if the preset performance requirement is the priority of loading performance or the priority of storage efficiency; if the preset performance requirement is Query performance is prioritized, and it is determined to perform a query test on the database to be stored.

所述第二确定模块64,具体用于如果测试类型为加载测试,控制每个所述待存储数据库加载所述测试数据,确定每个所述待存储数据库加载所述测试数据的加载时间、占用的存储空间和CPU的平均利用率。The second determination module 64 is specifically configured to control each of the to-be-stored databases to load the test data if the test type is a load test, and to determine the loading time and occupation of each of the to-be-stored databases to load the test data. The average utilization of storage space and CPU.

所述第二确定模块64,具体用于如果测试类型为查询测试,在每个所述待存储数据库中查询所述测试数据中每条数据,确定每个待存储数据库对所述测试数据中每条数据进行查询的平均响应时间、平均网络数据传输量和CPU平均利用率。The second determination module 64 is specifically configured to query each piece of data in the test data in each of the databases to be stored if the test type is a query test, and determine whether each database to be stored is responsible for each piece of the test data. The average response time, average network data transfer volume, and average CPU utilization for querying data from a single piece of data.

所述第三确定模块65,具体用于如果所述预先设定的性能要求为加载性能优先,针对每个待存储数据库,确定该待存储数据库加载所述测试数据对应的加载时间、占用的存储空间和CPU的平均利用率的第一乘积结果;将所述第一乘积结果按照从大到小的顺序排序,选取第一乘积结果较小的第一设定数量的待存储数据库作为第一候选数据库;将所述第一候选数据库中加载时间最小的待存储数据库确定为目标数据库。The third determining module 65 is specifically configured to determine, for each database to be stored, the loading time and storage occupied corresponding to loading the test data in the database to be stored if the preset performance requirement is priority for loading performance. The first product result of the average utilization rate of space and CPU; sort the first product results in descending order, and select the first set number of databases to be stored with smaller first product results as the first candidate database; determining the database to be stored with the smallest loading time among the first candidate databases as the target database.

所述第三确定模块65,具体用于如果所述预先设定的性能要求为存储效率优先,针对每个待存储数据库,确定该待存储数据库加载所述测试数据对应的加载时间、占用的存储空间和CPU的平均利用率的第一乘积结果;将所述第一乘积结果按照从大到小的顺序排序,选取第一乘积结果较小的第二设定数量的待存储数据库作为第二候选数据库;将所述第二候选数据库中占用的存储空间最小的待存储数据库确定为目标数据库。The third determining module 65 is specifically configured to determine, for each database to be stored, the loading time and storage occupied corresponding to loading the test data in the database to be stored if the preset performance requirement is storage efficiency priority. The first product result of the average utilization rate of the space and the CPU; sort the first product results in descending order, and select a second set number of databases to be stored with smaller first product results as the second candidate database; determining the database to be stored with the smallest storage space occupied in the second candidate database as the target database.

所述第三确定模块65,具体用于如果所述预先设定的性能要求为查询性能优先,针对每个待存储数据库,确定该待存储数据库中对所述测试数据中每条数据进行查询对应的平均响应时间、平均网络数据传输量和CPU平均利用率的第二乘积结果;将所述第二乘积结果按照从大到小的顺序排序,选取第二乘积结果较小的第三设定数量的待存储数据库作为第三候选数据库;将所述第三候选数据库中平均响应时间最小的待存储数据库确定为目标数据库。The third determining module 65 is specifically configured to, for each database to be stored, determine the corresponding data in the database to be stored for querying each piece of data in the test data if the preset performance requirement is query performance priority. The second product result of the average response time, the average network data transmission volume and the average CPU utilization rate; sort the second product results in descending order, and select the third set number with the second product result smaller The database to be stored is used as the third candidate database; the database to be stored with the smallest average response time among the third candidate databases is determined as the target database.

本发明实施例公开了一种数据存储方法及装置,应用于电子设备,该方法包括;针对当前待存储数据,从所述待存储数据中提取设定数量的数据作为测试数据;根据预先设定的性能要求,确定对待存储数据库进行测试的测试类型;根据所述测试类型及所述测试数据,对每个待存储数据库进行测试,确定每个待存储数据库对应的测试参数;根据所述每个待存储数据库对应的测试参数及所述预先设定的性能要求,确定目标数据库,并将所述待存储数据存储到所述目标数据库中。由于本发明实施例中,在待存储的数据中提取设定数量的数据作为测试数据,根据预先设定的性能要求,采用对应的测试类型,对每个待存储数据库进行测试,从而根据每个待存储数据库对应的测试参数,确定目标数据库,因此选择的目标数据库是满足当前性能要求的数据库,从而使数据的存储更加的合理,并提高了用户的体验。The embodiment of the present invention discloses a data storage method and device, which are applied to electronic equipment. The method includes: for current data to be stored, extracting a set amount of data from the to-be-stored data as test data; According to the test type and the test data, each database to be stored is tested, and the corresponding test parameters of each database to be stored are determined; The test parameters corresponding to the database to be stored and the preset performance requirements are determined, a target database is determined, and the data to be stored is stored in the target database. Because in the embodiment of the present invention, a set amount of data is extracted from the data to be stored as test data, and according to the preset performance requirements, the corresponding test type is used to test each database to be stored, so that according to each The test parameters corresponding to the database to be stored determine the target database. Therefore, the selected target database is a database that meets the current performance requirements, thereby making data storage more reasonable and improving user experience.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit and scope of the invention. Thus, provided that these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims (11)

1. A data storage method is applied to an electronic device, and the method comprises the following steps:
aiming at the current data to be stored, extracting a set amount of data from the data to be stored as test data;
determining a test type for testing a database to be stored according to a preset performance requirement;
testing each database to be stored according to the test type and the test data, and determining a test parameter corresponding to each database to be stored;
determining a target database according to the test parameters corresponding to each database to be stored and the preset performance requirements, and storing the data to be stored into the target database;
wherein, if the preset performance requirement is that the loading performance is prior, the determining the target database according to the test parameters corresponding to each database to be stored and the preset performance requirement comprises:
determining a first product result of loading time corresponding to the test data loaded by the database to be stored, occupied storage space and average utilization rate of a CPU (central processing unit) for each database to be stored;
sorting the first product results in a descending order, and selecting a first set number of databases to be stored with smaller first product results as first candidate databases;
determining a database to be stored with the minimum loading time in the first candidate database as a target database;
if the preset performance requirement is that storage efficiency is first, determining a target database according to the test parameters corresponding to each database to be stored and the preset performance requirement comprises:
determining a first product result of loading time corresponding to the test data loaded by the database to be stored, occupied storage space and average utilization rate of a CPU (central processing unit) for each database to be stored;
sorting the first product results in a descending order, and selecting a second set number of databases to be stored with smaller first product results as second candidate databases;
determining the database to be stored with the minimum storage space occupied in the second candidate database as a target database;
if the preset performance requirement is that the query performance is prior, determining a target database according to the test parameters corresponding to each database to be stored and the preset performance requirement comprises:
determining a second product result of average response time, average network data transmission quantity and CPU average utilization rate corresponding to each piece of data in the test data queried in each to-be-stored database;
sorting the second product results in a descending order, and selecting a third set number of databases to be stored with smaller second product results as a third candidate database;
and determining the database to be stored with the minimum average response time in the third candidate databases as a target database.
2. The method of claim 1, wherein before determining the type of test to test the database to be stored according to the predetermined performance requirement, the method further comprises:
and selecting a database corresponding to the type of the data to be stored as the database to be stored according to the type of the data to be stored and the data type aimed at by each storage database.
3. The method of claim 1, wherein the performance requirements comprise:
the method has the advantages of priority of loading performance, priority of storage efficiency and priority of query performance.
4. The method of claim 3, wherein determining the type of test to test the database to be stored according to the predetermined performance requirement comprises:
if the preset performance requirement is that loading performance is prior or storage efficiency is prior, determining to carry out loading test on the database to be stored;
and if the preset performance requirement is that the query performance is prior, determining to perform query test on the database to be stored.
5. The method of claim 4, wherein if the test type is a load test, the testing each database to be stored according to the test type and the test data, and determining the test parameters corresponding to each database to be stored comprises:
and controlling each database to be stored to load the test data, and determining the loading time, occupied storage space and the average utilization rate of the CPU for each database to be stored to load the test data.
6. The method of claim 4, wherein if the test type is query test, the testing each database to be stored according to the test type and the test data, and determining the test parameters corresponding to each database to be stored comprises:
and inquiring each piece of data in the test data in each database to be stored, and determining the average response time, the average network data transmission quantity and the average CPU utilization rate of each database to be stored for inquiring each piece of data in the test data.
7. A data storage device, for use in an electronic device, the device comprising:
the extraction module is used for extracting a set amount of data from the data to be stored as test data aiming at the current data to be stored;
the first determining module is used for determining the test type for testing the database to be stored according to the preset performance requirement;
the second determining module is used for testing each database to be stored according to the test type and the test data and determining the test parameters corresponding to each database to be stored;
a third determining module, configured to determine a target database according to the test parameters corresponding to each to-be-stored database and the preset performance requirement, and store the to-be-stored data in the target database;
the third determining module is specifically configured to determine, for each to-be-stored database, a first product result of loading time, occupied storage space, and average utilization rate of the CPU, where the loading time, occupied storage space, and average utilization rate correspond to loading of the test data by the to-be-stored database, if the preset performance requirement is that loading performance is prioritized; sorting the first product results in a descending order, and selecting a first set number of databases to be stored with smaller first product results as first candidate databases; determining a database to be stored with the minimum loading time in the first candidate database as a target database;
if the preset performance requirement is that the storage efficiency is prior, determining a first product result of loading time corresponding to the test data loaded by the database to be stored, occupied storage space and the average utilization rate of the CPU for each database to be stored; sorting the first product results in a descending order, and selecting a second set number of databases to be stored with smaller first product results as second candidate databases; determining the database to be stored with the minimum storage space occupied in the second candidate database as a target database;
if the preset performance requirement is that the query performance is prior, determining a second product result of average response time, average network data transmission quantity and CPU average utilization rate corresponding to the query of each piece of data in the test data in each database to be stored aiming at each database to be stored; sorting the second product results in a descending order, and selecting a third set number of databases to be stored with smaller second product results as a third candidate database; and determining the database to be stored with the minimum average response time in the third candidate databases as a target database.
8. The apparatus of claim 7, wherein the apparatus further comprises:
and the selection module is used for selecting the database corresponding to the type of the data to be stored as the database to be stored according to the type of the data to be stored and the data type aimed at by each storage database.
9. The apparatus according to claim 7, wherein the first determining module is specifically configured to determine to perform a load test on the database to be stored if the preset performance requirement is a load performance priority or a storage efficiency priority; and if the preset performance requirement is that the query performance is prior, determining to perform query test on the database to be stored.
10. The apparatus according to claim 9, wherein the second determining module is specifically configured to, if the test type is a load test, control each of the databases to be stored to load the test data, and determine a load time, an occupied storage space, and an average utilization rate of the CPU for each of the databases to be stored to load the test data.
11. The apparatus according to claim 9, wherein the second determining module is specifically configured to, if the test type is a query test, query each piece of data in the test data in each of the databases to be stored, and determine an average response time, an average network data transmission amount, and an average CPU utilization rate of each database to be stored for querying each piece of data in the test data.
CN201611070058.9A 2016-11-25 2016-11-25 A data storage method and device Active CN108108384B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611070058.9A CN108108384B (en) 2016-11-25 2016-11-25 A data storage method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611070058.9A CN108108384B (en) 2016-11-25 2016-11-25 A data storage method and device

Publications (2)

Publication Number Publication Date
CN108108384A CN108108384A (en) 2018-06-01
CN108108384B true CN108108384B (en) 2020-10-09

Family

ID=62206105

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611070058.9A Active CN108108384B (en) 2016-11-25 2016-11-25 A data storage method and device

Country Status (1)

Country Link
CN (1) CN108108384B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109189785A (en) * 2018-08-10 2019-01-11 平安科技(深圳)有限公司 Date storage method, device, computer equipment and storage medium
CN109256173A (en) * 2018-08-13 2019-01-22 中国航空无线电电子研究所 On-board memory devices test macro
CN110895450A (en) * 2019-11-01 2020-03-20 中电和瑞科技有限公司 A data storage method and device, storage medium and computer equipment
CN110990606B (en) * 2019-12-11 2023-10-03 Tcl移动通信科技(宁波)有限公司 Picture storage method and device, storage medium and electronic equipment
US11645424B2 (en) * 2020-04-27 2023-05-09 International Business Machines Corporation Integrity verification in cloud key-value stores
CN113760889B (en) * 2020-11-09 2024-05-17 北京沃东天骏信息技术有限公司 Data processing method, device, computer system and computer readable storage medium
CN113032402B (en) * 2021-04-09 2024-01-12 北京百度网讯科技有限公司 Methods, devices, equipment and storage media for storing data and obtaining data
CN113268681A (en) * 2021-07-05 2021-08-17 数字广东网络建设有限公司 User home location identification method and device
CN113449042B (en) * 2021-07-14 2024-06-21 中国银行股份有限公司 Automatic data warehouse separation method and device
CN114201508B (en) * 2021-12-14 2025-09-02 建信金融科技有限责任公司 Data processing method, data processing device, electronic device and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7761420B2 (en) * 2007-10-16 2010-07-20 International Business Machines Corporation Method and system for replicating objects
CN101742531B (en) * 2008-11-13 2013-03-20 中国移动通信集团设计院有限公司 Method and device for storing test data
DE102010033512A1 (en) * 2010-09-28 2012-03-29 Siemens Aktiengesellschaft Method for increasing performance of memory system for permanent storage of medical image data, involves storing defragmented data in sequence and calling data of respective applications
CN103905517A (en) * 2012-12-28 2014-07-02 中国移动通信集团公司 Data storage method and equipment
US9465715B2 (en) * 2014-06-12 2016-10-11 Oracle International Corporation Optimizing the number of shared processes executing in a computer system
CN105550274B (en) * 2015-12-10 2019-01-25 曙光信息产业(北京)有限公司 The querying method and device of this parallel database of two-pack
CN105608138B (en) * 2015-12-18 2019-03-12 贵州大学 A system for optimizing parallel data loading performance of array database

Also Published As

Publication number Publication date
CN108108384A (en) 2018-06-01

Similar Documents

Publication Publication Date Title
CN108108384B (en) A data storage method and device
US11055360B2 (en) Data write-in method and apparatus in a distributed file system
CN107728874A (en) The method, apparatus and equipment of user prompt operation are provided
CN106407207B (en) Real-time newly-added data updating method and device
CN109873904A (en) User of message status report process method, device and the storage medium of message push
CN106775470B (en) Data storage method and system
US10417192B2 (en) File classification in a distributed file system
US20200274549A1 (en) Compression Of High Dynamic Ratio Fields For Machine Learning
US20160364176A1 (en) Method for Storing Data and Device Thereof
US10394838B2 (en) App store searching
CN111582967A (en) Content search method, apparatus, device and storage medium
CN109801693B (en) Medical records grouping method and device, terminal and computer readable storage medium
US20150081710A1 (en) Data typing with probabilistic maps having imbalanced error costs
CN106407226B (en) A data processing method, backup server and storage system
WO2015014260A1 (en) Data processing method and server therefor
CN114265849B (en) Data aggregation method and system
CN109241360B (en) Matching method and device of combined character strings and electronic equipment
CN110688223B (en) Data processing method and related product
WO2025123839A1 (en) Data detection method and apparatus, object recommendation method and apparatus, and device and medium
CN114936187B (en) Data file processing method, device, equipment and storage medium
CN117130563A (en) Solid state disk capacity sharing method and device, electronic equipment and medium
CN117112941A (en) Dictionary acquisition method, dictionary acquisition device, computer device, storage medium, and program product
CN119003829A (en) Vector retrieval method, vector retrieval device, electronic equipment and storage medium
CN105468603B (en) Data selecting method and device
CN116737373A (en) Load balancing method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant