CN112882960A - Data acquisition method and device - Google Patents
Data acquisition method and device Download PDFInfo
- Publication number
- CN112882960A CN112882960A CN202110343591.2A CN202110343591A CN112882960A CN 112882960 A CN112882960 A CN 112882960A CN 202110343591 A CN202110343591 A CN 202110343591A CN 112882960 A CN112882960 A CN 112882960A
- Authority
- CN
- China
- Prior art keywords
- business
- data
- business data
- elements
- mapping relationship
- 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.)
- Granted
Links
Images
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
- G06F11/3672—Test management
-
- 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
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明涉及数据处理技术领域,具体涉及一种数据获取方法和装置。所述方法包括:获取测试人员输入的测试案例并识别业务要素;根据所述业务要素从预先构建的业务数据模型中获取与所述业务要素具有映射关系的业务数据;其中所述业务数据模型存储有业务要素,和,与所述业务要素具有映射关系的业务数据。本申请所提供的数据获取方案用户只需关测试案例的业务要素即通过测试案例业务要素配置即可获取所需的业务测试数据。
The invention relates to the technical field of data processing, in particular to a data acquisition method and device. The method includes: acquiring a test case input by a tester and identifying business elements; acquiring business data having a mapping relationship with the business elements from a pre-built business data model according to the business elements; wherein the business data model stores There are business elements, and business data having a mapping relationship with the business elements. In the data acquisition solution provided by this application, users only need to know the business elements of the test case, that is, through the configuration of the business elements of the test case, to obtain the required business test data.
Description
技术领域technical field
本发明涉及数据处理技术领域,具体涉及一种数据获取方法和装置。The invention relates to the technical field of data processing, in particular to a data acquisition method and device.
背景技术Background technique
在现有的软件测试中,测试数据准备是一个比较耗时的过程,往往需要专业的数据库人员或业务人员手工准备,然后再交由测试执行人员进行手工测试或自动化测试。特别在金融行业中,面对庞大的用户群体,需要进行大量的测试,由于实时性、多样性的要求,需要大量的测试数据以满足测试需要。而目前,一般需要相关人员采用人工方式按照相关业务流程准备测试数据,不仅数据制造效率低下,而且门槛较高,测试数据固定无法支持多样化测试。In existing software testing, test data preparation is a time-consuming process, which often requires manual preparation by professional database personnel or business personnel, and then handed over to test executives for manual testing or automated testing. Especially in the financial industry, in the face of a huge user group, a large number of tests need to be carried out. Due to the requirements of real-time and diversity, a large amount of test data is required to meet the test needs. At present, relevant personnel are generally required to manually prepare test data according to relevant business processes, which is not only inefficient in data production, but also has a high threshold, and the fixed test data cannot support diversified testing.
发明内容SUMMARY OF THE INVENTION
本申请的目的旨在至少能解决上述的技术缺陷之一。本申请所采用的技术方案如下:The purpose of this application is to solve at least one of the above-mentioned technical defects. The technical scheme adopted in this application is as follows:
第一方面,本申请实施例公开了一种数据获取方法,所述方法包括:In a first aspect, an embodiment of the present application discloses a data acquisition method, the method comprising:
获取测试人员输入的测试案例并识别业务要素;Capture test cases entered by testers and identify business elements;
根据所述业务要素从预先构建的业务数据模型中获取与所述业务要素具有映射关系的业务数据;其中所述业务数据模型存储有业务要素,和,与所述业务要素具有映射关系的业务数据。Obtain business data that has a mapping relationship with the business element from a pre-built business data model according to the business element; wherein the business data model stores business elements and business data that has a mapping relationship with the business element .
进一步地,所述构建业务数据模型包括:Further, the building a business data model includes:
获取有效的业务数据;Obtain valid business data;
通过业务数据层次划分标准,以树模型为基础构建所述有效业务数据模型;其中所述业务数据模型至少以降阶次序包括母类、子类、细类、衍生业务数据。The effective business data model is constructed based on the tree model according to the business data hierarchy division standard; wherein the business data model includes parent class, subclass, subclass, and derived business data at least in descending order.
进一步地,所述获取有效的业务数据包括:Further, the obtaining valid business data includes:
获取系统数据库表的数据源;Get the data source of the system database table;
清洗所述数据源中的脏数据,并过滤与业务要素不相关的数据后获取所述有效的业务数据。The dirty data in the data source is cleaned, and the data irrelevant to the business element is filtered to obtain the valid business data.
进一步地,所述与业务要素具有映射关系的业务数据可以为:固定值、函数关系或在数据库表中获取与所述业务要素具有映射关系的业务数据的SQL规则。Further, the business data having a mapping relationship with the business element may be: a fixed value, a functional relationship, or an SQL rule for acquiring the business data having a mapping relationship with the business element in a database table.
进一步地,所述获取与所述业务要素具有映射关系的业务数据包括:Further, the acquiring business data having a mapping relationship with the business element includes:
根据所述业务要素在所述预先构建的业务数据模型中获取业务字段;其中所述业务字段为与所述业务要素具有映射关系的业务数据的唯一标识;Obtain a business field in the pre-built business data model according to the business element; wherein the business field is a unique identifier of the business data that has a mapping relationship with the business element;
根据所述唯一标识确定所述与所述业务要素具有映射关系的业务数据。The business data having a mapping relationship with the business element is determined according to the unique identifier.
进一步地,所述方法还包括:Further, the method also includes:
构建目标测试案例业务数据唯一标识号;其中,所述目标测试案例至少包括两个以上业务要素;所述根据两个业务要素获取的业务数据的标识号均为所述唯一标识号;Constructing the unique identification number of the target test case business data; wherein, the target test case includes at least two or more business elements; the identification numbers of the business data obtained according to the two business elements are the unique identification numbers;
将获取的第一业务要素的第一业务数据缓存于业务场景数据池中;caching the acquired first business data of the first business element in the business scenario data pool;
根据所述第一业务数据和第二业务要素在所述预构建的业务数据模型中获取第二业务数据。Obtain second business data in the pre-built business data model according to the first business data and the second business element.
第二方面,本申请实施例提供了一种数据获取装置,所述装置包括:获取模块、存储模块和构建模块;其中,In a second aspect, an embodiment of the present application provides a data acquisition device, the device includes: an acquisition module, a storage module, and a building module; wherein,
所述获取模块,用于获取测试人员输入的测试案例并识别业务要素;The acquisition module is used to acquire test cases input by testers and identify business elements;
所述构建模块,用于构建业务数据模型;所述业务数据模型存储有业务要素,和,与所述业务要素具有映射关系的业务数据。The building module is used to build a business data model; the business data model stores business elements and business data that has a mapping relationship with the business elements.
所述存储模块,用于存储预先构建的业务数据模型;The storage module is used to store the pre-built business data model;
所述获取模块,还用于根据所述业务要素从预先构建的业务数据模型中获取与所述业务要素具有映射关系的业务数据。The obtaining module is further configured to obtain business data having a mapping relationship with the business element from a pre-built business data model according to the business element.
进一步地,所述获取模块还用于获取有效的业务数据;所述构建模块具体用于通过业务数据层次划分标准,以树模型为基础构建所述业务数据模型;其中所述业务数据模型至少以降阶次序包括母类、子类、细类、衍生业务数据。Further, the obtaining module is also used to obtain valid business data; the building module is specifically configured to construct the business data model based on the tree model through the business data hierarchy division standard; wherein the business data model is at least as low as lower. The rank order includes parent class, subclass, subclass, and derived business data.
第三方面,本申请实施例提供了一种电子设备,包括处理器和存储器;In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory;
所述存储器,用于存储操作指令;the memory for storing operation instructions;
所述处理器,用于通过调用所述操作指令,执行上述任一实施例中所述的方法。The processor is configured to execute the method described in any of the foregoing embodiments by invoking the operation instruction.
第四方面,本申请实施例提供了一种计算机可读存储介质,所述存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一实施例所述的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method described in any of the foregoing embodiments is implemented.
本申请实施例提供数据获取方案通过建立业务数据模型,同时建立业务场景数据池用来进行同一测试案例下的关联业务数据的数据联动动态获取,最终达到测试人员只需关注的业务要素,而不需要关注业务要素与底层技术逻辑的实现。本申请的有益效果至少包括以下之一:The embodiments of the present application provide a data acquisition solution by establishing a business data model and a business scenario data pool to dynamically acquire the data of the associated business data under the same test case, so as to finally achieve the business elements that testers only need to pay attention to, instead of Need to pay attention to the realization of business elements and underlying technical logic. The beneficial effects of the present application include at least one of the following:
(1)基于本申请所提供的数据获取方案用户只需关测试案例的业务要素即通过测试案例业务要素配置即可获取所需的测试数据;(1) Based on the data acquisition scheme provided by this application, the user only needs to know the business elements of the test case, that is, through the configuration of the business elements of the test case, to obtain the required test data;
(2)基于本申请所提供的数据获取方案数据获取过程简单便捷、实现了数据获取及获取的真正复用且维护成本较低;(2) Based on the data acquisition scheme provided by this application, the data acquisition process is simple and convenient, the real multiplexing of data acquisition and acquisition is realized, and the maintenance cost is low;
(3)基于本申请所提供的数据获取方案生成的数据准确多样,能够大幅提高测试效率和测试质量,尤其解决了测试数据动态获取难度大,效率低,测试数据不够多样性且准确度低的难点痛点。(3) The data generated based on the data acquisition scheme provided by the application is accurate and diverse, which can greatly improve the test efficiency and test quality, especially solve the problem that the dynamic acquisition of test data is difficult, the efficiency is low, the test data is not diverse enough and the accuracy is low Difficult pain points.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对本申请实施例描述中所需要使用的附图作简单地介绍。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments of the present application.
图1为本申请实施例提供的一种数据获取方法的流程示意图;1 is a schematic flowchart of a data acquisition method according to an embodiment of the present application;
图2为本申请实施例提供的一种业务数据模型关系表;Fig. 2 is a kind of business data model relation table provided by the embodiment of this application;
图3为本申请实施例提供的一种数据获取装置的示意图;3 is a schematic diagram of a data acquisition apparatus provided by an embodiment of the present application;
图4为本申请实施例提供的一种电子设备的结构示意图。FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
下面详细描述本申请的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本申请,而不能解释为对本发明的限制。The following describes in detail the embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, but not to be construed as limiting the present invention.
本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可包括复数形式,其中的“第一”“第二”等只是为了介绍清楚方案而进行的对象区分定义,并不对对象本身进行限制,当然“第一”和“第二”限定的对象可能是同一个终端、设备和用户等,也可能是同一种终端、设备和用户。应该进一步理解的是,本申请的说明书中使用的措辞“包括”是指存在所述特征、整数、步骤、操作、元件和/或组件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元件、组件和/或它们的组。这里使用的措辞“和/或”包括一个或更多个相关联的列出项的全部或任一单元和全部组合。It will be understood by those skilled in the art that unless expressly stated otherwise, the singular forms "a", "an", "the" and "the" can also include the plural forms, wherein "first", "second", etc. The definition of object distinction is only for the purpose of introducing the scheme clearly, and does not limit the object itself. Of course, the objects defined by "first" and "second" may be the same terminal, device, user, etc., or the same type of terminal, devices and users. It should be further understood that the word "comprising" used in the specification of this application refers to the presence of stated features, integers, steps, operations, elements and/or components, but does not preclude the presence or addition of one or more other features, Integers, steps, operations, elements, components and/or groups thereof. As used herein, the term "and/or" includes all or any element and all combination of one or more of the associated listed items.
此外应理解,本申请实施例中“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A 和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一(项)个”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a、b或c中的至少一项(个),可以表示:a,b,c,a和b,a和 c,b和c,或a、b和c,其中a、b、c可以是单个,也可以是多个。In addition, it should be understood that, in the embodiments of the present application, "at least one" refers to one or more, and "a plurality" refers to two or more. "And/or", which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, it can mean that A exists alone, A and B exist at the same time, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the associated objects are an "or" relationship. "At least one (item) of the following" or its similar expression refers to any combination of these items, including any combination of single item (item) or plural item (item). For example, at least one (a) of a, b or c may represent: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, c Can be single or multiple.
如背景技术中所陈述的目前包括金融测试等很多测试领域的测试数据是需要测试人员利用数据库或其他辅助生成操作来获取测试数据,此方法步骤繁琐,人力成本较大。此外,还有一些技术方案是先确定各测试系统对应的造数模型,然后基于各造数模型中关键的造数数据字段以及造数规则,生成各测试系统对应的测试数据,此方法生成的测试数据都是固定的,无法根据场景变换生成多样的测试数据。另外,还有一些方案是通过解析并执行SQL指令信息,获取数据库操作函数库中对应的驱动函数,从目标数据库中获取参数化依据,此方法主要用于自动化测试脚本,同时使用的是纯技术语言,不易理解操作。还有一些方案是通过预先对各个测试字段类型创建生成规则,将数据库中的各原始数据转换为多个测试数据,此方法使用纯技术语言,测试人员需要对生成规则有较深入理解才能够准确写成相应语句,不利于推广使用。综上,基于上述测试数据获取方案存在的各种局限性,本申请下述实施例公开了一种数据获取方法和装置以解决上述至少一种技术问题。As stated in the background art, the test data in many test fields, including financial tests, requires testers to obtain test data by using a database or other auxiliary generating operations. This method has complicated steps and high labor costs. In addition, there are some technical solutions that first determine the number-making model corresponding to each test system, and then generate the test data corresponding to each test system based on the key number-setting data fields and number-setting rules in each number-setting model. The test data is fixed, and various test data cannot be generated according to scene changes. In addition, there are some solutions to obtain the corresponding driver function in the database operation function library by parsing and executing the SQL instruction information, and obtain the parameterization basis from the target database. This method is mainly used for automated test scripts, and uses pure technology. Language, difficult to understand operation. There are also some solutions that create generation rules for each test field type in advance, and convert each original data in the database into multiple test data. This method uses pure technical language, and testers need to have a deep understanding of the generation rules to be accurate. Written in corresponding sentences, it is not conducive to promotion and use. To sum up, based on the various limitations of the above test data acquisition solutions, the following embodiments of the present application disclose a data acquisition method and apparatus to solve at least one of the above technical problems.
图1示出了本申请实施例提供的一种数据获取的流程示意图,如图1 所示,该方法主要可以包括:FIG. 1 shows a schematic flowchart of a data acquisition provided by an embodiment of the present application. As shown in FIG. 1 , the method may mainly include:
S101、获取测试人员输入的测试案例并识别业务要素;S101. Obtain test cases input by testers and identify business elements;
S102、根据所述业务要素从预先构建的业务数据模型中获取与所述业务要素具有映射关系的业务数据;其中所述业务数据模型存储有业务要素,和,与所述业务要素具有映射关系的业务数据。S102: Acquire business data that has a mapping relationship with the business element from a pre-built business data model according to the business element; wherein the business data model stores business elements, and, has a mapping relationship with the business element business data.
在进一步的可选实施例中,所述构建业务数据模型包括:In a further optional embodiment, the building a business data model includes:
步骤1、获取有效的业务数据;Step 1. Obtain valid business data;
步骤2、通过业务数据层次划分标准,以树模型为基础构建所述有效业务数据模型;其中所述业务数据模型至少以降阶次序包括母类、子类、细类、衍生业务数据。Step 2: Construct the effective business data model based on the tree model according to the business data hierarchy division standard; wherein the business data model includes at least a parent class, a subclass, a subclass, and derived business data in descending order.
在优选实施例中,所述构建业务数据模型包括:In a preferred embodiment, the building a business data model includes:
步骤1、获取系统数据库表的数据源;Step 1. Obtain the data source of the system database table;
步骤2、清洗所述数据源中的脏数据,并过滤与业务要素不相关的数据后获取所述有效的业务数据。Step 2: Clean the dirty data in the data source and filter the data irrelevant to the business element to obtain the valid business data.
步骤3、通过业务数据层次划分标准,以树模型为基础构建所述有效业务数据模型;其中所述业务数据模型至少以降阶次序包括母类、子类、细类、衍生业务数据。Step 3: Construct the effective business data model based on the tree model according to the business data hierarchy division standard; wherein the business data model includes parent class, subclass, subclass, and derived business data at least in descending order.
在进一步的可选实施例中,业务要素取值对应业务数据的枚举值,包括固定值,函数关系值或SQL规则值,即所述与业务要素具有映射关系的业务数据可以为:In a further optional embodiment, the value of the business element corresponds to the enumeration value of the business data, including a fixed value, a function relationship value or an SQL rule value, that is, the business data that has a mapping relationship with the business element may be:
(1)固定值;(1) Fixed value;
(2)函数关系;(2) functional relationship;
(3)在数据库表中获取与所述业务要素具有映射关系的业务数据的 SQL规则。(3) Acquire the SQL rules of the business data having a mapping relationship with the business elements in the database table.
在进一步的可选实施例中,所述获取与所述业务要素具有映射关系的业务数据包括:In a further optional embodiment, the acquiring business data having a mapping relationship with the business element includes:
步骤1、根据所述业务要素在所述预先构建的业务数据模型中获取业务字段;其中所述业务字段为与所述业务要素具有映射关系的业务数据的唯一标识;Step 1. Obtain business fields in the pre-built business data model according to the business elements; wherein the business fields are unique identifiers of business data that have a mapping relationship with the business elements;
步骤2、根据所述唯一标识确定所述与所述业务要素具有映射关系的业务数据。Step 2: Determine the business data having a mapping relationship with the business element according to the unique identifier.
在本申请实施例中,每个业务交易所包含的业务要素(也即测试案例中包含业务要素)均可对应到与其具有映射关系的业务数据,业务数据则可通过库表及库表字段对应,如客户类-对私客户类-账号状态正常的对私客户类,其包含的业务数据有客户号cust_info-cust_no、客户名cust_info- cust_name、客户证件类型cust_info-cust_IDtype等,对于业务交易 APICODE,其业务要素有客户号、客户名、客户证件号、账号等,其中客户号、客户名、客户证件号则对应上述业务数据中的各个具体的业务字段的业务数据。因此通过建立业务要素和业务数据的映射关系即可建立业务语言向技术语言转换的桥梁。In the embodiment of the present application, the business elements included in each business transaction (that is, the business elements included in the test case) can correspond to the business data that has a mapping relationship with it, and the business data can be mapped through the library table and the library table field. , such as customer class - private customer class - private customer class with normal account status, the business data contained in it includes customer number cust_info-cust_no, customer name cust_info-cust_name, customer ID type cust_info-cust_IDtype, etc. For business transaction APICODE, Its business elements include customer number, customer name, customer certificate number, account number, etc., wherein the customer number, customer name, and customer certificate number correspond to the business data of each specific business field in the above business data. Therefore, by establishing the mapping relationship between business elements and business data, a bridge from business language to technical language can be established.
在上述实施例的基础上,在具体的实施例中测试人员提供测试案例或通过界面勾选/填写业务场景的业务取值等的方式构建业务要素,系统可自动根据已建立的业务数据模型进行通用SQL规则的填充或固定值、函数关系值多方式的补充将业务语言转换为技术语言。具体的实现方法如下:On the basis of the above embodiment, in a specific embodiment, the tester provides test cases or constructs business elements by checking/filling in the business value of the business scenario through the interface. The filling of general SQL rules or the addition of fixed values and function relation values in multiple ways converts business language into technical language. The specific implementation method is as follows:
每个业务交易都有很多种交易场景,但这些交易场景中所使用的业务要素即业务语言是一样的,只是取值会有所不同,结合已建立的业务数据模型(在具体实施例中该模型以业务要素-业务数据表的形式存储),只需要以业务要素的枚举值进行通用取值方式的SQL填充或固定值、函数关系值多方式的补充即可完成技术语言的业务场景适配。如图2示例所示,通过改变通用SQL规则的枚举值即可满足不同场景的数据条件,实现业务语言向技术语言的转换。Each business transaction has many transaction scenarios, but the business elements used in these transaction scenarios, that is, the business language, are the same, but the values will be different. Combined with the established business data model (in the specific embodiment, this The model is stored in the form of business elements - business data tables), and it only needs to use the enumeration values of business elements to fill in the SQL in the general value method or supplement the fixed value and function relationship value in multiple ways to complete the business scenario adaptation of the technical language. match. As shown in the example in Figure 2, by changing the enumeration values of the general SQL rules, the data conditions of different scenarios can be met, and the conversion from business language to technical language can be realized.
在进一步的可选实施例中,当所述与业务要素具有映射关系的业务数据可以为在数据库表中获取与所述业务要素具有映射关系的业务数据的 SQL规则时,所述根据业务要素获取具有映射关系的业务数据的实现方式还包括:In a further optional embodiment, when the business data having a mapping relationship with the business element may be an SQL rule for acquiring the business data having a mapping relationship with the business element in a database table, the obtaining according to the business element The implementation of the business data with the mapping relationship also includes:
步骤1、构建目标测试案例业务数据唯一标识号;其中,所述目标测试案例至少包括两个以上业务要素;所述根据两个业务要素获取的业务数据的标识号均为所述唯一标识号;Step 1, constructing the unique identification number of the target test case business data; wherein, the target test case includes at least two or more business elements; the identification numbers of the business data obtained according to the two business elements are the unique identification numbers;
步骤2、将获取的第一业务要素的第一业务数据缓存于业务场景数据池中;Step 2, caching the acquired first business data of the first business element in the business scenario data pool;
步骤3、根据所述第一业务数据和第二业务要素在所述预构建的业务数据模型中获取第二业务数据。Step 3: Acquire second business data in the pre-built business data model according to the first business data and the second business element.
在本申请实施例中通过建立业务场景类数据池(也即业务测试案例的测试场景数据池),并以唯一标识号进行业务场景关联要素的实时动态交互,以获取满足场景的一组数据,如业务场景案例包含业务要素A、B、 C、D…,其中A、B的取值为联表SQL获取,同时B的SQL关系部分由 A的值决定,则该发明将会优先根据A的SQL获取A的值,存入业务场景类数据池,并生成唯一场景标识号,接着将A的值传入B的SQL规则获取B的值,再写入业务场景类该标识下的场景中,依此类推完成一组场景业务数据的获取。基于本申请实施例,解决了测试数据动态获取难度大,效率低,测试数据不够多样性且准确度低的难点痛点。In the embodiment of the present application, by establishing a business scenario data pool (that is, a test scenario data pool of a business test case), and performing real-time dynamic interaction of business scenario associated elements with a unique identification number, a set of data that satisfies the scenario is obtained, If the business scenario case includes business elements A, B, C, D..., where the values of A and B are obtained from the joint table SQL, and the SQL relation part of B is determined by the value of A, the invention will give priority to the value of A based on the value of A. SQL obtains the value of A, stores it in the business scenario class data pool, and generates a unique scenario identification number, then passes the value of A into the SQL rule of B to obtain the value of B, and writes it into the scenario under the ID of the business scenario class. And so on to complete the acquisition of a set of scene business data. Based on the embodiments of the present application, the difficulties and pain points of dynamic acquisition of test data are difficult, low in efficiency, and the test data is not sufficiently diverse and low in accuracy.
基于本申请上述实施例提供的数据获取方案,在具体应用操作中用户只需按照业务场景在界面中选择配置相关数据类,即可获得相应测试数据,无需关注数据类或业务场景的取值逻辑,提升用户体验,降低使用门槛,极大的提高测试效率;此外,上述实施例提供的数据获取方案也能够满足用户7*24小时实时动态获取测试数据的需求,同时所获取的测试数据是动态多样的,丰富测试场景同时避免人为测试可能存在的不充分性。同时,利用本申请上述实施例所公开的数据获取方案在业务系统发生较大功能或架构变更时,也只需针对性的维护受影响的数据类和业务库表的数据关系模型,即可实时完成测试数据的更新,用户在业务层级上是不感知也无需感知的,极大提高了测试数据获取方案的易用性和健壮性。Based on the data acquisition solution provided by the above embodiments of the present application, in the specific application operation, the user only needs to select and configure the relevant data class in the interface according to the business scenario, and then the corresponding test data can be obtained, without paying attention to the value logic of the data class or business scenario , improve the user experience, lower the use threshold, and greatly improve the test efficiency; in addition, the data acquisition solution provided by the above embodiment can also meet the user's 7*24-hour real-time dynamic acquisition test data needs, and the acquired test data is dynamic Diverse, enriching test scenarios while avoiding possible inadequacies of human testing. At the same time, when the data acquisition scheme disclosed in the above-mentioned embodiments of the present application is used, when a major function or architecture change occurs in the business system, it is only necessary to maintain the data relationship model of the affected data classes and business database tables in a targeted manner, and then real-time After completing the update of the test data, the user does not perceive or need to perceive it at the business level, which greatly improves the usability and robustness of the test data acquisition scheme.
基于图1所示的数据获取方法,另一方面本申请实施例提供了一种数据获取装置,所述装置如图3所示,所述装置可以包括:301获取模块、 302存储模块和303构建模块;其中,Based on the data acquisition method shown in FIG. 1 , on the other hand, an embodiment of the present application provides a data acquisition apparatus. The apparatus is shown in FIG. 3 . The apparatus may include: 301 an acquisition module, 302 a storage module, and 303 a construction module module; of which,
所述301获取模块,用于获取测试人员输入的测试案例并识别业务要素;The 301 acquisition module is used to acquire test cases input by testers and identify business elements;
所述303构建模块,用于构建业务数据模型;所述业务数据模型存储有业务要素,和,与所述业务要素具有映射关系的业务数据。The 303 building module is used to construct a business data model; the business data model stores business elements and business data that has a mapping relationship with the business elements.
所述302存储模块,用于存储预先构建的业务数据模型;The 302 storage module is used to store the pre-built business data model;
所述301获取模块,还用于根据所述业务要素从预先构建的业务数据模型中获取与所述业务要素具有映射关系的业务数据。The obtaining module 301 is further configured to obtain business data having a mapping relationship with the business element from a pre-built business data model according to the business element.
在进一步的实施例中,根据所述301获取模块获取的有效的业务数据,所述303构建模块具体用于通过业务数据层次划分标准,以树模型为基础构建所述业务数据模型;其中所述业务数据模型至少以降阶次序包括母类、子类、细类、衍生业务数据。In a further embodiment, according to the valid business data acquired by the acquisition module in 301, the construction module in 303 is specifically configured to construct the business data model based on a tree model through business data hierarchical division criteria; wherein the The business data model includes parent class, subclass, subclass, and derived business data at least in descending order.
可以理解的是,本实施例中的数据获取装置的上述各组成设备具有实现图1中所示的实施例中的方法相应步骤的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块或系统。上述模块和系统可以是软件和/或硬件,上述各模块和系统可以单独实现,也可以多个模块和系统集成实现。对于上述各模块和系统的功能描述具体可以参见图1中所示实施例中的方法的对应描述,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。It can be understood that the above-mentioned components of the data acquisition apparatus in this embodiment have the function of implementing the corresponding steps of the method in the embodiment shown in FIG. 1 . This function can be implemented by hardware or by executing corresponding software by hardware. The hardware or software includes one or more modules or systems corresponding to the above functions. The above-mentioned modules and systems may be software and/or hardware, and the above-mentioned modules and systems may be implemented independently, or multiple modules and systems may be integrated and implemented. For the functional description of the above-mentioned modules and systems, reference may be made to the corresponding description of the method in the embodiment shown in FIG. It will not be repeated here.
可以理解的是,本发明实施例示意的结构并不构成对数据获取装置的具体结构的具体限定。在本申请另一些实施例中,数据获取装置可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the specific structure of the data acquisition apparatus. In other embodiments of the present application, the data acquisition apparatus may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
本申请实施例提供了一种电子设备,包括处理器和存储器;Embodiments of the present application provide an electronic device, including a processor and a memory;
存储器,用于存储操作指令;memory for storing operation instructions;
处理器,用于通过调用操作指令,执行本申请任一实施方式中所提供的数据获取方法。The processor is configured to execute the data acquisition method provided in any embodiment of the present application by invoking the operation instruction.
作为一个示例,图4示出了本申请实施例所适用的一种电子设备的结构示意图,如图4所示,该电子设备400包括:处理器401和存储器403。其中,处理器401和存储器403相连,如通过总线402相连。可选的,电子设备400还可以包括收发器404。需要说明的是,实际应用中收发器404 不限于一个。可以理解的是,本发明实施例示意的结构并不构成对电子设备400的具体结构的具体限定。在本申请另一些实施例中,电子设备400 可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实。可选地,电子设备还可以包括显示屏405,用于显示图像,或需要时接收用户的操作指令。As an example, FIG. 4 shows a schematic structural diagram of an electronic device to which the embodiments of the present application are applied. As shown in FIG. 4 , the
其中,处理器401应用于本申请实施例中,用于实现上述方法实施例所示的方法。收发器404可以包括接收机和发射机,收发器404应用于本申请实施例中,用于执行时实现本申请实施例的电子设备与其他设备通信的功能。The
处理器401可以是CPU(Central Processing Unit,中央处理器),通用处理器,DSP(Digital Signal Processor,数据信号处理器),ASIC (Application SpecificIntegrated Circuit,专用集成电路),FPGA(Field Programmable Gate Array,现场可编程门阵列)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器401也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等。The
处理器401也可以包括一个或多个处理单元,例其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是电子设备400的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。处理器 401中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器401中的存储器为高速缓冲存储器。该存储器可以保存处理器401刚用过或循环使用的指令或数据。如果处理器401需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器401的等待时间,因而提高了系统的效率。The
处理器401可以运行本申请实施例提供的数据获取方法,以便于降低用户的操作复杂度、提高终端设备的智能化程度,提升用户的体验。处理器401可以包括不同的器件,比如集成CPU和GPU时,CPU和GPU可以配合执行本申请实施例提供的数据获取方法,比如数据获取方法中部分算法由CPU执行,另一部分算法由GPU执行,以得到较快的处理效率。The
总线402可包括一通路,在上述组件之间传送信息。总线402可以是 PCI(Peripheral Component Interconnect,外设部件互连标准)总线或EISA (ExtendedIndustry Standard Architecture,扩展工业标准结构)总线等。总线402可以分为地址总线、数据总线、控制总线等。为便于表示,图4 中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The
存储器403可以是ROM(Read Only Memory,只读存储器)或可存储静态信息和指令的其他类型的静态存储设备,磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。The
可选的,存储器403用于存储执行本申请方案的应用程序代码,并由处理器401来控制执行。处理器401用于执行存储器403中存储的应用程序代码,以实现本申请任一实施方式中所提供的数据获取方法。Optionally, the
存储器403可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器401通过运行存储在存储器403的指令,从而执行电子设备400的各种功能应用以及数据处理。存储器403可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,应用程序的代码等。存储数据区可存储电子设备400使用过程中所创建的数据(比如相机应用采集的图像、视频等)等。
存储器403还可以存储本申请实施例提供的数据获取方法对应的一个或多个计算机程序。该一个或多个计算机程序被存储在上述存储器403 中并被配置为被该一个或多个处理器401执行,该一个或多个计算机程序包括指令,上述指令可以用于执行上述相应实施例中的各个步骤。The
当然,本申请实施例提供的数据获取方法的代码还可以存储在外部存储器中。这种情况下,处理器401可以通过外部存储器接口运行存储在外部存储器中的数据获取方法的代码,处理器401可以控制运行数据获取流程。Certainly, the code of the data acquisition method provided by the embodiment of the present application may also be stored in an external memory. In this case, the
显示屏405包括显示面板。在一些实施例中,电子设备400可以包括 1个或N个显示屏405,N为大于1的正整数。显示屏405可用于显示由用户输入的信息或提供给用户的信息以及各种图形用户界面(graphical user interface,GUI)。例如,显示屏405可以显示照片、视频、网页、或者文件等。
本申请实施例提供的电子设备,适用于上述方法任一实施例,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。The electronic device provided in the embodiments of the present application is applicable to any of the above-mentioned methods. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods provided above, which will not be repeated here.
本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该程序被处理器执行时实现上述方法实施例所示的数据获取方法。Embodiments of the present application provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the program is executed by a processor, the data acquisition method shown in the foregoing method embodiments is implemented.
本申请实施例提供的计算机可读存储介质,适用于上述方法任一实施例,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。The computer-readable storage medium provided by the embodiment of the present application is applicable to any embodiment of the above method. Therefore, for the beneficial effects that can be achieved, reference may be made to the beneficial effects of the corresponding methods provided above, which will not be repeated here. .
本申请实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的方法。本申请实施例提供的计算机程序产品,适用于上述方法任一实施例,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Embodiments of the present application further provide a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the above-mentioned relevant steps, so as to implement the methods in the above-mentioned embodiments. The computer program product provided by the embodiments of the present application is applicable to any embodiment of the above method. Therefore, the beneficial effects that can be achieved may refer to the beneficial effects of the corresponding methods provided above, which will not be repeated here.
本申请实施例提供数据获取方案通过建立业务数据模型,同时建立业务场景数据池用来进行同一测试案例下的关联业务数据的数据联动动态获取,最终达到测试人员只需关注的业务要素,而不需要关注业务要素与底层技术逻辑的实现。本申请实施例基于本申请所提供的数据获取方案用户只需关测试案例的业务要素即通过测试案例业务要素配置即可获取所需的测试数据;基于本申请所提供的数据获取方案数据获取过程简单便捷、实现了数据获取及获取的真正复用且维护成本较低;基于本申请所提供的数据获取方案生成的数据准确多样,能够大幅提高测试效率和测试质量,尤其解决了测试数据动态获取难度大,效率低,测试数据不够多样性且准确度低的难点痛点。The embodiments of the present application provide a data acquisition solution by establishing a business data model and a business scenario data pool to dynamically acquire the data of the associated business data under the same test case, so as to finally achieve the business elements that testers only need to pay attention to, instead of Need to pay attention to the realization of business elements and underlying technical logic. Based on the data acquisition solution provided by the present application, the user can obtain the required test data by configuring the business elements of the test case only by concerned with the business elements of the test case; based on the data acquisition solution provided by the present application, the data acquisition process It is simple and convenient, realizes the real reuse of data acquisition and acquisition, and has low maintenance cost; the data generated based on the data acquisition scheme provided by the application is accurate and diverse, which can greatly improve the test efficiency and test quality, especially solve the problem of dynamic acquisition of test data. Difficulty, low efficiency, difficult and painful points of insufficient diversity of test data and low accuracy.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,还可以做出若干改进和润饰,这些变化、替换、改进和润饰也应视为都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above contents are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the technical field disclosed in the present application can easily think of changes or substitutions, and can also Several improvements and modifications are made, and these changes, substitutions, improvements and modifications should also be deemed to be covered by the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110343591.2A CN112882960B (en) | 2021-03-30 | 2021-03-30 | A method and device for acquiring data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110343591.2A CN112882960B (en) | 2021-03-30 | 2021-03-30 | A method and device for acquiring data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112882960A true CN112882960A (en) | 2021-06-01 |
CN112882960B CN112882960B (en) | 2025-05-30 |
Family
ID=76040349
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110343591.2A Active CN112882960B (en) | 2021-03-30 | 2021-03-30 | A method and device for acquiring data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112882960B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114168488A (en) * | 2021-12-29 | 2022-03-11 | 中国邮政储蓄银行股份有限公司 | Method, device, computer readable storage medium and processor for automated testing |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150227452A1 (en) * | 2014-02-12 | 2015-08-13 | Wipro Limited | System and method for testing software applications |
CN106202080A (en) * | 2015-04-30 | 2016-12-07 | 中国移动通信集团公司 | A kind of webpage rendering intent, server and terminal unit |
CN108804266A (en) * | 2018-05-22 | 2018-11-13 | 郑州云海信息技术有限公司 | A kind of performance of storage system test method, device and computer readable storage medium |
CN110221982A (en) * | 2019-06-17 | 2019-09-10 | 深圳前海微众银行股份有限公司 | Performance test methods, device, equipment and the readable storage medium storing program for executing of operation system |
CN110471833A (en) * | 2019-06-27 | 2019-11-19 | 网宿科技股份有限公司 | A kind of acquisition methods of test data, electronic equipment and storage medium |
CN110737577A (en) * | 2018-07-20 | 2020-01-31 | 北京奇虎科技有限公司 | Method and device for storing test defect data |
CN111078823A (en) * | 2019-12-13 | 2020-04-28 | 北京明略软件系统有限公司 | Text element extraction method and device and electronic equipment |
CN111831278A (en) * | 2020-07-14 | 2020-10-27 | 北京思特奇信息技术股份有限公司 | Service element adaptive matching method and device, electronic equipment and storage medium |
CN111881020A (en) * | 2020-07-07 | 2020-11-03 | 上海中通吉网络技术有限公司 | Payment center interface testing method, device and system |
CN112416798A (en) * | 2020-12-04 | 2021-02-26 | 深圳前海微众银行股份有限公司 | Data processing method, device, equipment and storage medium |
-
2021
- 2021-03-30 CN CN202110343591.2A patent/CN112882960B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150227452A1 (en) * | 2014-02-12 | 2015-08-13 | Wipro Limited | System and method for testing software applications |
CN106202080A (en) * | 2015-04-30 | 2016-12-07 | 中国移动通信集团公司 | A kind of webpage rendering intent, server and terminal unit |
CN108804266A (en) * | 2018-05-22 | 2018-11-13 | 郑州云海信息技术有限公司 | A kind of performance of storage system test method, device and computer readable storage medium |
CN110737577A (en) * | 2018-07-20 | 2020-01-31 | 北京奇虎科技有限公司 | Method and device for storing test defect data |
CN110221982A (en) * | 2019-06-17 | 2019-09-10 | 深圳前海微众银行股份有限公司 | Performance test methods, device, equipment and the readable storage medium storing program for executing of operation system |
CN110471833A (en) * | 2019-06-27 | 2019-11-19 | 网宿科技股份有限公司 | A kind of acquisition methods of test data, electronic equipment and storage medium |
CN111078823A (en) * | 2019-12-13 | 2020-04-28 | 北京明略软件系统有限公司 | Text element extraction method and device and electronic equipment |
CN111881020A (en) * | 2020-07-07 | 2020-11-03 | 上海中通吉网络技术有限公司 | Payment center interface testing method, device and system |
CN111831278A (en) * | 2020-07-14 | 2020-10-27 | 北京思特奇信息技术股份有限公司 | Service element adaptive matching method and device, electronic equipment and storage medium |
CN112416798A (en) * | 2020-12-04 | 2021-02-26 | 深圳前海微众银行股份有限公司 | Data processing method, device, equipment and storage medium |
Non-Patent Citations (2)
Title |
---|
周鹏飞等: "基于CVI和ASP.NET的测试数据获取方法", 兵器装备工程学报, vol. 37, no. 5, 25 May 2016 (2016-05-25) * |
魔都飘雪: "软件测试中准备测试数据的一些方法_测试模型及数据获取方式", Retrieved from the Internet <URL:https://blog.csdn.net/zhusongziye/article/details/79078936> * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114168488A (en) * | 2021-12-29 | 2022-03-11 | 中国邮政储蓄银行股份有限公司 | Method, device, computer readable storage medium and processor for automated testing |
Also Published As
Publication number | Publication date |
---|---|
CN112882960B (en) | 2025-05-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109471626B (en) | Page logic structure, page generation method, page data processing method and device | |
US10185644B2 (en) | Service implementation based debugger for service oriented architecture projects | |
CN113656227A (en) | Chip verification method and device, electronic equipment and storage medium | |
CN110825731A (en) | Data storage method and device, electronic equipment and storage medium | |
CN111985194A (en) | Data storage method and device, electronic equipment and storage medium | |
CN113486010A (en) | Database synchronization method, device, server and storage medium | |
CN108733602B (en) | data processing | |
CN112506503A (en) | Programming method, device, terminal equipment and storage medium | |
CN105511890A (en) | Graphical interface updating method and graphical interface updating device | |
CN112882960A (en) | Data acquisition method and device | |
CN111291443B (en) | Method, device and device for automatic generation of I/O module model of vehicle controller software | |
CN115186140A (en) | Method, device and electronic device for generating industrial topology map | |
CN118586052A (en) | Bus interconnection verification method, device, electronic device, storage medium and program | |
CN117573936A (en) | Data relationship display method and device and related equipment | |
CN110955599A (en) | Object creation method, apparatus, electronic device, and computer-readable storage medium | |
US20240319967A1 (en) | Script generation method and apparatus, device, and storage medium | |
WO2018205390A1 (en) | Control layout display control method, system, and apparatus, and computer readable storage medium | |
CN115794621A (en) | Code coverage test method, device, equipment and storage medium | |
CN117271300A (en) | Traversal test method, device, equipment and medium | |
CN114757124A (en) | CFD workflow modeling method and device based on XML, computer and storage medium | |
CN107133082A (en) | Realize the method and system of synchronous virtual unit component | |
US20190384695A1 (en) | Happens-before-based dynamic concurrency analysis for actor-based programs | |
TWI803875B (en) | Modeling device and modeling method of business logic representation model | |
JPH06348499A (en) | Object directional programming support device and its method | |
CN114968005B (en) | Equipment virtual training modeling method, device, terminal equipment and system |
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 |