Movatterモバイル変換


[0]ホーム

URL:


CN113342667A - Data processing method, data processing device, electronic equipment and computer readable storage medium - Google Patents

Data processing method, data processing device, electronic equipment and computer readable storage medium
Download PDF

Info

Publication number
CN113342667A
CN113342667ACN202110680606.4ACN202110680606ACN113342667ACN 113342667 ACN113342667 ACN 113342667ACN 202110680606 ACN202110680606 ACN 202110680606ACN 113342667 ACN113342667 ACN 113342667A
Authority
CN
China
Prior art keywords
data
simulation
query request
matched
sample
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110680606.4A
Other languages
Chinese (zh)
Inventor
陈逸青
李辉
梁策
甘大为
梁钧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Netease Zaigu Technology Co Ltd
Original Assignee
Hangzhou Netease Zaigu Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Netease Zaigu Technology Co LtdfiledCriticalHangzhou Netease Zaigu Technology Co Ltd
Priority to CN202110680606.4ApriorityCriticalpatent/CN113342667A/en
Publication of CN113342667ApublicationCriticalpatent/CN113342667A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本申请的实施例提供了一种数据处理方法、装置、电子设备以及计算机可读存储介质,涉及计算机技术领域。该方法包括:获取数据查询请求,并确定与数据查询请求相匹配的数据模拟规则;若匹配到数据模拟规则,则反馈第一数据;其中,第一数据为基于匹配到的数据模拟规则模拟构造而产生的;若未匹配到数据模拟规则,则反馈第二数据;其中,第二数据为基于数据查询请求在数据库中查询得到的真实数据。可见,实施本申请,一方面,在匹配到数据模拟规则时,反馈基于数据模拟规则模拟构造而成的第一数据,降低了构造第一数据的复杂度,提升了构造第一数据的灵活度;另一方面,未匹配到数据模拟规则时,反馈真实数据,从而保障了测试数据的供应。

Figure 202110680606

Embodiments of the present application provide a data processing method, apparatus, electronic device, and computer-readable storage medium, which relate to the field of computer technology. The method includes: acquiring a data query request, and determining a data simulation rule matching the data query request; if the data simulation rule is matched, feeding back first data; wherein the first data is a simulation structure based on the matched data simulation rule If the data simulation rule is not matched, the second data is fed back; wherein, the second data is the real data obtained by querying the database based on the data query request. It can be seen that, in the implementation of the present application, on the one hand, when the data simulation rules are matched, the first data simulated and constructed based on the data simulation rules are fed back, which reduces the complexity of constructing the first data and improves the flexibility of constructing the first data. ; On the other hand, when the data simulation rules are not matched, the real data is fed back, thus ensuring the supply of test data.

Figure 202110680606

Description

Data processing method, data processing device, electronic equipment and computer readable storage medium
Technical Field
Embodiments of the present application relate to the field of computer technology, and more particularly, to a data processing method, a data processing apparatus, an electronic device, and a computer-readable storage medium.
Background
This section is intended to provide a background or context to the embodiments of the disclosure recited in the claims. The description herein is not admitted to be relevant prior art by inclusion in this section.
Currently, with the development of computer technology, more and more products and applications need to be subjected to data testing before being formally used to determine defects existing in the products or applications. However, in the related art, the test data may be manufactured in a manual manner, which increases the cost and complexity of the test data in the manufacturing process, and in addition, the manufactured test data may be only applied to a specific service, which not only reduces the versatility and flexibility of the manufactured test data, but also increases the cost of maintaining the manufactured test data.
It should be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute related art known to those of ordinary skill in the art.
Disclosure of Invention
Based on the above problems, the inventor has made corresponding thinking, made targeted improvements, and provided a data processing method, a data processing apparatus, an electronic device, and a computer-readable storage medium, and if a data simulation rule is matched, first data is fed back, and if a data simulation rule is not matched, second data is fed back, so that generation of test data does not completely depend on real data, and the supply of test data is ensured by two ways of simulation data and real data, logic of data query is perfected, and experience of developers in obtaining test data is improved.
According to a first aspect of an embodiment of the present application, a data processing method is disclosed, which includes:
acquiring a data query request, and determining a data simulation rule matched with the data query request;
if the data simulation rule is matched, feeding back first data; wherein the first data is generated based on the matched data simulation rule simulation structure;
if the data simulation rule is not matched, feeding back second data; and the second data is real data obtained by querying in the database based on the data query request.
In one embodiment, based on the foregoing solution, the data query request includes a query request link, and the method further includes:
determining a query request link corresponding to the data query request, and determining a simulation rule identifier matched with the query request link;
if the simulation rule identification is matched, determining the data simulation rule corresponding to the simulation rule identification as the data simulation rule matched with the data query request;
and if the simulation rule identification is not matched, determining that the data simulation rule matched with the data query request does not exist.
In one embodiment, based on the foregoing scheme, the data simulation rule comprises:
the method comprises the following steps of (1) obtaining a model name, a field name corresponding to the model name, the number of data, a processing mode of sensitive data in sample data and a feedback format of the sample data; the sample data is generated by simulating a structure based on a model name, a field name and a data number, the data number is used for limiting the number of the sample data, and the processing mode of sensitive data in the sample data comprises data desensitization and/or data confusion.
In one embodiment, based on the foregoing solution, the data query request includes a filter condition, and the method further includes:
if the data simulation rule is matched, determining a model name, a field name, the number of data and a processing mode corresponding to the data simulation rule;
obtaining sample data based on the model name, the field name, the number of data pieces and the processing mode;
determining a filtering condition corresponding to the data query request, and filtering the sample data according to the filtering condition to obtain filtered sample data;
and obtaining first data corresponding to the filtered sample data based on the feedback format, and feeding back the first data.
In one embodiment, based on the foregoing scheme, the method further includes:
sample data is constructed in a simulation mode based on the model name, the field name, the number of data pieces and the processing mode; or
And acquiring preset simulation data constructed by pre-simulation, and taking data matched with the model name, the field name, the number of data pieces and the processing mode in the preset simulation data as sample data.
In one embodiment, based on the foregoing scheme, the method further includes:
acquiring import data, and merging the sample data and the import data to update the sample data; the method comprises the steps that imported data are data corresponding to import operation, the import operation is operation acting on a graphical user interface, and the graphical user interface is used for editing sample data;
acquiring export data, and deleting the export data from the sample data to update the sample data; the export data is data corresponding to export operation, and the export operation is operation acting on a graphical user interface;
acquiring sample data to be replaced and replacement data, and replacing the sample data to be replaced with the replacement data; the sample data to be replaced is data corresponding to the replacement operation, the replacement data is data corresponding to the input operation, and the replacement operation and the input operation are operations acting on the graphical user interface.
In one embodiment, based on the foregoing scheme, the filtering condition includes a filtering field name and a data filtering condition that the filtering field name needs to satisfy, and the method further includes:
acquiring a filtering field name from the filtering condition, and determining a data value corresponding to the filtering field name in the sample data;
and acquiring data filtering conditions from the filtering conditions, determining target data values meeting the data filtering conditions from the data values, and determining sample data corresponding to the target data values as filtered sample data.
In one embodiment, based on the foregoing solution, the data query request includes a query request link, and the method further includes:
if the data simulation rule is not matched, determining a query request link corresponding to the data query request;
and determining second data in the database based on the query request link, and feeding back the second data.
In one embodiment, based on the foregoing scheme, the method further includes:
acquiring an authentication request, and transparently transmitting the authentication request to a database to acquire a target authentication result consistent with a preset authentication result; the preset authentication result is the result that the interface verification serial number of the application program data interface is consistent with the authentication verification serial number and the interface key of the application program data interface is consistent with the authentication interface key; the application program data interface is a data interface for sending an authentication request;
and feeding back a target authentication result to obtain a data query request.
According to a second aspect of the embodiments of the present application, there is disclosed a data processing apparatus comprising: a determination module, a first feedback module, and a second feedback module, wherein:
the determining module is configured to acquire the data query request and determine a data simulation rule matched with the data query request;
the first feedback module is configured to feed back the first data if the data simulation rule is matched; wherein the first data is generated based on the matched data simulation rule simulation structure;
the second feedback module is configured to feed back second data if the data simulation rule is not matched; and the second data is real data obtained by querying in the database based on the data query request.
According to a third aspect of embodiments of the present application, there is disclosed an electronic device comprising: a processor; and a memory having computer readable instructions stored thereon which, when executed by the processor, implement the data processing method as disclosed in the first aspect.
According to a fourth aspect of embodiments of the present application, a computer program medium is disclosed, having computer readable instructions stored thereon, which, when executed by a processor of a computer, cause the computer to perform the data processing method disclosed according to the first aspect of the present application.
The method and the device can acquire the data query request and determine the data simulation rule matched with the data query request; if the data simulation rule is matched, feeding back first data; wherein the first data is generated based on the matched data simulation rule simulation structure; if the data simulation rule is not matched, feeding back second data; and the second data is real data obtained by querying in the database based on the data query request. Compared with the related art, by implementing the embodiment of the application, on one hand, if the data simulation rule is matched, the first data is fed back, and if the data simulation rule is not matched, the second data is fed back, so that the generation of the test data does not depend on the real data completely, the supply of the test data is ensured by two ways of the simulation data and the real data, the logic of data query is perfected, and the experience of developers for obtaining the test data is improved; on the other hand, a general method for simulating and constructing first data based on the simulation data rule is provided, different first data can be fed back according to different data simulation rules, the test function can be completed by using the first data in more service scenes, and the efficiency of simulating and constructing the first data is improved; in addition, when different first data need to be fed back, the data simulation rule can be changed, and the flexibility of constructing the first data is improved.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present application will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the present application are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
FIG. 1 shows a schematic flow diagram of a data processing method according to an example embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating a process of obtaining a data query request according to an example embodiment of the present application;
FIG. 3 is a schematic flow diagram illustrating a process for determining data simulation rules that match a data query request according to an example embodiment of the present application;
FIG. 4 illustrates a flow diagram of data processing according to an example embodiment of the present application;
FIG. 5 illustrates a flow diagram for feeding back first data according to an example embodiment of the present application;
FIG. 6 is a schematic flow chart illustrating sample data acquisition according to an example embodiment of the present application;
FIG. 7 is a schematic flow chart illustrating a process of acquiring preset simulation data according to an exemplary embodiment of the present application;
FIG. 8 is a schematic flow diagram illustrating editing sample data according to an example embodiment of the present application;
FIG. 9 illustrates a graphical user interface for editing sample data according to an example embodiment of the present application;
FIG. 10 is a schematic flow chart diagram illustrating obtaining filtered sample data according to an example embodiment of the present application;
fig. 11 is a schematic flow chart illustrating feedback of first data according to an example embodiment of the present application;
FIG. 12 illustrates a flow diagram for feeding back second data according to an example embodiment of the present application;
FIG. 13 is a block diagram of a data processing apparatus according to another alternative example embodiment of the present application;
FIG. 14 is a block diagram illustrating a data processing electronic device according to another alternative exemplary embodiment of the present application.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
The principles and spirit of the present application will be described with reference to a number of exemplary embodiments. It should be understood that these embodiments are given solely for the purpose of enabling those skilled in the art to better understand and to practice the present application, and are not intended to limit the scope of the present application in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one of skill in the art, embodiments of the present application may be embodied as an apparatus, device, method, or computer program product. Thus, the present application may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to an embodiment of the present application, a data processing method, a data processing apparatus, an electronic device, and a computer-readable storage medium are provided.
Any number of elements in the drawings are by way of example and not by way of limitation, and any nomenclature is used solely for differentiation and not by way of limitation.
The principles and spirit of the present application are explained in detail below with reference to several representative embodiments of the present application.
Summary of The Invention
At present, the scheme of the related art for data processing is generally as follows: real data stored in the database is fed back as test data, or test data which can only be used for a specific service scene is manufactured in a manual mode. Therefore, the data processing using the above method generally depends entirely on real data, or can be applied only in a specific service scenario, and has a high labor cost.
Based on the above problems, the applicant thought that it is possible to avoid that the test data fed back during data processing completely depends on the real data and that the test data can be applied only to a specific service scenario, and in one embodiment of the present disclosure, the feedback generates the first data based on the data simulation rule simulation configuration when the data simulation rule is matched, and the real data is fed back when the data simulation rule is not matched. Therefore, the first data are generated through the data simulation rule simulation structure matched with the data query request, the generation of the test data in the related technology is completely dependent on the real data, and the supply of the test data can be guaranteed through two ways of the simulation data and the real data no matter whether the data simulation rule is matched or not, so that the logic of data query is perfected, and the experience of developers for obtaining the test data is improved.
Application scene overview
It should be noted that the following application scenarios are merely illustrated for the convenience of understanding the spirit and principles of the present application, and the embodiments of the present application are not limited in this respect. Rather, embodiments of the present application may be applied to any scenario where applicable.
When the method is applied to a database scene, the generation of test data in the related technology is completely dependent on real data, and the supply of the test data can be guaranteed in two ways of simulation data and real data no matter whether the data simulation rule is matched or not, so that the logic of data query is perfected, and the experience of developers for obtaining the test data is improved.
Illustrative methodMethod of
In conjunction with the application scenarios described above, a data processing method according to an exemplary embodiment of the present application is described below with reference to fig. 1 and 12.
Referring to fig. 1, fig. 1 is a flow chart illustrating a data processing method according to an exemplary embodiment of the present application. As shown in fig. 1, the data processing method may include:
step S110: and acquiring a data query request, and determining a data simulation rule matched with the data query request.
Step S120: if the data simulation rule is matched, feeding back first data; wherein the first data is generated based on the matched data simulation rule simulation structure.
Step S130: if the data simulation rule is not matched, feeding back second data; and the second data is real data obtained by querying in the database based on the data query request.
On one hand, if the data simulation rule is matched, the first data are fed back, and if the data simulation rule is not matched, the second data are fed back, so that the generation of the test data does not depend on the real data completely, the supply of the test data can be guaranteed in two ways of the simulation data and the real data, the logic of data query is perfected, and the experience degree of developers for acquiring the test data is improved; on the other hand, a general method for simulating and constructing first data based on the simulation data rule is provided, different first data can be fed back according to different data simulation rules, the test function can be completed by using the first data in more service scenes, and the efficiency of simulating and constructing the first data is improved; in addition, when different first data need to be fed back, the data simulation rule can be changed, and the flexibility of constructing the first data is improved.
These steps are described in detail below.
In step S110, a data query request is obtained, and a data simulation rule matching the data query request is determined.
Specifically, the data query request is a request for querying test data, and the request may be issued by a tester needing the test data, or may be issued by any developer needing the test data, which is not particularly limited in this exemplary embodiment. And, the data simulation rule is a rule for constructing test data by subsequent simulation.
For example, a data query request A is obtained, and it is determined whether there is a data simulation rule matching the data query request A.
Referring to fig. 2, fig. 2 is a schematic flow chart of a process before a data query request is obtained. As shown in fig. 2, may include:
step S210: acquiring an authentication request, and transparently transmitting the authentication request to a database to acquire a target authentication result consistent with a preset authentication result; the preset authentication result is the result that the interface verification serial number of the application program data interface is consistent with the authentication verification serial number and the interface key of the application program data interface is consistent with the authentication interface key; the application program data interface is a data interface for sending an authentication request.
The database is used to store real data, where the real data is data matched with the test requirement of the developer, for example, if the developer needs to test whether the application a can load a large amount of purchase data during the promotion period to ensure that the user can purchase goods successfully, the real data may be historical purchase data of different users on the application a.
The authentication request is a request sent by a developer who needs to acquire test data, and the authentication request carries an interface verification serial number and an interface key of an application program data interface which sends the request. The interface verification serial number of the application program data interface refers to a unique identifier, the unique identifier corresponds to an application program tested by a developer, the interface key refers to a password used by the developer to log in the application program, the authentication verification serial number is data used for judging whether the interface verification serial number is legal, and the authentication interface key is data used for judging whether the interface key is legal.
When the authentication request is obtained, the authentication request is directly transmitted to a server corresponding to the database without any processing on the authentication request so as to obtain a target authentication result fed back by the server, the target authentication result fed back by the server can be divided into two types, and when the target authentication result is consistent with a preset authentication result, the server feeds back the target authentication result to an application program used by a developer. The preset authentication result refers to an authentication result that the interface key and the interface verification serial number are both legal, that is, the authentication result when the interface key exists in the authentication interface key and the interface verification serial number exists in the authentication verification serial number.
For example, an authentication request B is obtained, the request is transmitted to a server corresponding to the database, the interface verification serial number 123 and the interface key XX1 in the authentication data B obtained by the database are obtained, and the authentication verification serial number and the authentication interface key are obtained, if 123 exists in the authentication verification serial number and XX1 exists in the authentication interface key, it is determined that the authentication is successful at this time, and then a target authentication result which is consistent with the preset authentication result and indicates that the authentication is successful is fed back.
Step S220: and feeding back a target authentication result to obtain a data query request.
And feeding back the target authentication result to an application program, wherein the application program is the application program which sends out the authentication request. After the application program obtains the target authentication result, the data query request can be sent according to the requirements of developers needing to test the data.
For example, the target authentication result is fed back to the application program 1, where the application program 1 is an application program that sends an authentication request, and at this time, a data query request, that is, a data query request sent by a developer that needs to test data through the application program 1, may be obtained.
Therefore, by implementing the optional embodiment, the fed-back target authentication result needs to be obtained before the data query request is obtained, so that the risk that the first data or the second data fed back subsequently is leaked is avoided, and the safety of data processing is improved.
Referring to fig. 3, fig. 3 is a flow chart illustrating a process of determining a data simulation rule matching a data query request. As shown in fig. 3, the data query request includes a query request link, and determining the data simulation rule matching the data query request may include:
step S310: and determining a query request link corresponding to the data query request, and determining a simulation rule identifier matched with the query request link.
Specifically, the query request link refers to a link used for initiating a data query request, the simulation rule identifier refers to an identifier corresponding to a data simulation rule, and the identifier may be represented by a number, a letter, or a string, which is not limited in this exemplary embodiment. It is worth noting that one simulation rule identifier uniquely identifies one data simulation rule.
For example, it is determined that the query request link corresponding to the data query request a is xxxxxx.xxxx, and there is a simulation rule identification corresponding to xxxxxx.xxxx, which may be 123 in particular.
Step S320: and if the simulation rule identification is matched, determining the data simulation rule corresponding to the simulation rule identification as the data simulation rule matched with the data query request.
Specifically, if a simulation rule identifier corresponding to the query request link exists, a data simulation rule corresponding to the simulation rule identifier is obtained.
For example, if the simulation rule corresponding to the data request link xxxx.xxxx is identified as 123, then the data simulation rule C corresponding to 123 is obtained.
Step S330: and if the simulation rule identification is not matched, determining that no data simulation rule matched with the data query request exists.
Specifically, if the simulation rule identifier is not matched, it is determined that the simulation rule identifier corresponding to the data query request cannot be matched.
For example, if the data request is linked to xx.xx, and there is no simulation rule id matching xx.xx, it is determined that there is no data simulation rule matching the data query request.
Therefore, whether the simulation rule identification corresponding to the query request link exists or not is determined, the follow-up determination that the fed-back data is the first data or the second data is facilitated, namely whether the simulation rule identification corresponding to the query request link exists or not can guarantee the supply of the test data in two ways of the simulation data and the real data, the logic of data query is improved, and the experience of developers for obtaining the data is improved.
As an alternative embodiment, the data simulation rule includes: the method comprises the following steps of (1) obtaining a model name, a field name corresponding to the model name, the number of data, a processing mode of sensitive data in sample data and a feedback format of the sample data; the sample data is generated by simulating a structure based on a model name, a field name and a data number, the data number is used for limiting the number of the sample data, and the processing mode of sensitive data in the sample data comprises data desensitization and/or data confusion.
Specifically, the sample data refers to test data required by a developer who initiates a data query request, the model name refers to a name for distinguishing the sample data, for example, the sample data may be data for testing a shopping application, the model name may be shop _ mockbata, the sample data may also be data used in testing a medical diagnosis, and the model name may be hospital _ mockbata.
The field names are names corresponding to each data item in the sample data, for example, data items of shopping time, shopping products, and payment amount exist in the sample data for testing the shopping application, and there are three field names, which may be time, product, and type, respectively.
The number of data pieces refers to the number of required test data, for example, if a user who sends a query data request needs 3 sample data pieces, the number of data pieces is 3. Sensitive data refers to data which may bring harm to users and society using application programs after leakage, and data desensitization and data obfuscation are ways for desensitizing sensitive data in sample data, specifically, data desensitization refers to ways for deforming sensitive data through desensitization rules, and data obfuscation refers to ways for replacing sensitive data in sample data with data that looks like real production data that cannot be abused by anyone. The feedback format refers to a format of the sample data when the sample data is fed back to the application.
For example, the data simulation rule includes a model name shop _ mockdata, field names time, product, and type, a number of data pieces 3, a processing mode data desensitization of sensitive data in the data, and a feedback format Json (JS Object Notation) format of sample data.
Therefore, by implementing the optional embodiment, a universal data simulation rule is provided, different first data can be determined according to different data simulation rules subsequently, not only is the flexibility of the simulation construction of the first data increased, but also the different data simulation rules can be determined according to different business scene requirements, so that the business scene in which the subsequently determined first data can be applied is expanded, in addition, the first data are not generated based on an artificial form any more, and the efficiency of simulation construction of the first data is improved.
In step S120, if the data simulation rule is matched, feeding back the first data; wherein the first data is generated based on the matched data simulation rule simulation structure.
Specifically, the first data is data generated according to a data simulation rule configuration.
For example, fig. 4 shows a flow chart of data processing, as shown in fig. 4, wherein thedata interface 410 is a query data interface provided for all services to issue a data query request. Thefirst server 420 is a server which feeds back the first data based on the matched data simulation rule, and thesecond server 430 is a server corresponding to a database storing real data.
If the data simulation rule corresponding to the data query request is matched, the data query request is sent to thefirst server 420, the first data is constructed based on the data simulation rule corresponding to the data query request in a simulation manner, and the first data is fed back to thedata interface 410.
As an alternative embodiment, please refer to fig. 5, and fig. 5 shows a schematic flow chart of feeding back the first data. As shown in fig. 5, the data query request includes a filter condition, and the feeding back the first data may include:
step S510: and if the data simulation rule is matched, determining the model name, the field name, the number of data and the processing mode corresponding to the data simulation rule.
Specifically, the filtering condition refers to a condition corresponding to a test requirement of a developer, and is used for filtering the sample data, so as to obtain data meeting the filtering condition in the sample data, and further implement filtering of the sample data.
For example, the data simulation rule matched with the data query request a is a data simulation rule 1, the data simulation rule 1 includes a model name shop _ mockbata, field names time, product and type, a data number of 3 and a processing mode data desensitization of sensitive data, based on which the obtained model name corresponding to the data simulation rule 1 is shop _ mockbata, the field names time, product and type, the data number of 3 and the processing mode is data desensitization.
Step S520: and obtaining sample data based on the model name, the field name, the number of data pieces and the processing mode.
Specifically, sample data is obtained according to the model name, the field name, the number of data pieces, and the processing mode.
For example, the obtained model name is shop _ mockdata, the field names are time, product, and type, the number of data pieces is 3, and the processing mode is data desensitization.
Based on this, sample data D can be obtained, specifically, the sample data D includes 3 pieces of data, which are data 1, data 2, and data 3, and includes a field value corresponding to time, 2 months and 22 days, a short sleeve field value corresponding to Product, a field value clothing corresponding to type, a field value corresponding to time, X months and XX days, a field value corresponding to Product, gold, a financial Product corresponding to type, a field value corresponding to time, 3 months and 03 days, a field value corresponding to Product, a ball shoe, and a field value shoe corresponding to type in data 1.
Step S530: and determining a filtering condition corresponding to the data query request, and filtering the sample data according to the filtering condition to obtain the filtered sample data.
Specifically, the filtered sample data is the data determined after the sample data is filtered according to the filtering condition.
For example, sample data D is obtained, specifically, the sample data D includes 3 pieces of data, which are data 1, data 2, and data 3, and includes a field value corresponding to time in data 1, 2 months and 22 days, a field value corresponding to Product short-sleeve, a field value corresponding to type, a field value corresponding to time in data 2, X months and XX days, a field value corresponding to Product is gold, a field value corresponding to type, a financial Product, a field value corresponding to time in data 3, 3 months and 03 days, a field value corresponding to Product is a ball shoe, and a shoe field value corresponding to type.
The obtained filtering condition is that time is 2 months and 22 days, that is, only data with the field name time value of 2 months and 22 days is needed finally, based on the data, sample data D is filtered, data 2 and data 3 are filtered, and it is determined that the filtered sample data is data 1.
Step S540: and obtaining first data corresponding to the filtered sample data based on the feedback format, and feeding back the first data.
Specifically, the format of the sample data is converted according to the determined feedback format to obtain first data, and the first data is fed back.
For example, the sample data after filtering is data 1, the data 1 is converted into a Json format to obtain first data, and the first data is fed back.
Therefore, in the implementation of the optional embodiment, on one hand, the sample data is generated based on the data simulation rule, that is, the sample data is not generated in a manual mode any more, so that the efficiency of generating the sample data is improved, different sample data can be generated based on different data simulation rules, and the flexibility of generating the sample data is improved; on the other hand, the obtained first data is the data obtained after the sample data is filtered according to the filtering condition, the testing requirement of a developer sending a data query request is met, and besides, the format of the first data needs to be adjusted according to the feedback format, so that the use and unified management of the first data are facilitated, and the developer can understand the content of the first data more easily.
As an alternative embodiment, please refer to fig. 6, and fig. 6 shows a schematic flow chart of obtaining sample data. As shown in fig. 6, may include:
step S610: and simulating and constructing sample data based on the model name, the field name, the number of data pieces and the processing mode.
Specifically, there are two ways to obtain sample data based on the model name, the field name, the number of data pieces, and the processing manner, where the first way is constructed by real-time simulation according to the model name, the field name, the number of data pieces, and the processing manner.
For example, the obtained model name is shop _ mockdata, the field names are time, product, and type, the number of data pieces is 3, and the processing mode is data desensitization.
Based on this, the sample data D can be constructed in real-time simulation according to the above data, specifically, the sample data D includes 3 pieces of data, which are data 1, data 2 and data 3, and includes a field value corresponding to time, i.e., 2 months and 22 days, a short sleeve corresponding to Product, a field value garment corresponding to type, i.e., X months and XX days, a field value corresponding to time, i.e., gold, a field value corresponding to type, a financial Product corresponding to type, i.e., 3 months and 03 days, a field value corresponding to time, i.e., a ball shoe, and a shoe corresponding to type in the data 1.
Step S620: and acquiring preset simulation data constructed by pre-simulation, and taking data matched with the model name, the field name, the number of data pieces and the processing mode in the preset simulation data as sample data.
Specifically, a second way to obtain sample data based on the model name, the field name, the number of pieces of data, and the processing way is to match from preset simulation data of a pre-simulation configuration.
For example, fig. 7 shows a schematic flowchart of a process for obtaining preset simulation data, as shown in fig. 7, where theperson 710 is a developer, and theserver 720 is a server for generating a query request link, it should be noted that the query request link generated by theserver 720 is a link that can be matched to a data simulation rule, and sample data that can be obtained through the data simulation rule corresponding to the link, and the sample data is sample data obtained from preset simulation data constructed by simulation in advance.
Step S730 is a process of creating a model name in advance for the developer, and after the developer creates the created model name, the created model name needs to be sent to thedata management system 740 for the maintenance of the model name by thedata management system 740, step S750 is a process of acquiring sample data from real data, step S760 is a process of performing data desensitization on sensitive data in the sample data, step S770 is a process of transforming the data format according to the feedback format, and performing data simulation rule creation according to the model name in S730, the sample data in S750, the data desensitization manner in S760, and the feedback format in S770, and step S780 is a process of generating a query link corresponding to the data simulation rule in S770.
Based on this, when the query request link matches the query request link in S780, the preset simulation data in S750 is obtained, and then data matching the model name, the field name, the number of pieces of data, and the processing manner in the preset simulation data is taken as sample data.
For example, there are 10 pieces of preset simulation data constructed by simulation in advance, the model name of the 1 st piece of preset simulation data is user _ mockbata, the model names of the 2 nd to 7 th pieces of preset simulation data are shop _ mockbata, the model names of the 8 th to 10 th pieces of preset simulation data are app _ mockbata, 3 field names exist in the 2 nd to 6 th pieces of preset simulation data, which are respectively time, product and type, 2 field names exist in the 7 th piece of preset simulation data, which are respectively color and amount, the processing formats of the 2 nd to 6 th pieces of data are data desensitization, and the processing formats of the rest data are data obfuscation.
The acquired model name is shop _ mockdata, the field names are time, product and type, the number of data is 3, the processing mode data desensitization of sensitive data in the data is realized, and based on the data desensitization, sample data acquired in preset simulation data are any three pieces of data from 2 nd to 6 th.
It can be seen that, in implementing this alternative embodiment, there are two ways to generate sample data, one way is to simulate and construct the sample data in real time according to the model name, the field name, the number of data pieces, and the processing method, and the other way is to match the sample data with preset simulation data generated in advance. By using the first mode, different sample data can be simulated and constructed based on different model names, field names, data numbers and processing modes, the flexibility of simulation construction sample data is increased, in the second mode, the sample data is directly obtained by matching from preset simulation data generated in advance, and the generation speed of the sample data is improved because the preset sample simulation data is generated in advance.
Referring to fig. 8, fig. 8 is a schematic flow chart illustrating editing sample data. As shown in fig. 8, may include:
step S810: acquiring import data, and merging the sample data and the import data to update the sample data; the import data is data corresponding to import operation, the import operation is operation acting on a graphical user interface, and the graphical user interface is used for editing the sample data.
The developer needing test data can edit the sample data, and the editing process can be realized on a graphical user interface. The import data refers to data which needs to be imported into the sample data by a developer, and correspondingly, the import operation is an operation performed on a graphical user interface by the developer and is used for determining the import data.
For example, fig. 9 shows a graphical user interface for editing sample data, where theinterface 910 is a graphical user interface, the model name of the sample data is displayed in theinput box 920, the field name of the sample data is displayed in theinput box 930, the sample data is displayed in the data entry table 950 is displayed in theinput box 940, the field value corresponding to the field name is displayed in each cell in the table 950, the operation performed by the user on thecontrol 960 is an import operation, and the operation performed by the user on thecontrol 970 is an export operation.
When a user needing test data touches thecontrol 960 on thegui 910, the imported data is obtained, and after the imported data is obtained, the imported data and the sample data in the table 950 are merged to obtain updated sample data.
Step S820: acquiring export data, and deleting the export data from the sample data to update the sample data; the export data is data corresponding to export operation, and the export operation is operation acting on the graphical user interface.
The export data is data corresponding to export operation, the export operation is an operation which can be acted on a graphical user interface by a developer, and the operation is used for determining which data in the sample data need to be deleted.
For example, fig. 9 shows a graphical user interface for editing sample data, and the user's operation oncontrol 970 is an export operation.
When a developer needing test data touchescontrol 970 ongraphical user interface 910, export data is obtained, and after the export data is obtained, the export data is deleted from table 950 to obtain updated sample data.
Step S830: acquiring sample data to be replaced and replacement data, and replacing the sample data to be replaced with the replacement data; the sample data to be replaced is data corresponding to the replacement operation, the replacement data is data corresponding to the input operation, and the replacement operation and the input operation are operations acting on the graphical user interface.
The sample data to be replaced refers to data needing to be replaced, and the replacement data is used for replacing the replaced data. The alternative operation is an operation which can act on the graphical user interface, specifically a selection operation, and the input operation is another operation which acts on the graphical user interface, specifically an input operation.
For example, fig. 9 shows a graphical user interface for editing sample data, when a developer selects a field value corresponding to a field name in the sample data of the table 950, the field value is data to be replaced, and after selecting the data to be replaced, the developer may input replacement data in a cell corresponding to the field value, so as to implement a process of replacing the data to be replaced with the replacement data.
Therefore, by implementing the optional embodiment, the sample data can be edited by acting on the operation on the graphical user interface, the requirements of developers needing to test the data are better met, the experience of the developers is improved, and the flexibility of editing the sample data is also improved.
Referring to fig. 10, fig. 10 is a schematic flow chart illustrating a process of obtaining filtered sample data. As shown in fig. 10, the filtering condition includes a filtering field name and a data filtering condition that the filtering field name needs to satisfy, and may include:
step S1010: and acquiring the name of the filtering field from the filtering condition, and determining a data value corresponding to the name of the filtering field in the sample data.
The filtering field names are one or more of the field names, and some data in the sample data can be filtered through the data values corresponding to the filtering field names.
For example, the filter field name is time, and the data value corresponding to time in the sample data is 2 months and 22 days.
Step S1020: and acquiring data filtering conditions from the filtering conditions, determining target data values meeting the data filtering conditions from the data values, and determining sample data corresponding to the target data values as filtered sample data.
The data filtering condition refers to a condition that a data value corresponding to the filtering field name should satisfy, and based on this, the target data value refers to a data value satisfying the data filtering condition.
For example, the data filtering condition is that time is 2 months and 22 days, and there are 3 pieces of sample data, the time value of the first piece of sample data is 2 months and 21 days, the time value of the 2 nd piece of sample data is 3 months and 1, the time value of the 3 rd piece of sample data is 2 months and 22 days, based on this, the target data value is 2 months and 22 days, and the filtered sample data is the third piece of sample data.
Therefore, by implementing the optional embodiment, the sample data can be filtered according to the filtering conditions, and the filtering conditions correspond to the testing requirements of developers, so that the fitting degree of the filtered sample data and the requirements of the developers is improved, the experience of the developers is improved, different filtered sample data can be obtained through different filtering conditions, and the flexibility of determining the sample data is increased.
Fig. 11 is a schematic flowchart illustrating a process of feeding back first data according to the foregoing embodiment, as shown in fig. 11, where thedata interface 1110 is an interface for uniformly querying data, theserver 1120 is a server for determining the first data, and theserver 1130 is a server corresponding to a database storing real data. First, step S1140 is a process in which a developer sends an authentication request from the unifiedquery data interface 1110, step S1150 is a process in which theserver 1120 acquires the authentication request, step S1160 is a process in which the authentication request is transmitted to theserver 1130 when the authentication request is received, step S1170 is a process in which a corresponding determination is made to obtain an authentication result, step S1180 is a process in which theserver 1130 feeds back the target authentication result to theserver 1120 if the authentication result is a target authentication result that is consistent with a preset authentication result, theserver 1120 sends the target authentication result to the unifiedquery data interface 1110, and at this time, theserver 1120 may receive the data query request.
Step S1190 is a process of receiving the data query request, step S1191 is a process of determining a data simulation rule matching the data query request, step S1192 is a process of simulating and constructing sample data based on the data simulation rule if the data simulation rule is matched, step S1193 is a process of obtaining first data based on a feedback format, and step S1194 is a process of feeding back the first data to the unifiedquery data interface 1110.
Step S1195 is a process of transmitting the data query request to theserver 1130 if the data simulation rule is not matched, and step S1196 is a process of obtaining real data and returning the real data to theserver 1110, where the real data is data obtained from a database in theserver 1130. Embodiments of steps S1195 and S1196 are described in detail below.
In step S130, if the data simulation rule is not matched, feeding back second data; and the second data is real data obtained by querying in the database based on the data query request.
Specifically, the second data refers to real data stored in the database, which is generated during use by a user using the application program.
For example, fig. 4 shows a flow chart of data processing, and as shown in fig. 4, if the data simulation rule is not matched, the data query request is sent to thesecond server 430, and the second data is acquired in thesecond server 430, so as to feed back the second data to thedata interface 410.
As an alternative embodiment, please refer to fig. 12, and fig. 12 shows a schematic flow chart of feeding back the second data. As shown in fig. 12, the data query request includes a query request link, which may include:
step 1210: and if the data simulation rule is not matched, determining a query request link corresponding to the data query request.
If the data simulation rule is not matched, it is proved that no rule capable of simulating and manufacturing the first data exists at the moment, and based on the rule, an inquiry request link corresponding to the inquiry request needs to be acquired.
For example, if no data simulation rule corresponding to the data query request is matched, the query request link corresponding to the data query request is determined to be xx.
Step S1220: and determining second data in the database based on the query request link, and feeding back the second data.
And determining real data, namely second data, in the database according to the query request link, and feeding back the second data.
For example, the real data corresponding to the query request linked with xx.xx is determined to be data E in the database, and the data E is fed back.
Therefore, by implementing the optional embodiment, real data is fed back when the data simulation rule is not matched, so that the data which can be fed back also exists even under the condition that the data simulation rule cannot be matched, the logic of the query request is perfected, the supply of test data can be guaranteed by two ways of simulating data and real data, the experience degree of developers is improved, and the normal operation of subsequent test services is facilitated.
By implementing the embodiment of the application, on one hand, if the data simulation rule is matched, the first data is fed back, and if the data simulation rule is not matched, the second data is fed back, so that the generation of the test data does not depend on the real data completely, the supply of the test data can be guaranteed by two ways of the simulation data and the real data, the logic of data query is perfected, and the experience of developers for obtaining the test data is improved; on the other hand, a general method for simulating and constructing first data based on the simulation data rule is provided, different first data can be fed back according to different data simulation rules, the test function can be completed by using the first data in more service scenes, and the efficiency of simulating and constructing the first data is improved; in addition, when different first data need to be fed back, the data simulation rule can be changed, and the flexibility of constructing the first data is improved.
Exemplary Medium
Having described the method of the exemplary embodiments of the present application, the media of the exemplary embodiments of the present application will be described next.
In some possible embodiments, aspects of the present application may also be implemented as a medium having program code stored thereon, which when executed by a processor of a device, is used to implement the steps in the information display method according to various exemplary embodiments of the present application described in the above section "exemplary method" of the present specification.
Specifically, the processor of the device, when executing the program code, is configured to implement the following steps: acquiring a data query request, and determining a data simulation rule matched with the data query request; if the data simulation rule is matched, feeding back first data; wherein the first data is generated based on the matched data simulation rule simulation structure; if the data simulation rule is not matched, feeding back second data; and the second data is real data obtained by querying in the database based on the data query request.
In some embodiments of the present application, the program code is further configured to, when executed by the processor of the device, perform the following steps: determining a query request link corresponding to the data query request, and determining a simulation rule identifier matched with the query request link; if the simulation rule identification is matched, determining the data simulation rule corresponding to the simulation rule identification as the data simulation rule matched with the data query request; and if the simulation rule identification is not matched, determining that no data simulation rule matched with the data query request exists.
In some embodiments of the present application, the program code is further configured to, when executed by the processor of the device, perform the following steps: if the data simulation rule is matched, determining a model name, a field name, the number of data and a processing mode corresponding to the data simulation rule; obtaining sample data based on the model name, the field name, the number of data pieces and the processing mode; determining a filtering condition corresponding to the data query request, and filtering the sample data according to the filtering condition to obtain filtered sample data; and obtaining first data corresponding to the filtered sample data based on the feedback format, and feeding back the first data.
In some embodiments of the present application, the program code is further configured to, when executed by the processor of the device, perform the following steps: sample data is constructed in a simulation mode based on the model name, the field name, the number of data pieces and the processing mode; or acquiring preset simulation data constructed by pre-simulation, and taking data matched with the model name, the field name, the number of data pieces and the processing mode in the preset simulation data as sample data.
In some embodiments of the present application, the program code is further configured to, when executed by the processor of the device, perform the following steps: acquiring import data, and merging the sample data and the import data to update the sample data; the method comprises the steps that imported data are data corresponding to import operation, the import operation is operation acting on a graphical user interface, and the graphical user interface is used for editing sample data; acquiring export data, and deleting the export data from the sample data to update the sample data; the export data is data corresponding to export operation, and the export operation is operation acting on a graphical user interface; acquiring sample data to be replaced and replacement data, and replacing the sample data to be replaced with the replacement data; the sample data to be replaced is data corresponding to the replacement operation, the replacement data is data corresponding to the input operation, and the replacement operation and the input operation are operations acting on the graphical user interface.
In some embodiments of the present application, the program code is further configured to, when executed by the processor of the device, perform the following steps: acquiring a filtering field name from the filtering condition, and determining a data value corresponding to the filtering field name in the sample data; and acquiring data filtering conditions from the filtering conditions, determining target data values meeting the data filtering conditions from the data values, and determining sample data corresponding to the target data values as filtered sample data.
In some embodiments of the present application, the program code is further configured to, when executed by the processor of the device, perform the following steps: if the data simulation rule is not matched, determining a query request link corresponding to the data query request; and determining second data in the database based on the query request link, and feeding back the second data.
In some embodiments of the present application, the program code is further configured to, when executed by the processor of the device, perform the following steps: acquiring an authentication request, and transparently transmitting the authentication request to a database to acquire a target authentication result consistent with a preset authentication result; the preset authentication result is the result that the interface verification serial number of the application program data interface is consistent with the authentication verification serial number and the interface key of the application program data interface is consistent with the authentication interface key; the application program data interface is a data interface for sending an authentication request; and feeding back a target authentication result to obtain a data query request.
It should be noted that: the above-mentioned medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take a variety of forms, including, but not limited to: an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device over any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., over the internet using an internet service provider).
Exemplary devices
Having described the medium of the exemplary embodiment of the present application, next, a data processing apparatus of the exemplary embodiment of the present application will be described with reference to fig. 13.
Referring to fig. 13, fig. 13 is a block diagram illustrating a data processing apparatus according to an exemplary embodiment of the present application. As shown in fig. 13, adata processing apparatus 1300 according to an exemplary embodiment of the present application includes: adetermination module 1310, afirst feedback module 1320, and asecond feedback module 1330, wherein:
a determiningmodule 1310 configured to obtain the data query request and determine a data simulation rule matching the data query request;
afirst feedback module 1320 configured to feed back the first data if the data simulation rule is matched; wherein the first data is generated based on the matched data simulation rule simulation structure;
asecond feedback module 1330 configured to feed back second data if the data simulation rule is not matched; and the second data is real data obtained by querying in the database based on the data query request.
It can be seen that, by implementing the apparatus shown in fig. 13, the first data is constructed based on the simulation of the data simulation rule, so that the test data in the related art is prevented from being generated completely depending on the real data, the supply of the test data can be ensured by two ways of the simulation data and the real data, the logic of data query is improved, and the experience of developers in obtaining the test data is improved.
In one embodiment, based on the foregoing solution, before the determiningmodule 1310 obtains the data query request, the method includes:
acquiring an authentication request, and transparently transmitting the authentication request to a database to acquire a target authentication result consistent with a preset authentication result; the preset authentication result is the result that the interface verification serial number of the application program data interface is consistent with the authentication verification serial number and the interface key of the application program data interface is consistent with the authentication interface key; the application program data interface is a data interface for sending an authentication request;
and feeding back a target authentication result to obtain a data query request.
Therefore, by implementing the optional embodiment, the target authentication result fed back by the database needs to be obtained before the data query request is obtained, so that the risk that the first data and the second data fed back subsequently are leaked is avoided, and the safety of data processing is improved.
In one embodiment, based on the foregoing scheme, the determiningmodule 1310 determines the data simulation rule matching the data query request, including:
determining a query request link corresponding to the data query request, and determining a simulation rule identifier matched with the query request link;
if the simulation rule identification is matched, determining the data simulation rule corresponding to the simulation rule identification as the data simulation rule matched with the data query request;
and if the simulation rule identification is not matched, determining that no data simulation rule matched with the data query request exists.
Therefore, whether the simulation rule identification corresponding to the query request link exists or not is determined, the follow-up determination that the fed-back data is the first data or the second data is facilitated, namely whether the simulation rule identification corresponding to the query request link exists or not can guarantee the supply of the test data in two ways of the simulation data and the real data, the logic of data query is improved, and the experience of developers for obtaining the data is improved.
In one embodiment, based on the foregoing scheme, the determiningmodule 1310 data modeling rules comprises: the method comprises the following steps of (1) obtaining a model name, a field name corresponding to the model name, the number of data, a processing mode of sensitive data in sample data and a feedback format of the sample data; the sample data is generated by simulating a structure based on a model name, a field name and a data number, the data number is used for limiting the number of the sample data, and the processing mode of sensitive data in the sample data comprises data desensitization and/or data confusion.
Therefore, by implementing the optional embodiment, a universal data simulation rule is provided, different first data can be determined according to different data simulation rules subsequently, not only is the flexibility of the simulation construction of the first data increased, but also the different data simulation rules can be determined according to different business scene requirements, so that the business scene in which the subsequently determined first data can be applied is expanded, in addition, the first data are not generated based on an artificial form any more, and the efficiency of simulation construction of the first data is improved.
In one embodiment, based on the foregoing scheme, if thefirst feedback module 1320 matches the data simulation rule, the feedback of the first data includes:
if the data simulation rule is matched, determining a model name, a field name, the number of data and a processing mode corresponding to the data simulation rule;
obtaining sample data based on the model name, the field name, the number of data pieces and the processing mode;
determining a filtering condition corresponding to the data query request, and filtering the sample data according to the filtering condition to obtain filtered sample data;
and obtaining first data corresponding to the filtered sample data based on the feedback format, and feeding back the first data.
Therefore, in the implementation of the optional embodiment, on one hand, the sample data is generated based on the data simulation rule, that is, the sample data is not generated in a manual mode any more, so that the efficiency of generating the sample data is improved, different sample data can be generated based on different data simulation rules, and the flexibility of generating the sample data is improved; on the other hand, the obtained first data is the data obtained after the sample data is filtered according to the filtering condition, the testing requirement of a developer sending a data query request is met, and besides, the format of the first data needs to be adjusted according to the feedback format, so that the use and unified management of the first data are facilitated, and the developer can understand the content of the first data more easily.
In an embodiment, based on the foregoing scheme, the obtaining, by thefirst feedback module 1320, sample data based on the model name, the field name, the number of data pieces, and the processing manner includes:
sample data is constructed in a simulation mode based on the model name, the field name, the number of data pieces and the processing mode;
and acquiring preset simulation data constructed by pre-simulation, and taking data matched with the model name, the field name, the number of data pieces and the processing mode in the preset simulation data as sample data.
It can be seen that, in implementing this alternative embodiment, the sample data is generated in two ways, one way is generated by simulating the structure in real time according to the model name, the field name, the number of data pieces and the processing way, and the other way is obtained by matching the preset simulation data generated in advance. By using the first mode, different sample data can be simulated and constructed based on different model names, field names, data numbers and processing modes, the flexibility of simulation construction sample data is increased, in the second mode, the sample data is directly obtained by matching from preset simulation data generated in advance, and the speed of generating the sample data is improved because the preset sample simulation data is generated in advance.
In one embodiment, based on the foregoing solution, thefirst feedback module 1320 further includes:
acquiring import data, and merging the sample data and the import data to update the sample data; the imported data is data corresponding to the import operation, the import operation is operation acting on a graphical user interface, and the graphical user interface is used for editing the sample data;
acquiring export data, and deleting the export data from the sample data to update the sample data; the export data is data corresponding to export operation, and the export operation is operation acting on a graphical user interface;
acquiring sample data to be replaced and replacement data, and replacing the sample data to be replaced with the replacement data; the sample data to be replaced is data corresponding to the replacement operation, the replacement data is data corresponding to the input operation, and the replacement operation and the input operation are operations acting on the graphical user interface.
Therefore, by implementing the optional embodiment, the sample data can be edited by acting on the operation on the graphical user interface, the requirements of the user needing to test the data are better met, the experience degree of the user is improved, and the flexibility of editing the sample data is also improved.
In an embodiment, based on the foregoing solution, the filtering processing performed by thefirst feedback module 1320 on the sample data according to the filtering condition to obtain the filtered sample data includes:
acquiring a filtering field name from the filtering condition, and determining a data value corresponding to the filtering field name in the sample data;
and acquiring data filtering conditions from the filtering conditions, determining target data values meeting the data filtering conditions from the data values, and determining sample data corresponding to the target data values as filtered sample data.
Therefore, by implementing the optional embodiment, the sample data can be filtered according to the filtering conditions, and the filtering conditions correspond to the testing requirements of developers, so that the fitting degree of the filtered sample data and the requirements of the developers is improved, the experience of the developers is improved, different filtered sample data can be obtained through different filtering conditions, and the flexibility of determining the sample data is increased.
In one embodiment, based on the foregoing scheme, if thesecond feedback module 1330 does not match the data simulation rule, the second feedback module feeds back the second data, including:
if the data simulation rule is not matched, determining a query request link corresponding to the data query request;
and determining second data in the database based on the query request link, and feeding back the second data.
Therefore, by implementing the optional embodiment, real data is fed back when the data simulation rule is not matched, so that the data which can be fed back also exists even under the condition that the data simulation rule cannot be matched, the logic of the query request is perfected, the supply of test data can be guaranteed by two ways of simulating data and real data, the experience degree of developers is improved, and the normal operation of subsequent test services is facilitated.
It should be noted that although in the above detailed description several modules or units of the data processing device are mentioned, this division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Exemplary electronic device
Having described the method, medium, and apparatus of the exemplary embodiments of the present application, an electronic device according to another exemplary embodiment of the present application is next described.
As will be appreciated by one skilled in the art, aspects of the present application may be embodied as a system, method or program product. Accordingly, various aspects of the present application may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
Anelectronic device 1400 according to such an embodiment of the present disclosure is described below with reference to fig. 14. Theelectronic device 1400 shown in fig. 14 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present disclosure.
As shown in fig. 14, theelectronic device 1400 is embodied in the form of a general purpose computing device. The components of theelectronic device 1400 may include, but are not limited to: the at least oneprocessing unit 1410, the at least onememory unit 1420, thebus 1430 that connects the various system components (including thememory unit 1420 and the processing unit 1410), and thedisplay unit 1440.
Wherein the storage unit stores program code that is executable by theprocessing unit 1410, such that theprocessing unit 1410 performs steps according to various exemplary embodiments of the present disclosure described in the "exemplary methods" section above in this specification.
Thestorage unit 1420 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)1421 and/or acache memory unit 1422, and may further include a read only memory unit (ROM) 1423.
Thestorage unit 1420 may also include a program/usage tool 1424 having a set (at least one) ofprogram modules 1425,such program modules 1425 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, and in some combination, may comprise a representation of a network environment.
Thebus 1430 may include a data bus, an address bus, and a control bus.
Theelectronic device 1400 may also communicate with one or more external devices 1470 (e.g., keyboard, pointing device, bluetooth device, etc.), which may be through an input/output (I/O)interface 1450. Also, theelectronic device 1400 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via thenetwork adapter 1460. As shown, thenetwork adapter 1460 communicates with the other modules of theelectronic device 1400 via the bus 1230. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with theelectronic device 1400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the present disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the present disclosure described in the "exemplary methods" section above of this specification, when the program product is run on the terminal device.
While the spirit and principles of the application have been described with reference to several particular embodiments, it is to be understood that the application is not limited to the disclosed embodiments, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit from the description. The application is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (10)

1. A method of data processing, the method comprising:
acquiring a data query request, and determining a data simulation rule matched with the data query request;
if the data simulation rule is matched, feeding back first data; wherein the first data is generated based on the matched data simulation rule simulation construct;
if the data simulation rule is not matched, feeding back second data; and the second data is real data obtained by querying in a database based on the data query request.
2. The data processing method of claim 1, wherein the data processing method is applied to a computer system
The data query request comprises a query request link;
the determining the data simulation rule matched with the data query request comprises:
determining the query request link corresponding to the data query request, and determining a simulation rule identifier matched with the query request link;
if the simulation rule identification is matched, determining that the data simulation rule corresponding to the simulation rule identification is the data simulation rule matched with the data query request;
and if the simulation rule identification is not matched, determining that the data simulation rule matched with the data query request does not exist.
3. The data processing method of any of claims 1 to 2, wherein the data simulation rule comprises:
the method comprises the following steps of (1) obtaining a model name, a field name corresponding to the model name, the number of data, a processing mode of sensitive data in sample data and a feedback format of the sample data; the sample data is generated based on the model name, the field name and the data number simulation structure, the data number is used for limiting the number of the sample data, and the processing mode of sensitive data in the sample data comprises data desensitization and/or data confusion.
4. The data processing method of claim 3, wherein the data query request includes a filter condition;
if the data simulation rule is matched, feeding back first data, including:
if the data simulation rule is matched, determining the model name, the field name, the number of data and the processing mode corresponding to the data simulation rule;
obtaining the sample data based on the model name, the field name, the number of the data pieces and the processing mode;
determining the filtering condition corresponding to the data query request, and filtering the sample data according to the filtering condition to obtain the filtered sample data;
and obtaining first data corresponding to the filtered sample data based on the feedback format, and feeding back the first data.
5. The data processing method according to claim 4, wherein the obtaining the sample data based on the model name, the field name, the number of pieces of data, and the processing manner includes:
simulating and constructing the sample data based on the model name, the field name, the data number and the processing mode; or
And acquiring preset simulation data constructed by pre-simulation, and taking data matched with the model name, the field name, the number of data pieces and the processing mode in the preset simulation data as the sample data.
6. The data processing method according to claim 4, wherein the filtering condition comprises a filtering field name and a data filtering condition that the filtering field name needs to satisfy;
the filtering the sample data according to the filtering condition to obtain the filtered sample data includes:
acquiring the name of the filtering field from the filtering condition, and determining a data value corresponding to the name of the filtering field in the sample data;
and acquiring the data filtering condition from the filtering condition, and determining a target data value meeting the data filtering condition from the data values to determine the sample data corresponding to the target data value as the filtered sample data.
7. The data processing method of claim 1, wherein the data query request includes a query request link;
if the data simulation rule is not matched, feeding back second data, including:
if the data simulation rule is not matched, determining the query request link corresponding to the data query request;
and determining second data in the database based on the query request link, and feeding back the second data.
8. A data processing apparatus, comprising:
the determining module is configured to acquire a data query request and determine a data simulation rule matched with the data query request;
the first feedback module is configured to feed back first data if the data simulation rule is matched; wherein the first data is generated based on the matched data simulation rule simulation construct;
the second feedback module is configured to feed back second data if the data simulation rule is not matched; and the second data is real data obtained by querying in a database based on the data query request.
9. An electronic device, comprising:
a processor;
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the data processing method of any one of claims 1-7 via execution of the executable instructions.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the data processing method of any one of claims 1 to 7.
CN202110680606.4A2021-06-182021-06-18Data processing method, data processing device, electronic equipment and computer readable storage mediumPendingCN113342667A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202110680606.4ACN113342667A (en)2021-06-182021-06-18Data processing method, data processing device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110680606.4ACN113342667A (en)2021-06-182021-06-18Data processing method, data processing device, electronic equipment and computer readable storage medium

