CN114911857A - Data processing method and device - Google Patents
Data processing method and device Download PDFInfo
- Publication number
- CN114911857A CN114911857A CN202210539514.9A CN202210539514A CN114911857A CN 114911857 A CN114911857 A CN 114911857A CN 202210539514 A CN202210539514 A CN 202210539514A CN 114911857 A CN114911857 A CN 114911857A
- Authority
- CN
- China
- Prior art keywords
- field
- target
- request data
- interface
- warehousing
- 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
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 32
- 238000001514 detection method Methods 0.000 claims abstract description 41
- 238000012545 processing Methods 0.000 claims abstract description 17
- 238000000034 method Methods 0.000 claims description 33
- 238000012360 testing method Methods 0.000 claims description 13
- 230000001960 triggered effect Effects 0.000 claims description 2
- 230000008569 process Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000006872 improvement Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- GOLXNESZZPUPJE-UHFFFAOYSA-N spiromesifen Chemical compound CC1=CC(C)=CC(C)=C1C(C(O1)=O)=C(OC(=O)CC(C)(C)C)C11CCCC1 GOLXNESZZPUPJE-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/252—Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Computational Linguistics (AREA)
- Storage Device Security (AREA)
Abstract
The invention discloses a data processing method and a data processing device, which can obtain target request data to be subjected to warehousing detection; determining whether at least one piece of put-in data of a target interface exists in a target database, and if so, respectively obtaining service field information and system field information from each piece of put-in data of the target interface; carrying out field name consistency comparison and field value consistency comparison on each put-in-storage data of the target interface and target request data to obtain a consistency comparison result; and determining whether the target request data has the warehousing authority or not based on the consistency comparison result. The invention can determine whether the storage operation is required to be carried out on the request data of the target interface or not, and does not need to manually determine whether the storage operation is required or not, thereby effectively reducing the consumption of human resources and effectively improving the processing efficiency.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data processing method and apparatus.
Background
With the development of computer science and technology, the generation technology of interface test cases is continuously improved.
Currently, after obtaining request data of an interface, the request data of the interface may be imported into a database for storage, and an interface test case for testing the interface is generated by using the request data.
If the same request data is stored in the database, the request data does not need to be stored in the database, and unnecessary consumption of storage resources is avoided. Specifically, the prior art may manually determine whether the requested data of the interface needs to be saved in the database.
However, when the number of interfaces is large or the number of requested data of an interface is large, the manual processing efficiency is low.
Disclosure of Invention
In view of the above problems, the present invention provides a data processing method and apparatus for overcoming the above problems or at least partially solving the above problems, and the technical solution is as follows:
a data processing method, the data processing method comprising:
obtaining target request data to be subjected to warehousing detection; the target request data is interface request data of a target interface, service field information and system field information of the target interface are stored in the target request data, the service field information comprises at least one service field name and a corresponding field value, and the system field information comprises at least one system field name;
determining whether at least one piece of put-in data of the target interface exists in a target database, and if so, respectively obtaining service field information and system field information from each piece of put-in data of the target interface; the business field names and the system field names in the data which are put into the database of the same interface are consistent;
performing field name consistency comparison and field value consistency comparison on each put-in-storage data of the target interface and the target request data to obtain consistency comparison results;
and determining whether the target request data has the warehousing permission or not based on the consistency comparison result.
Optionally, the consistency comparison result includes a first comparison result and a second comparison result; the performing field name consistency comparison and field value consistency comparison on each put-in-storage data of the target interface and the target request data to obtain consistency comparison results includes:
performing consistency comparison of service field names and system field names on the data which are put into the database of the target interface and the target request data to obtain the first comparison result;
and performing consistency comparison of service field values on each put-in-storage data of the target interface and the target request data to obtain a second comparison result.
Optionally, the target database is predefined with a service field name and a system field name of each interface, and the service field name and the system field name in the data put in storage of each interface are predefined service field names and system field names.
Optionally, the performing consistency comparison between the service field name and the system field name on each put-in-storage data of the target interface and the target request data to obtain the first comparison result includes:
determining a service field name and a system field name of the target interface, which are labeled in advance, from the target database;
and performing consistency comparison on the determined service field name and system field name of the target interface, which are labeled in advance, and the service field name and system field name in the target request data to obtain the first comparison result.
Optionally, the performing consistency comparison of service field values on each put-in-storage data of the target interface and the target request data to obtain the second comparison result includes:
for the service field information in any one of the warehoused data of the target interface: comparing the service field information with the service field information in the target request data to obtain a third comparison result, wherein the field value under each service field name is compared with the service field information in the target request data;
determining each of the third comparison results as the second comparison result.
Optionally, the determining whether the target request data has a warehousing permission based on the consistency comparison result includes:
when at least one third comparison result is consistent, determining that the target request data does not have the warehousing permission;
and when the first comparison result is consistent and the third comparison results are inconsistent, determining that the target request data has the storage permission.
Optionally, the method further includes:
and when the target request data is determined to have the warehousing right, performing warehousing operation on the target request data to generate a corresponding interface test case.
Optionally, after the target request data to be subjected to the warehousing detection is obtained, the method further includes:
searching the warehousing marking information of the target interface in the target database; the target database also comprises warehousing marking information of at least one interface, and the warehousing marking information comprises corresponding warehousing marking fields, field type identifiers and field values;
and determining whether the target request data has the warehousing authority or not based on the searched warehousing marking information of the target interface.
Optionally, the warehousing marking field includes: a warehousing field, a Yapi system entering field and/or an interface marking field; when the warehousing marking field comprises a warehousing field, a Yapi system entering field and an interface marking field, determining whether the target request data has warehousing permission or not based on the searched warehousing marking information of the target interface, wherein the steps comprise:
and if the field value of the warehousing field is an automatic warehousing identification value, the field value of the Yapi system entering field is a Yapi identification value, and the field value of the interface marking field is a marked identification value in the searched warehousing marking information of the target interface, determining that the target request data has warehousing permission.
A data processing apparatus comprising: the device comprises a first obtaining unit, a first determining unit, a second obtaining unit, a first comparing unit, a third obtaining unit and a second determining unit; wherein:
the first obtaining unit is used for obtaining target request data to be subjected to warehousing detection; the target request data is interface request data of a target interface, service field information and system field information of the target interface are stored in the target request data, the service field information comprises at least one service field name and a corresponding field value, and the system field information comprises at least one system field name;
the first determining unit is used for determining whether at least one piece of warehoused data of the target interface exists in a target database, and if yes, the second obtaining unit is triggered;
the second obtaining unit is configured to obtain service field information and system field information from each piece of data already put into storage in the target interface; the business field names and the system field names in the data which are put into the database of the same interface are consistent;
the first comparing unit is used for performing field name consistency comparison and field value consistency comparison on each input data of the target interface and the target request data;
the third obtaining unit is used for obtaining a consistency comparison result;
and the second determining unit is used for determining whether the target request data has the warehousing permission or not based on the consistency comparison result.
Optionally, the consistency comparison result includes a first comparison result and a second comparison result; the first comparison unit includes: a second comparing unit and a third comparing unit; the third obtaining unit includes: a fourth obtaining unit and a fifth obtaining unit;
the second comparing unit is used for performing consistency comparison of the business field names and the system field names on the data which are put into the database and the target request data of the target interface;
the fourth obtaining unit is configured to obtain the first comparison result;
the third comparing unit is configured to perform consistency comparison of service field values on each of the warehoused data of the target interface and the target request data;
the fifth obtaining unit is configured to obtain the second comparison result.
Optionally, the target database is predefined with a service field name and a system field name of each interface, and the service field name and the system field name in the data put in storage of each interface are predefined service field names and system field names.
Optionally, the second comparing unit is configured to determine, from the target database, a service field name and a system field name of the target interface, where the label is printed in advance;
and carrying out consistency comparison on the determined service field name and system field name of the target interface, which are labeled in advance, and the service field name and system field name in the target request data.
Optionally, the third comparing unit is configured to, for the service field information in any binned data of the target interface: comparing the business field information with the business field information in the target request data under the name of each business field to obtain a third comparison result;
the fifth obtaining unit is configured to determine each third comparison result as the second comparison result.
Optionally, the second determining unit includes: a third determination unit and a fourth determination unit; wherein:
the third determining unit is configured to determine that the target request data does not have a warehousing permission when at least one third comparison result is consistent;
and the fourth determining unit is configured to determine that the target request data has the warehousing permission when the first comparison result is consistent and the third comparison results are inconsistent.
Optionally, the apparatus further comprises: a warehousing operation unit and a generation unit;
the warehousing operation unit is used for performing warehousing operation on the target request data when the target request data is determined to have warehousing rights;
the generating unit is used for generating a corresponding interface test case.
Optionally, the apparatus further comprises: a searching unit and a fifth determining unit;
the searching unit is used for searching the warehousing marking information of the target interface in the target database; the target database also comprises warehousing marking information of at least one interface, and the warehousing marking information comprises corresponding warehousing marking fields, field type identifiers and field values;
and the fifth determining unit is used for determining whether the target request data has the warehousing permission or not based on the searched warehousing marking information of the target interface.
Optionally, the warehousing marking field includes: a warehousing field, a Yapi system entering field and/or an interface marking field; when the warehousing marking field comprises a warehousing field, an input Yapi system field and an interface marking field, the fifth determining unit is used for:
and if the field value of the warehousing field is an automatic warehousing identification value, the field value of the Yapi system entering field is a Yapi identification value, and the field value of the interface marking field is a marked identification value in the searched warehousing marking information of the target interface, determining that the target request data has warehousing permission.
The data processing method and the data processing device can obtain target request data to be subjected to warehousing detection; the target request data is interface request data of a target interface, service field information and system field information of the target interface are stored in the target request data, the service field information comprises at least one service field name and a corresponding field value, and the system field information comprises at least one system field name; determining whether at least one piece of put-in data of a target interface exists in a target database, and if so, respectively obtaining service field information and system field information from each piece of put-in data of the target interface; the system comprises a database, a database and a database, wherein the service field names and the system field names in each database data of the same interface are consistent; carrying out field name consistency comparison and field value consistency comparison on each put-in-storage data of the target interface and target request data to obtain a consistency comparison result; and determining whether the target request data has the warehousing authority or not based on the consistency comparison result.
The invention can carry out the consistency comparison of the business field information between the target request data and the put-in-storage data of the target interface in the target database, thereby carrying out the put-in detection on the target request data and determining whether the target request data has the put-in-storage authority. Only when the target request data is determined to have the warehousing right, warehousing operation is carried out on the target request data, and a corresponding interface test case can be generated based on the warehoused target request data; and when the target request data is determined not to have the warehousing right, the target request data is forbidden to be subjected to warehousing operation, so that unnecessary resource consumption is avoided. The invention can determine whether the storage operation is required to be carried out on the request data of the target interface or not, and does not need to manually determine whether the storage operation is required or not, thereby effectively reducing the consumption of human resources and effectively improving the processing efficiency.
The foregoing description is only an overview of the technical solutions of the present invention, and the following detailed description of the present invention is provided to enable the technical means of the present invention to be more clearly understood, and to enable the above and other objects, features, and advantages of the present invention to be more clearly understood.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart illustrating a first data processing method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a second data processing method provided by the embodiment of the invention;
FIG. 3 is a flow chart of a third data processing method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram illustrating a data processing apparatus according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
As shown in fig. 1, the present embodiment proposes a first data processing method, which may include the steps of:
s101, obtaining target request data to be subjected to warehousing detection; the target request data is interface request data of a target interface, service field information and system field information of the target interface are stored in the target request data, the service field information comprises at least one service field name and a corresponding field value, and the system field information comprises at least one system field name;
the storage detection may be a detection mode for detecting whether the request data of a certain interface can be stored in the database.
Wherein, the target interface may be a certain interface.
The target request data may be request data of a target interface.
The service field is a field which can affect the service data returned by the interface. It should be noted that, for the same service field, when the field value of the service field changes, the interface may return different service data based on different field values.
Specifically, the service field information may store related information of the service field, such as a service field name and a field value. Specifically, the service field information may include at least one service field name and a corresponding field value. For example, the service field information may include a first service field name and a corresponding first field value, and a second service field name and a corresponding second field value.
And the change of the system field in the system field information cannot influence the service data returned by the interface. Specifically, the system field information may include at least one corresponding system field name and a corresponding field value.
It should be noted that, after the target request data to be subjected to the warehousing detection is obtained, the subsequent steps may be executed to perform the warehousing detection on the target request data and determine whether the warehousing operation can be performed on the target request data.
S102, determining whether at least one piece of put-in-storage data of a target interface exists in a target database, if so, executing a step S103 to determine whether target request data is repeated with certain piece of put-in-storage data of the target interface; otherwise, it may be determined that the interface request data of the target interface is not stored in the target database, and the target request data may be directly put into a library. The business field names and the system field names in the data which are put into the database of the same interface can be consistent;
wherein the target database may be a database for storing interface request data. Specifically, the target database may store multiple interface request data of multiple interfaces, that is, the warehoused data of multiple interfaces.
The warehoused data can be interface request data stored in a target database. Specifically, one piece of put-in-storage data may correspond to one interface request data of the interface.
Specifically, the binned data may include service field information and system field information of the interface. The service field information may include a corresponding service field name and field value, and the system field information may include a corresponding system field name and field value.
It should be noted that, in the target database, the service field name and the system field name in each of the warehoused data of the same interface may be the same. For example, in the target database, the warehoused data of the first interface includes first warehoused data and second warehoused data, names of service fields in the first warehoused data and the second warehoused data may be the same, and names of system fields in the first warehoused data and the second warehoused data may be the same.
Optionally, for a certain interface, the present invention may mark the field names of the interface in the target database in advance, that is, identify which field names of the interface are service field names and which field names are system field names; and then, the invention can perform warehousing detection on the request data of the interface.
Optionally, the present invention may set a parameter item of the field type identification value on the interface information configuration table, and implement identification of the field type for each field name of the interface by using the parameter item, so as to tag the field name of the interface. For example, for the first field name of the interface, the present invention may set the identification value of the field type thereof as the service field identification value on the interface information configuration table, so as to tag the first field name as the service field name; for another example, for the second field name of the interface, the present invention may set the identification value of the field type to the system field identification value on the interface information configuration table, so as to tag the first field name as the system field name. At this time, the field name of the interface and the corresponding field type identification value may be correspondingly stored in the interface information configuration table.
S103, respectively obtaining service field information and system field information from each data put in storage of a target interface;
specifically, after the target request data is obtained, the method and the device can search each piece of put-in-storage data of the target interface in the target database based on the interface name of the target interface carried in the target request data, and then can extract corresponding service field information and system field information from each piece of put-in-storage data respectively.
S104, carrying out field name consistency comparison on each put-in-storage data of the target interface and target request data and carrying out field value consistency comparison to obtain a consistency comparison result;
wherein the consistency comparison result may include a field name consistency comparison result and a field value consistency comparison result.
Specifically, the field name consistency comparison may include a business field name consistency comparison and a system field name consistency comparison.
Optionally, the field value consistency comparison may include only a consistency comparison of business field values;
optionally, the field value consistency comparison may also include both consistency comparison of the service field value and consistency comparison of the system field value.
Specifically, the method can compare the consistency of the field name and the field value of the target request data with each in-storage data after each in-storage data of the target interface is obtained, and determine whether the business field name and the system field name in the target request data are changed or not so as to avoid illegal data storage of the request data; and determining whether the service field information in the target request data exists in the target database so as to avoid repeated warehousing of the same request data.
Optionally, the present invention may mark the service field name and the system field name of the target interface in the target database, and then perform consistency comparison between the field name and the field value of each piece of the put-in-storage data of the target interface and the target request data.
Optionally, if the service field name and the system field name in the target request data are respectively consistent with the service field name and the system field name of the target interface in the target database, the method can determine that the service field and the system field of the target request data are legal and have no illegal fields;
optionally, if the service field name and the system field name in the target request data are less than the service field name and the system field name of the target interface in the target database, for example, less than one service field name or one system field name, the present invention may regard the present request data as the target request data loss related field, and at this time, may also determine that the service field and the system field in the target request data are legal;
optionally, if the service field name and the system field name in the target request data are more than the service field name or the system field name of the target interface in the target database, for example, one more service field name or system field name is added, the present invention may consider that extra service fields or system field names are additionally configured during the request, and at this time, the target request data may be prohibited from being put into the database, and a technician may be prompted to process the service fields of the target request data;
optionally, if it is determined that the service field information in a certain piece of put-in-storage data in the target database is consistent with the service field information of the target request data, that is, the name of each service field in the piece of put-in-storage data is consistent with the target request data, and the field value under each service field name is also consistent, the present invention may determine that the data of the piece of put-in-storage data is consistent with the data of the target request data, that is, put-in data identical to the target request data is stored in the target database, and at this time, the present invention may prohibit putting in storage the target request data, so as to avoid meaningless consumption of storage resources.
And S105, determining whether the target request data has the warehousing permission or not based on the consistency comparison result.
Specifically, the method and the device can determine that the target request data has the warehousing permission when the service field and the system field in the target request data are legal and the same warehoused data as the target request data are not stored in the target database.
Optionally, in other data processing methods proposed in this embodiment, the method may further include:
and when the target request data is determined to have the warehousing right, performing warehousing operation on the target request data to generate a corresponding interface test case.
Specifically, the method and the device can lead the target request data into the target database for storage when the target request data is determined to have the storage right. Then, the invention can generate the corresponding interface test case based on the target request data imported into the target request data.
It should be noted that, the method shown in fig. 1 may be used in the present invention, and the consistency comparison between the service field information and the system field information is performed on the target request data and the put-in-storage data of the target interface in the target database, so as to perform put-in detection on the target request data, and determine whether the target request data has put-in-storage permission. Only when the target request data is determined to have the warehousing right, warehousing operation is carried out on the target request data, and a corresponding interface test case can be generated based on the warehoused target request data; and when the target request data is determined not to have the warehousing right, the target request data is forbidden to be subjected to warehousing operation, so that unnecessary resource consumption is avoided.
It should be further noted that, according to the method shown in fig. 1, the present invention can determine whether to perform the warehousing operation on the request data of the target interface, and does not need to manually determine whether to perform the warehousing operation, so that the consumption of human resources can be effectively reduced, and the processing efficiency can be effectively improved.
The data processing method provided by the embodiment can obtain target request data to be subjected to warehousing detection; the target request data is interface request data of a target interface, service field information and system field information of the target interface are stored in the target request data, the service field information comprises at least one service field name and a corresponding field value, and the system field information comprises at least one system field name; determining whether at least one piece of put-in-storage data of a target interface exists in a target database, and if so, respectively obtaining service field information and system field information from each put-in-storage data of the target interface; the business field names and the system field names in the data which are put into the database of the same interface are consistent; carrying out field name consistency comparison and field value consistency comparison on each put-in-storage data of the target interface and target request data to obtain a consistency comparison result; and determining whether the target request data has the warehousing authority or not based on the consistency comparison result. The invention can carry out the consistency comparison of the business field information between the target request data and the put-in-storage data of the target interface in the target database, thereby carrying out the put-in detection on the target request data and determining whether the target request data has the put-in-storage authority. Only when the target request data is determined to have the warehousing right, performing warehousing operation on the target request data, and generating a corresponding interface test case based on the warehoused target request data; and when the target request data is determined not to have the warehousing right, the target request data is forbidden to be subjected to warehousing operation, so that unnecessary resource consumption is avoided. The invention can determine whether the storage operation is required to be carried out on the request data of the target interface or not, and does not need to manually determine whether the storage operation is required or not, thereby effectively reducing the consumption of human resources and effectively improving the processing efficiency.
Based on fig. 1, the present embodiment proposes a second data processing method as shown in fig. 2. In the method, the consistency comparison result includes a first comparison result and a second comparison result; step S104 may include:
s201, performing consistency comparison of business field names and system field names on each input data of a target interface and target request data to obtain a first comparison result;
s202, carrying out consistency comparison of service field values on each put-in-storage data of the target interface and the target request data to obtain a second comparison result.
It should be noted that the service field affects the service data returned by the interface, and the system field does not. Therefore, when the field value consistency comparison is carried out on the target request data of the target interface and each put-in data, the consistency comparison of the service field value can be carried out only without carrying out the consistency comparison of the system field value, the put-in detection efficiency is improved, and the consumption of detection resources is reduced.
Optionally, in another data processing method provided in this embodiment, the performing consistency comparison on service field values of the data put into storage and the target request data at the target interface to obtain a second comparison result includes:
for any business field information in the input data of the target interface: comparing the service field information with the service field information in the target request data to obtain a third comparison result, wherein the field value under each service field name is compared with the service field information in the target request data;
and determining each third comparison result as a second comparison result.
Specifically, when comparing one piece of put-in data of the target interface with the target request data, if the field value under any service field in the piece of put-in data is the same as the field value under the corresponding service field in the target request number, the method can determine that the service field value in the piece of put-in data is consistent with the service field value in the target request data, and can determine that the data of the piece of put-in data is the same as the data of the target request data; if the field value under at least one service field exists in the input data and is different from the field value under the corresponding service field in the target request data, the invention can determine that the input data is different from the target request data.
Optionally, as shown in fig. 2, in the second data processing method, step S105 may include:
s203, when at least one third comparison result is consistent, determining that the target request data does not have the warehousing permission;
and S204, when the first comparison result is consistent and the third comparison results are inconsistent, determining that the target request data has the warehousing permission.
Specifically, if at least one third comparison result is consistent, the method and the device can determine that the target database stores the warehoused data which is the same as the target request data, and at the moment, the method and the device can determine that the target request data does not have warehousing authority in order to avoid unnecessary resource consumption, and forbid warehousing operation on the target request data;
specifically, if the first comparison result is consistent and all the third comparison results are inconsistent, the method and the device can determine that the service field and the system field in the target request data are legal, and can determine that the warehoused data identical to the target request data is not stored in the target database.
It should be noted that the invention can effectively ensure the realization of warehousing detection, further improve the warehousing detection efficiency and reduce the consumption of detection resources.
According to the data processing method provided by the embodiment of the invention, the realization of the warehousing detection can be effectively guaranteed, the warehousing detection efficiency is further improved, and the consumption of detection resources is reduced.
Based on fig. 2, the present embodiment proposes a third data processing method as shown in fig. 3. In the method, the business field names and the system field names of all the interfaces are predefined in a target database, and the business field names and the system field names in the data which are put in storage of all the interfaces are the predefined business field names and system field names. Step S201 may include:
s301, determining a service field name and a system field name of a target interface, wherein the service field name and the system field name are marked in advance;
specifically, the present invention may pre-tag the service field names and system field names of each interface in the field configuration page of the interface according to a defined tagging manner, that is, the service field names and system field names are identified in all the field names of the interfaces, and the tagged service field names and system field names of each interface are stored in the target database, so that the consistency comparison between the service field names and system field names can be performed when the target request data is subjected to the storage detection.
S302, the service field name and the system field name of the determined target interface, which are marked in advance, are compared with the service field name and the system field name in the target request data in a consistent manner, and a first comparison result is obtained.
Specifically, after the business field names and the system field names of the labeled target interface are found, the business field names of the labeled target interface and the business field names in the target request data are compared in consistency, and the system field names of the labeled target interface and the system field names in the target request data are compared in consistency.
Specifically, the first comparison result may be consistent; at this time, the invention can determine that the service field and the system field in the target request data are legal fields;
specifically, the first comparison result may be that the service field name in the target request data is less than the service field name of the pre-labeled target interface, or that the system field name in the target request data is less than the system field name of the pre-labeled target interface; at this time, the present invention can consider that some service fields or system fields are lost in the request, and can still determine that the service fields and the system fields in the target request data are legal fields;
specifically, the first comparison result may be a service field name of a pre-labeled service field name of a service field name redundant target interface in the target request data, or a pre-labeled system field name of a system field name redundant target interface in the target request data; at this time, the present invention may consider that the request is additionally configured with redundant service fields or system fields, and determine that the service fields or system fields in the target request data are illegal fields, so as to prompt a technician to perform corresponding processing on the target request data.
It should be noted that, according to the method shown in fig. 3, the implementation of the warehousing detection can be effectively guaranteed, and the improvement of the warehousing efficiency is further guaranteed.
The data processing method provided by the embodiment can effectively guarantee the realization of the warehousing detection and further guarantee the improvement of the warehousing efficiency.
Based on fig. 1, the present embodiment proposes a fourth data processing method. After step S101, the method may further include:
s401, searching in-storage marking information of a target interface in a target database; the target database also comprises warehousing marking information of at least one interface, and the warehousing marking information comprises corresponding warehousing marking fields, field type identifiers and field values;
the warehousing marking information can be field information which is labeled in advance in a target database and used for determining whether the interface has warehousing permission.
The field type identifier may identify a field type to which the current field belongs, that is, may be used to identify that the current field is a traffic field or a non-traffic field.
It should be noted that the warehousing marking field may be a non-business field. Specifically, the warehousing marking field may be a field configured by a technician for different interfaces, and a field value thereof may also be set by the technician according to an actual situation.
Optionally, the warehousing marking field includes: a warehousing field, an import Yapi system field and/or an interface marking field.
Specifically, the entry field may be a field for detecting whether the interface has an automatic entry authority. It should be noted that the entry field may be formed by at least one of letters, numbers and characters, such as isAuto.
Specifically, the Yapi entry system field may be a field used to detect whether the interface has an automatic Yapi entry system authority.
Specifically, the interface marking field may be used to detect whether a marked service field of the interface is stored in the target database. The interface marking field may be formed of at least one of letters, numbers and characters, such as isMark. It should be noted that, when the marked service field of the interface is not stored in the target database, the present invention may determine that the request data of the interface does not have the warehousing right.
S402, determining whether the target request data has the warehousing authority or not based on the searched warehousing marking information of the target interface.
Specifically, the invention can respectively determine whether the field value in each warehousing marking information accords with the warehousing condition after searching out each warehousing marking information of the target interface. When at least one field value in each warehousing marking information does not accord with the warehousing condition, the method can determine that the target request data does not have the warehousing permission.
Optionally, the step S402 may include:
and if the field value of the warehousing field is the automatic warehousing identification value, the field value of the field entering the Yapi system is the Yapi identification value and the field value of the interface marking field is the marked identification value in the searched warehousing marking information of the target interface, determining that the target request data has warehousing permission.
The field value of the warehousing field may include an automatic warehousing identification value and a warehousing prohibition identification value, for example, the automatic warehousing identification value may be 1, and the warehousing prohibition identification value may be 0;
the field value of the Yapi system entry field may include a Yapi entry identification value and a Yapi entry prohibition identification value, for example, the Yapi entry identification value may be 1, and the Yapi entry prohibition identification value may be 0.
The field value of the interface marking field may include a marked identification value and an unmarked identification value, for example, the marked identification value may be 1, and the unmarked identification value may be 0.
Specifically, the method can determine that the target request data has the warehousing permission only when the field value of the warehousing field is the automatic warehousing identification value, the field value of the input Yapi system field is the input Yapi identification value, and the field value of the interface marking field is the marked identification value, for example, only when the field value of the warehousing field is 1, the field value of the input Yapi system field is 1, and the field value of the interface marking field is 1.
It should be noted that, through steps S401 and S402, on the basis of the warehousing detection shown in fig. 1, a warehousing detection mode for performing warehousing detection on the target request data based on the warehousing marking information is added, so that the effectiveness and the detection efficiency of the warehousing detection can be further ensured, and the warehousing efficiency of the target request data is improved.
It should be noted that, only when it is determined in steps S402 and S105 that the target request data has the warehousing right, it is determined that the target request data has the final warehousing right, and the target request data can be subjected to the warehousing operation. If it is determined in step S402 or S105 that the target request data does not have the warehousing authority, it may be determined that the target request data does not have the final warehousing authority, and the warehousing operation of the target request data is prohibited.
Optionally, the present invention may execute steps S401 and S402 before step S102, at this time, if it is determined in step S402 that the target request data does not have the warehousing authority, the present invention may prohibit step S102 from being executed again, so as to avoid unnecessary resource consumption;
optionally, the present invention may further perform steps S401 and S402 after step S105, at this time, if it is determined in step S105 that the target request data does not have the warehousing authority, the present invention may prohibit performing steps S401 and S402 again, so as to avoid unnecessary resource consumption.
The data processing method provided by the embodiment adds a warehousing detection mode for performing warehousing detection on the target request data based on the warehousing marking information, and can further guarantee the effectiveness and the detection efficiency of the warehousing detection, so that the warehousing efficiency of the target request data is improved.
Corresponding to the method shown in fig. 1, the present embodiment proposes a data processing apparatus as shown in fig. 4. The apparatus may include: a first obtaining unit 101, a first determining unit 102, a second obtaining unit 103, a first comparing unit 104, a third obtaining unit 105, and a second determining unit 106; wherein:
a first obtaining unit 101, configured to obtain target request data to be subjected to warehousing detection; the target request data is interface request data of a target interface, service field information and system field information of the target interface are stored in the target request data, the service field information comprises at least one service field name and a corresponding field value, and the system field information comprises at least one system field name;
a first determining unit 102, configured to determine whether at least one piece of binned data of a target interface exists in a target database, and if so, trigger a second obtaining unit 103;
a second obtaining unit 103, configured to obtain service field information and system field information from each warehoused data of the target interface; the business field names and the system field names in the data which are put into the database of the same interface are consistent;
a first comparing unit 104, configured to perform field name consistency comparison and field value consistency comparison on each of the warehoused data and the target request data of the target interface;
a third obtaining unit 105 for obtaining a consistency comparison result;
and a second determining unit 106, configured to determine whether the target request data has a warehousing right based on the consistency comparison result.
It should be noted that, for the specific processing procedures of the first obtaining unit 101, the first determining unit 102, the second obtaining unit 103, the first comparing unit 104, the third obtaining unit 105, and the second determining unit 106 and the technical effects brought by the processing procedures, reference may be made to the relevant description of steps S101 to S105 in the method shown in fig. 1 in this embodiment, and details are not repeated here.
Optionally, the consistency comparison result includes a first comparison result and a second comparison result; the first comparison unit 104 includes: a second comparing unit and a third comparing unit; the third obtaining unit 105 includes: a fourth obtaining unit and a fifth obtaining unit;
the second comparison unit is used for performing consistency comparison of the business field names and the system field names on each data put into storage of the target interface and the target request data;
a fourth obtaining unit configured to obtain a first comparison result;
the third comparison unit is used for carrying out consistency comparison of service field values on each data put into storage of the target interface and the target request data;
a fifth obtaining unit, configured to obtain a second comparison result.
Optionally, the target database is predefined with a service field name and a system field name of each interface, and the service field name and the system field name in the data put in storage of each interface are predefined service field names and system field names.
Optionally, the second comparing unit is configured to determine, from the target database, a service field name and a system field name of the target interface, where the label is printed in advance;
and comparing the service field name and the system field name of the determined target interface with the service field name and the system field name in the target request data in a consistent manner.
Optionally, the third comparing unit is configured to, for any service field information in the binned data of the target interface: comparing the service field information with the service field information in the target request data to obtain a third comparison result, wherein the field value under each service field name is compared with the service field information in the target request data;
a fifth obtaining unit configured to determine each third comparison result as the second comparison result.
Optionally, the second determining unit 106 includes: a third determination unit and a fourth determination unit; wherein:
the third determining unit is used for determining that the target request data does not have the warehousing permission when at least one third comparison result is consistent;
and the fourth determining unit is used for determining that the target request data has the warehousing permission when the first comparison result is consistent and the third comparison results are inconsistent.
Optionally, the apparatus further comprises: a warehousing operation unit and a generation unit;
the warehousing operation unit is used for performing warehousing operation on the target request data when the target request data is determined to have the warehousing right;
and the generating unit is used for generating a corresponding interface test case.
Optionally, the apparatus further comprises: a searching unit and a fifth determining unit;
the searching unit is used for searching the warehousing marking information of the target interface in the target database; the target database also comprises warehousing marking information of at least one interface, and the warehousing marking information comprises corresponding warehousing marking fields, field type identifiers and field values;
and the fifth determining unit is used for determining whether the target request data has the warehousing permission or not based on the searched warehousing marking information of the target interface.
Optionally, the warehousing marking field includes: a warehousing field, a Yapi system entering field and/or an interface marking field; when the warehousing marking field comprises a warehousing field, an input Yapi system field and an interface marking field, the fifth determining unit is used for:
and if the field value of the warehousing field is the automatic warehousing identification value, the field value of the field entering the Yapi system is the Yapi identification value and the field value of the interface marking field is the marked identification value in the searched warehousing marking information of the target interface, determining that the target request data has warehousing permission.
The data processing device provided by the embodiment can obtain target request data to be subjected to warehousing detection; the target request data is interface request data of a target interface, service field information and system field information of the target interface are stored in the target request data, the service field information comprises at least one service field name and a corresponding field value, and the system field information comprises at least one system field name; determining whether at least one piece of put-in data of a target interface exists in a target database, and if so, respectively obtaining service field information and system field information from each piece of put-in data of the target interface; the business field names and the system field names in the data which are put into the database of the same interface are consistent; carrying out field name consistency comparison and field value consistency comparison on each put-in-storage data of the target interface and target request data to obtain a consistency comparison result; and determining whether the target request data has the warehousing authority or not based on the consistency comparison result. The invention can carry out the consistency comparison of the business field information between the target request data and the put-in-storage data of the target interface in the target database, thereby carrying out the put-in detection on the target request data and determining whether the target request data has the put-in-storage authority. Only when the target request data is determined to have the warehousing right, performing warehousing operation on the target request data, and generating a corresponding interface test case based on the warehoused target request data; and when the target request data is determined not to have the warehousing right, the target request data is forbidden to be subjected to warehousing operation, so that unnecessary resource consumption is avoided. The invention can determine whether the storage operation is required to be carried out on the request data of the target interface or not, and does not need to manually determine whether the storage operation is required or not, thereby effectively reducing the consumption of human resources and effectively improving the processing efficiency.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims (10)
1. A data processing method, characterized in that the data processing method comprises:
obtaining target request data to be subjected to warehousing detection; the target request data is interface request data of a target interface, service field information and system field information of the target interface are stored in the target request data, the service field information comprises at least one service field name and a corresponding field value, and the system field information comprises at least one system field name;
determining whether at least one piece of put-in data of the target interface exists in a target database, and if so, respectively obtaining service field information and system field information from each piece of put-in data of the target interface; the business field names and the system field names in the data which are put into the database of the same interface are consistent;
carrying out field name consistency comparison on each put-in-storage data of the target interface and the target request data and carrying out field value consistency comparison to obtain a consistency comparison result;
and determining whether the target request data has the warehousing permission or not based on the consistency comparison result.
2. The data processing method of claim 1, wherein the consistency comparison result comprises a first comparison result and a second comparison result; the performing field name consistency comparison and field value consistency comparison on each put-in-storage data of the target interface and the target request data to obtain consistency comparison results includes:
performing consistency comparison of service field names and system field names on the data which are put into the database of the target interface and the target request data to obtain the first comparison result;
and performing consistency comparison of service field values on each put-in-storage data of the target interface and the target request data to obtain a second comparison result.
3. The data processing method of claim 2, wherein the service field name and the system field name of each interface are predefined in the target database, and the service field name and the system field name in the binned data of each interface are predefined service field names and system field names.
4. The data processing method according to claim 3, wherein the performing consistency comparison between service field names and system field names on each of the warehoused data of the target interface and the target request data to obtain the first comparison result comprises:
determining a pre-tagged service field name and a system field name of the target interface from the target database;
and performing consistency comparison on the determined service field name and system field name of the target interface, which are marked in advance, and the service field name and system field name in the target request data to obtain the first comparison result.
5. The data processing method according to claim 2, wherein the performing consistency comparison of service field values on each put-in data of the target interface and the target request data to obtain the second comparison result includes:
for the service field information in any one of the warehoused data of the target interface: comparing the service field information with the service field information in the target request data to obtain a third comparison result, wherein the field value under each service field name is compared with the service field information in the target request data;
determining each of the third comparison results as the second comparison result.
6. The data processing method of claim 5, wherein the determining whether the target request data has warehousing permission based on the consistency comparison result comprises:
when at least one third comparison result is consistent, determining that the target request data does not have the warehousing permission;
and when the first comparison result is consistent and the third comparison results are inconsistent, determining that the target request data has the warehousing permission.
7. The data processing method of claim 1, wherein the method further comprises:
and when the target request data is determined to have the warehousing right, performing warehousing operation on the target request data to generate a corresponding interface test case.
8. The data processing method according to claim 1, wherein after the obtaining target request data to be subjected to warehousing detection, the method further comprises:
searching the warehousing marking information of the target interface in the target database; the target database also comprises warehousing marking information of at least one interface, and the warehousing marking information comprises corresponding warehousing marking fields, field type identifiers and field values;
and determining whether the target request data has the warehousing authority or not based on the searched warehousing marking information of the target interface.
9. The data processing method of claim 8, wherein the warehousing marking field comprises: a warehousing field, a Yapi system field and/or an interface marking field; when the warehousing marking field comprises a warehousing field, an input Yapi system field and an interface marking field, determining whether the target request data has warehousing permission or not based on the searched warehousing marking information of the target interface, wherein the steps comprise:
and if the field value of the warehousing field is an automatic warehousing identification value, the field value of the Yapi system entering field is a Yapi identification value, and the field value of the interface marking field is a marked identification value in the searched warehousing marking information of the target interface, determining that the target request data has warehousing permission.
10. A data processing apparatus, comprising: the device comprises a first obtaining unit, a first determining unit, a second obtaining unit, a first comparing unit, a third obtaining unit and a second determining unit; wherein:
the first obtaining unit is used for obtaining target request data to be subjected to warehousing detection; the target request data is interface request data of a target interface, service field information and system field information of the target interface are stored in the target request data, the service field information comprises at least one service field name and a corresponding field value, and the system field information comprises at least one system field name;
the first determining unit is used for determining whether at least one piece of warehoused data of the target interface exists in a target database, and if yes, the second obtaining unit is triggered;
the second obtaining unit is configured to obtain service field information and system field information from each piece of data already put into storage in the target interface; the business field names and the system field names in the data which are put into the database of the same interface are consistent;
the first comparing unit is used for performing field name consistency comparison and field value consistency comparison on each input data of the target interface and the target request data;
the third obtaining unit is used for obtaining a consistency comparison result;
and the second determining unit is used for determining whether the target request data has the warehousing permission or not based on the consistency comparison result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210539514.9A CN114911857A (en) | 2022-05-18 | 2022-05-18 | Data processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210539514.9A CN114911857A (en) | 2022-05-18 | 2022-05-18 | Data processing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114911857A true CN114911857A (en) | 2022-08-16 |
Family
ID=82769669
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210539514.9A Pending CN114911857A (en) | 2022-05-18 | 2022-05-18 | Data processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114911857A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117009998A (en) * | 2023-08-29 | 2023-11-07 | 上海倍通医药科技咨询有限公司 | Data inspection method and system |
-
2022
- 2022-05-18 CN CN202210539514.9A patent/CN114911857A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117009998A (en) * | 2023-08-29 | 2023-11-07 | 上海倍通医药科技咨询有限公司 | Data inspection method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7945563B2 (en) | Search early warning | |
CN108427731B (en) | Page code processing method and device, terminal equipment and medium | |
US11182544B2 (en) | User interface for contextual document recognition | |
CN110389941B (en) | Database checking method, device, equipment and storage medium | |
CN113282498B (en) | Method, device, equipment and storage medium for generating test cases | |
CN111026663B (en) | Software defect detection method, device, computer equipment and storage medium | |
CN108664471A (en) | Text region error correction method, device, equipment and computer readable storage medium | |
CN114911857A (en) | Data processing method and device | |
CN111581076A (en) | System code testing method and device, computer equipment and storage medium | |
US20080022263A1 (en) | Identifying The Origin Of Application Resources | |
CN107704529A (en) | The recognition methods of information uniqueness, application server, system and storage medium | |
US20120151581A1 (en) | Method and system for information property management | |
CN110706035B (en) | Updating effect evaluation method and device, storage medium and electronic equipment | |
CN112822200A (en) | Internet of things data security protection method and device and server | |
CN111191235A (en) | Suspicious file analysis method and device and computer readable storage medium | |
CN103593273B (en) | Method, device and system for testing circuit board card | |
CN115618350A (en) | Industrial control asset vulnerability detection method, equipment, storage medium and device | |
CN115186240A (en) | Social network user alignment method, device and medium based on relevance information | |
CN113988176B (en) | Sample labeling method and device | |
CN112507389A (en) | Webpage data processing method and device | |
CN111125567A (en) | Equipment marking method and device, electronic equipment and storage medium | |
CN111444392A (en) | Method, device and equipment for accessing cave library | |
CN113360522A (en) | Method and device for quickly identifying sensitive data | |
CN116881930B (en) | Analysis method and device for SQL injection loopholes based on ORM framework | |
CN113609352B (en) | Character string retrieval method, device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |