A data acquisition method and apparatus
By identifying business elements in the test case and obtaining corresponding data from the pre-built business data model, establishing a business scenario data pool for data linkage, the problem of time-consuming and insufficient diversity of test data preparation in software testing is solved, and dynamic acquisition and reusing of test data is achieved.
Patent Information
- Application Number
- CN202110343591.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-30
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2041-03-30
AI Technical Summary
In existing software testing, the preparation of test data is time-consuming and has a high threshold. Especially in the financial industry, a large amount of diversified test data is required to meet the requirements of real-time and diversity, but the existing technology is difficult to achieve dynamic acquisition and reuse.
By obtaining the test cases input by the tester, identifying business elements, and obtaining corresponding business data from the pre-constructed business data model based on these elements, establishing a business scenario data pool for data linkage dynamic acquisition.
It realizes dynamic acquisition and reuse of test data, reduces user operation complexity, improves test efficiency and quality, and solves the problem of insufficient diversity and low accuracy of test data.
Smart Images

Figure CN112882960B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly relates to a data acquisition method and apparatus. Background Art
[0002] In existing software testing, test data preparation is a time-consuming process. Usually, professional database personnel or business personnel need to prepare the data manually and then hand it over to test execution personnel for manual testing or automated testing. Especially in the financial industry, in the face of a large 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 needed to meet the test needs. At present, relevant personnel generally need to prepare test data manually according to relevant business processes. Not only is the data manufacturing efficiency low, but the threshold is also high, and the fixed test data cannot support diversified testing. Summary of the Invention
[0003] The purpose of this application aims to solve at least one of the above technical defects. The technical solutions adopted in this application are as follows:
[0004] In a first aspect, an embodiment of this application discloses a data acquisition method, and the method includes:
[0005] Obtain a test case input by a tester and identify business elements;
[0006] Obtain business data having a mapping relationship with the business elements from a pre-constructed business data model; wherein the business data model stores business elements and business data having a mapping relationship with the business elements.
[0007] Further, the construction of the business data model includes:
[0008] Obtain valid business data;
[0009] Build the valid business data model based on a tree model through a business data hierarchy division standard; wherein the business data model includes at least a parent class, a subclass, a detailed class, and derivative business data in a descending order.
[0010] Further, the obtaining of the valid business data includes:
[0011] Obtain the data source of the system database table;
[0012] Clean the dirty data in the data source and filter out the data irrelevant to the business elements to obtain the valid business data.
[0013] 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 obtaining business data having a mapping relationship with the business element in a database table.
[0014] Further, the obtaining of the business data having a mapping relationship with the business element includes:
[0015] Obtaining a business field in the pre-constructed business data model according to the business element; wherein the business field is a unique identifier of the business data having a mapping relationship with the business element;
[0016] Determining the business data having a mapping relationship with the business element according to the unique identifier.
[0017] Further, the method further includes:
[0018] Constructing a unique identifier number for the business data of the target test case; wherein the target test case includes at least two or more business elements; the identifier numbers of the business data obtained according to the two business elements are both the unique identifier number;
[0019] Caching the first business data of the first business element obtained in the business scenario data pool;
[0020] Obtaining second business data in the pre-constructed business data model according to the first business data and the second business element.
[0021] 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 construction module; wherein,
[0022] The acquisition module is configured to acquire a test case input by a tester and identify business elements;
[0023] The construction module is configured to construct a business data model; the business data model stores business elements and business data having a mapping relationship with the business elements.
[0024] The storage module is configured to store the pre-constructed business data model;
[0025] The acquisition module is further configured to acquire business data having a mapping relationship with the business element from the pre-constructed business data model according to the business element.
[0026] Further, the acquisition module is further configured to acquire valid business data; the construction module is specifically configured to construct the business data model based on a tree model through a business data hierarchical division standard; wherein the business data model includes at least a parent class, a subclass, a detailed class, and derivative business data in a descending order.
[0027] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory;
[0028] The memory is used to store operation instructions;
[0029] The processor is configured to execute the method described in any of the above embodiments by calling the operation instructions.
[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in any of the above embodiments is implemented.
[0031] The data acquisition solution provided by the embodiments of the present application builds a business data model and simultaneously builds a business scenario data pool for dynamically acquiring associated business data under the same test case. Ultimately, testers only need to focus on the business elements and do not need to concern themselves with the implementation of the business elements and the underlying technical logic. The beneficial effects of the present application at least include one of the following:
[0032] (1) Based on the data acquisition solution provided by the present application, users only need to focus on the business elements of the test case, and can obtain the required test data through the configuration of the business elements of the test case;
[0033] (2) Based on the data acquisition solution provided by the present application, the data acquisition process is simple and convenient, realizing true reuse of data acquisition and acquisition, and having a low maintenance cost;
[0034] (3) The data generated based on the data acquisition solution provided by the present application is accurate and diverse, which can greatly improve the test efficiency and test quality, especially solving the difficulties and pain points of difficult and inefficient dynamic acquisition of test data, lack of diversity of test data, and low accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments of the present application.
[0036] Figure 1 A flowchart of a data acquisition method provided by an embodiment of the present application;
[0037] Figure 2 A relationship table of a business data model provided by an embodiment of the present application;
[0038] Figure 3 A schematic diagram of a data acquisition device provided by an embodiment of the present application;
[0039] Figure 4Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0040] The embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote 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 and should not be construed as a limitation of the present invention.
[0041] Those skilled in the art of the present technology can understand that, unless specifically stated otherwise, the singular forms "a", "an", "the", and "said" used herein may also include the plural forms. The "first", "second", etc. are only used to clearly introduce the solution and define the objects, and do not limit the objects themselves. Of course, the objects defined by "first" and "second" may be the same terminal, device, and user, etc., or the same type of terminal, device, and user. It should be further understood that the term "including" used in the description of the present application means the presence of the described features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or their groups. The phrase "and / or" used herein includes all or any unit and all combinations of one or more of the associated listed items.
[0042] In addition, it should be understood that "at least one" in the embodiments of the present application means one or more, and "a plurality" means two or more. The "and / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B may be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one (item) of the following" or its similar expression refers to any combination of these items, including any combination of single item (s) or plural item (s). For example, at least one (item) 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, and c may be single or multiple.
[0043] As stated in the background art, currently in many testing fields including financial testing, etc., test data requires testers to obtain the test data by using a database or other auxiliary generation operations. This method has cumbersome steps and high labor costs. In addition, there are also some technical solutions that first determine the data generation models corresponding to each test system, and then generate the test data corresponding to each test system based on the key data generation fields and data generation rules in each data generation model. The test data generated by this method is fixed and cannot generate diverse test data according to scenario changes. Additionally, there are some solutions that obtain the corresponding driver functions in the database operation function library by parsing and executing SQL instruction information, and obtain the parameterization basis from the target database. This method is mainly used for automated test scripts and uses pure technical languages, which are not easy to understand and operate. There are also some solutions that create generation rules for each test field type in advance and convert the original data in the database into multiple test data. This method uses pure technical languages, and testers need to have a relatively in-depth understanding of the generation rules to accurately write the corresponding statements, which is not conducive to popularization and use. In summary, 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 device to solve at least one of the above technical problems.
[0044] Figure 1 FIG. shows a schematic flowchart of a data acquisition provided by an embodiment of the present application. As Figure 1 shown, the method mainly may include:
[0045] S101. Obtain a test case input by a tester and identify business elements;
[0046] S102. Obtain business data having a mapping relationship with the business elements from a pre-constructed business data model according to the business elements; wherein the business data model stores business elements and business data having a mapping relationship with the business elements.
[0047] In a further optional embodiment, the constructing the business data model includes:
[0048] Step 1. Obtain valid business data;
[0049] Step 2. Construct the valid business data model based on a tree model through a business data hierarchical division standard; wherein the business data model includes at least a parent class, a subclass, a detailed class, and derivative business data in a descending order.
[0050] In a preferred embodiment, the constructing the business data model includes:
[0051] Step 1. Obtain the data source of the system database table;
[0052] Step 2: Clean the dirty data in the data source, and filter out the data irrelevant to the business elements to obtain the effective business data.
[0053] Step 3: Based on the business data hierarchy division standard, construct the effective business data model based on the tree model; wherein the business data model includes at least, in descending order, parent classes, subclasses, detailed classes, and derivative business data.
[0054] In a further alternative embodiment, the business element values correspond to the enumerated values of the business data, including fixed values, function relation values, or SQL rule values, that is, the business data having a mapping relationship with the business elements can be:
[0055] (1) Fixed values;
[0056] (2) Function relations;
[0057] (3) SQL rules for obtaining the business data having a mapping relationship with the business elements in the database table.
[0058] In a further alternative embodiment, the obtaining of the business data having a mapping relationship with the business elements includes:
[0059] Step 1: Obtain the business fields in the pre-constructed business data model according to the business elements; wherein the business fields are the unique identifiers of the business data having a mapping relationship with the business elements;
[0060] Step 2: Determine the business data having a mapping relationship with the business elements according to the unique identifier.
[0061] In the embodiments of the present application, each business element included in each business transaction (that is, the business elements included in the test cases) can correspond to the business data having a mapping relationship with it, and the business data can be corresponding through the library table and the library table fields. For example, for the customer class - the private customer class - the private customer class with a normal account status, the business data it contains are customer number cust_info - cust_no, customer name cust_info - cust_name, customer document type cust_info - cust_IDtype, etc. For the business transaction APICODE, its business elements are customer number, customer name, customer document number, account number, etc., and among them, the customer number, customer name, and customer document number correspond to the business data of each specific business field in the above business data. Therefore, by establishing the mapping relationship between the business elements and the business data, a bridge for converting the business language to the technical language can be established.
[0062] Based on the above embodiments, in a specific embodiment, testers provide test cases or build business elements by means of checking / filling in the business values of the business scenarios through the interface. The system can automatically fill in the general SQL rules according to the established business data model or supplement them in multiple ways with fixed values and function relationship values to convert business language into technical language. The specific implementation method is as follows:
[0063] Each business transaction has many transaction scenarios, but the business elements, that is, the business language, used in these transaction scenarios are the same, only the values are different. Combining the established business data model (in a specific embodiment, this model is stored in the form of business element - business data table), only the SQL filling of the general value-taking method with the enumerated values of the business elements or the supplementation in multiple ways with fixed values and function relationship values is required to complete the adaptation of the business scenario of the technical language. As Figure 2 shown in the example, by changing the enumerated values of the general SQL rules, the data conditions of different scenarios can be satisfied, and the conversion from business language to technical language can be realized.
[0064] In a further optional embodiment, when the business data having a mapping relationship with the business element can be the SQL rule for obtaining the business data having a mapping relationship with the business element in the database table, the implementation manner of obtaining the business data having a mapping relationship according to the business element further includes:
[0065] Step 1: Construct a unique identification number for the business data of the target test case; 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 both the unique identification number;
[0066] Step 2: Cache the first business data of the first business element obtained in the business scenario data pool;
[0067] Step 3: Obtain the second business data in the pre-constructed business data model according to the first business data and the second business element.
[0068] In the embodiment of the present application, a business scenario data pool (i.e., a test scenario data pool of a business test case) is established, and real-time dynamic interaction of business scenario-related elements is performed with a unique identification number to obtain a set of data that meets the scenario. For example, a business scenario case includes business elements A, B, C, D..., where the values of A and B are obtained by a joint table SQL, and the SQL relationship of B is partially determined by the value of A. Then, the invention will preferentially obtain the value of A according to the SQL of A, store it in the business scenario data pool, and generate a unique scenario identification number. Then, the value of A is passed into the SQL rule of B to obtain the value of B, and then written into the scenario under the business scenario class identification, and so on to complete the acquisition of a set of scenario business data. Based on the embodiment of the present application, the difficulties and pain points of dynamic acquisition of test data are solved, such as high difficulty and low efficiency, insufficient diversity of test data and low accuracy.
[0069] Based on the data acquisition scheme provided by the above embodiment of the present application, in specific application operations, users only need to select and configure relevant data classes in the interface according to the business scenario to obtain corresponding test data, without paying attention to the value logic of the data class or business scenario, thereby improving user experience, lowering the threshold for use, and greatly improving test efficiency; in addition, the data acquisition scheme provided by the above embodiment can also meet the user's 7*24 hours real-time dynamic acquisition of test data needs, and the acquired test data is dynamic and diverse, enriching the test scenario while avoiding the possible insufficiency of manual testing. At the same time, using the data acquisition scheme disclosed in the above embodiment of the present application, when a major functional or architectural change occurs in the business system, it is only necessary to maintain the data relationship model of the affected data class and business library table in a targeted manner to complete the update of test data in real time. Users are not aware of it and do not need to be aware of it at the business level, which greatly improves the ease of use and robustness of the test data acquisition scheme.
[0070] based on Figure 1 The data acquisition method shown in the figure, on the other hand, the embodiment of the present application provides a data acquisition device, the device is as follows Figure 3 As shown, the device may include: 301 acquisition module, 302 storage module and 303 construction module; wherein,
[0071] The acquisition module 301 is used to acquire the test cases input by the tester and identify the business elements;
[0072] The 303 construction module is used to construct a business data model; the business data model stores business elements and business data having a mapping relationship with the business elements.
[0073] The storage module 302 is used to store the pre-built business data model;
[0074] The 301 acquisition module is further configured to obtain business data having a mapping relationship with the business element from a pre-constructed business data model according to the business element.
[0075] In a further embodiment, according to the valid business data obtained by the 301 acquisition module, the 303 construction module is specifically configured to construct the business data model based on a tree model through a business data hierarchy division criterion; wherein the business data model includes at least a parent class, a subclass, a detailed class, and derivative business data in a descending order.
[0076] It can be understood that the above-mentioned respective component devices of the data acquisition device in this embodiment have functions corresponding to the corresponding steps of the method in the Figure 1 illustrated embodiment. This function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules or systems corresponding to the above functions. The above modules and systems can be software and / or hardware, and the above-mentioned respective modules and systems can be implemented separately or integrated by multiple modules and systems. For the function descriptions of the above-mentioned respective modules and systems, reference can specifically be made to the corresponding descriptions of the method in the Figure 1 illustrated embodiment. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be elaborated here.
[0077] It can be understood that the structure schematically shown in the embodiment of the present invention does not constitute a specific limitation on the specific structure of the data acquisition device. In other embodiments of the present application, the data acquisition device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure can be implemented by hardware, software, or a combination of software and hardware.
[0078] An embodiment of the present application provides an electronic device, including a processor and a memory;
[0079] The memory is used to store operation instructions;
[0080] The processor is configured to execute the data acquisition method provided in any embodiment of the present application by calling the operation instructions.
[0081] As an example, Figure 4 shows a schematic structural diagram of an electronic device applicable to the embodiment of the present application, as shown in Figure 4As shown in the figure, the electronic device 400 includes a processor 401 and a memory 403. Among them, the processor 401 and the memory 403 are connected, such as connected through a bus 402. Optionally, the electronic device 400 may further include a transceiver 404. It should be noted that in practical applications, the transceiver 404 is not limited to one. It can be understood that the structure schematically shown in the embodiments of the present invention does not constitute a specific limitation on the specific structure of the electronic device 400. In other embodiments of the present application, the electronic device 400 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure can be implemented in hardware, software, or a combination of software and hardware. Optionally, the electronic device may further include a display screen 405 for displaying images or receiving user operation instructions when needed.
[0082] Among them, the processor 401 is applied in the embodiments of the present application to implement the methods shown in the above method embodiments. The transceiver 404 may include a receiver and a transmitter. The transceiver 404 is applied in the embodiments of the present application to implement the function of communicating between the electronic device of the present application and other devices when executed.
[0083] The processor 401 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in connection with the disclosure of the present application. The processor 401 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0084] The processor 401 may also include one or more processing units. Among them, different processing units may be independent devices or integrated in one or more processors. Among them, the controller may be the nerve center and command center of the electronic device 400. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions. A memory may also be provided in the processor 401 for storing instructions and data. In some embodiments, the memory in the processor 401 is a cache memory. This memory may store the instructions or data that the processor 401 has just used or recycled. If the processor 401 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 401, and thus improves the efficiency of the system.
[0085] The processor 401 may run the data acquisition method provided in the embodiments of the present application to facilitate reducing the operation complexity of the user, improving the intelligence level of the terminal device, and enhancing the user experience. The processor 401 may include different devices. For example, when the CPU and GPU are integrated, the CPU and GPU may cooperate to execute the data acquisition method provided in the embodiments of the present application. For example, some algorithms in the data acquisition method are executed by the CPU, and another part of the algorithms are executed by the GPU to obtain a faster processing efficiency.
[0086] The bus 402 may include a path for transmitting information between the above components. The bus 402 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 402 may be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 4 only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.
[0087] The memory 403 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a disk storage medium, or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0088] Optionally, the memory 403 is used to store the application program code for executing the solution of the present application and is controlled by the processor 401 to execute. The processor 401 is used to execute the application program code stored in the memory 403 to implement the data acquisition method provided in any embodiment of the present application.
[0089] The memory 403 can be used to store computer-executable program codes, and the executable program codes include instructions. The processor 401 executes various functional applications and data processing of the electronic device 400 by running the instructions stored in the memory 403. The memory 403 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, codes of application programs, etc. The data storage area can store data created during the use of the electronic device 400 (such as images, videos, etc. collected by a camera application), etc.
[0090] The memory 403 can also store one or more computer programs corresponding to the data acquisition method provided in the embodiments of the present application. The one or more computer programs are stored in the above-mentioned memory 403 and are configured to be executed by the one or more processors 401. The one or more computer programs include instructions, and the above instructions can be used to execute the respective steps in the corresponding embodiments above.
[0091] Of course, the code of the data acquisition method provided in the embodiments of the present application can also be stored in an external memory. In this case, the processor 401 can run the code of the data acquisition method stored in the external memory through the external memory interface, and the processor 401 can control the running of the data acquisition process.
[0092] The display screen 405 includes a display panel. In some embodiments, the electronic device 400 can include one or N display screens 405, where N is a positive integer greater than 1. The display screen 405 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces (GUIs). For example, the display screen 405 can display photos, videos, web pages, or files, etc.
[0093] The electronic device provided in the embodiments of the present application is applicable to any of the above method embodiments. Therefore, the beneficial effects it can achieve can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here.
[0094] The embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the data acquisition method shown in the above method embodiments.
[0095] The computer-readable storage medium provided in the embodiments of the present application is applicable to any of the above method embodiments. Therefore, the beneficial effects it can achieve can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here.
[0096] The embodiments of the present application also provide a computer program product. When the computer program product runs on a computer, it enables the computer to execute the above-related steps to implement the method in the above 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 it can achieve can refer to the beneficial effects in the corresponding method provided above, and will not be elaborated here.
[0097] The data acquisition solution provided by the embodiments of the present application establishes a business data model and simultaneously establishes a business scenario data pool for dynamically obtaining associated business data under the same test case. Ultimately, it enables testers to only focus on the business elements without the need to concern themselves with the implementation of the business elements and the underlying technical logic. Based on the data acquisition solution provided by the present application, users only need to focus on the business elements of the test case and can obtain the required test data through the configuration of the business elements of the test case. Based on the data acquisition solution provided by the present application, the data acquisition process is simple and convenient, realizing the true reuse of data acquisition and acquisition, and having a relatively low maintenance cost. The data generated based on the data acquisition solution provided by the present application is accurate and diverse, which can significantly improve the test efficiency and test quality, especially solving the difficulties and pain points of the large difficulty, low efficiency, lack of diversity, and low accuracy of dynamically obtaining test data.
[0098] The above content is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, and can also make several improvements and refinements. These changes, substitutions, improvements, and refinements should also be regarded as being covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A data acquisition method, characterized in that, the method includes: Obtaining a test case input by a tester and identifying business elements; Obtaining business data having a mapping relationship with the business elements from a pre-constructed business data model; wherein the business data model stores business elements and business data having a mapping relationship with the business elements; The method further includes: Constructing a unique identifier for the business data of the target test case; wherein, the target test case includes at least two or more business elements; the identifier of the business data obtained according to two business elements is the unique identifier; Caching the first business data of the first business element in a business scenario data pool, wherein, by establishing the business scenario data pool, real-time dynamic interaction of business scenario associated elements is performed with the unique identifier to obtain a set of data that meets the scenario; Obtaining second business data from the pre-constructed business data model according to the first business data and the second business element; The business data having a mapping relationship with the business elements is: A fixed value, a functional relationship, or an SQL rule for obtaining business data having a mapping relationship with the business elements in a database table; The obtaining of the business data having a mapping relationship with the business elements includes: Obtaining a business field from the pre-constructed business data model according to the business element; wherein the business field is the unique identifier of the business data having a mapping relationship with the business element; Determining the business data having a mapping relationship with the business element according to the unique identifier.
2. The data acquisition method according to claim 1, characterized in that, The pre-constructed business data model includes: Obtaining valid business data; Pre-constructing the business data model based on a tree model through a business data hierarchical division standard; wherein the business data model includes at least a parent class, a subclass, a detailed class, and derivative business data in a descending order.
3. The data acquisition method according to claim 2, characterized in that, The obtaining of the valid business data includes: Obtaining the data source of the system database table; Cleaning the dirty data in the data source and filtering the data irrelevant to the business elements to obtain the valid business data.
4. A data acquisition device, characterized in that, The device includes: an acquisition module, a storage module, and a construction module; wherein, The acquisition module is used to obtain a test case input by a tester and identify business elements; The construction module is used to construct a business data model; the business data model stores business elements and business data having a mapping relationship with the business elements, and at the same time constructs a unique identifier for the business data of the target test case; wherein, the target test case includes at least two or more business elements; the identifier of the business data obtained according to two business elements is the unique identifier; The storage module is used to store the pre-constructed business data model; The obtaining module is further configured to obtain service data having a mapping relationship with the service element from a pre-constructed service data model, and cache the service data of the first service element obtained in a service scenario data pool. Specifically, by establishing the service scenario data pool, real-time dynamic interaction of service scenario association elements is performed with a unique identification number to obtain a set of data that meets the scenario; Obtain second service data in the pre-constructed service data model according to the first service data and the second service element; The device further includes: The service data having a mapping relationship with the service element is: a fixed value, a functional relationship, or an SQL rule for obtaining service data having a mapping relationship with the service element in a database table; The obtaining of service data having a mapping relationship with the service element includes: Obtain a service field in the pre-constructed service data model according to the service element; wherein the service field is a unique identifier of service data having a mapping relationship with the service element.
5. The data obtaining device according to claim 4, wherein, the obtaining module is further configured to obtain valid service data; the constructing module is specifically configured to construct the service data model based on a tree model through a service data hierarchical division criterion; wherein the service data model includes at least a parent class, a subclass, a detailed class, and derivative service data in a descending order; 6. An electronic device, wherein, it includes a processor and a memory; the memory is used to store operation instructions; the processor is configured to execute the method according to any one of claims 1-3 by calling the operation instructions.
7. A computer-readable storage medium, wherein, a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1-3 is implemented.
Citation Information
Patent Citations
Performance test method, device and equipment for service system and readable storage medium
CN110221982A