Publications (1)

Publication NumberPublication Date
CN113342667Atrue CN113342667A (en)2021-09-03

Family

ID=77477400

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110680606.4APendingCN113342667A (en)2021-06-182021-06-18Data processing method, data processing device, electronic equipment and computer readable storage medium

Country Status (1)

CountryLink
CN (1)CN113342667A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114356785A (en)*2022-03-112022-04-15中航信移动科技有限公司 A data processing method, device, electronic device and storage medium
CN116842237A (en)*2023-07-052023-10-03北京天融信网络安全技术有限公司 Data generation method, device, electronic equipment and computer-readable storage medium

Citations (14)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103297475A (en)*2012-03-012013-09-11阿里巴巴集团控股有限公司Mock service system and processing method of Mock service
WO2015195830A2 (en)*2014-06-182015-12-23Alibaba Group Holding LimitedData query method and apparatus
CN105843734A (en)*2016-03-182016-08-10厦门美图移动科技有限公司Automatic test method and device and computing device
CN107908541A (en)*2017-07-262018-04-13平安壹钱包电子商务有限公司Interface test method, device, computer equipment and storage medium
CN109241102A (en)*2018-09-212019-01-18杭州网易再顾科技有限公司Data processing method and device, storage medium and electronic equipment
CN109450736A (en)*2018-12-112019-03-08杭州网易再顾科技有限公司Network interface test method and device, medium and calculating equipment
CN109491905A (en)*2018-11-022019-03-19北京金山云网络技术有限公司Head end test method, apparatus and electronic equipment
CN109634836A (en)*2018-10-232019-04-16平安科技(深圳)有限公司Test data packaging method, device, equipment and storage medium
CN110149328A (en)*2019-05-222019-08-20平安科技(深圳)有限公司Interface method for authenticating, device, equipment and computer readable storage medium
CN110334010A (en)*2019-05-302019-10-15深圳壹账通智能科技有限公司Sample data generation method, device, computer equipment and storage medium
WO2020119434A1 (en)*2018-12-152020-06-18深圳壹账通智能科技有限公司Method and apparatus for interface data processing, method and apparatus for automated testing, device, and medium
CN112035357A (en)*2020-08-312020-12-04平安医疗健康管理股份有限公司Intelligent test method, device, equipment and storage medium
CN112188493A (en)*2020-10-222021-01-05深圳云之家网络有限公司Authentication method, system and related equipment
CN112416770A (en)*2020-11-232021-02-26平安普惠企业管理有限公司 Test data generation method, device, equipment and storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103297475A (en)*2012-03-012013-09-11阿里巴巴集团控股有限公司Mock service system and processing method of Mock service
WO2015195830A2 (en)*2014-06-182015-12-23Alibaba Group Holding LimitedData query method and apparatus
CN105843734A (en)*2016-03-182016-08-10厦门美图移动科技有限公司Automatic test method and device and computing device
CN107908541A (en)*2017-07-262018-04-13平安壹钱包电子商务有限公司Interface test method, device, computer equipment and storage medium
CN109241102A (en)*2018-09-212019-01-18杭州网易再顾科技有限公司Data processing method and device, storage medium and electronic equipment
CN109634836A (en)*2018-10-232019-04-16平安科技(深圳)有限公司Test data packaging method, device, equipment and storage medium
CN109491905A (en)*2018-11-022019-03-19北京金山云网络技术有限公司Head end test method, apparatus and electronic equipment
CN109450736A (en)*2018-12-112019-03-08杭州网易再顾科技有限公司Network interface test method and device, medium and calculating equipment
WO2020119434A1 (en)*2018-12-152020-06-18深圳壹账通智能科技有限公司Method and apparatus for interface data processing, method and apparatus for automated testing, device, and medium
CN110149328A (en)*2019-05-222019-08-20平安科技(深圳)有限公司Interface method for authenticating, device, equipment and computer readable storage medium
CN110334010A (en)*2019-05-302019-10-15深圳壹账通智能科技有限公司Sample data generation method, device, computer equipment and storage medium
CN112035357A (en)*2020-08-312020-12-04平安医疗健康管理股份有限公司Intelligent test method, device, equipment and storage medium
CN112188493A (en)*2020-10-222021-01-05深圳云之家网络有限公司Authentication method, system and related equipment
CN112416770A (en)*2020-11-232021-02-26平安普惠企业管理有限公司 Test data generation method, device, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114356785A (en)*2022-03-112022-04-15中航信移动科技有限公司 A data processing method, device, electronic device and storage medium
CN114356785B (en)*2022-03-112022-05-20中航信移动科技有限公司 A data processing method, device, electronic device and storage medium
CN116842237A (en)*2023-07-052023-10-03北京天融信网络安全技术有限公司 Data generation method, device, electronic equipment and computer-readable storage medium

Similar Documents

PublicationPublication DateTitle
CN112099768B (en)Business process processing method and device and computer readable storage medium
CN112685029B (en)Method, device, equipment and storage medium for generating visual template
US11126938B2 (en)Targeted data element detection for crowd sourced projects with machine learning
CN111694561B (en) Interface management method, device, equipment and storage medium
CN111881042B (en)Automatic test script generation method and device and electronic equipment
CN112015654B (en) Method and apparatus for testing
CN108111364B (en)Service system testing method and device
CN108228175A (en)Movable backstage development approach, device, server and medium
CN109815147A (en) Test case generation method, apparatus, server and medium
CN111626602A (en)Service processing method, service processing device, storage medium and electronic equipment
CN113342667A (en)Data processing method, data processing device, electronic equipment and computer readable storage medium
CN114282078A (en) Project data processing method, device, electronic device and storage medium
US20210124752A1 (en)System for Data Collection, Aggregation, Storage, Verification and Analytics with User Interface
CN113687859B (en) A branch management method, device, electronic device and medium for software development
CN115422202A (en)Service model generation method, service data query method, device and equipment
CN113254340B (en) A method and device for generating test cases
CN113810340B (en)Data reporting method, device, equipment and computer readable storage medium
CN114218100A (en)Business model testing method, device, system, equipment, medium and program product
CN113190462A (en)Dynamic data debugging method, device and equipment
CN112346736B (en)Data processing method and system
CN115222545B (en) Message modular processing method, device, computer equipment and storage medium
CN114817071B (en)Online automatic test system, method and device and readable storage medium
CN116561161A (en)Data backtracking method, system and storage medium based on mysql database behaviors
WO2023151397A1 (en)Application program deployment method and apparatus, device, and medium
CN115129584A (en)Data processing method, data processing apparatus, storage medium, and electronic apparatus

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20210903

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp