CN115840677A - Data verification method, device, equipment and storage medium - Google Patents

Data verification method, device, equipment and storage medium Download PDF

Info

Publication number
CN115840677A
CN115840677A CN202211611377.1A CN202211611377A CN115840677A CN 115840677 A CN115840677 A CN 115840677A CN 202211611377 A CN202211611377 A CN 202211611377A CN 115840677 A CN115840677 A CN 115840677A
Authority
CN
China
Prior art keywords
target
verification
data
expression
request data
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
CN202211611377.1A
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.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information 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 Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202211611377.1A priority Critical patent/CN115840677A/en
Publication of CN115840677A publication Critical patent/CN115840677A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a data verification method, a data verification device, data verification equipment and a storage medium. The method comprises the following steps: acquiring target request data to be sent of a target service interface, wherein the target request data comprises target service object identification information; calling a target service interface to send target request data and acquiring target response data corresponding to a target service object returned by the target service interface; acquiring a target verification expression corresponding to a target business object, wherein the target verification expression is obtained by carrying out logic operation configuration on the basis of actual response data corresponding to the target business object; and performing service logic verification on the target response data based on the target verification expression to obtain a target verification result corresponding to the target service object. By the technical scheme of the embodiment of the invention, the service logic can be verified on the response data of the service interface, so that the abnormal condition of the service logic can be found in time, and the accuracy of the response data of the service interface is further ensured.

Description

