Test data acquisition method and device, equipment and storage medium

By establishing a relationship between the target object code and the target query interface, real-time business data is obtained from the data warehouse, solving the problem that test data cannot simulate actual business scenarios in existing technologies, and improving the accuracy and efficiency of test data.

CN115994092BActive Publication Date: 2026-03-27BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-19
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies cannot simulate real-world business scenario data, resulting in low efficiency and accuracy in application testing.

Method used

By establishing a relationship between the target object code and the target query interface, test data is obtained from a data warehouse built based on real-time business data of actual business scenarios, and the target object code is replaced in the interface data to obtain the test data corresponding to the target business interface.

Benefits of technology

It improves the accuracy and efficiency of test data acquisition, simplifies the test data construction process, ensures that test data comes from real-time business data, and avoids the subjectivity and limitations of manual editing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115994092B_ABST
    Figure CN115994092B_ABST
Patent Text Reader

Abstract

The present disclosure provides a test data acquisition method and device, computer equipment and a storage medium; it relates to the technical field of computers. The method comprises: obtaining interface data of a target service interface of an application, and determining a target object code in the interface data; an association relationship is established between the target object code and a target query interface; the target query interface is used to indicate business data corresponding to the target object code in a data warehouse; in response to an operation instruction for the target service interface, the target data corresponding to the target object code is acquired from the data warehouse through the target query interface; in the interface data, the target data is used to replace the target object code, and corresponding test data is obtained. The present disclosure can solve the problem of low application test accuracy caused by the inability to simulate actual business scenario data in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and in particular, to a test data acquisition method and device, a computer device and a storage medium. BACKGROUND

[0002] Before an application is deployed online, it often needs to be tested in advance. With the increasing requirements of the market on the quality of the application, application testing is particularly important. The business scenarios covered in the application testing process are an important factor in determining the testing effect.

[0003] Currently, business scenario data is simulated by manually editing data, resulting in subjective and limited business scenario data for testing, which cannot simulate actual business scenario data, thereby reducing the efficiency and accuracy of application testing.

[0004] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present disclosure, and therefore can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY

[0005] The purpose of the embodiments of the present disclosure is to provide a test data acquisition method and device, a computer device and a storage medium, thereby to a certain extent, solving the problem of low efficiency and accuracy of application testing caused by the inability to simulate actual business scenario data in the related art.

[0006] According to a first aspect of the present disclosure, a test data acquisition method is provided, the method comprising: acquiring interface data of a target business interface of an application, and determining a target object code in the interface data; establishing an association relationship between the target object code and a target query interface; the target query interface is used to indicate business data corresponding to the target object code in a data warehouse, and the data warehouse is constructed based on real-time business data of an actual business scenario; in response to an operation instruction for the target business interface, according to the association relationship, the target data corresponding to the target object code is acquired from the data warehouse through the target query interface; in the interface data, the target data is used to replace the target object code, and test data corresponding to the target business interface is obtained.

[0007] Optionally, before the association relationship between the target object code and the target query interface is established, the method further comprises: configuring a data reporting logic in a front-end processing logic code of the business data, so as to trigger the data reporting logic to report the real-time business data during the execution of the front-end processing logic code; so that the server constructs the data warehouse according to the reported real-time business data.

[0008] Optionally, the constructing the data warehouse according to the real-time business data comprises: recording a reporting time of the real-time business data, so that a server determines a data storage dimension according to a configured business scenario category; and storing the real-time business data according to the data storage dimension and the reporting time, to construct the data warehouse.

[0009] Optionally, the constructing the data warehouse comprises: in response to a data storage amount of the data warehouse reaching a preset storage threshold for any business scenario category, updating stored data corresponding to the real-time business data currently reported in the data warehouse according to a chronological order of the reporting time.

[0010] Optionally, the determining the target object code in the interface data comprises: determining a target field in the interface data; and starting from the target field, traversing to both ends of the interface data respectively, and taking a first complete object code found as the target object code, the target object code comprising the target field.

[0011] Optionally, the establishing an association relationship between the target object code and a target query interface comprises: establishing corresponding query interfaces under each dimension according to the data storage dimension; the data storage dimension comprising at least one of an application dimension, a business dimension and a scenario dimension; determining a target storage dimension corresponding to the target object code, and determining a target query interface according to the target storage dimension; and binding the target object code and the target query interface, to obtain stored data corresponding to the target object code through the target query interface.

[0012] Optionally, the method further comprises: running the test data to execute a test process of the target business interface of the application.

[0013] According to a second aspect of the present disclosure, a test data acquisition apparatus is provided, the apparatus comprising: an object determining module, a relationship establishing module, a data acquiring module and a data replacing module; wherein the object determining module is configured to acquire interface data of a target service interface of an application, and determine a target object code in the interface data; the relationship establishing module is configured to establish an association relationship between the target object code and a target query interface; the target query interface is used to indicate service data corresponding to the target object code in a data warehouse, the data warehouse being constructed based on real-time service data of an actual service scenario; the data acquiring module is configured to, in response to an operation instruction for the target service interface, acquire target data corresponding to the target object code from the data warehouse through the target query interface according to the association relationship; and the data replacing module is configured to replace the target object code with the target data in the interface data to obtain test data corresponding to the target service interface.

[0014] According to a third aspect of the present disclosure, a computer readable storage medium is provided, the computer readable storage medium storing a computer program, the computer program being executed by a processor to implement the method of any of the above embodiments.

[0015] According to a fourth aspect of the present disclosure, a computer device is provided, comprising: one or more processors; and a storage device for one or more programs, the one or more programs being executed by the one or more processors to cause the one or more processors to perform the method of any of the above embodiments.

[0016] The example embodiments of the present disclosure can have the following partial or all beneficial effects:

[0017] In the test data acquisition method provided by the example embodiments of the present disclosure, on the one hand, by establishing an association relationship between a target object code and a target query interface, and acquiring real-time service data corresponding to the target object code from a data warehouse according to the association relationship, test data is constructed, so that the test data is directly derived from the real-time service data, avoiding subjectivity and limitations caused by manual editing of service scenario data, thereby improving the accuracy of test results. On the other hand, by acquiring interface data of an application in advance, and then replacing a target object code in the interface data with target data, interface test data based on an actual service scenario can be quickly obtained, simplifying the test data construction process and improving the test data acquisition efficiency.

[0018] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0019] The accompanying drawings, which are incorporated herein and constitute part of this specification, illustrate examples consistent with the present disclosure and, together with the description, further serve to explain the principles of the present disclosure. It is to be understood that the drawings are only schematic, and that they do not necessarily represent a limiting case of the present disclosure. For a better understanding, the examples of the present disclosure will now be described, by way of example, with reference to the accompanying drawings, in which:

[0020] Figure 1 An application scenario architecture diagram of the test data acquisition method and device according to one embodiment of the present disclosure is schematically shown.

[0021] Figure 2 One of the flowcharts of the test data acquisition method according to one embodiment of the present disclosure is schematically shown.

[0022] Figure 3 A flowchart of the construction and updating process of the data warehouse according to one embodiment of the present disclosure is schematically shown.

[0023] Figure 4 The second flowchart of the test data acquisition method according to one embodiment of the present disclosure is schematically shown.

[0024] Figure 5 A structural block diagram of the test data acquisition device according to one embodiment of the present disclosure is schematically shown.

[0025] Figure 6 A computer device block diagram suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0026] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations may, however, be implemented in many different forms and should not be construed as limited to the implementations set forth herein; rather, these implementations are provided so that this disclosure will be thorough and complete, and will fully convey the scope of example implementations to those skilled in the art. The described features, structures, or characteristics can be combined in one or more implementations. In the following description, numerous specific details are provided to give a thorough understanding of example implementations. One skilled in relevant art will recognize, however, that the implementations can be practiced without one or more of the specific details, or with other methods, components, materials, and so forth. In other instances, well-known structures have not been described in detail to avoid obscuring the understanding of this description. It will be appreciated that the scope of the disclosure includes possibilities for implementing individual features individually and various combinations and permutations of features.

[0027] In addition, the accompanying drawings are only schematic and are non-limiting detailed representations of embodiments of the disclosure. Identical components have been given the same reference numerals in the various drawings and will not necessarily be described again for each of them. Some of the blocks in the drawings are functional blocks that do not necessarily correspond to a physical or logical entity. These functional blocks can be implemented in software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0028] The following related technical terms are explained to facilitate better understanding of the present application.

[0029] Mock: Mock can generate Mock interface according to user's input interface information such as protocol, URL, interface name, request header, request parameter and return data. The Mock interface will automatically generate simulation data, and the developer can use Mock to freely construct the required data. That is, Mock can create a virtual object to test in the testing process for some objects that are not easy to construct or obtain. Mock can configure online return data or simulate offline return data through a local proxy tool to obtain data.

[0030] Figure 1 A schematic diagram of an exemplary system architecture 100 to which the test data acquisition method and device of the embodiments of the present disclosure can be applied is shown. As shown in Figure 1 The system architecture 100 can include a terminal 110 and a server 120. The terminal 110 and the server 120 communicate through a network. The network can include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0031] The application developer can upload the interface data of the target business interface of the application to the terminal 110, so that the terminal 110 acquires the interface data of the target business interface of the application, and determines the target object code in the interface data; an association relationship is established between the target object code and the target query interface; the target query interface is used to indicate the business data corresponding to the target object code in the data warehouse in the server 120, and the data warehouse is constructed based on real-time business data of actual business scenarios; the data warehouse is set in the server 120. In response to an operation instruction for the target business interface, the target data corresponding to the target object code is acquired from the server 120 through the target query interface according to the association relationship; in the interface data, the target data is used to replace the target object code, and the test data corresponding to the target business interface is obtained.

[0032] In this example, the terminal 110 can include a mobile device, a tablet computer, a laptop computer, or a built-in device in a motor vehicle, etc., or any combination thereof. In some embodiments, the mobile device can include a smart home device, a wearable device, a smart mobile device, a virtual reality device, or an augmented reality device, etc., or any combination thereof. In some embodiments, the built-in device in the motor vehicle can include an on-board computer, an on-board television, etc.

[0033] The server 120 can be a standalone physical server, or a server cluster or a distributed system composed of multiple physical servers, wherein the multiple servers can constitute a blockchain, and the server is a node on the blockchain. The warehouse server 110 and the data processing server cluster 120 can also be cloud servers that provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, etc. basic cloud computing services.

[0034] The test data acquisition method provided by the embodiments of the present disclosure can be executed in the terminal 110, and accordingly, the test data acquisition device is generally arranged in the terminal 110.

[0035] The test data acquisition method disclosed by the embodiments of the present disclosure will be introduced below in combination with specific embodiments.

[0036] Reference Figure 2 As shown in the figure, the test data acquisition method of an example embodiment provided by the present disclosure can include the following steps S210-S240.

[0037] Step S210, acquiring interface data of a target service interface of an application, and determining a target object code in the interface data.

[0038] Step S220, establishing an association relationship between the target object code and a target query interface; the target query interface is used to indicate business data corresponding to the target object code in a data warehouse, and the data warehouse is constructed based on real-time business data of an actual business scenario.

[0039] Step S230, in response to an operation instruction for the target service interface, according to the association relationship, obtaining target data corresponding to the target object code from the data warehouse through the target query interface.

[0040] Step S240, in the interface data, the target object code is replaced by the target data to obtain test data corresponding to the target service interface.

[0041] In the test data acquisition method provided in the example embodiment, on one hand, by establishing an association relationship between the target object code and the target query interface, and according to the association relationship, real-time business data corresponding to the target object code is acquired from the data warehouse, and test data is constructed accordingly, so that the test data is directly derived from the real-time business data, avoiding the subjectivity and limitations brought by manual editing of business scenario data, thereby improving the accuracy of the test result. On the other hand, by acquiring the interface data of the application in advance, and then replacing the target object code in the interface data with the target data, interface test data based on the actual business scenario can be quickly obtained, simplifying the test data construction process and improving the efficiency of acquiring test data.

[0042] The various steps of the present disclosure are described in more detail below.

[0043] In step S210, the interface data of the target business interface of the application is acquired, and the target object code is determined in the interface data.

