CN107403112B - Data checking method and equipment thereof - Google Patents

Data checking method and equipment thereof Download PDF

Info

Publication number
CN107403112B
CN107403112B CN201710644918.3A CN201710644918A CN107403112B CN 107403112 B CN107403112 B CN 107403112B CN 201710644918 A CN201710644918 A CN 201710644918A CN 107403112 B CN107403112 B CN 107403112B
Authority
CN
China
Prior art keywords
data
received
key
instance data
value pairs
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.)
Active
Application number
CN201710644918.3A
Other languages
Chinese (zh)
Other versions
CN107403112A (en
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710644918.3A priority Critical patent/CN107403112B/en
Publication of CN107403112A publication Critical patent/CN107403112A/en
Application granted granted Critical
Publication of CN107403112B publication Critical patent/CN107403112B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Abstract

The present disclosure provides a data verification method. The data verification method comprises the following steps: receiving an application interface request from an application, the application interface request including an entry parameter; transparently transmitting the received application interface request to the corresponding micro service; receiving instance data from a corresponding microservice; and verifying the received instance data based on the entry parameter. The embodiment of the disclosure also provides corresponding data checking equipment.

Description

Data checking method and equipment thereof
Technical Field
The present disclosure relates to the field of data processing, and in particular, to a data verification method and device.
Background
With the rapid development of the mobile internet, mobile applications (apps) are also increasingly used. Mobile apps typically request access to a server through an interface to obtain relevant data. The prior art provides a way to verify data returned by a server. The scheme checks the integrity of all interface data through one or more fixed JSonschema check files. And checking the data returned by the server side or the data taken by the app each time, wherein each interface corresponds to at least one JSonschema file. This solution therefore requires the maintenance of many complex json schema files, which are cumbersome and complex to maintain.
Therefore, a need exists for a scheme for verifying data that at least partially avoids the difficult maintenance problems of the prior art.
Disclosure of Invention
In view of the above, the present disclosure provides a data verification method, a data verification apparatus, and a corresponding computer-readable storage medium.
One aspect of the present disclosure provides a method for data verification. The method includes receiving an application interface request from an application, the application interface request including an entry parameter; transparently transmitting the received application interface request to the corresponding micro service; receiving instance data from a corresponding microservice; and verifying the received instance data based on the entry parameter.
According to some embodiments of the present disclosure, the received instance data comprises a plurality of levels of data having respective key-value pairs at each level. In this case, checking the received instance data based on the ingress parameter may include: acquiring key value pairs of data of a plurality of levels at each level; and comparing the obtained key-value pair with key-value pairs of one or more instance data obtained and cached before, level by level, to check the received instance data. Wherein the key-value pair of the one or more instance data previously fetched and cached is also for the application interface request with the entry parameter.
According to some embodiments of the present disclosure, comparing the retrieved key-value pair hierarchically to key-value pairs of one or more instance data previously retrieved and cached to check the received instance data may comprise: if a hierarchy exists in the multiple hierarchies in the received instance data whose key-value pair is different from the key-value pair of the one or more previously acquired and cached instance data, storing the received instance data for verification of the subsequently received instance data.
According to some embodiments of the present disclosure, comparing the retrieved key-value pair hierarchically to key-value pairs of one or more instance data previously retrieved and cached to check the received instance data may comprise: determining that a data anomaly occurred with the received instance data if the received instance data lacks one or more key value pairs as compared to one or more previously obtained and cached instance data, or if the received instance data was not received within a predetermined period of time.
According to some embodiments of the disclosure, the method may further comprise reporting a data exception to be handled by way of intervention. The method may also include caching instance data for which data exceptions are handled for verification of subsequently received instance data.
According to some embodiments of the present disclosure, handling the data exception by way of intervention may include: discarding the example data with the data exception; or the example data with the data exception is used as standard data for checking the subsequently received example data.
Another aspect of the present disclosure provides an apparatus for data verification. The device comprises a first receiving unit, a first sending unit, a second receiving unit and a checking unit. The first receiving unit is used for receiving an application interface request from an application, wherein the application interface request comprises an entrance parameter. The first sending unit is used for transparently transmitting the received application interface request to the corresponding micro-service. The second receiving unit is used for receiving the instance data from the corresponding micro service. The checking unit is used for checking the received example data based on the entry parameter.
According to some embodiments of the present disclosure, the received instance data comprises a plurality of levels of data having respective key-value pairs at each level. In this case, the verification unit may also be configured to: acquiring key value pairs of the data of the multiple levels at each level; and comparing the obtained key-value pair with key-value pairs of one or more previously obtained and cached instance data level by level to check the received instance data, wherein the key-value pair of the one or more previously obtained and cached instance data is directed to the application interface request with the entry parameter.
According to some embodiments of the disclosure, the verification unit may be further operable to: determining that there is a different hierarchy of key-value pairs among a plurality of hierarchies in the received instance data than key-value pairs of the previously acquired and cached one or more instance data. The device may further comprise a cache unit for storing said received instance data for verification of subsequently received instance data.
According to some embodiments of the disclosure, the verification unit may be further operable to: determining that a data anomaly occurred with the received instance data if the received instance data lacks one or more key value pairs as compared to one or more previously acquired and cached instance data, or if the received instance data was not received within a predetermined period of time.
According to some embodiments of the disclosure, the apparatus may further include an abnormal situation handling unit. The abnormal condition processing unit is used for reporting data abnormality so as to process the data abnormality in an intervention mode. In this case, the cache unit may further be configured to cache the instance data whose data exception is handled, so as to be used for checking subsequently received instance data.
According to some embodiments of the disclosure, handling the data exception by way of intervention may include: discarding the example data with the data exception; or the example data with the data exception is used as standard data for checking the subsequently received example data.
Another aspect of the present disclosure provides an apparatus for processing data. The apparatus includes a memory storing computer-executable instructions and a processor. The processor executes the computer-executable instructions stored by the memory to perform the method as described above.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method as described above when executed.
Another aspect of the disclosure provides a computer program comprising computer executable instructions for implementing the method as described above when executed.
The above scheme at least partially avoids the problem of difficult maintenance caused by the need to check the integrity of all interface data through one or more fixed JSonschema check files in the prior art by performing data check on the entry parameters.
Drawings
The above features and advantages of the present disclosure will become more apparent from the following detailed description of the embodiments of the present disclosure when taken in conjunction with the accompanying drawings, in which:
FIG. 1 illustrates a simplified flow diagram of a data verification method in accordance with an embodiment of the present disclosure;
FIG. 2 illustrates a schematic block diagram of a data verification device in accordance with an embodiment of the present disclosure;
FIG. 3 shows a schematic diagram of device connectivity according to an embodiment of the present disclosure;
FIG. 4 illustrates an example flow of a specific implementation of data verification in accordance with an embodiment of the present disclosure;
fig. 5 shows a block diagram of an example hardware arrangement of a data processing device according to an embodiment of the present disclosure; and
fig. 6 schematically illustrates an exemplary system architecture 600 to which the method according to fig. 1 may be applied, according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The words "a", "an" and "the" and the like as used herein are also intended to include the meanings of "a plurality" and "the" unless the context clearly dictates otherwise. Furthermore, the terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, operations, and/or components, but do not preclude the presence or addition of one or more other features, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Some block diagrams and/or flow diagrams are shown in the figures. It will be understood that some blocks of the block diagrams and/or flowchart illustrations, or combinations thereof, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the instructions, which execute via the processor, create means for implementing the functions/acts specified in the block diagrams and/or flowchart block or blocks.
Accordingly, the techniques of this disclosure may be implemented in hardware and/or software (including firmware, microcode, etc.). In addition, the techniques of this disclosure may take the form of a computer program product on a computer-readable medium having instructions stored thereon for use by or in connection with an instruction execution system. In the context of this disclosure, a computer-readable medium may be any medium that can contain, store, communicate, propagate, or transport the instructions. For example, the computer readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. Specific examples of the computer readable medium include: magnetic storage devices, such as magnetic tape or Hard Disk Drives (HDDs); optical storage devices, such as compact disks (CD-ROMs); a memory, such as a Random Access Memory (RAM) or a flash memory; and/or wired/wireless communication links.
FIG. 1 shows a simplified flow diagram of a data verification method according to an embodiment of the present disclosure.
As shown in fig. 1, the method includes an operation S110 of receiving an application interface request from an application, the application interface request including an entry parameter;
operation S120, transparently transmitting the received application interface request to the corresponding micro service;
operation S130 of receiving instance data from a corresponding micro service; and
in operation S140, the received instance data is checked based on the entry parameter.
In some examples, the received instance data may include multiple tiers of data having respective key-value pairs at each tier. In this case, checking the received instance data based on the entry parameter includes: acquiring key value pairs of data of a plurality of levels at each level; and comparing the obtained key-value pair with the key-value pairs of one or more pieces of example data obtained and cached before hierarchically to check the received example data, wherein the key-value pair of one or more pieces of example data obtained and cached before aims at the application interface request with the entry parameter.
In some examples, comparing the retrieved key-value pairs hierarchically to key-value pairs of one or more instance data previously retrieved and cached to check the received instance data may include: if a hierarchy exists in the multiple hierarchies in the received instance data whose key-value pair is different from the key-value pair of the one or more previously acquired and cached instance data, storing the received instance data for verification of the subsequently received instance data.
In some examples, comparing the retrieved key-value pairs hierarchically to key-value pairs of one or more instance data previously retrieved and cached to check the received instance data may include: determining that a data anomaly occurred with the received instance data if the received instance data lacks one or more key value pairs as compared to one or more previously obtained and cached instance data, or if the received instance data was not received within a predetermined period of time.
In some examples, the method may further include reporting the data exception to handle the data exception by way of intervention. The method may also include caching instance data for which data exceptions are handled for verification of subsequently received instance data.
The intervention described herein may include manual intervention performed by a user after receiving an alarm (e.g., a short message), or may include automatic intervention performed by the system according to a predefined processing rule after receiving the alarm, and the embodiments of the present disclosure are not limited by the specific implementation manner of the specific intervention measure. For example, the user can be notified by short message, and the user can handle the abnormal condition. The user referred to herein may be a developer, a maintainer, or any other person having abnormal situation handling/parameter modification rights of the apparatus or system described in the present disclosure, and the present disclosure is not limited thereto.
In some examples, handling the data exception by way of intervention may include: discarding the example data with the data exception; or the example data with the data exception is used as standard data for checking the subsequently received example data.
Fig. 2 shows a simplified block diagram of a data verification device corresponding to the method shown in fig. 1. As shown in fig. 2, the apparatus includes a first receiving unit 210, a first transmitting unit 220, a second receiving unit 230, and a verifying unit 240. The first receiving unit 210 is configured to receive an application interface request from an application, where the application interface request includes an entry parameter. The first sending unit 220 is configured to transparently transmit the received application interface request to the corresponding micro service. The second receiving unit 230 is configured to receive instance data from a corresponding microservice. The verification unit 240 is configured to verify the received instance data based on the entry parameter.
In some examples, the received instance data includes multiple tiers of data having respective key-value pairs at each tier. In this case, the verification unit 240 may also be used to: acquiring key value pairs of data of a plurality of levels at each level; and comparing the obtained key-value pair with the key-value pairs of one or more pieces of example data obtained and cached before hierarchically to check the received example data, wherein the key-value pair of one or more pieces of example data obtained and cached before aims at the application interface request with the entry parameter.
In some examples, the verification unit 240 may also be used to: it is determined that there is a hierarchy of multiple hierarchies in the received instance data whose key-value pairs are different from key-value pairs of one or more instance data previously acquired and cached.
The apparatus may further include a caching unit 250, the caching unit 250 being configured to store the received instance data for verification of subsequently received instance data.
In some examples, the verification unit 240 may also be used to: determining that a data anomaly occurred with the received instance data if the received instance data lacks one or more key value pairs as compared to one or more previously obtained and cached instance data, or if the received instance data was not received within a predetermined period of time.
In some examples, the apparatus may also include an abnormal situation handling unit 260. The exception handling unit 260 is used to report data exceptions to handle the data exceptions by way of intervention. In this case, the buffer unit 260 may also be configured to buffer the instance data whose data exception is processed, so as to be used for checking the subsequently received instance data.
In some examples, handling the data exception by way of intervention may include: discarding the example data with the data exception; or the example data with the data exception is used as standard data for checking the subsequently received example data.
In some examples, the apparatus may further include a second sending unit 270 to return the verified instance data to the application. Specifically, the verified instance data may be instance data processed by the abnormal situation processing unit 260.
It should be noted that, although the first receiving unit 210/the first sending unit 220 are shown as being connected to the buffer unit 250 in fig. 3 to indicate that the data received/sent by the first receiving unit 210/the first sending unit 220 can be stored/buffered in the buffer unit 250, the data received by the first receiving unit 210 may also be directly sent via the first sending unit 220, which is not limited by the present disclosure.
Hereinafter, the technical solution of the present disclosure will be explained in more detail with reference to fig. 3 and 4. Fig. 3 shows a schematic diagram of device connectivity according to an embodiment of the present disclosure. The device for data verification according to the present disclosure is shown in fig. 3 as an API (application interface) gateway, however any other name may be used as long as it can implement the functions of the device described in the embodiments of the present disclosure.
With the rapid development of internet services, large internet companies include numerous service platforms, and release their apps for the convenience of users. If each application has its own API exit, maintenance modifications can involve complex dependency logic. In order to facilitate fast service replication and service management and control on multiple platforms, the embodiments of the present disclosure introduce a device for handling these service replication and service management and control. In some embodiments of the present disclosure, such a device may be used as a gateway, such as the API gateway shown in fig. 3. In this case, besides the functions described in fig. 2, the API gateway may also have functions of controlling flow, security, auditing, monitoring, and the like that the gateway usually has, and details are not described here. Of course, any other device that can handle service replication and service management and control may be used, and is not limited to the API gateway. Specifically, one application interface request (e.g., app request) may be transparently transmitted to a plurality of soas (micro services) through, for example, an API gateway.
The gateway may act as an interface pass-through platform, transparently transmitting all application interface requests to the corresponding soa (micro service). In actual practice, each microservice may typically be maintained by a team. The embodiment of the disclosure at least partially avoids the problem of difficult maintenance caused by the need of checking the integrity of all interface data through one or more fixed JSonschema check files in the prior art by performing data check on the entry parameters in, for example, an API gateway.
In some embodiments of the present disclosure, data verification may be performed by way of data training.
FIG. 4 illustrates an example flow of one particular implementation of a method for data verification in accordance with an embodiment of the present disclosure. As shown in fig. 4, the specific implementation is as follows:
operation 410. the API gateway receives an API request from the app, the API including entry parameters, the structure of which may be a key & value one-to-one correspondence. For example, x 1-22, x 2-4555, etc.;
operation 420. the API gateway transparently (i.e., without processing) transmits the received API request to the corresponding micro-soa, receives instance data of the json structure returned by the corresponding soa;
operation 430. the API gateway stores the key (key) as a request entry parameter, e.g., by a cache (e.g., cache redis), which may be recorded as (x1, x2) with a value (value) as the json structure data returned. Examples of json structure data may be as follows:
Figure BDA0001365410930000081
Figure BDA0001365410930000091
in the json structure data, for example, code represents an operation code, success represents correctness or inaccuracy of return data, and data is specific return data. The data is composed of a plurality of hierarchical data. It should be noted that, although the data has two levels in the above example, the embodiments of the present disclosure are not limited thereto, and data having more or fewer levels may also be applied. Further, while x1 and x2 are described as examples of entry parameters, in a particular implementation, more or fewer entry parameters may be present.
In general, all json data may be a multi-level key & value structure. A normal operation period may be predefined as the normal operation period. In embodiments of the present disclosure, data obtained during a normal operation period may be defaulted to substantially normal data and may be used for data verification against data obtained later. The normal operation time period may be selected as desired. For example, one hour after the test passes at both the server side and the app side may be selected, but the method is not limited thereto, and other time periods may be used, such as 1 day, 2 days, 1 week, and the like. In some embodiments of the present disclosure, the time period may be selected continuously, however, in other embodiments, the time period may be selected randomly, at specific intervals, with specific characteristics (for example, a certain time period of each day, etc.), or in other time period selection manners commonly used or possibly conceivable by those skilled in the art, and will not be described herein again.
And acquiring and caching the json structure data returned for the first time in the time period as complete data during the normal operation time period, wherein the json structure data returned for the first time in the time period is cached when an interface request with the same entry parameter is received next time, and data verification is performed by comparing the json structure data returned for two times, and the data is assumed to be data 1. One example of a comparison method is as follows:
as can be seen by the above code, the obtained json structure data returned from the soa for a particular ingress parameter may include code, success, data, where the code and data may be intervened to make them equal to the values that may exist (e.g., values in a set of values). However, data has many possible values, e.g. different combinations of possible values of json objects at various levels, which are undoubtedly complicated and time-consuming to (e.g. manually) intervene on. According to the embodiment of the disclosure, more complete data can be obtained by continuously performing intervention and automatic pre-judgment according to the obtained data in the normal operation period, so as to be used as standard data for the next verification. In the verification process, verification needs to be performed on data of each hierarchy in the data respectively. And when the data verification of the previous level is unsuccessful, the data verified at this time and the data verified at the previous level are judged to be different values of the data, and the data verified at the next level does not need to be verified.
When verifying each data after obtaining data1, for example, each key-value pair of data of the first hierarchy (the "next hierarchy" for the above-described structural data) in the data may be first acquired, and checked for null (null). For key-value pairs that are not empty, the last fetched hierarchy key-value pair (e.g., data1) may then be compared to the current fetched hierarchy key-value pair. If the comparison result shows that the key value pairs taken twice are different and the data acquisition time period is a normal operation time period, the key values which are not null values can be stored for the next data verification, and the data verification is finished.
If the comparison result shows that the key value pairs taken twice are the same, the data verification of the level in the data is successful. An attempt is made to acquire data of the next level and to check. If the next level data does not exist, ending the verification, if the next level data exists, continuing the operation of the verification, comparing the data with the key and the value of the same level of the last complete data, and so on until all levels in the data are compared or until different key value pairs appear in a certain level.
A data exception condition for instance data is indicated if there is a field missing (e.g., the instance data lacks one or some key-value pairs compared to previous instance data) and/or the data acquisition time is not within a predefined normal operating time period (e.g., a developer). If there is no field missing and the data acquisition time is within the predefined normal operation time period (i.e. the instance data is normal), and the instance data is not the same as the data1, the instance data of this verification is buffered as a basis for the next comparison. This result (cached instance data) may be assumed to be data 2.
There may also be multiple comparison results data3, data4. In some embodiments, at each comparison, a comparison is required with all comparison results previously cached. For example, when verifying data3, a level-by-level key-value pair comparison needs to be made with both data1 and data 2.
Whether data is normal may have different definitions for different scenarios. For example, in some embodiments of the present disclosure, a case where there is a new addition of a key value in a multi-level structure may be considered as a data normal case, and in other embodiments, the case may also be considered as a data abnormal case. The embodiments of the present disclosure are not limited by different specific definitions of whether data is normal or not.
Operation 440 during the next normal operation time period, the gateway may also receive interface requests from the various apps with the same entry parameters, i.e., whether the entry parameters of the request are x1, x 2. At this time, all the cached comparison results (including the cached results during the last normal operation time period and the cached results before the current normal operation time period, such as the respective data1, data2, data3, data4.. obtained from the cache) may be traversed to be compared with the structure values and key value pairs of the respective levels of the current instance data. If the new value exists, the fact that the new value exists can be prompted, the instance data is normally returned to the app (because the newly added key generally does not have an influence on json analysis of the app), and if the fact that the current instance data lacks the key is found, it is indicated that an empty pointer may exist when the app receives the instance data or the data is empty, namely, the instance data is abnormal, so that the risk of display disorder is caused.
At this time, the API gateway may send an alarm, for example, by sending a short message. This problem can be solved by means of intervention after receiving the alarm. For example, the problem may be solved by discarding this data or taking this data as standard data, or any other intervention measure commonly used or possibly conceivable by those skilled in the art may be adopted, and will not be described herein. It should be noted that this manner of alarming and intervention is equally applicable to the case where an anomaly in the data is detected during operation 430.
Furthermore, the intervention described herein may include manual intervention by a user (e.g., a developer or other personnel with specific authority) after receiving an alert (e.g., a short message), or may include automatic intervention by a system according to predefined processing rules after receiving the alert, and embodiments of the present disclosure are not limited by the specific implementation of a specific intervention measure.
It should be noted that, for the cached comparison results data1, data2, data3 and data4, they may be named separately for each normal operation time period, may be named uniformly for all normal operation time periods, or may be named in other manners that may be thought or used by those skilled in the art, and the embodiments of the present disclosure are not limited by specific naming manners.
Operation 450. after intervention, the outcome of the intervention may be cached as a result of the data check corresponding to the intervention. Then, in the next normal operation time period, the json data (data1, data2, data 3.) returned in the first two normal operation time periods can be continuously compared with the data received in the third normal operation time period, and so on. Currently, in some embodiments, the number of the normal operation time periods to be compared may also be set, for example, only the first two normal operation time periods are compared, and only the data of the first two normal operation time periods are cached, and the like. It should be noted that during the second normal operation period, only the comparison with the data buffered during the first normal operation period is required.
The above embodiments buffer data and retrieve the buffered data for verification during a normal operation time period, however, in other embodiments, only data may be buffered during a normal operation time period, and the buffered data may be retrieved from, for example, a buffer (e.g., a redis buffer) after the time period for centralized data verification, or at any other time after the data is buffered for data verification.
In the embodiment, correct interface json data training and checking standard data are obtained by defining a normal operation period, then in actual operation, the newly obtained data and the training and checking standard data are compared by levels and key values, if the key values are found to be lacked, an alarm is given out, the data is abandoned through intervention or taken as the standard data, and if the key values are newly added, the data can be automatically added into the standard data. By the method, efficient json structure data verification is realized.
Fig. 5 schematically shows a block diagram of an apparatus for file transfer according to an embodiment of the present disclosure, which corresponds to the apparatus shown in fig. 2. The device shown in fig. 5 is only an example and should not bring any limitation to the function and use range of the embodiments of the present disclosure.
As shown in fig. 5, the apparatus 500 according to the embodiment includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the apparatus 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The device 500 may further include one or more of AN input section 506 including a keyboard, a mouse, and the like, AN output section 507 including a device such as a Cathode Ray Tube (CRT), a liquid crystal display (L CD), and the like, and a speaker, and the like, a storage section 508 including a hard disk, and the like, and a communication section 509 including a network interface card such as a L AN card, a modem, and the like, the communication section 509 performs communication processing via a network such as the internet, the drive 510 is also connected to the I/O interface 505 as necessary, a removable medium 511 such as a magnetic disk, AN optical disk, a magneto-optical disk, a semiconductor memory, and the like, is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The above-described functions defined in the apparatus of the embodiment of the present disclosure are performed when the computer program is executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable media shown in the present disclosure may be computer readable signal media or computer readable storage media or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, 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. In contrast, in the present disclosure, 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.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As another aspect, the present disclosure also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to perform the method of fig. 1.
Fig. 6 schematically illustrates an exemplary system architecture 600 to which the method according to fig. 1 may be applied, according to an embodiment of the disclosure.
As shown in fig. 6, a system architecture 600 according to this embodiment may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. The terminal devices 601, 602, 603 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and having data processing capabilities, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. The terminal devices 601, 602, 603 may also be representations of devices that perform specific services in the embodiments of the present disclosure.
The server 605 may be a server that provides various services, and may be, for example, an API gateway described in the embodiments of the present disclosure. The method shown in fig. 1 provided by the embodiments of the present disclosure may be executed on the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (12)

1. A method for data verification, comprising:
receiving an application interface request from an application, the application interface request including an entry parameter;
transparently transmitting the received application interface request to the corresponding micro service;
receiving instance data from a corresponding microservice; and
verifying the received instance data based on the entry parameter;
wherein the received instance data comprises a plurality of levels of data having respective key-value pairs at each level, and the checking the received instance data based on the entry parameter comprises:
acquiring key value pairs of the data of the multiple levels at each level; and
comparing the obtained key-value pair with key-value pairs of one or more previously obtained and cached instance data, obtained based on the application interface request with the entry parameter, hierarchically to verify the received instance data.
2. The method of claim 1, wherein comparing the retrieved key-value pairs hierarchically to key-value pairs of one or more instance data previously retrieved and cached to verify the received instance data comprises:
storing the received instance data for verification of subsequently received instance data if there is a hierarchy in the received instance data having a key-value pair different from a key-value pair of the previously acquired and cached one or more instance data.
3. The method of claim 1, wherein comparing the retrieved key-value pairs hierarchically to key-value pairs of one or more instance data previously retrieved and cached to verify the received instance data comprises:
determining that a data anomaly occurred with the received instance data if the received instance data lacks one or more key value pairs as compared to one or more previously acquired and cached instance data, or if the received instance data was not received within a predetermined period of time.
4. The method of claim 3, further comprising:
reporting the data exception to process the data exception by way of intervention; and
and caching the example data processed by the data exception for checking the subsequently received example data.
5. The method of claim 4, wherein the data exception is handled by intervention comprising:
discarding the example data with the data exception; or
And taking the example data with the data exception as standard data for checking the subsequently received example data.
6. An apparatus for data verification, comprising:
a first receiving unit, configured to receive an application interface request from an application, where the application interface request includes an entry parameter;
the first sending unit is used for transparently transmitting the received application interface request to the corresponding micro-service;
a second receiving unit for receiving instance data from a corresponding micro service; and
a checking unit, configured to check the received instance data based on the entry parameter;
wherein the received instance data comprises a plurality of levels of data having respective key-value pairs at each level, the check unit further to:
acquiring key value pairs of the data of the multiple levels at each level; and
comparing the obtained key-value pair with key-value pairs of one or more previously obtained and cached instance data, obtained based on the application interface request with the entry parameter, hierarchically to verify the received instance data.
7. The device of claim 6, wherein the verification unit is further to: determining that there is a hierarchy of multiple hierarchies in the received instance data whose key-value pairs are different from the key-value pairs of the previously acquired and cached one or more instance data; and
the apparatus further comprises: and the cache unit is used for storing the received example data so as to be used for verifying the subsequently received example data.
8. The device of claim 7, wherein the verification unit is further to:
determining that a data anomaly occurred with the received instance data if the received instance data lacks one or more key value pairs as compared to one or more previously acquired and cached instance data, or if the received instance data was not received within a predetermined period of time.
9. The apparatus of claim 8, further comprising:
an exception condition handling unit for reporting the data exception to handle the data exception by way of intervention,
the cache unit is further configured to cache the instance data whose data exception is processed, so as to check the subsequently received instance data.
10. The apparatus of claim 8 or 9, wherein the data exception is handled by intervention comprising:
discarding the example data with the data exception; or
And taking the example data with the data exception as standard data for checking the subsequently received example data.
11. An apparatus for processing data, comprising:
a memory storing computer-executable instructions; and
a processor executing computer-executable instructions stored by the memory to perform the method of any of claims 1 to 5.
12. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 5.
CN201710644918.3A 2017-07-31 2017-07-31 Data checking method and equipment thereof Active CN107403112B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710644918.3A CN107403112B (en) 2017-07-31 2017-07-31 Data checking method and equipment thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710644918.3A CN107403112B (en) 2017-07-31 2017-07-31 Data checking method and equipment thereof

Publications (2)

Publication Number Publication Date
CN107403112A CN107403112A (en) 2017-11-28
CN107403112B true CN107403112B (en) 2020-07-31

Family

ID=60402245

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710644918.3A Active CN107403112B (en) 2017-07-31 2017-07-31 Data checking method and equipment thereof

Country Status (1)

Country Link
CN (1) CN107403112B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108089956B (en) * 2017-12-07 2021-05-04 畅捷通信息技术股份有限公司 Method and system for verifying returned data of interface
CN108696598B (en) * 2018-07-26 2021-04-13 廊坊新奥智能科技有限公司 Method and device for transparently transmitting message received by stateless service through long connection under micro-service architecture
CN110377471B (en) * 2019-07-17 2022-08-23 江苏满运软件科技有限公司 Interface verification data generation method and device, storage medium and electronic equipment
CN117707653A (en) * 2024-02-06 2024-03-15 天津医康互联科技有限公司 Parameter monitoring method, device, electronic equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105099811A (en) * 2015-06-03 2015-11-25 北京金山安全软件有限公司 Interface testing method and device
CN105868050A (en) * 2015-12-29 2016-08-17 乐视网信息技术(北京)股份有限公司 Verification method and device based on JSON data
CN105893237A (en) * 2015-08-04 2016-08-24 乐视致新电子科技(天津)有限公司 Test data driving method and equipment
CN106155891A (en) * 2015-04-02 2016-11-23 阿里巴巴集团控股有限公司 Interface test method, interface description data library generating method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155891A (en) * 2015-04-02 2016-11-23 阿里巴巴集团控股有限公司 Interface test method, interface description data library generating method and device
CN105099811A (en) * 2015-06-03 2015-11-25 北京金山安全软件有限公司 Interface testing method and device
CN105893237A (en) * 2015-08-04 2016-08-24 乐视致新电子科技(天津)有限公司 Test data driving method and equipment
CN105868050A (en) * 2015-12-29 2016-08-17 乐视网信息技术(北京)股份有限公司 Verification method and device based on JSON data

Also Published As

Publication number Publication date
CN107403112A (en) 2017-11-28

Similar Documents

Publication Publication Date Title
CN107403112B (en) Data checking method and equipment thereof
CN109684188B (en) Test method and device
CN113157545A (en) Method, device and equipment for processing service log and storage medium
CN109299124B (en) Method and apparatus for updating a model
CN112887355B (en) Service processing method and device for abnormal server
CN109871294B (en) Method and device for checking data and processing request
US20200028733A1 (en) Method and apparatus for processing information
CN109145591B (en) Plug-in loading method of application program
CN114428815A (en) Data storage method and device, electronic equipment and computer readable medium
CN112084114A (en) Method and apparatus for testing an interface
CN112463616A (en) Chaos testing method and device for Kubernetes container platform
CN108471635B (en) Method and apparatus for connecting wireless access points
US10649869B2 (en) Burn process data retrieval and notification
CN110633182A (en) System, method and apparatus for monitoring server stability
CN111885006B (en) Page access and authorized access method and device
CN110688677A (en) Method and device for executing intelligent contracts
CN115190008B (en) Fault processing method, fault processing device, electronic equipment and storage medium
CN108089823B (en) Information output method and device for storage system
CN110262756B (en) Method and device for caching data
CN113704016B (en) Cloud function component diagnosis method, device, equipment and storage medium
KR102180105B1 (en) Method and apparatus for determining malicious software for software installed on device
CN113992491B (en) Application server group operation and maintenance management system, method and device
CN114285743B (en) Method, device, electronic equipment and storage medium for updating configuration information
CN117932641A (en) Data processing method, device, electronic equipment and storage medium
CN111460270B (en) Information pushing method and device

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
CB03 Change of inventor or designer information

Inventor after: Li Shuqian

Inventor after: Zhu Dewei

Inventor before: Zhu Dewei

CB03 Change of inventor or designer information
GR01 Patent grant
GR01 Patent grant