Data verification method, device, equipment and storage medium
Technical Field
Embodiments of the present invention relate to computer technologies, and in particular, to a data verification method, apparatus, device, and storage medium.
Background
With the rapid development of computer technology, more and more application software is developed. In the process of using the application software, the effectiveness and accuracy of the display data obtained by calling the back-end interface seriously affect the user experience, so that the service providing the interface needs to be monitored, and the accuracy of the display data is ensured.
Currently, it is common to monitor the abnormal conditions of hardware such as CPU (Central Processing Unit) occupancy rate and memory occupancy rate of an application host, or monitor the abnormal conditions of TPS (Transaction Per Second, number of messages processed Per Second) when an application runs, and the minimum time consumption TP99 and abnormal rate required by meeting 99% of network requests by using a way such as embedding points.
However, in the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
the existing method only monitors indexes such as TPS, TP99 and the like of a host machine of an application or an application class to determine whether a service interface is abnormal. However, when the service logic of the service interface is abnormal, such as data part missing, data display error or data not meeting the specification, the states of the host of the application and the application index are normal, and the abnormal condition of the service logic cannot be sensed, so that the accuracy of the service interface responding to the data cannot be effectively ensured.
Disclosure of Invention
The embodiment of the invention provides a data verification method, a data verification device, data verification equipment and a storage medium, which are used for verifying service logic of response data of a service interface so as to find abnormal conditions of the service logic in time and further ensure the accuracy of the response data of the service interface.
In a first aspect, an embodiment of the present invention provides a data verification method, including:
acquiring target request data to be sent by a target service interface, wherein the target request data comprises: target business object identification information corresponding to the target business object;
calling the target service interface to send the target request data and obtaining target response data corresponding to the target service object returned by the target service interface;
acquiring a target verification expression corresponding to the target business object, wherein the target verification expression is obtained by performing logic operation configuration on actual response data corresponding to the target business object;
and performing service logic verification on the target response data based on the target verification expression to obtain a target verification result corresponding to the target service object.
In a second aspect, an embodiment of the present invention further provides a data verification apparatus, including:
a target request data obtaining module, configured to obtain target request data to be sent by a target service interface, where the target request data includes: target business object identification information corresponding to the target business object;
a target response data obtaining module, configured to call the target service interface to send the target request data, and obtain target response data corresponding to the target service object returned by the target service interface;
a target verification expression obtaining module, configured to obtain a target verification expression corresponding to the target service object, where the target verification expression is obtained by performing logic operation configuration based on actual response data corresponding to the target service object;
and the data verification module is used for performing service logic verification on the target response data based on the target verification expression to obtain a target verification result corresponding to the target service object.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a data validation method as provided by any of the embodiments of the invention.
In a fourth aspect, the embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the data verification method provided in any embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits:
the method comprises the steps of configuring a verification expression corresponding to each service object by performing logic operation on actual response data of each service object in a target service interface in advance, so that the target verification expression corresponding to the target service object can be utilized to perform service logic verification on target response data corresponding to the target service object returned by the target service interface, whether the target response data accords with the service logic is determined, and a target verification result corresponding to the target service object is obtained, thereby realizing the service logic verification on the response data of the service interface, further discovering abnormal conditions of the service logic in time, and further ensuring the accuracy of the service interface response data.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description will be given below of the drawings required for the embodiments or the technical solutions in the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart of a data verification method provided by an embodiment of the invention;
FIG. 2 is a flow diagram of another method for data verification provided by an embodiment of the invention;
FIG. 3 is a flow chart of yet another data verification method provided by an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a data verification apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
It should be noted that, in the technical solution of the present disclosure, the aspects of collecting, updating, analyzing, processing, using, transmitting, storing and the like of the personal information of the related user all conform to the regulations of the relevant laws and regulations, and are used for legal purposes without violating the good customs of the public order. Necessary measures are taken for the personal information of the user, the illegal access to the personal information data of the user is prevented, and the personal information safety, the network safety and the national safety of the user are maintained.
Fig. 1 is a flowchart of a data verification method according to an embodiment of the present invention, which is applicable to a case of performing service logic verification on response data returned by a service interface. The method may be performed by a data verification apparatus, which may be implemented by software and/or hardware, integrated in an electronic device. As shown in fig. 1, the method specifically includes the following steps:
s110, target request data to be sent by a target service interface are obtained, wherein the target request data comprise: and target business object identification information corresponding to the target business object.
The target service interface may be any backend service interface that needs to be monitored, so that application data in the backend server can be obtained by calling the target service interface. For example, the target traffic interface may refer to a remote invocation interface such as an HTTP interface or a TCP interface. The target request data may refer to request data to which the target service interface may respond. The target business object may refer to a business object to which the target business interface can respond, such as a commodity, a user, and the like. For example, if the target business interface is an interface for querying user order information, the target business object may refer to any user registered in the target business interface, so as to query out the order information of the specified user. The target business object identification information may be information for uniquely identifying the business object so as to distinguish different business objects. The target request data may include other request parameter information besides the target service object identification information, which may be specifically determined based on the service function of the target service interface.
Specifically, data verification of the target service interface may be performed in an actually used application client, or may be performed in an operation console of a simulation test, so that various target request data can be simulated, and further, comprehensive service logic verification is performed on the target service interface. For example, the application client may generate target request data to be sent by the target service interface based on the target service object identification information.
And S120, calling the target service interface to send target request data and acquiring target response data corresponding to the target service object returned by the target service interface.
Specifically, the application client may send the target request data to the back-end server by calling the target service interface, and the back-end server may perform response processing on the target request data based on the service logic of the target service interface to obtain target response data matched with the target service object, and return the target response data through the target service interface, so that the application client may obtain the target response data of the target service object.
S130, obtaining a target verification expression corresponding to the target business object, wherein the target verification expression is obtained by performing logic operation configuration on the basis of actual response data corresponding to the target business object.
Wherein, the actual response data may refer to real response data conforming to the business logic. And storing the actual response data of each business object corresponding to the target business interface in the back-end server. The target verification expression may refer to a verification expression corresponding to the target business object. The number of target verification expressions may be one or more, and the specific number thereof may be determined based on the actual business logic. The different target verification expressions can verify whether the returned response parameter information conforms to the specification and the accuracy of the interface business logic from different dimensions.
For example, each target verification expression may include: at least one logical operator for performing a logical operation on the response parameter information. Wherein logical operators may include, but are not limited to: greater than, greater than or equal to, less than or equal to, or not equal to. For example, if the actual response parameter information corresponding to the target business object is sex male, then "sex equals male" may be used as one target verification expression.
Specifically, the actual response data of each service object, which can be responded by the target response interface, may be subjected to logic operation in advance, and a verification expression corresponding to each service object is configured. The embodiment may configure the verification Expression by using an Expression Language that is dynamically executable by the application program, such as mvvel (MVFLEX Expression Language), so as to improve data verification efficiency. The Mvel is a dynamic or static embeddable expression language, provides a runtime language for a Java platform, and provides convenient and flexible dynamics for a JAVA language. MVELs can be like regular expressions, with operators that directly support sets, arrays, strings, etc.
In the actual verification process, a target verification expression corresponding to a target service object configured in advance can be obtained. It should be noted that, when the service logic of the target service interface changes, the target verification expression may be dynamically updated, so that the new service logic is verified based on the updated target verification expression, thereby achieving a monitoring target that continuously adapts to the change of the service logic, and further improving convenience and efficiency of data verification.
S140, based on the target verification expression, performing service logic verification on the target response data to obtain a target verification result corresponding to the target service object.
Specifically, whether the service logic of the target service interface is accurate or not can be verified by detecting whether the target response data satisfies each target verification expression. For example, verifying the content may include: whether the interface calls correctly or not, whether the return code of the interface is correct or not, whether a certain response parameter in the return result conforms to the type set in the expression or not, whether a certain response parameter conforms to a specific interval or not, whether the number of a certain set conforms to or is greater than a specific numerical value or not, whether a specific response parameter value is contained in the set or not, and the like. Whether the response service logic of the target service interface is abnormal or not can be comprehensively verified by utilizing different target verification expressions, so that the abnormal condition of the service logic can be timely found, and the accuracy of the service interface response data is further ensured.
Exemplarily, S140 may include: detecting whether a response parameter return value in the target response data meets each target verification expression or not; and if at least one unsatisfied target verification expression exists, determining that a target verification result corresponding to the target business object is an abnormal result.
Specifically, whether a response parameter return value in the target response data meets each target verification expression is detected, and if the response parameter return value which does not meet the target verification expression exists in the target response data, a target verification result corresponding to the target service object can be determined to be an abnormal result. For example, all target verification expressions in preset configuration may be executed according to target response data returned by the target service interface, if an execution failure condition is found in the process of executing the expressions, the target verification result may be determined to be an abnormal result, the target verification expressions with execution failure and corresponding response parameter return values may be recorded, and the target verification result may be written into the database for subsequent query and analysis.
It should be noted that, the target service interface may be periodically verified by using request data of different service objects, so as to monitor the service logic validity of the interface from multiple angles. The service logic verification of each service interface may be implemented by informing the execution of steps S110-S140. The more detailed the request data and the verification expression are, the more the verification expression can verify whether the returned data of different interfaces conform to the service logic, so that the problems which cannot be discovered by the conventional white-box monitoring are discovered, such as partial missing of response data, error in data display, non-compliance of data and the like, and the blind area of the conventional white-box monitoring is effectively filled.
According to the technical scheme of the embodiment, the verification expression corresponding to each business object is configured by performing logic operation on actual response data of each business object in the target business interface in advance, so that the target verification expression corresponding to the target business object can be utilized to perform business logic verification on the target response data corresponding to the target business object returned by the target business interface, whether the target response data accords with the business logic is determined, and a target verification result corresponding to the target business object is obtained, so that the business logic verification on the response data of the business interface is realized, the abnormal condition of the business logic can be timely found, and the accuracy of the business interface response data is further ensured.
On the basis of the above technical solution, the target verification expression may include at least one first verification expression and/or at least one second verification expression. The first verification expression may be an expression used for verifying a general response parameter corresponding to the target business object. The second verification expression may be an expression for verifying a unique response parameter corresponding to the target business object.
The general response parameter may be a response parameter commonly used by the service interface. For example, the universal response parameter may refer to gender, identification number, phone number, percentage, amount, date, and the like. The first verification expression may refer to an expression that may be common to different service interfaces. The specific response parameter may refer to a non-generic response parameter, that is, a response parameter specifically existing in the target service interface, so as to verify whether the response parameter meets a certain specific condition, for example, whether a certain response parameter meets a positive integer characteristic between 1 and 15 is determined, which is part of flexibility. The first verification expression may refer to a custom expression set for different business interfaces. Different business interfaces can set up multiple custom expressions to characteristically verify compliance with relevant business logic characteristics.
Illustratively, performing logical operation configuration based on actual response data corresponding to the target business object to obtain the target verification expression may include: displaying general response parameter actual information and specific response parameter actual information in actual response data corresponding to the target business object; determining a first verification expression corresponding to the target business object based on an expression selection operation triggered by the user aiming at the actual information of the general response parameter; and determining a second verification expression corresponding to the target business object based on the expression input operation triggered by the user aiming at the actual information of the special response parameter.
Specifically, the general response parameter actual information and the specific response parameter actual information in the actual response data corresponding to the target business object may be displayed, so that the user may directly select a matched expression from the preset general expressions based on the displayed general response parameter actual information, and the expression selected by the user is used as the first verification expression corresponding to the target business object, thereby configuring the first verification expression more conveniently. The user can input the expression matched with the displayed special response parameter actual information in a self-defined manner, so that a second verification expression corresponding to the target business object is obtained, and further, more flexible verification requirements can be provided. Whether the returned response data conforms to the business logic characteristics can be more accurately verified by using the first verification expression and the second verification expression.
For example, if the target service interface Y _001 is used to return the user's registration and usage information such as the user's gender, identification number, registration time (first time of service function usage), order quantity, and order details to the user side. The actual response data of the two service objects corresponding to the target service interface are assumed as follows:
1. user a _001, gender male, identification number: 130xxxxxxxxxxx0011, order quantity 2, registration time 1 month 1 day 2020, where 1 order is in a completed state.
2. User a _002, gender woman, identification number: 130xxxxxxxxxxx3587, order quantity 5, registration time of 8 months and 5 days 2020, with 3 orders being completed and 1 order being refunded.
It should be noted that, in an alternative embodiment, the user a _001 and the user a _002 may be virtual users specifically set for service logic verification, and information of the virtual users may be flexibly set according to verification requirements.
The first verification expression configured for the first service object (user a _ 001) in the target service interface Y _001 is as follows: the interface return code is equal to the normal return code, the gender return value is equal to the male gender return value, and the ID card return value meets the ID card specification; the second verification expression is: the registration time return value is greater than or equal to 1 month and 1 day in 2019, and the order quantity return value is greater than or equal to 2. Wherein, 1 month and 1 day in 2019 refers to the service development time. By setting the order quantity return value to be greater than or equal to 2, the verification expression does not need to be modified again after the order quantity actual value in the actual response data is increased, the manpower success is saved, and the verification efficiency is improved.
The first verification expression configured for the second service object (user a _ 002) in the target service interface Y _001 is as follows: the interface return code is equal to the normal return code, the gender return value is equal to the female, and the ID card return value meets the ID card specification; the second verification expression is: the registration time return value is greater than or equal to 1 month and 1 day 2019, the order quantity return value is greater than or equal to 5, and the refund order quantity return value is greater than or equal to 1. The verification expression can be flexibly and efficiently configured aiming at different business objects, so that the problem of large difference of different business logics is avoided.
On the basis of the above technical solution, after S140, the method may further include: if the target verification result is an abnormal result, acquiring a target abnormal processing mode corresponding to a preset target service interface; and performing exception handling on the target service interface based on the target exception handling mode.
Specifically, the exception handling mode corresponding to each service interface, such as a short message notification mode, a mail notification mode, an instant messaging software notification mode, and the like, may be configured in advance, so that dynamic configuration of the exception handling mode may be implemented. When the target verification result is an abnormal result, the target service interface can be subjected to abnormal processing based on a target abnormal processing mode corresponding to the preset target service interface, for example, the abnormal result and corresponding abnormal response data are sent to a designated mailbox in a mail communication mode, so that related personnel can be timely reminded to take intervention attention, whether the target service interface has a problem or not is judged by the related personnel, and the target service interface is subjected to intervention investigation, positioning and solving at the first time. If the target service interface is actually in a problem, the relevant personnel enter a problem solving process, and if the target service interface is in a false alarm, the relevant personnel can change the corresponding expression to avoid the false alarm.
Fig. 2 is a flowchart of another data verification method according to an embodiment of the present invention, and the present embodiment describes in detail a generation manner of target request data based on the foregoing embodiments. Wherein explanations of the same or corresponding terms as those of the above embodiments are omitted.
Referring to fig. 2, another data verification method provided in this embodiment specifically includes the following steps:
s210, a simulation request data set for test verification is obtained, wherein the simulation request data set is generated in advance based on request parameter information of an existing service object corresponding to a target service interface in a simulation mode.
Specifically, because the request data in the application client that is actually used is generated based on the actual operation of the user, the generation frequency or the generation type of the request data cannot be effectively controlled, so that the calling condition of the service interface can be dynamically controlled in an operation console of a simulation test, and the service logic of the service interface can be effectively verified. For example, a target service interface to be monitored and request parameter information of an existing service object corresponding to the target service interface may be preconfigured in the operation console, and a simulation request data set corresponding to the target service interface is generated based on the request parameter information of the existing service object in a simulation manner. Different simulation request data in the simulation request data set can correspond to different verification dimensions so as to comprehensively or monitor and verify important business logic.
S220, taking each simulation request data in the simulation request data set as target request data to be sent by the target service interface one by one.
Specifically, each simulation request data in the simulation request data set can be used as target request data to be sent by the target service interface one by one, so that the target service interface can be called to send each simulation request data in the following, and whether the response data of each service object conforms to the service logic can be verified, thereby comprehensively realizing the logic verification of the service interface and further ensuring the accuracy of the verification of the response data of the service interface.
Illustratively, S220 may include: acquiring a target calling verification period corresponding to a preset target service interface; and calling a verification period every other target, and triggering and executing the operation of taking each simulation request data in the simulation request data set as target request data to be sent of a target service interface one by one.
Specifically, a target call verification period corresponding to the target service interface may be configured in the operation console, so that service logic verification of the target service interface may be periodically performed according to the target call verification period. For example, if the target call verification period is executed once every 1 hour, the target service interface is called to send each piece of simulation request data one by one every hour, so that periodic automatic verification can be realized, the service logic of the service interface is ensured to be effective and accurate for a long time, and the abnormal condition of the interface can be found more timely.
And S230, calling the target service interface to send target request data and acquiring target response data corresponding to the target service object returned by the target service interface.
S240, obtaining a target verification expression corresponding to the target business object, wherein the target verification expression is obtained by performing logic operation configuration on the basis of actual response data corresponding to the target business object.
Specifically, the configuration operation of the target verification expression can be performed in the operation console, thereby realizing the dynamic configuration of the verification expression.
And S250, performing service logic verification on the target response data based on the target verification expression to obtain a target verification result corresponding to the target service object.
According to the technical scheme of the embodiment, a simulation request data set corresponding to a target service interface is generated through simulation based on request parameter information of an existing service object corresponding to the target service interface in advance, and each simulation request data in the simulation request data set is used as target request data to be sent by the target service interface one by one, so that the target service interface can be called to send each simulation request data subsequently, whether response data of each service object conform to service logic or not is verified, logic verification of the service interface can be comprehensively achieved, and accuracy of verification of service interface response data is further guaranteed.
Fig. 3 is a flowchart of another data verification method according to an embodiment of the present invention, which is a preferred embodiment. Wherein explanations of the same or corresponding terms as those of the above embodiments are omitted.
Referring to fig. 3, another data verification method provided in this embodiment specifically includes the following steps:
s310, loading a target call verification period corresponding to a target service interface, a simulation request data set, a first verification expression, a second verification expression and a target exception handling mode.
And S320, calling a verification period every target, and executing operation of taking each simulation request data in the simulation request data set as target request data.
S330, calling the target service interface to send target request data and obtaining target response data returned by the target service interface.
S340, executing the first verification expression according to the target response data, and recording failure information when the execution fails.
And S350, executing a second verification expression according to the target response data, and recording failure information when the execution fails.
And S360, detecting whether failure information exists, if so, executing the step S370, and if not, executing the step S320.
And S370, notifying related personnel according to the target exception handling mode.
According to the technical scheme of the embodiment, the target call verification period, the simulation request data set, the first verification expression, the second verification expression and the target exception handling mode corresponding to the target service interface are configured in advance, so that the service logic can be verified on the response data of the service interface periodically, the exception condition of the service logic can be found in time and notified in time, and the accuracy of the response data of the service interface is further ensured.
The following is an embodiment of the data verification apparatus provided in the embodiments of the present invention, and the apparatus and the data verification method of each embodiment belong to the same inventive concept, and details that are not described in detail in the embodiments of the data verification apparatus may refer to the embodiments of the data verification method described above.
Fig. 4 is a schematic structural diagram of a data verification apparatus according to an embodiment of the present invention, which is applicable to data verification of a pre-training model, and is particularly applicable to a fine tuning scenario when a downstream task is a cross-language task such as a translation task. As shown in fig. 4, the apparatus specifically includes: a target request data acquisition module 410, a target response data acquisition module 420, a target verification expression acquisition module 430, and a data verification module 440.
The target request data obtaining module 410 is configured to obtain target request data to be sent by a target service interface, where the target request data includes: target business object identification information corresponding to the target business object; a target response data obtaining module 420, configured to invoke the target service interface to send the target request data, and obtain target response data corresponding to the target service object returned by the target service interface; a target verification expression obtaining module 430, configured to obtain a target verification expression corresponding to the target service object, where the target verification expression is obtained by performing logic operation configuration based on actual response data corresponding to the target service object; and the data verification module 440 is configured to perform service logic verification on the target response data based on the target verification expression, and obtain a target verification result corresponding to the target service object.
According to the technical scheme of the embodiment, the verification expression corresponding to each business object is configured by performing logic operation on actual response data of each business object in the target business interface in advance, so that the target verification expression corresponding to the target business object can be utilized to perform business logic verification on the target response data corresponding to the target business object returned by the target business interface, whether the target response data accords with the business logic is determined, and a target verification result corresponding to the target business object is obtained, so that the business logic verification on the response data of the business interface is realized, the abnormal condition of the business logic can be timely found, and the accuracy of the business interface response data is further ensured.
Optionally, the target request data obtaining module 410 includes:
the simulation request data set acquisition unit is used for acquiring a simulation request data set for test verification, wherein the simulation request data set is generated in advance based on request parameter information of an existing service object corresponding to a target service interface in a simulation manner;
and the target request data acquisition unit is used for taking each simulation request data in the simulation request data set as target request data to be sent by a target service interface one by one.
Optionally, the target request data obtaining unit is specifically configured to:
acquiring a target calling verification period corresponding to the target service interface which is configured in advance; and triggering and executing once operation of taking each simulation request data in the simulation request data set as target request data to be sent by a target service interface one by one every other in the target calling verification period.
Optionally, the target verification expression comprises at least one first verification expression and/or at least one second verification expression;
the first verification expression is an expression used for verifying a general response parameter corresponding to the target business object;
the second verification expression is an expression used for verifying a specific response parameter corresponding to the target business object.
Optionally, the apparatus further comprises:
a verification expression configuration module to: displaying general response parameter actual information and specific response parameter actual information in actual response data corresponding to the target business object; determining a first verification expression corresponding to the target business object based on an expression selection operation triggered by the user aiming at the general response parameter actual information; and determining a second verification expression corresponding to the target business object based on an expression input operation triggered by the user aiming at the actual information of the special response parameter.
Optionally, the data verification module 440 is specifically configured to:
detecting whether a response parameter return value in the target response data meets each target verification expression; and if at least one unsatisfied target verification expression exists, determining that a target verification result corresponding to the target business object is an abnormal result.
Optionally, the apparatus further comprises:
the exception handling module is used for acquiring a target exception handling mode corresponding to the target service interface, which is configured in advance, if the target verification result is an exception result after the target verification result corresponding to the target service object is acquired; and performing exception handling on the target service interface based on the target exception handling mode.
The data verification device provided by the embodiment of the invention can execute the data verification method provided by any embodiment of the invention, and has the corresponding functional module and beneficial effect of executing the data verification method.
It should be noted that, in the embodiment of the data verification apparatus, the included units and modules are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. FIG. 5 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 5 is only an example and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in fig. 5, electronic device 12 is in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination of which may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of embodiments of the invention as described.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with electronic device 12, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 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 the network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, to name a few.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, to implement a data verification method provided by the embodiment of the present invention, the method includes:
acquiring target request data to be sent by a target service interface, wherein the target request data comprises: target business object identification information corresponding to the target business object;
calling the target service interface to send the target request data and obtaining target response data corresponding to the target service object returned by the target service interface;
acquiring a target verification expression corresponding to the target business object, wherein the target verification expression is obtained by performing logic operation configuration on actual response data corresponding to the target business object;
and performing service logic verification on the target response data based on the target verification expression to obtain a target verification result corresponding to the target service object.
Of course, those skilled in the art can understand that the processor can also implement the technical solution of the data verification method provided by any embodiment of the present invention.
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of a data verification method as provided in any of the embodiments of the present invention, the method comprising:
acquiring target request data to be sent by a target service interface, wherein the target request data comprises: target business object identification information corresponding to the target business object;
calling the target service interface to send the target request data and acquiring target response data corresponding to the target service object returned by the target service interface;
acquiring a target verification expression corresponding to the target business object, wherein the target verification expression is obtained by performing logic operation configuration on actual response data corresponding to the target business object;
and performing service logic verification on the target response data based on the target verification expression to obtain a target verification result corresponding to the target service object.
Computer storage media for embodiments of the present invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-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 computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer 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 computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, 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's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It will be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general purpose computing device, they can be centralized in a single computing device or distributed over a network of multiple computing devices, and they can alternatively be implemented by program code executable by a computing device, so that they can be stored in a storage device and executed by a computing device, or they can be separately fabricated into various integrated circuit modules, or multiple modules or steps thereof can be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method of data validation, comprising:
acquiring target request data to be sent by a target service interface, wherein the target request data comprises: target business object identification information corresponding to the target business object;
calling the target service interface to send the target request data and acquiring target response data corresponding to the target service object returned by the target service interface;
acquiring a target verification expression corresponding to the target business object, wherein the target verification expression is obtained by performing logic operation configuration on actual response data corresponding to the target business object;
and performing service logic verification on the target response data based on the target verification expression to obtain a target verification result corresponding to the target service object.
2. The method of claim 1, wherein the obtaining target request data to be sent by a target service interface comprises:
acquiring a simulation request data set for test verification, wherein the simulation request data set is generated in advance based on the request parameter information of an existing service object corresponding to a target service interface in a simulation manner;
and taking each simulation request data in the simulation request data set as target request data to be sent by a target service interface one by one.
3. The method according to claim 2, wherein the step of using each simulation request data in the simulation request data set as target request data to be sent by a target service interface one by one comprises:
acquiring a target calling verification period corresponding to the target service interface which is configured in advance;
and triggering and executing once operation of taking each simulation request data in the simulation request data set as target request data to be sent by a target service interface one by one every other in the target calling verification period.
4. The method according to claim 1, wherein the target verification expression comprises at least one first verification expression and/or at least one second verification expression;
the first verification expression is an expression used for verifying a general response parameter corresponding to the target business object;
the second verification expression is an expression used for verifying a specific response parameter corresponding to the target business object.
5. The method of claim 4, wherein performing a logical operation configuration based on actual response data corresponding to the target business object to obtain the target verification expression comprises:
displaying general response parameter actual information and specific response parameter actual information in actual response data corresponding to the target business object;
determining a first verification expression corresponding to the target business object based on an expression selection operation triggered by the user aiming at the actual information of the general response parameter;
and determining a second verification expression corresponding to the target business object based on an expression input operation triggered by the user aiming at the actual information of the special response parameter.
6. The method according to claim 1, wherein the performing business logic verification on the target response data based on the target verification expression to obtain a target verification result corresponding to the target business object includes:
detecting whether a response parameter return value in the target response data meets each target verification expression or not;
and if at least one unsatisfied target verification expression exists, determining that a target verification result corresponding to the target service object is an abnormal result.
7. The method according to any one of claims 1 to 6, further comprising, after obtaining a target verification result corresponding to the target business object:
if the target verification result is an abnormal result, acquiring a target abnormal processing mode corresponding to the target service interface which is configured in advance;
and performing exception handling on the target service interface based on the target exception handling mode.
8. A data verification apparatus, comprising:
a target request data obtaining module, configured to obtain target request data to be sent by a target service interface, where the target request data includes: target business object identification information corresponding to the target business object;
a target response data acquisition module, configured to invoke the target service interface to send the target request data, and acquire target response data corresponding to the target service object returned by the target service interface;
a target verification expression obtaining module, configured to obtain a target verification expression corresponding to the target service object, where the target verification expression is obtained by performing logic operation configuration based on actual response data corresponding to the target service object;
and the data verification module is used for performing service logic verification on the target response data based on the target verification expression to obtain a target verification result corresponding to the target service object.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a data validation method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the data authentication method according to any one of claims 1 to 7.
CN202211611377.1A 2022-12-14 2022-12-14 Data verification method, device, equipment and storage medium Pending CN115840677A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211611377.1A CN115840677A (en) 2022-12-14 2022-12-14 Data verification method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211611377.1A CN115840677A (en) 2022-12-14 2022-12-14 Data verification method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115840677A true CN115840677A (en) 2023-03-24

Family

ID=85578644

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211611377.1A Pending CN115840677A (en) 2022-12-14 2022-12-14 Data verification method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115840677A (en)

Similar Documents

Publication Publication Date Title
CN108563445B (en) Application program code detection method and server
CN112115026B (en) Server cluster monitoring method and device, electronic equipment and readable storage medium
CN108134708B (en) Method and device for monitoring third-party interface
CN110851471A (en) Distributed log data processing method, device and system
CN115034596A (en) Risk conduction prediction method, device, equipment and medium
CN112306833A (en) Application program crash statistical method and device, computer equipment and storage medium
CN112100239A (en) Portrait generation method and apparatus for vehicle detection device, server and readable storage medium
CN110737655A (en) Method and device for reporting data
CN114153703A (en) Micro-service exception positioning method and device, electronic equipment and program product
CN111400294B (en) Data anomaly monitoring method, device and system
CN110162982B (en) Method and device for detecting illegal rights, storage medium and electronic equipment
CN112491625A (en) Operation and maintenance alarming method, device and equipment based on instant communication platform
CN111913861A (en) Performance test method, device, equipment and medium of Internet of things system
CN116071152A (en) Data processing method and device, electronic equipment and storage medium
CN114928603A (en) Client software upgrading method and device, electronic equipment and medium
CN111427878B (en) Data monitoring alarm method, device, server and storage medium
CN115840677A (en) Data verification method, device, equipment and storage medium
CN111741046B (en) Data reporting method, data acquisition method, device, equipment and medium
CN110348984B (en) Automatic credit card data input method and related equipment under different transaction channels
CN113763094A (en) Service information processing method, device, server, medium and system
CN112261072A (en) Service calling method, device, equipment and storage medium
CN111045723B (en) Method and device for notifying code change between associated systems
US11706117B1 (en) Message-based monitoring and action system
CN111369346B (en) User credit evaluation method, device, server and storage medium
CN116975200A (en) Method, device, equipment and medium for controlling working state of server

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