[0044] In the example embodiment, the target business interface refers to the business interface of the to-be-tested business of the application. For example, the target business interface can be a search business interface, a transaction business interface, etc. of the application A. The interface data refers to the full-amount business template data contained in the application interface for the target business. The interface data can include functions predefined for the target business and data such as conventions for linking different parts of the application. The interface data can be uploaded by the developer or obtained by calling the corresponding application interface.

[0045] In the example embodiment, the target business can include multiple business scenario nodes, and the business scenario nodes can include parent nodes or child nodes under the parent nodes, which are not limited in the example. For example, the target business is search, which can include business scenario nodes such as finance, mall, payment, and ranking, and the target object code can be a program code corresponding to the business scenario node, for example, the target object code can be a JSON string, which is a lightweight data exchange format, easy for users to read and write, and also easy for machines to parse and generate. The JSON string is composed of a set of "name / value" pairs.

[0046] For example, the target object code can be determined in the interface data by the following steps.

[0047] First, the target field can be determined in the interface data; then, starting from the target field, the interface data is traversed towards both ends, and the first complete object code found is taken as the target object code, which includes the target field.

[0048] In the example embodiment, the target field can be the name of the target object. The first complete object code can be determined according to the data format of the interface data. For example, the interface data is a JSON string, the object in the JSON string is an unordered set of "name / value" pairs, and the format of the JSON string is: an object starts with a " "(left bracket) and ends with a "}" (right bracket). Each "name" is followed by a ":" (colon); the "name / value" pairs are separated by a "," (comma). According to the above data format, the " " and " " and all the strings contained therebetween can be taken as the target object code by finding the " " and " " symmetrically before and after the target field.

[0049] For example, the interface data of the target business interface is as follows:

[0050]

[0051]

[0052] In the above code, "..." represents omitted part of the string; each line of characters represents a different "name / value" pair, for example, "wareId":"100000" represents that the name is "goods identification" and the value is "100000". "xxx" represents the specific value corresponding to the name. When the target field is set to "wareType", the first complete object code found symmetrically before and after is:

[0053]

[0054]

[0055] The above string is the target object code.

[0056] In some embodiments, the method further comprises: configuring data reporting logic in the front-end processing logic code of the business data, so as to trigger the data reporting logic to report the real-time business data during execution of the front-end processing logic code; and constructing a data warehouse according to the reported real-time business data.

[0057] In the example embodiment, the front-end processing logic code can include at least one of the logic code for loading and rendering of the front end. The front-end processing logic code can be encapsulated into a unified API (Application Programming Interface), so that each layer in the network hierarchy interacts with each other and provides services through the interface, and all business scenarios can call the unified API when the front end is loaded and rendered.

[0058] In the example embodiment, the data reporting logic can also be encapsulated in the unified API, so that when the business scenario data is loaded and rendered on the front end, the data reporting logic is also triggered, realizing the synchronization of the front-end rendering of real-time business data and the reporting to the data warehouse.

[0059] Exemplarily, the data warehouse can be set in the background server of the front end, and the construction of the data warehouse can be realized through the cooperation of the front end and the back end. Figure 3 The method can include the following steps:

[0060] In step S310, the reporting time of the real-time business data is recorded. In the example, the terminal can record the reporting time (data sending time) and then continue to report the reporting time, or the server can record the reporting time (data receiving time), which is not limited in the example.

[0061] In step S320, the server determines the data storage dimension according to the configured business scenario category.

[0062] In step S330, the server stores the real-time business data according to the data storage dimension and the reporting time, to construct the data warehouse.

[0063] In step S340, for any business scenario category, the server updates the corresponding stored data in the data warehouse with the currently reported real-time business data according to the order of the reporting time, in response to the data storage amount of the data warehouse reaching a preset storage threshold.

[0064] In the example embodiment, the business scenario category can be determined according to the specific scenarios of different business lines in the application. Exemplarily, application A-business line 1-scenario 3, for example, application A-search business-rankings, etc. The data storage dimension can also be in the dimension of application-business line-scenario, that is, the application is a storage dimension, the different business lines in the application are a self-storage dimension, and the different business scenarios of each business line are a storage dimension, forming multi-level and multi-dimensional data storage. The data storage method in the example can adopt de-duplication storage, that is, the existing data in the data warehouse under the same dimension is not stored repeatedly, to save storage space.

[0065] In the example embodiment, the maximum data storage amount under each dimension can be set, or only the maximum data storage amount under the minimum dimension can be set, which is not limited in the example. When the current data storage amount under any dimension reaches the maximum data storage amount, the new data can be stored in the form of covering the old data in the next storage process.

[0066] For example, the maximum storage quantity of business data under each business scenario is N (N>0). Taking the "application A-search business-list" business scenario as an example, the data storage and updating process is as follows:

[0067] Suppose the actual storage quantity of business data of the "application A-search business-list" business scenario in the dynamic data business data warehouse is M, and the data to be stored in sequence is M0, M1, M2, …, M N-1 When M<N, there is business data Mx related to the business scenario that needs to be stored, and Mx is directly stored. The actual storage quantity of business data of the business scenario becomes M+1. When M=N, there is business data Mx related to the business scenario that needs to be stored, and Mx is used to overwrite M0 to update the data warehouse. Even if M0=Mx, the new data in the warehouse is used to replace the stored historical data, thereby realizing the dynamic updating process of the data warehouse.

[0068] In step S220, an association relationship is established between the target object code and a target query interface. The target query interface is used to indicate the business data corresponding to the target object code in the data warehouse.

[0069] In the example embodiment, the association relationship can be a one-to-one matching relationship from the target object code to the target query interface. In the example, the business data corresponding to the target object code can be queried and obtained by calling the target query interface. The business data corresponding to the target query interface can include all or part of the data stored in the data warehouse. The specific amount of returned data can be set according to specific circumstances, and the example does not limit this.

[0070] For example, the association relationship can be established by the following steps.

[0071] According to the data storage dimension, the corresponding query interface under each dimension is established.

[0072] In the example embodiment, the data storage dimension can include at least one of the application dimension, the business dimension, and the scenario dimension. For different dimensions, the corresponding query interface can be configured to facilitate the query of the actual business data of the dimension.

[0073] For example, taking the "application A-search business-list" business scenario as an example, the query interface of the application dimension, the query interface of the application A-search business dimension, and the query interface of the application A-search business-list dimension can be respectively set. Different data storage dimensions can be configured with different query interfaces, and the storage data of different dimensions can be obtained through the query interfaces of different dimensions.

[0074] The target storage dimension corresponding to the target object code is determined, and the target query interface is determined according to the target storage dimension.

[0075] In the example embodiment, the target object code corresponds to one business scenario node, and the business scenario node has respective data storage dimensions and query interfaces.

[0076] The target object code is bound to the target query interface to obtain the stored data corresponding to the target object code through the target query interface.

[0077] In the example embodiment, the target object code is bound to the target query interface, and when the business data of the data warehouse is updated, the newly updated data can be obtained through the target query interface to construct test data based on the latest actual business data, so that the test result conforms to the actual situation at the moment, and the test accuracy is improved.

[0078] In step S230, in response to the operation instruction for the target business interface, the target data corresponding to the target object code is obtained from the data warehouse through the target query interface according to the association relationship.

[0079] In the example embodiment, the operation instruction can be a request operation for the target business interface, for example, a search request for a search business. When the user triggers the operation instruction, the system returns the real-time business data obtained from the data warehouse, and the returned business data can include multiple pieces of stored data stored in the data warehouse.

[0080] In step S240, the target data is replaced with the target object code in the interface data to obtain the test data corresponding to the target business interface.

[0081] In the example embodiment, the target data obtained from the data warehouse is replaced with the corresponding target object code in the interface data to obtain the test data of the target business interface. Each piece of returned business data can form a set of test data, and the final test data can include business data under various processing scenarios in the target business, ensuring the richness of the test data.

[0082] In some embodiments, the test data is run to perform a test process of the target business interface of the application.

[0083] In the example embodiment, the test data is run on the terminal to obtain a test result. When it is detected that the stored data in the data warehouse is updated, the updated data is obtained to form new test data for the test process. The present disclosure can be a test process based on dynamic test data of a dynamic data warehouse, which can quickly find application problems and achieve rapid response to problems.

[0084] Reference Figure 4A schematic diagram of a processing procedure of a data acquisition method for the present disclosure can include the following steps S401-S412.

[0085] In step S401, the terminal configures data reporting logic in the front-end processing logic code of service data.

[0086] In step S402, in response to an operation instruction for a target service interface, the terminal runs the front-end processing logic while triggering the data reporting logic.

[0087] In step S403, the server receives real-time service data reported by the terminal to build a data warehouse.

[0088] In step S404, the server determines whether the data storage amount M of the current service scenario in the data warehouse reaches the maximum data storage amount N. If yes, the process proceeds to step S405; otherwise, the process proceeds to step S406.

[0089] In step S405, the server updates the stored data of the current service scenario in the data warehouse by using the currently received real-time service data, and the process proceeds to step S407.

[0090] In step S406, the server stores the currently received real-time service data into the corresponding data storage dimension of the data warehouse, and the process proceeds to step S407.

[0091] In step S407, the terminal establishes corresponding query interfaces under each dimension according to the data storage dimensions in the data warehouse.

[0092] In step S408, the terminal acquires interface data of a target service interface of an application.

[0093] In step S409, the terminal determines a target object code in the interface data according to a test target.

[0094] In step S410, the terminal establishes an association relationship between the target object code and a target query interface.

[0095] In step S411, in response to an operation instruction for the target service interface, the terminal acquires target data corresponding to the target object code from the data warehouse through the target query interface.

[0096] In step S412, the terminal replaces the target object code with the target data in the interface data to obtain test data corresponding to the target service interface.

[0097] In the above embodiments, the order of the steps is only exemplary, and the execution order of the above steps can be adjusted as needed.

[0098] The specific details of each step in the above embodiments have been described in detail in the foregoing embodiments, and will not be repeated here.

[0099] This disclosure addresses the problem that manually edited MOCK data often fails to accurately reflect real-world business scenarios, leading to low testing efficiency and accuracy. Firstly, by establishing a dynamic data warehouse, test data is sourced from actual business scenarios, and dynamic updates ensure its timeliness, making the test data more closely aligned with current business conditions and guaranteeing testing accuracy and timeliness. Secondly, by establishing a relationship between target object code and target query interfaces, the business components of the test data correspond to actual business data, enabling rapid acquisition of data from different business scenarios, saving manpower and resources, and improving testing efficiency. Furthermore, by replacing target object code in interface data that serves as a base template with target data, rapid construction of test data is achieved, further enhancing testing efficiency.

[0100] Furthermore, in this example embodiment, a test data acquisition device 500 is also provided. This test data acquisition device 500 can be applied to a terminal device. (See reference...) Figure 5 As shown, the test data acquisition device 500 may include: an object determination module 510, a relationship establishment module 520, a data acquisition module 530, and a data replacement module 540; wherein, the object determination module 510 is configured to acquire interface data of the target business interface of the application and determine the target object code in the interface data; the relationship establishment module 520 is configured to establish an association between the target object code and the target query interface; the target query interface is used to indicate the business data corresponding to the target object code in the data warehouse, and the data warehouse is constructed based on real-time business data of actual business scenarios; the data acquisition module 530 is configured to respond to the operation command for the target business interface, and according to the association, acquire the target data corresponding to the target object code from the data warehouse through the target query interface; the data replacement module 540 is configured to replace the target object code in the interface data with the target data to obtain the test data corresponding to the target business interface.

[0101] In one exemplary embodiment of this disclosure, the apparatus 500 further includes a configuration module, which is configured to: configure data reporting logic in the front-end processing logic code of business data before establishing an association between the target object code and the target query interface, so as to trigger the data reporting logic to report real-time business data during the execution of the front-end processing logic code; so that the server can build a data warehouse based on the reported real-time business data.

[0102] In an example embodiment of the present disclosure, the apparatus 500 further comprises a recording module configured to record a reporting time of the real-time service data, so that the server determines a data storage dimension according to a configured service scenario category, and stores the real-time service data according to the data storage dimension and the reporting time to construct a data warehouse.

[0103] In an example embodiment of the present disclosure, constructing the data warehouse comprises: for any service scenario category, in response to a data storage amount of the data warehouse reaching a preset storage threshold, updating stored data corresponding to the current reported real-time service data in the data warehouse in a chronological order of the reporting time.

[0104] In an example embodiment of the present disclosure, the object determining module 510 is further configured to determine a target field in the interface data, and traverse the interface data from the target field to both ends of the interface data to take a first complete object code found as a target object code, the target object code comprising the target field.

[0105] In an example embodiment of the present disclosure, the relationship establishing module 520 is further configured to establish a corresponding query interface under each dimension according to the data storage dimension, the data storage dimension comprising at least one of an application dimension, a service dimension and a scenario dimension, determine a target storage dimension corresponding to the target object code, and determine a target query interface according to the target storage dimension, and bind the target object code with the target query interface to obtain stored data corresponding to the target object code through the target query interface.

[0106] In an example embodiment of the present disclosure, the apparatus 500 further comprises a running module configured to run test data to perform a test process of a target service interface of an application.

[0107] The specific details of each module or unit in the test data obtaining apparatus described above have been described in detail in the corresponding test data obtaining method, and thus will not be described here again.

[0108] As another aspect, the present disclosure further provides a computer readable medium, which can be contained in the network device described in the above embodiments, or can exist independently without being assembled into the network device. The computer readable medium carries one or more programs, which, when executed by a computer device, cause the computer device to implement the method in the above embodiments. For example, the computer device can implement each step shown in the above embodiments, etc. Figures 2-4

[0109] ​It should be noted that the computer readable medium shown in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer readable storage media can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component. In the present disclosure, the computer readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or component. The program code contained in the computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0110] In addition, in the exemplary embodiments of the present disclosure, a device capable of implementing the above method is also provided. Those skilled in the art can understand that various aspects of the present disclosure can be implemented as a system, a method or a program product. Therefore, various aspects of the present disclosure can be embodied as a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which can be collectively referred to as "circuitry", "module" or "system" herein.

[0111] Referring to Figure 6 , Figure 6 is a structural schematic diagram of a computer device provided by an embodiment of the present application. As Figure 6 shown, the computer device 600 includes a processor 610, a memory 620, an input / output interface 630 and a communication bus 640. The processor 610 is connected to the memory 620 and the input / output interface 630, for example, the processor 610 can be connected to the memory 620 and the input / output interface 630 through the communication bus 640. The processor 610 is configured to support the computer device to execute Figures 2-4The processor 610 can be a Central Processing Unit (CPU), a Network Processor (NP), a hardware chip, or any combination thereof. The hardware chip can be an Application-Specific Integrated Circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD can be a Complex Programmable Logic Device (CPLD), a Field-Programmable Gate Array (FPGA), a Generic Array Logic (GAL), or any combination thereof. The memory 620 is configured to store program codes and the like. The memory 620 can include a volatile memory (VM), for example, a Random Access Memory (RAM); the memory 620 can also include a non-volatile memory (NVM), for example, a Read-Only Memory (ROM), a flash memory, a Hard Disk Drive (HDD), or a Solid-State Drive (SSD); and the memory 620 can further include a combination of the above-mentioned memories.

[0112] The input and output interface 630 is configured to input or output data.

[0113] For example, the processor 610 can invoke the program codes to perform the following operations:

[0114] obtain interface data of a target service interface of an application, and determine a target object code in the interface data; establish an association relationship between the target object code and a target query interface; the target query interface is used to indicate service data corresponding to the target object code in a data warehouse; the data warehouse is constructed based on real-time service data of an actual service scenario; in response to an operation instruction for the target service interface, the target data corresponding to the target object code is obtained from the data warehouse through the target query interface according to the association relationship; and in the interface data, the target data is used to replace the target object code, to obtain test data corresponding to the target service interface.

[0115] It should be noted that the implementation of each operation can also correspond to the description in the test data acquisition method in the above Figures 2-4The processor 610 can also perform the above-mentioned method embodiments in cooperation with the input and output interface 630.

[0116] Through the above description of the embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.) or a network, and includes a number of instructions to enable an apparatus to perform the method according to the embodiments of the present disclosure.

[0117] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not for limiting purposes. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be executed synchronously or asynchronously, for example, in multiple modules.

[0118] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired result. In addition or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be divided into multiple steps, etc., all of which should be considered as part of the present disclosure.

[0119] It should be understood that the present disclosure disclosed and defined in this specification extends to all alternative combinations of two or more individual features mentioned or obvious from the text and / or drawings. All these different combinations constitute multiple alternative aspects of the present disclosure. The embodiments of the present disclosure illustrate the best mode currently known for implementing the present disclosure and will enable one skilled in the art to utilize the present disclosure.

Claims

1. A test data acquisition method, characterized by, The method comprises: acquiring interface data of a target business interface of an application, and determining a target object code in the interface data; establishing an association relationship between the target object code and a target query interface; the target query interface is used to indicate business data corresponding to the target object code in a data warehouse, the data warehouse is constructed based on real-time business data of an actual business scenario, and the association relationship is established based on a data storage dimension corresponding to a business scenario category; in response to an operation instruction for the target business interface, target data corresponding to the target object code is acquired from the data warehouse through the target query interface according to the association relationship; in the interface data, the target data is used to replace the target object code, and test data corresponding to the target business interface is obtained.

2. The test data acquisition method of claim 1, wherein, Before the association relationship between the target object code and the target query interface is established, the method further comprises: configuring data reporting logic in a front-end processing logic code of business data, so as to trigger the data reporting logic to report real-time business data during execution of the front-end processing logic code; so that the service end constructs the data warehouse according to the reported real-time business data.

3. The test data acquisition method of claim 2, wherein, The method further comprises: recording the reporting time of the real-time business data, so that the service end determines a data storage dimension according to a configured business scenario category, and stores the real-time business data according to the data storage dimension and the reporting time, to construct the data warehouse.

4. The test data acquisition method of claim 3, wherein, The method of constructing the data warehouse comprises: for any business scenario category, in response to the data storage amount of the data warehouse reaching a preset storage threshold, the corresponding stored data in the data warehouse is updated by using the currently reported real-time business data according to the chronological order of the reporting time.

5. The test data acquisition method of claim 1, wherein, The method of determining the target object code in the interface data comprises: determining a target field in the interface data; starting from the target field, traversing to both ends of the interface data respectively, and taking the first complete object code found as the target object code; the target object code comprises the target field.

6. The test data acquisition method of claim 3, wherein, The method of establishing an association relationship between the target object code and the target query interface comprises: establishing corresponding query interfaces under each dimension according to the data storage dimension; the data storage dimension comprises at least one of an application dimension, a business dimension and a scenario dimension; determining a target storage dimension corresponding to the target object code, and determining a target query interface according to the target storage dimension; binding the target object code and the target query interface, so as to acquire stored data corresponding to the target object code through the target query interface.

7. The test data acquisition method of any one of claims 1-6, wherein, The method further comprises: running the test data to execute a test process of the target business interface of the application.

8. A test data acquisition apparatus, characterized by comprising: The device comprises: an object determination module configured to acquire interface data of a target business interface of an application, and determine a target object code in the interface data; The relationship establishing module is configured to establish an association relationship between the target object code and a target query interface, the target query interface is used to indicate business data corresponding to the target object code in a data warehouse, the data warehouse is constructed based on real-time business data of an actual business scenario, and the association relationship is established based on a data storage dimension corresponding to a business scenario category; The data obtaining module is configured to, in response to an operation instruction for the target business interface, obtain target data corresponding to the target object code from the data warehouse through the target query interface according to the association relationship. The data replacing module is configured to replace the target object code with the target data in the interface data to obtain test data corresponding to the target business interface.

9. A computer device, comprising: comprise: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method according to any one of claims 1-7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Method and device for generating data report

    CN114090608A

  • Data query method and device, electronic equipment and storage medium

    CN115033605A

  • Generating test scripts for testing a network-based application

    US20180024914A1