CN115129589B - A database testing method and device - Google Patents
A database testing method and device Download PDFInfo
- Publication number
- CN115129589B CN115129589B CN202210731397.6A CN202210731397A CN115129589B CN 115129589 B CN115129589 B CN 115129589B CN 202210731397 A CN202210731397 A CN 202210731397A CN 115129589 B CN115129589 B CN 115129589B
- Authority
- CN
- China
- Prior art keywords
- distributed
- transaction
- data storage
- distributed transaction
- database
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 115
- 238000005192 partition Methods 0.000 claims abstract description 106
- 238000013500 data storage Methods 0.000 claims abstract description 84
- 238000000034 method Methods 0.000 claims abstract description 52
- 238000004590 computer program Methods 0.000 claims description 18
- 238000012545 processing Methods 0.000 abstract description 18
- 238000010586 diagram Methods 0.000 description 15
- 230000008569 process Effects 0.000 description 14
- 230000006870 function Effects 0.000 description 9
- 230000006872 improvement Effects 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 6
- 238000009662 stress testing Methods 0.000 description 4
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 3
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 3
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 239000006227 byproduct Substances 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 229920001296 polysiloxane Polymers 0.000 description 1
- 239000000047 product Substances 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
- 239000010979 ruby Substances 0.000 description 1
- 229910001750 ruby Inorganic materials 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000009897 systematic effect Effects 0.000 description 1
- 238000010998 test method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/466—Transaction processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本说明书公开了一种数据库的测试方法及装置,可以根据期望生成的分布式事务跨数据存储节点的数量,确定生成分布式事务所需的分区键的数量,以生成满足期望生成的分布式事务跨数据存储节点的数量的分布式事务,进而可以通过生成的满足测试需求的分布式事务,有效的对数据库处理分布式事务的效率进行测试。
The present specification discloses a method and device for testing a database, which can determine the number of partition keys required to generate distributed transactions according to the number of distributed transactions across data storage nodes expected to be generated, so as to generate distributed transactions that meet the expected number of distributed transactions across data storage nodes to be generated, and then the efficiency of the database in processing distributed transactions can be effectively tested by generating distributed transactions that meet the test requirements.
Description
技术领域Technical Field
本说明书涉及计算机技术领域,尤其涉及一种数据库的测试方法及装置。The present invention relates to the field of computer technology, and in particular to a method and device for testing a database.
背景技术Background Art
随着计算机技术的发展,数据库所需要存储的数据量也在不断增多,而单机数据库往往不能容纳这些激增的数据量,因此,各业务平台往往会将数据表拆分成分区表来存储在多个物理节点中,进而可以通过这种分布式数据库来存储这些日益增长的数据,但是,由于每个物理节点中通常只存放了一部分数据,因此,在用户需要对数据进行操作时,可能会访问多个节点,从而产生分布式事务,而分布式事务的处理对分布式数据库的性能的影响较大,所以,分布式数据库对分布式事务的处理效率则是对数据库进行评测的一个重点。With the development of computer technology, the amount of data that databases need to store is also increasing, and stand-alone databases often cannot accommodate this surge in data. Therefore, various business platforms often split data tables into partitioned tables to store them in multiple physical nodes, and then use this distributed database to store these growing data. However, since each physical node usually only stores a part of the data, when users need to operate on the data, they may access multiple nodes, thereby generating distributed transactions. The processing of distributed transactions has a greater impact on the performance of distributed databases. Therefore, the processing efficiency of distributed databases on distributed transactions is a key point in evaluating databases.
目前,常用的分布式数据库评测方式的测试效果较差,不能很好的测试出分布式数据库对分布式事务的处理效率。At present, the test effect of the commonly used distributed database evaluation method is poor and cannot effectively test the processing efficiency of the distributed database for distributed transactions.
因此,如何能够有效地对分布式数据库处理分布式事务的效率进行测试,则是一个亟待解决的问题。Therefore, how to effectively test the efficiency of distributed databases in processing distributed transactions is an urgent problem to be solved.
发明内容Summary of the invention
本说明书提供一种数据库的测试方法及装置,以解决现有技术存在的不能有效对分布式数据库处理分布式事务的效率进行测试的问题。The present specification provides a database testing method and device to solve the problem in the prior art that the efficiency of a distributed database in processing distributed transactions cannot be effectively tested.
本说明书采用下述技术方案:This manual adopts the following technical solutions:
本说明书提供了一种数据库的测试方法,包括:This specification provides a database testing method, including:
获取测试分布式数据库所需的测试参数,所述测试参数包括:所述分布式数据库对应的各数据存储节点的数量、期望数量,所述期望数量用于表示期望生成的分布式事务跨数据存储节点的数量;Acquire test parameters required for testing a distributed database, the test parameters including: the number and expected number of data storage nodes corresponding to the distributed database, the expected number being used to indicate the number of distributed transactions across data storage nodes that are expected to be generated;
根据所述测试参数,确定在生成的分布式事务实际跨数据存储节点的数量满足所述期望数量的条件下,分布式事务所需的分区键的数量;Determine, according to the test parameters, the number of partition keys required for the distributed transaction under the condition that the number of data storage nodes actually spanned by the generated distributed transaction meets the expected number;
根据所述分区键的数量,生成分布式事务;Generate a distributed transaction according to the number of partition keys;
根据所述分布式事务,对所述分布式数据库进行测试。The distributed database is tested according to the distributed transaction.
可选地,获取测试分布式数据库所需的测试参数,具体包括:Optionally, obtain test parameters required for testing the distributed database, including:
获取用户所使用的客户端发送的配置文件;Get the configuration file sent by the client used by the user;
根据所述配置文件,确定测试分布式数据库所需的测试参数。According to the configuration file, test parameters required for testing the distributed database are determined.
可选地,根据所述测试参数,确定在生成的分布式事务实际跨数据存储节点的数量满足所述期望数量的条件下,分布式事务所需的分区键的数量,具体包括:Optionally, according to the test parameters, determining the number of partition keys required for the distributed transaction under the condition that the number of data storage nodes actually spanned by the generated distributed transaction meets the expected number specifically includes:
根据所述测试参数,以及预先确定出的数据关联关系,确定在生成的分布式事务实际跨数据存储节点的数量满足所述期望数量的条件下,分布式事务所需的分区键的数量,所述数据关联关系用于表示所述分布式数据库对应的各数据存储节点的数量、所述期望数量、所述分布式事务所需的分区键的数量之间的关联。According to the test parameters and the predetermined data association relationship, the number of partition keys required for the distributed transaction is determined under the condition that the number of data storage nodes actually crossed by the generated distributed transaction meets the expected number. The data association relationship is used to represent the association between the number of data storage nodes corresponding to the distributed database, the expected number, and the number of partition keys required for the distributed transaction.
可选地,确定数据关联关系,具体包括:Optionally, determining the data association relationship specifically includes:
针对所述分布式数据库对应的每个数据存储节点,确定该数据存储节点中存储有分布式事务执行所需要的数据的概率;For each data storage node corresponding to the distributed database, determining the probability that the data storage node stores data required for the distributed transaction execution;
根据每个数据存储节点中包含有分布式事务执行所需要的数据的概率,确定所述数据关联关系。The data association relationship is determined according to the probability that each data storage node contains data required for the distributed transaction execution.
可选地,根据所述分区键的数量,生成分布式事务,具体包括:Optionally, generating a distributed transaction according to the number of partition keys specifically includes:
从所述分布式数据库的各数据分区所包含的各分区键中,选取所述分区键的数量的分区键;Selecting the number of partition keys from the partition keys included in each data partition of the distributed database;
根据选取出的所述分区键的数量的分区键,生成分布式事务。A distributed transaction is generated according to the partition keys of the selected number of partition keys.
可选地,根据选取出的所述数量的分区键,生成分布式事务,具体包括:Optionally, generating a distributed transaction according to the selected number of partition keys specifically includes:
将预设的事务模板中预留的事务执行所需分区键的占位符,修改为选取出的所述数量的分区键,生成分布式事务。The placeholders of the partition keys required for transaction execution reserved in the preset transaction template are modified to the selected number of partition keys to generate a distributed transaction.
可选地,根据所述分布式事务,根据所述分布式事务,对所述分布式数据库进行测试,具体包括:Optionally, testing the distributed database according to the distributed transaction specifically includes:
根据预设的负载均衡分配策略,将生成的所述分布式事务,分配到至少部分数据存储节点中,以对所述分布式数据库进行测试。According to a preset load balancing distribution strategy, the generated distributed transaction is distributed to at least part of the data storage nodes to test the distributed database.
可选地,根据所述分区键的数量,生成分布式事务之前,所述方法还包括:Optionally, before generating a distributed transaction according to the number of partition keys, the method further includes:
获取用户输入的期望分布式事务比例,所述期望分布式事务比例用于表示生成的分布式事务占生成的全部事务的比例;Obtaining an expected distributed transaction ratio input by a user, where the expected distributed transaction ratio is used to indicate the ratio of the generated distributed transactions to all generated transactions;
根据所述分区键的数量,生成分布式事务,具体包括:According to the number of partition keys, a distributed transaction is generated, specifically including:
根据所述期望分布式事务比例,以及所述分区键的数量,生成分布式事务。A distributed transaction is generated according to the expected distributed transaction ratio and the number of partition keys.
本说明书提供了一种数据库的测试装置,包括:This specification provides a database testing device, including:
获取模块,用于获取测试分布式数据库所需的测试参数,所述测试参数包括:所述分布式数据库对应的各数据存储节点的数量、期望数量,所述期望数量用于表示期望生成的分布式事务跨数据存储节点的数量;An acquisition module is used to acquire test parameters required for testing a distributed database, wherein the test parameters include: the number and expected number of data storage nodes corresponding to the distributed database, wherein the expected number is used to indicate the number of distributed transactions across data storage nodes that are expected to be generated;
确定模块,用于根据所述测试参数,确定在生成的分布式事务实际跨数据存储节点的数量满足所述期望数量的条件下,分布式事务所需的分区键的数量;A determination module, configured to determine, based on the test parameters, the number of partition keys required for a distributed transaction under the condition that the number of data storage nodes actually spanned by the generated distributed transaction meets the expected number;
生成模块,用于根据所述分区键的数量,生成分布式事务;A generation module, used for generating a distributed transaction according to the number of partition keys;
测试模块,用于根据所述分布式事务,对所述分布式数据库进行测试。A testing module is used to test the distributed database according to the distributed transaction.
本说明书提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述数据库的测试方法。This specification provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned database testing method is implemented.
本说明书提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述数据库的测试方法。This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned database testing method when executing the program.
本说明书采用的上述至少一个技术方案能够达到以下有益效果:At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
在本说明书提供的数据库的测试方法,首先获取测试数据库所需的测试参数,其中,测试参数包括:存储有数据库中各数据分区对应数据的物理节点的数量、期望的每个分布式事务跨物理节点的数量,根据测试参数以及预先确定出的数据关联关系,确定生成分布式事务所需的分区键的数量,其中,数据关联关系用于表示存储有数据库中各数据分区对应数据的物理节点的数量、期望的每个分布式事务跨物理节点的数量、生成分布式事务所需的分区键的数量之间的关联,根据分区键的数量,生成分布式事务,根据分布式事务,对数据库进行测试。In the database testing method provided in the present specification, the test parameters required for testing the database are first obtained, wherein the test parameters include: the number of physical nodes storing data corresponding to each data partition in the database, the expected number of physical nodes across each distributed transaction, and the number of partition keys required for generating distributed transactions are determined based on the test parameters and a predetermined data association relationship, wherein the data association relationship is used to represent the association between the number of physical nodes storing data corresponding to each data partition in the database, the expected number of physical nodes across each distributed transaction, and the number of partition keys required for generating distributed transactions, and a distributed transaction is generated based on the number of partition keys, and the database is tested based on the distributed transaction.
从上述方法中可以看出,可以根据期望生成的分布式事务跨数据存储节点的数量,确定生成分布式事务所需的分区键的数量,以生成满足期望生成的分布式事务跨数据存储节点的数量的分布式事务,进而可以通过生成的满足测试需求的分布式事务,有效的对数据库处理分布式事务的效率进行测试。It can be seen from the above method that the number of partition keys required to generate distributed transactions can be determined based on the expected number of distributed transactions across data storage nodes to generate distributed transactions that meet the expected number of distributed transactions across data storage nodes. Furthermore, the efficiency of the database in processing distributed transactions can be effectively tested by generating distributed transactions that meet the test requirements.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
此处所说明的附图用来提供对本说明书的进一步理解,构成本说明书的一部分,本说明书的示意性实施例及其说明用于解释本说明书,并不构成对本说明书的不当限定。在附The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The exemplary embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification.
图中:In the figure:
图1为本说明书中提供的一种数据库的测试方法的流程示意图;FIG1 is a schematic diagram of a flow chart of a database testing method provided in this specification;
图2为本说明书中提供的事务模板的示意图;FIG2 is a schematic diagram of a transaction template provided in this specification;
图3为本说明书中提供的对数据库进行测试的流程的示意图;FIG3 is a schematic diagram of a process for testing a database provided in this specification;
图4为本说明书提供的一种数据库的测试装置的示意图;FIG4 is a schematic diagram of a database testing device provided in this specification;
图5为本说明书提供的一种对应于图1的电子设备的示意图。FIG. 5 is a schematic diagram of an electronic device provided in this specification corresponding to FIG. 1 .
具体实施方式DETAILED DESCRIPTION
为使本说明书的目的、技术方案和优点更加清楚,下面将结合本说明书具体实施例及相应的附图对本说明书技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本说明书保护的范围。In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
以下结合附图,详细说明本说明书各实施例提供的技术方案。The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
图1为本说明书中提供的一种数据库的测试方法的流程示意图,包括以下步骤:FIG1 is a flow chart of a database testing method provided in this specification, comprising the following steps:
S100:获取测试分布式数据库所需的测试参数,所述测试参数包括:所述分布式数据库对应的各数据存储节点的数量、期望数量,所述期望数量用于表示期望生成的分布式事务跨数据存储节点的数量。S100: Acquire test parameters required for testing a distributed database, wherein the test parameters include: the number of data storage nodes corresponding to the distributed database and an expected number, wherein the expected number is used to indicate the number of distributed transactions across data storage nodes that are expected to be generated.
在分布式数据库运行过程中,当分布式数据库执行分布式事务所需的跨物理节点数越多时,对分布式数据库的性能的影响就越大,因此,如何测试分布式数据库在处理跨数据存储节点数不同的分布式事务时的效率,就显得尤为重要。During the operation of a distributed database, the more physical nodes a distributed database needs to execute distributed transactions, the greater the impact on the performance of the distributed database. Therefore, it is particularly important to test the efficiency of a distributed database in processing distributed transactions across different numbers of data storage nodes.
基于此,在本说明书中,服务器可以基于测试需求,对分布式数据库进行测试,而在此之前,业务平台可以获取测试人员输入的测试参数,进而可以根据测试参数对分布式数据库进行测试。其中,测试参数可以包括:分布式数据库对应的各数据存储节点的数量,以及期望数量,这里的分布式数据库对应的各数据存储节点是指存储有分布式数据库中的至少部分数据分区所包含的数据的物理节点,这里的期望数据是指期望的每个分布式事务跨数据存储节点的数量。Based on this, in this specification, the server can test the distributed database based on the test requirements, and before that, the business platform can obtain the test parameters input by the tester, and then test the distributed database according to the test parameters. Among them, the test parameters may include: the number of each data storage node corresponding to the distributed database, and the expected number, where each data storage node corresponding to the distributed database refers to the physical node storing the data contained in at least part of the data partition in the distributed database, and the expected data here refers to the expected number of data storage nodes across each distributed transaction.
进一步地,为了便于保存、管理各测试参数,用户还可以将测试分布式数据库所需的测试参数写入到配置文件中,以通过业务平台提供的用户所使用的客户端,将配置文本发送给业务平台,以使业务平台根据配置文件,获取测试分布式数据库所需的测试参数。Furthermore, in order to facilitate the storage and management of various test parameters, users can also write the test parameters required for testing the distributed database into the configuration file, and send the configuration text to the business platform through the client used by the user provided by the business platform, so that the business platform can obtain the test parameters required for testing the distributed database according to the configuration file.
在本说明书中,用于实现数据库的测试方法的执行主体,可以是指服务器等设置于业务平台的指定设备,也可以是指诸如台式电脑、笔记本电脑等终端设备,为了便于描述,下面仅以服务器是执行主体为例,对本说明书提供的数据库的测试方法进行说明。In this specification, the execution entity used to implement the database testing method may refer to a designated device such as a server set up on a business platform, or may refer to a terminal device such as a desktop computer or a laptop computer. For the sake of ease of description, the database testing method provided in this specification is described below using the server as the execution entity as an example.
结合上述内容,服务器可以在监听到的测试人员在终端设备或终端设备安装的客户端中输入测试参数后,获取测试分布式数据库所需的测试参数,进而根据测试参数对分布式数据库进行测试,以得到测试结果。In combination with the above content, the server can obtain the test parameters required for testing the distributed database after monitoring the tester entering the test parameters in the terminal device or the client installed on the terminal device, and then test the distributed database according to the test parameters to obtain the test results.
S102:根据所述测试参数,确定在生成的分布式事务实际跨数据存储节点的数量满足所述期望数量的条件下,分布式事务所需的分区键的数量。S102: Determine, according to the test parameters, the number of partition keys required for the distributed transaction under the condition that the number of data storage nodes actually crossed by the generated distributed transaction meets the expected number.
服务器在获取到测试分布式数据库所需的测试参数后,可以创建一个压测线程,并通过压测线程,根据测试参数,以及预先确定出的数据关联关系,确定在生成的分布式事务实际跨数据存储节点的数量满足期望数量的条件下,分布式事务所需的分区键的数量。这里的数据关联关系用于表示分布式数据库对应的各数据存储节点的数量、期望数量、分布式事务所需的分区键的数量三者之间的关联关系。After obtaining the test parameters required for testing the distributed database, the server can create a stress testing thread and, through the stress testing thread, determine the number of partition keys required for the distributed transaction based on the test parameters and the pre-determined data association relationship, under the condition that the number of data storage nodes actually spanned by the generated distributed transaction meets the expected number. The data association relationship here is used to represent the association between the number of data storage nodes corresponding to the distributed database, the expected number, and the number of partition keys required for the distributed transaction.
其中,分区键是指数据库分区所依据的键,例如:在某个数据库中存在一张学生表,学生表中有学号、姓名、班级三个属性,学生表中保存有学号为1、2、3、4、5、6的六个学生的信息,其中可以以学号为分区键,将这六个学生的信息划分为三个数据分区,即,学号为1、2的学生的信息在数据分区一中,学号为3、4的学生的信息在数据分区二中,学号为5、6的学生的信息在数据分区三中,进而可以将不同的数据分区可以保存在不同的数据存储节点中,例如:将数据分区一和三保存在数据存储节点一中,将数据分区二保存在数据存储节点二中。Among them, the partition key refers to the key based on which the database partition is based. For example, there is a student table in a certain database. The student table has three attributes: student number, name, and class. The student table stores information of six students with student numbers 1, 2, 3, 4, 5, and 6. The student number can be used as the partition key to divide the information of these six students into three data partitions, that is, the information of students with student numbers 1 and 2 is in data partition one, the information of students with student numbers 3 and 4 is in data partition two, and the information of students with student numbers 5 and 6 is in data partition three. Different data partitions can be stored in different data storage nodes. For example, data partitions one and three are stored in data storage node one, and data partition two is stored in data storage node two.
从上述内容中可以看出,生成的用于测试分布式数据库的事务所能涉及的数据所在的表,在需要参与到分布式数据库测试的数据存储节点中都存了一部分,具体的分布方式还可以是采用均分的方式,例如:上述内容中的数据分区一保存在数据存储节点一中,数据分区二保存在数据存储节点二中,数据分区三保存在数据存储节点三中。From the above content, it can be seen that the table containing the data involved in the transaction generated for testing the distributed database is partially stored in the data storage nodes that need to participate in the distributed database test. The specific distribution method can also be an equal distribution method. For example: data partition one in the above content is stored in data storage node one, data partition two is stored in data storage node two, and data partition three is stored in data storage node three.
因此,可以通过控制分区键的数量,来控制分布式事务执行的时候跨数据存储节点的数量,例如:当生成的分布式事务为查询学号为1、3的学生的信息时,执行该分布式事务就需要涉及到数据分区一,以及数据分区二,因此,该分布式事务执行时就需要跨两个数据存储节点一和二。Therefore, the number of data storage nodes that are crossed when a distributed transaction is executed can be controlled by controlling the number of partition keys. For example, when the generated distributed transaction is to query the information of students with student numbers 1 and 3, the execution of the distributed transaction will involve data partition one and data partition two. Therefore, the execution of the distributed transaction will need to cross two data storage nodes, one and two.
在上述内容中,数据的关联关系的确定方法可以是针对分布式数据库对应的每个数据存储节点,确定该数据存储节点中包含有分布式事务执行所需要的数据的概率,根据每个数据存储节点中包含有分布式事务执行所需要的数据的概率,确定生成分布式事务所需的分区键的数量、期望数量、分布式数据库对应的各数据存储节点的数量之间的关联关系,具体可以参考如下公式:In the above content, the method for determining the association relationship of data can be to determine the probability that each data storage node corresponding to the distributed database contains the data required for the execution of the distributed transaction, and determine the association relationship between the number of partition keys required for generating the distributed transaction, the expected number, and the number of data storage nodes corresponding to the distributed database according to the probability that each data storage node contains the data required for the execution of the distributed transaction. For details, refer to the following formula:
在上述公式中,P(xi=0)是指针对任意一个数据存储节点i,该数据存储节点中不包含有分布式事务执行所需要的数据的概率,m是指分布式数据库对应的各数据存储节点的数量,n是指生成分布式事务所需的分区键的数量,P(xi=1)是指针对任意一个数据存储节点i,该数据存储节点中包含有分布式事务执行所需要的数据的概率。In the above formula, P( xi = 0) refers to the probability that, for any data storage node i, the data storage node does not contain the data required for the execution of distributed transactions, m refers to the number of data storage nodes corresponding to the distributed database, n refers to the number of partition keys required to generate distributed transactions, and P( xi = 1) refers to the probability that, for any data storage node i, the data storage node contains the data required for the execution of distributed transactions.
从上述公式中可以看出,当生成分布式事务所需的分区键的数量为1时,就说明只有一个数据存储节点中有分布式事务执行所需的数据,此时,针对任意一个数据存储节点来说,该数据存储节点中不包含有分布式事务执行所需的数据的概率为因此,当生成分布式事务所需的分区键的数量为n时,针对任意一个数据存储节点来说,该数据存储节点中不包含有分布式事务执行所需的数据的概率为进而可知,该数据存储节点中不包含有分布式事务执行所需的数据的概率为 It can be seen from the above formula that when the number of partition keys required to generate a distributed transaction is 1, it means that only one data storage node has the data required for the distributed transaction execution. At this time, for any data storage node, the probability that the data storage node does not contain the data required for the distributed transaction execution is Therefore, when the number of partition keys required to generate a distributed transaction is n, for any data storage node, the probability that the data storage node does not contain the data required for the distributed transaction execution is It can be further known that the probability that the data storage node does not contain the data required for the execution of distributed transactions is
进一步地,若期望数量为k,设随机变量表示包含由n个分区键的分布式事务的实际跨数据存储节点的数量,xi是独立同分布的随机变量,满足具体可以参考以下公式:Furthermore, if the expected number is k, let the random variable represents the number of actual cross-data storage nodes for distributed transactions involving n partition keys, and xi is an independent and identically distributed random variable that satisfies For details, please refer to the following formula:
在上述公式中,是指期望生成的分布式事务跨数据存储节点的数量,基于此,可以推导出,生成分布式事务所需的分区键的数量n,与数据存储节点的数量m,以及期望数量k之间的关联关系,具体可以参考以下公式。In the above formula, It refers to the number of distributed transactions across data storage nodes that are expected to be generated. Based on this, we can deduce the relationship between the number n of partition keys required to generate distributed transactions, the number m of data storage nodes, and the expected number k. For details, please refer to the following formula.
从上述公式中可以看出,在知道分布式数据库对应的各数据存储节点的数量m的情况下,可以根据期望数量k,确定生成分布式事务所需的分区键的数量n。It can be seen from the above formula that when the number m of each data storage node corresponding to the distributed database is known, the number n of partition keys required to generate a distributed transaction can be determined according to the expected number k.
S104:根据所述分区键的数量,生成分布式事务。S104: Generate a distributed transaction according to the number of partition keys.
S106:根据所述分布式事务,对所述分布式数据库进行测试。S106: Testing the distributed database according to the distributed transaction.
在本说明书中,服务器可以根据分布式事务所需的分区键的数量,从分布式数据库的各数据分区所包含的各分区键中,选取出上述内容中确定出的生成分布式事务所需的分区键的数量的分区键,并根据选取出的若干个分区键,生成分布式事务,并且,生成的分布式事务的跨数据存储节点的数量,为测试参数中的期望数量,进而可以通过生成的分布式事务,对分布式数据库进行测试。In this specification, the server can select the number of partition keys required for generating distributed transactions determined in the above content from the partition keys contained in each data partition of the distributed database according to the number of partition keys required for the distributed transaction, and generate a distributed transaction based on the selected partition keys. In addition, the number of cross-data storage nodes of the generated distributed transaction is the expected number in the test parameters, and the distributed database can be tested through the generated distributed transactions.
其中,从分布式数据库的各数据分区中,选取分区键的方法可以有很多,例如:根据生成分布式事务所需的分区键的数量,通过简单随机抽样、系统抽样等方法选取出若干个分区键。There are many methods for selecting partition keys from each data partition of a distributed database. For example, according to the number of partition keys required to generate distributed transactions, a number of partition keys are selected by simple random sampling, systematic sampling, etc.
在上述内容中,根据选取出的分区键,生成分布式事务的方法可以是,将预设的事务模板中预留的事务执行所需要的分区键的占位符,修改为通过上述方法确定出的各分区键。例如:若事务模板是查询学号为i的学生的信息,通过上述方法确定出的分区键为学号1、4,则可以将事务模板中的学号i改写为查询学号为1和4的学生的信息,这样就生成了一个分布式事务,具体如图2所示。In the above content, according to the selected partition key, the method of generating a distributed transaction can be to modify the placeholder of the partition key required for transaction execution reserved in the preset transaction template to each partition key determined by the above method. For example: if the transaction template is to query the information of the student with student number i, and the partition keys determined by the above method are student numbers 1 and 4, then the student number i in the transaction template can be rewritten to query the information of students with student numbers 1 and 4, so that a distributed transaction is generated, as shown in Figure 2.
图2为本说明书中提供的事务模板的示意图。FIG. 2 is a schematic diagram of a transaction template provided in this specification.
在图2中,“?”即为上述内容中所说的占位符,“SELECT*FROM commodity WHERE s_i_id=?”是指从名称为“commodity”的表中查询商品编号(即“s_i_id”)为占位符所填入的分区键的商品的全部信息。假设通过上述内容选取出的分区键为“10011”,也就是需要查询商品编号为10011的商品的全部信息,则可以根据这里的事务模板,生成一个事务,也就是将分区键“10011”插入到该事务模板预设的占位符中,即“SELECT*FROM commodity WHEREs_i_id=10011”,这样就可以使执行该事务的数据存储节点查询商品编号为“10011”的商品的全部信息。In FIG2 , “?” is the placeholder mentioned in the above content, and “SELECT * FROM commodity WHERE s_i_id=?” means to query all the information of the commodity whose partition key is filled in the placeholder with the commodity number (i.e., “s_i_id”) from the table named “commodity”. Assuming that the partition key selected by the above content is “10011”, that is, it is necessary to query all the information of the commodity with the commodity number 10011, then a transaction can be generated according to the transaction template here, that is, the partition key “10011” is inserted into the placeholder preset by the transaction template, that is, “SELECT * FROM commodity WHERE s_i_id=10011”, so that the data storage node executing the transaction can query all the information of the commodity with the commodity number “10011”.
在上述内容中,服务器可以将生成的各分布式事务,根据预设的负载均衡分配策略,将这些分布式事务,分配到至少部分数据存储节点中,并通过这些数据存储节点执行生成的各分布式事务,以对分布式数据库进行测试,其中,负载均衡分配策略可以是按照多种算法进行事务的分配,例如:轮询算法等。In the above content, the server can distribute the generated distributed transactions to at least part of the data storage nodes according to a preset load balancing distribution strategy, and execute the generated distributed transactions through these data storage nodes to test the distributed database, wherein the load balancing distribution strategy can be to distribute transactions according to a variety of algorithms, such as: polling algorithm, etc.
进一步地,从上述内容中可知,由于生成分布式事务所需分区键的数量是根据基于数学期望得到的数据关联关系确定的,因此,实际生成的分布式事务的实际跨数据存储节点的数量与测试参数中的期望数量可能会存在一些偏差,因此,服务器还可以针对生成的每个分布式事务,保存该分布式事务在执行过程中的实际跨数据存储节点的数量并展示,以供开发人员查阅。Furthermore, from the above content, it can be seen that since the number of partition keys required to generate a distributed transaction is determined based on the data association relationship obtained based on mathematical expectation, the actual number of cross-data storage nodes of the distributed transaction actually generated may be somewhat different from the expected number in the test parameters. Therefore, the server can also save and display the actual number of cross-data storage nodes of the distributed transaction during the execution process for each distributed transaction generated for developers to review.
除此之外,由于分布式数据库在处理包含有不同比例的分布式事务的事务集时的效率也是不同的,例如:分布式数据库在处理包含有10%分布式事务的事务集时的效率,只有执行不包含分布式事务的事务集的百分之五十。In addition, the efficiency of a distributed database in processing transaction sets containing different proportions of distributed transactions is also different. For example, the efficiency of a distributed database in processing a transaction set containing 10% distributed transactions is only 50% of that of executing a transaction set that does not contain distributed transactions.
基于此,在本说明书中,在根据所述分区键的数量,生成分布式事务之前,服务器还可以获取用户输入的期望分布式事务比例(期望分布式事务比例用于确定生成的事务集中所包含的分布式事务占全部事务的比例),并根据期望分布式事务比例,生成预设数量的分布式事务。Based on this, in this specification, before generating distributed transactions according to the number of partition keys, the server can also obtain the expected distributed transaction ratio input by the user (the expected distributed transaction ratio is used to determine the proportion of distributed transactions included in the generated transaction set to all transactions), and generate a preset number of distributed transactions based on the expected distributed transaction ratio.
在上述内容中,服务器可以按照获取到的期望分布式事务比例,生成事务集,在该事务集中包含有若干个本地事务,以及若干个分布式事务,其中,分布式事务在该事务集所包含的全部事务中的占比为期望分布式事务比例。In the above content, the server can generate a transaction set according to the obtained expected distributed transaction ratio, in which the transaction set includes several local transactions and several distributed transactions, wherein the proportion of distributed transactions in all transactions included in the transaction set is the expected distributed transaction ratio.
从上述内容中可以看出,服务器可以根据用户输入的期望分布式事务比例,生成预设数量的事务,并且在这些事务中,分布式事务占生成的全部事务的比例接近于期望分布式事务的比例,进而可以测试分布式数据库在处理包含有不同比例分布式事务的事务集时的效率。From the above content, it can be seen that the server can generate a preset number of transactions according to the expected distributed transaction ratio input by the user, and among these transactions, the proportion of distributed transactions to all generated transactions is close to the proportion of expected distributed transactions, thereby testing the efficiency of the distributed database in processing transaction sets containing distributed transactions of different proportions.
需要说明的是,在上述内容中,用户可以将期望分布式事务比例和分布式数据库对应的各数据存储节点的数量、期望数量,一起写在配置文件中,以发送给服务器,也可以单独将期望分布式事务比例发送给服务器,以使服务器按照期望分布式事务比例,生成分布式事务。It should be noted that in the above content, the user can write the expected distributed transaction ratio and the number and expected number of data storage nodes corresponding to the distributed database in a configuration file to send it to the server, or send the expected distributed transaction ratio to the server alone so that the server generates distributed transactions according to the expected distributed transaction ratio.
为了进一步地对上述内容进行说明,以下结合图3对控制分布式事务比例对分布式数据库进行测试的流程进行详细说明。In order to further illustrate the above content, the process of controlling the distributed transaction ratio to test the distributed database is described in detail below with reference to FIG. 3 .
图3为本说明书中提供的对数据库进行测试的流程的示意图。FIG. 3 is a schematic diagram of a process for testing a database provided in this specification.
结合图3可以看出,服务器在接收到测试指令后,可以创建一个压测线程,并通过压测线程,读取配置文件,以获取各测试参数。As can be seen from FIG3 , after receiving the test instruction, the server can create a stress testing thread and read the configuration file through the stress testing thread to obtain various test parameters.
在图3中,服务器可以通过事务生成模块,根据配置文件,计算分布式事务的所需的分区键的数量,进而可以根据期望分布式事务比例,判断生成的每个事务的类型,若需要生成分布式事务,则可以进行分区键抽取,以获取生成分布式事务所需的各分区键,并根据预设的事务模板,生成分布式事务,若需要生成本地事务,则可以根据预设的事务模板,直接生成本地事务。In Figure 3, the server can calculate the number of partition keys required for distributed transactions according to the configuration file through the transaction generation module, and then determine the type of each generated transaction according to the expected distributed transaction ratio. If a distributed transaction needs to be generated, partition key extraction can be performed to obtain the partition keys required to generate the distributed transaction, and a distributed transaction can be generated according to a preset transaction template. If a local transaction needs to be generated, a local transaction can be directly generated according to the preset transaction template.
进一步地,在图3中服务器在生成用于测试分布式数据库的分布式事务和本地事务之后,可以按照预设负载均衡分配策略,将生成的各个事务分配到分布式数据库的各个数据存储节点中执行,并统计信息,进而将统计的信息展示给开发人员,其中,这里的统计信息可以是统计对分布式数据库进行测试过程中的分布式事务被执行时的真实的跨数据存储节点数量和事务集中分布式事务的实际比例。Furthermore, in FIG3 , after the server generates distributed transactions and local transactions for testing the distributed database, it can distribute the generated transactions to the various data storage nodes of the distributed database for execution according to the preset load balancing distribution strategy, and collect statistics, and then display the statistical information to the developers, wherein the statistical information here can be the actual number of cross-data storage nodes when the distributed transactions are executed during the testing of the distributed database and the actual proportion of distributed transactions in the transaction set.
通过上述内容可以看出,服务器可以根据获取到的测试参数,控制生成的用于测试分布式数据库的事务集中分布式事务的比例,以及每个分布式事务的跨数据存储节点的数量,因此,可以有效的对分布式数据库处理分布式事务的效率进行测试。From the above content, it can be seen that the server can control the proportion of distributed transactions in the transaction set generated for testing the distributed database and the number of cross-data storage nodes for each distributed transaction based on the obtained test parameters. Therefore, the efficiency of the distributed database in processing distributed transactions can be effectively tested.
以上为本说明书的一个或多个实施例提供的数据库的测试方法,基于同样的思路,本说明书还提供了相应的数据库的测试装置,如图4所示。The above is a database testing method provided in one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding database testing device, as shown in FIG4 .
图4为本说明书提供的一种数据库的测试装置的示意图,包括:FIG4 is a schematic diagram of a database testing device provided in this specification, comprising:
获取模块401,用于获取测试分布式数据库所需的测试参数,所述测试参数包括:所述分布式数据库对应的各数据存储节点的数量、期望数量,所述期望数量用于表示期望生成的分布式事务跨数据存储节点的数量;An acquisition module 401 is used to acquire test parameters required for testing a distributed database, wherein the test parameters include: the number and expected number of data storage nodes corresponding to the distributed database, wherein the expected number is used to indicate the number of distributed transactions across data storage nodes that are expected to be generated;
确定模块402,用于根据所述测试参数,确定在生成的分布式事务实际跨数据存储节点的数量满足所述期望数量的条件下,分布式事务所需的分区键的数量;A determination module 402 is used to determine, based on the test parameters, the number of partition keys required for the distributed transaction under the condition that the number of data storage nodes actually spanned by the generated distributed transaction meets the expected number;
生成模块403,用于根据所述分区键的数量,生成分布式事务;A generating module 403, configured to generate a distributed transaction according to the number of partition keys;
测试模块404,用于根据所述分布式事务,对所述分布式数据库进行测试。The testing module 404 is used to test the distributed database according to the distributed transaction.
可选地,获取模块401具体用于,获取用户所使用的客户端发送的配置文件;根据所述配置文件,确定测试分布式数据库所需的测试参数。Optionally, the acquisition module 401 is specifically used to acquire a configuration file sent by a client used by the user; and determine test parameters required for testing the distributed database according to the configuration file.
可选地,确定模块402具体用于,根据所述测试参数,以及预先确定出的数据关联关系,确定在生成的分布式事务实际跨数据存储节点的数量满足所述期望数量的条件下,分布式事务所需的分区键的数量,所述数据关联关系用于表示所述分布式数据库对应的各数据存储节点的数量、所述期望数量、所述分布式事务所需的分区键的数量之间的关联。Optionally, the determination module 402 is specifically used to determine, based on the test parameters and a predetermined data association relationship, the number of partition keys required for the distributed transaction under the condition that the number of data storage nodes actually crossed by the generated distributed transaction meets the expected number, and the data association relationship is used to represent the association between the number of data storage nodes corresponding to the distributed database, the expected number, and the number of partition keys required for the distributed transaction.
可选地,确定模块402具体用于,针对所述分布式数据库对应的每个数据存储节点,确定该数据存储节点中存储有分布式事务执行所需要的数据的概率;根据每个数据存储节点中包含有分布式事务执行所需要的数据的概率,确定所述数据关联关系。Optionally, the determination module 402 is specifically used to determine, for each data storage node corresponding to the distributed database, the probability that the data storage node stores the data required for the execution of the distributed transaction; and determine the data association relationship based on the probability that each data storage node contains the data required for the execution of the distributed transaction.
可选地,生成模块403具体用于,从所述分布式数据库的各数据分区所包含的各分区键中,选取所述分区键的数量的分区键;根据选取出的所述分区键的数量的分区键,生成分布式事务。Optionally, the generation module 403 is specifically used to select partition keys of the number of partition keys from each partition key included in each data partition of the distributed database; and generate a distributed transaction according to the partition keys of the number of partition keys selected.
可选地,生成模块403具体用于,将预设的事务模板中预留的事务执行所需分区键的占位符,修改为选取出的所述数量的分区键,生成分布式事务。Optionally, the generating module 403 is specifically configured to modify the placeholders of the partition keys required for transaction execution reserved in the preset transaction template to the selected number of partition keys, so as to generate a distributed transaction.
可选地,测试模块404具体用于,根据预设的负载均衡分配策略,将生成的所述分布式事务,分配到至少部分数据存储节点中,以对所述分布式数据库进行测试。Optionally, the testing module 404 is specifically configured to distribute the generated distributed transactions to at least part of the data storage nodes according to a preset load balancing distribution strategy, so as to test the distributed database.
可选地,确定模块402具体用于,获取用户输入的期望分布式事务比例,所述期望分布式事务比例用于表示生成的分布式事务占生成的全部事务的比例;Optionally, the determination module 402 is specifically used to obtain an expected distributed transaction ratio input by a user, where the expected distributed transaction ratio is used to indicate the ratio of the generated distributed transactions to all generated transactions;
生成模块403,具体用于:The generating module 403 is specifically used for:
根据所述期望分布式事务比例,以及所述分区键的数量,生成分布式事务。A distributed transaction is generated according to the expected distributed transaction ratio and the number of partition keys.
本说明书还提供了一种计算机可读存储介质,该存储介质存储有计算机程序,计算机程序可用于执行上述图1提供的一种数据库的测试方法。This specification also provides a computer-readable storage medium, which stores a computer program. The computer program can be used to execute a database testing method provided in FIG. 1 above.
本说明书还提供了图5所示的一种对应于图1的电子设备的示意结构图。如图5,在硬件层面,该电子设备包括处理器、内部总线、网络接口、内存以及非易失性存储器,当然还可能包括其他业务所需要的硬件。处理器从非易失性存储器中读取对应的计算机程序到内存中然后运行,以实现上述图1的数据库的测试方法。当然,除了软件实现方式之外,本说明书并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。This specification also provides a schematic structural diagram of an electronic device corresponding to Figure 1, as shown in Figure 5. As shown in Figure 5, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and of course may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the test method of the database in Figure 1 above. Of course, in addition to software implementations, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable GateArray,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware DescriptionLanguage)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(RubyHardware Description Language)等,目前最普遍使用的是VHDL(Very-High-SpeedIntegrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本说明书时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and/or hardware.
本领域内的技术人员应明白,本说明书的实施例可提供为方法、系统、或计算机程序产品。因此,本说明书可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本说明书可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
本说明书是参照根据本说明书实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。This specification is described with reference to the flowchart and/or block diagram of the method, device (system), and computer program product according to the embodiment of this specification. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of the process and/or box in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
本领域技术人员应明白,本说明书的实施例可提供为方法、系统或计算机程序产品。因此,本说明书可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
本说明书可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本说明书,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
以上仅为本说明书的实施例而已,并不用于限制本说明书。对于本领域技术人员来说,本说明书可以有各种更改和变化。凡在本说明书的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本说明书的权利要求范围之内。The above are only embodiments of this specification and are not intended to limit this specification. For those skilled in the art, this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the scope of the claims of this specification.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210731397.6A CN115129589B (en) | 2022-06-24 | 2022-06-24 | A database testing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210731397.6A CN115129589B (en) | 2022-06-24 | 2022-06-24 | A database testing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115129589A CN115129589A (en) | 2022-09-30 |
CN115129589B true CN115129589B (en) | 2024-11-05 |
Family
ID=83379986
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210731397.6A Active CN115129589B (en) | 2022-06-24 | 2022-06-24 | A database testing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115129589B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114265830A (en) * | 2021-12-23 | 2022-04-01 | 山东浪潮科学研究院有限公司 | Openresty-based distributed database performance optimization scheme |
CN114547198A (en) * | 2022-02-18 | 2022-05-27 | 北京奥星贝斯科技有限公司 | Dynamic evaluation method and device for distributed transaction database |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2472620B (en) * | 2009-08-12 | 2016-05-18 | Cloudtran Inc | Distributed transaction processing |
CN113448767B (en) * | 2020-03-24 | 2024-08-23 | 北京金山云网络技术有限公司 | Distributed transaction database recovery method, device, equipment and storage medium |
-
2022
- 2022-06-24 CN CN202210731397.6A patent/CN115129589B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114265830A (en) * | 2021-12-23 | 2022-04-01 | 山东浪潮科学研究院有限公司 | Openresty-based distributed database performance optimization scheme |
CN114547198A (en) * | 2022-02-18 | 2022-05-27 | 北京奥星贝斯科技有限公司 | Dynamic evaluation method and device for distributed transaction database |
Also Published As
Publication number | Publication date |
---|---|
CN115129589A (en) | 2022-09-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113282659B (en) | Data processing method and device based on block chain | |
CN107391527B (en) | Data processing method and device based on block chain | |
CN116136952B (en) | Simulation test method and device for components | |
CN112015739A (en) | Data verification and data query method and device | |
CN117573359B (en) | Heterogeneous cluster-based computing framework management system and method | |
CN111796864A (en) | Data verification method and device | |
CN114547024A (en) | A SQL statement risk detection method, device, equipment and medium | |
WO2025044317A1 (en) | Method and apparatus for accelerating model training, storage medium, and electronic device | |
CN117828360A (en) | Model training method, model training device, model code generating device, storage medium and storage medium | |
CN114840426A (en) | Code testing method and device | |
CN114840427A (en) | Code testing and test case generating method and device | |
CN115129589B (en) | A database testing method and device | |
CN117555697B (en) | A cache loading system, method, device and equipment for distributed training | |
CN111967767A (en) | Business risk identification method, device, equipment and medium | |
CN112015751A (en) | Data query method and related equipment | |
CN111209277A (en) | Data processing method, device, equipment and medium | |
CN107544753B (en) | Data processing method and device and server | |
CN116107636A (en) | A hardware acceleration method, device, storage medium and electronic equipment | |
CN111967769B (en) | Risk identification method, apparatus, device and medium | |
CN114676132A (en) | A data table association method, device, storage medium and electronic device | |
CN114662167A (en) | A layout method, device and equipment for node relationship penetration | |
CN111753200B (en) | Data determination method, device, equipment and medium | |
CN118466863B (en) | Data storage method and device, storage medium and electronic equipment | |
CN113392015B (en) | A product testing method, device, equipment and medium | |
CN113011165B (en) | A method, device, equipment and medium for identifying blocked keywords |
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 |