CN111427566A - Data processing method and device suitable for analog interface platform and server - Google Patents

Data processing method and device suitable for analog interface platform and server Download PDF

Info

Publication number
CN111427566A
CN111427566A CN202010192218.7A CN202010192218A CN111427566A CN 111427566 A CN111427566 A CN 111427566A CN 202010192218 A CN202010192218 A CN 202010192218A CN 111427566 A CN111427566 A CN 111427566A
Authority
CN
China
Prior art keywords
verification
data
response data
model
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
CN202010192218.7A
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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet 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 Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202010192218.7A priority Critical patent/CN111427566A/en
Publication of CN111427566A publication Critical patent/CN111427566A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers

Abstract

The disclosure relates to a data processing method and device suitable for an analog interface platform and a server. The method comprises the following steps: acquiring request data sent by a requester; inputting the request data into a preset verification model, and verifying the request data by the verification model to obtain a first verification result; the first verification result is used for representing that the request data passes the verification of the verification model, or the first verification result is used for representing that the request data does not pass the verification of the verification model; and returning response data corresponding to the first verification result. In this embodiment, the request data of the requester can be constrained forcibly to meet the requirement of the simulation interface platform, which is beneficial to improving the efficiency of the requester in developing by using the simulation interface platform and reducing the difficulty of subsequent maintenance.

Description

Data processing method and device suitable for analog interface platform and server
Technical Field
The present disclosure relates to the field of cloud management technologies, and in particular, to a data processing method and apparatus suitable for an analog interface platform, and a server.
Background
The mock platform can simulate a server (server) and provide data for a front-end engineer in a development stage, so that great convenience can be provided for the front-end engineer. In practical application, a back-end engineer can formulate a mock data interface in the mock platform, so that the front-end engineer can conveniently acquire mock data through the mock data interface.
Existing mock platforms require front end engineers and back end engineers to voluntarily follow the protocol when using the mock platform. However, in practical application, various factors can cause the protocol agreed on the mock platform to be set aside, and the progress of the parallel development work is influenced.
Disclosure of Invention
The present disclosure provides a data processing method and apparatus suitable for an analog interface platform, and a server, so as to solve the problems in the related art.
The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a data processing method suitable for an analog interface platform, including:
acquiring request data sent by a requester;
inputting the request data into a preset verification model, and verifying the request data by the verification model to obtain a first verification result; the first verification result is used for representing that the request data passes the verification of the verification model, or the first verification result is used for representing that the request data does not pass the verification of the verification model;
and returning response data corresponding to the first verification result.
Optionally, the verification model is obtained by: acquiring a preset protocol of the analog interface platform; the preset protocol prescribes a plurality of data structure bodies, each data structure body comprises a plurality of objects and is used for describing a data structure of request data;
acquiring a plurality of objects of each data structure;
and generating a verification model for verifying each data structure body based on the plurality of objects of each data structure body.
Optionally, the verifying the request data by the verification model includes:
acquiring the request data and a data structure body corresponding to the request data in the preset protocol;
sequentially comparing the object in the data structure body with the object in the request data;
when all objects in the request data pass comparison, determining that the request data meet the preset protocol and pass verification of the verification model; when at least one object in the request data fails to pass the comparison, determining that the request data does not satisfy the preset protocol and fails the verification of the verification model.
Optionally, returning response data corresponding to the first verification result includes:
and when the first verification result represents that the request data does not pass the verification of the verification model, returning first response data representing the request data abnormity to the requester.
Optionally, returning response data corresponding to the first verification result includes:
when the first verification result represents that the request data passes the verification of the verification model, second response data corresponding to the request data are obtained;
and returning the second response data to the requester.
Optionally, returning response data corresponding to the first verification result includes:
when the first verification result represents that the request data passes the verification of the verification model, second response data corresponding to the request data are obtained;
inputting the second response data into the verification model, and verifying the second response data by the verification model to obtain a second verification result, wherein the second verification result is used for representing that the second response data passes the verification of the verification model, or the second verification result is used for representing that the request data does not pass the verification of the verification model;
when the second check result represents that the second response data passes the verification of the check model, returning the second response data to the requester; and when the second check result represents that the second response data does not pass the verification of the check model, returning abnormal data representing the abnormality of the second response data to the requester as response data.
According to a second aspect of the embodiments of the present disclosure, there is provided a data processing method suitable for an analog interface platform, including:
acquiring response data, wherein the response data is generated by a response party when the response party receives request data sent by a request party;
inputting the response data into a preset verification model, and verifying the response data by the verification model to obtain a third verification result; the third verification result is used for representing that the response data passes the verification of the verification model, or the third verification result is used for representing that the response data does not pass the verification of the verification model;
and returning corresponding response data according to the third verification result.
Optionally, returning corresponding response data according to the third verification result includes:
when the third verification result represents that the request data passes the verification of the verification model, third response data representing the response data abnormity is returned to the responder; and when the third verification result represents that the response data does not pass the verification of the verification model, returning the response data to the requester.
According to a third aspect of the embodiments of the present disclosure, there is provided a data processing apparatus adapted to an analog interface platform, including:
the request data acquisition module is configured to acquire the request data sent by the requester;
the first result obtaining module is configured to input the request data into a preset verification model, and the verification model verifies the request data to obtain a first verification result; the first verification result is used for representing that the request data passes the verification of the verification model, or the first verification result is used for representing that the request data does not pass the verification of the verification model;
and the response data acquisition module is configured to execute the response data corresponding to the returned first verification result.
Optionally, the system further includes a verification model obtaining module, including:
a protocol acquisition unit configured to execute acquisition of a preset protocol of the analog interface platform; the preset protocol prescribes a plurality of data structure bodies, each data structure body comprises a plurality of objects and is used for describing a data structure of request data;
an object acquisition unit configured to execute acquisition of a plurality of objects of the respective data structures;
a model generation unit configured to execute generation of a verification model for verifying each of the data structure bodies based on a plurality of objects of the each data structure body.
Optionally, the first result obtaining module includes:
a structure body obtaining unit configured to perform obtaining of the request data and a data structure body corresponding to the request data in the preset protocol;
an object comparison unit configured to perform a sequential comparison of an object in the data structure and an object in the request data;
a result obtaining unit configured to perform verification that the request data satisfies the preset protocol and passes the verification model when all objects in the request data pass comparison; when at least one object in the request data fails to pass the comparison, determining that the request data does not meet the preset protocol and passes the verification of the verification model.
Optionally, the response data acquiring module includes:
the data sending unit is configured to execute the step of returning first response data representing the request data abnormity to the requester when the first verification result represents that the request data does not pass the verification of the verification model.
Optionally, the response data acquiring module includes:
the data acquisition unit is configured to acquire second response data corresponding to the request data when the first verification result represents that the request data passes the verification of the verification model;
a data sending unit configured to perform returning the second response data to the requester.
Optionally, the response data acquiring module includes:
the data acquisition unit is configured to acquire second response data corresponding to the request data when the first verification result represents that the request data passes the verification of the verification model;
a data checking unit configured to perform input of the second response data to the checking model, check the second response data by the checking model, and obtain a second checking result, where the second checking result is used to represent that the second response data passes verification of the checking model, or the second checking result is used to represent that the request data fails verification of the checking model;
a data sending unit configured to perform, when the second check result represents that the second response data passes the verification of the check model, returning the second response data to the requester; and when the second check result represents that the second response data does not pass the verification of the check model, returning abnormal data representing the abnormality of the second response data to the requester as response data.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a data processing apparatus adapted to an analog interface platform, including:
a response data acquisition module configured to perform acquisition of response data, the response data being generated by a responder upon receiving request data sent by a requester;
the third result acquisition module is configured to input the response data into a preset verification model, and the verification model verifies the response data to obtain a third verification result; the third verification result is used for representing that the response data passes the verification of the verification model, or the third verification result is used for representing that the response data does not pass the verification of the verification model;
and the response data sending module is configured to execute the corresponding response data returned according to the third verification result.
Optionally, the response data sending module includes:
the data sending unit is configured to execute the third response data which represents the response data abnormity to be returned to the responder when the third verification result represents that the request data passes the verification of the verification model; and when the third verification result represents that the response data does not pass the verification of the verification model, returning the response data to the requester.
According to a fifth aspect of embodiments of the present disclosure, there is provided a server including:
a processor;
a memory for storing a computer program executable by the processor; wherein the processor is configured to execute the computer program in the memory to implement the steps of the method according to any one of the above.
According to a sixth aspect of embodiments of the present disclosure, there is provided a storage medium, on which an executable computer program is executed, implementing the steps of the method according to any one of the above.
According to a seventh aspect of embodiments of the present disclosure, there is provided a computer program product which, when executed, performs the steps of the method as described in any one of the above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in this embodiment, a verification model may be preset in the simulation interface platform, after the request data sent by the requester is acquired, the request data may be input to the verification model, and the verification model verifies the request data, so as to obtain a first verification result that represents that the request data passes verification of the verification model or fails verification of the verification model; and then, returning corresponding response data according to the first verification result. Therefore, in the embodiment, the request data of the requester can be constrained forcibly to meet the requirement of the simulation interface platform, which is beneficial to improving the development efficiency of the requester using the simulation interface platform and reducing the difficulty of subsequent maintenance.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure. It will be apparent to those skilled in the art that other figures can be derived from these figures without inventive exercise.
FIG. 1 is a flow diagram illustrating a data processing method suitable for an analog interface platform in accordance with an exemplary embodiment.
FIG. 2 is a flow diagram illustrating obtaining a verification model in accordance with an exemplary embodiment.
Fig. 3 is a diagram illustrating verification of request parameters sent by a head-end device, according to an example embodiment.
Fig. 4 is a diagram illustrating verification of response data sent by a back-end device, according to an example embodiment.
FIG. 5 is a flow diagram illustrating the return of response data in accordance with an exemplary embodiment.
FIG. 6 is a diagram illustrating verification of request parameters and response data in accordance with an exemplary embodiment.
Fig. 7 is a schematic diagram illustrating a scenario in which a front-end device and a back-end device perform joint debugging according to an exemplary embodiment.
FIG. 8 is a flow diagram illustrating another data processing method suitable for an analog interface platform in accordance with an illustrative embodiment.
Fig. 9-13 are block diagrams illustrating a data processing apparatus suitable for an analog interface platform according to an example embodiment.
FIG. 14 is a block diagram illustrating a server in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
The embodiment of the present disclosure provides a data processing method suitable for an analog interface platform, where the analog interface platform may include a mock platform, and may be implemented by a server, and the server may provide a data port. In the following embodiments, the analog interface platform is a mock platform, and after a requester (such as a front-end device or a back-end device) communicates with a server, mock data (hereinafter referred to as response data) can be obtained from a data port. FIG. 1 is a flow diagram illustrating a data processing method suitable for an analog interface platform in accordance with an exemplary embodiment. Referring to fig. 1, a data processing method suitable for an analog interface platform includes steps 11 to 13, where:
in step 11, request data sent by a requester is acquired.
In this embodiment, the requester may send request data to the mock platform. The requesting party may include a front-end device or a back-end device, and taking the requesting party as the front-end device as an example, the front-end device may send request data, such as a request parameter, to the mock platform, so that the mock platform returns response data in response to the request parameter; taking the requestor as the backend device as an example, the backend device may send response data to the mock platform, and the response data may be provided to the front-end device as the mock data. The mock platform determines to acquire the request data sent by the requester when acquiring the request parameters sent by the front-end equipment or the response data sent by the back-end equipment.
In step 12, the request data is input to a preset verification model, and the verification model verifies the request data to obtain a first verification result.
Considering that a preset protocol is arranged in the mock platform, a verification model can be preset in the mock platform in the embodiment, and the verification model can verify the request data to determine whether the request data meets the preset protocol of the mock platform. The verification model may be obtained by the following steps, see fig. 2:
in step 21, a preset protocol of an analog interface platform, such as a mock platform, may be obtained, where the preset protocol specifies a plurality of data structures, and each data structure includes a plurality of objects, and may be used to describe a data structure of request data. Taking request data as an example of a request parameter, the data structure may be as follows:
Figure BDA0002416338810000061
wherein, Key is field name and value is field value.
In practice, value can be described from the following dimensions: a, whether a value is necessary; b, data type of value (string, number, boolean, array, etc.); c, value range (enumeration, maximum and minimum value of numeric type, maximum length of character string), etc. For example, value may include the following constraints: a, must be present; b, must be a number; c, a maximum value of 9999; d, minimum value 0.
In step 22, a plurality of objects of each data structure are acquired. Wherein each data structure in step 21 can obtain a plurality of objects corresponding to the request data described by the data structure. In other words, an object is a set of features that describe the requested data. Continuing with the example of request data as the request parameter, the object Key1 describing the field name is as follows:
Figure BDA0002416338810000071
it should be noted that, in step 22, by acquiring the object corresponding to the request data, the feature that needs to be verified in each request data can be determined.
In step 23, a verification model for each data structure is generated based on the plurality of objects for each data structure. The verification model may be configured as a program, a function, or a middleware, and in the case that the requested data can be verified, the verification model falls into the scope of the present disclosure. Taking the object of checking the key field name as an example, the checking model fun1 may have the following structure:
(1) the verification model fun1 obtains the request data and the description object Key 1.
(2) A field name Key1 is extracted from the request data.
(3) The field value of the field name Key1 is extracted.
(4) Judging whether a field value is missing; if the value of the field value is missing, the verification is not passed, and the step (8) is carried out; if the field value is not missing, the verification is passed, and the step (5) is carried out.
(5) Judging whether the field value meets the protocol requirement or not; if the field value does not meet the protocol requirement, the verification is not passed, and the step (8) is carried out; if the field value meets the protocol requirement, the verification is passed, and the step (6) is carried out.
(6) Judging whether the value of the field value is in an appointed range; if the value is not in the appointed range, the verification is not passed, and the step (8) is carried out; if the value is in the appointed range, the verification is passed, and the step (7) is carried out.
(7) And generating a verification result that the characterization request data passes the model verification.
(8) And generating a verification result that the characterization request data passes the non-model verification.
In this embodiment, after the request data is acquired, a data structure corresponding to the request data may be acquired. Then, the object in the data structure and the object in the request data are compared in sequence. And when all the objects in the request data pass comparison, determining that the request data meet the preset protocol and pass verification of the verification model. When at least one object in the request data fails to pass the comparison, the request data is determined not to meet the preset protocol and fails the verification of the verification model, wherein the verification result of the verification model on the request data is subsequently called as a first verification result to show differences.
In step 13, corresponding response data is returned according to the first verification result.
In this embodiment, the mock platform may return corresponding response data according to the first verification result, including:
in an example, the mock data stored in the mock platform is compliant with a preset protocol, i.e., the response data that is already present by default need not be checked. At this time, when the first verification result indicates that the request data fails to pass the verification of the verification model, the first response data indicating that the request data is abnormal may be returned to the requester. When the first verification result represents that the request data passes the verification of the verification model, response data corresponding to the request data is obtained and is called as second response data to show differences; the second response data may then be returned to the requestor. Therefore, the request data can be checked without checking the response data, and the request data can be ensured to meet the preset protocol.
For example, when the requesting party is a front-end device, referring to fig. 3, the front-end device may send a request parameter to the mock platform, and the mock platform may verify the request parameter by using the generated verification model. When the verification result indicates that the request data does not pass the verification of the verification model, the mock platform can generate abnormal data serving as response data to be returned to the front-end equipment, so that a user of the front-end equipment can adjust the request data according to the response data, and the request data finally meets the requirements of the mock platform. When the verification result represents that the request data passes the verification of the verification model, the mock platform can obtain response data (namely second response data) corresponding to the request data and return the response data to the front-end equipment, so that the front-end equipment can conveniently utilize the second response data to carry out corresponding development work, and the work efficiency is favorably improved.
For example, when the requesting party is a backend device, referring to fig. 4, the backend device may send response data to the mock platform, and the mock platform may verify the response data by using the generated verification middleware. When the verification result indicates that the response data does not pass the verification of the verification model, the mock platform can generate abnormal data serving as first response data to be returned to the back-end equipment, so that a user of the back-end equipment can adjust the response data according to the first response data, and the response data finally meets the requirements of the mock platform. And when the verification result represents that the response data passes the verification of the verification model, the mock platform can store the response data. In this embodiment, through verifying the response data, on one hand, it can be ensured that the response data meets the requirements of a preset protocol, that is, the response data conforms to the mock platform, and on the other hand, the front-end device can conveniently acquire correct response data to perform development work, which is beneficial to improving the work efficiency.
In another example, the mock data already stored in the mock platform still needs to be verified. Referring to fig. 5, in step 51, when the first verification result represents that the request data passes the verification of the verification model, the mock platform may obtain second response data corresponding to the request data from the stored mock data.
In step 52, the mock platform may input the second response data into the verification model (or the verification middleware), and the verification model verifies the second response data to obtain a second verification result. And the second check result is used for representing that the second response data passes the verification of the verification model, or the second check result is used for representing that the second response data does not pass the verification of the verification model. In step 53, when the second check result represents that the second response data passes the verification of the check model, returning the second response data to the requester; and when the second check result represents that the second response data does not pass the verification of the check model, returning abnormal data representing the abnormity of the second response data to the requester as response data. Therefore, in the embodiment, the accuracy of the response data acquired by the requester can be ensured and the development efficiency can be ensured by synchronously verifying the request data and the response data. In addition, the method and the device can be suitable for the situation that the stored mock data are more and inconvenient to reprocess, so that the accuracy of the old mock data is ensured.
For example, when the requesting party is a front-end device, referring to fig. 6, the front-end device may send a request parameter to the mock platform, and the mock platform may verify the request parameter by using the generated verification model. When the verification result indicates that the request data does not pass the verification of the verification model, the mock platform can generate abnormal data serving as response data to be returned to the front-end equipment, so that a user of the front-end equipment can adjust the request data according to the response data, and the request data finally meets the preset protocol.
When the verification result represents that the request data passes the verification of the verification model, the mock platform can obtain response data (namely, second response data) corresponding to the request data, verify the second response data by using the verification middleware, return the second response data to the front-end equipment when the second response data passes the verification of the verification model (the specific verification process refers to the embodiment), and return the second response data to the back-end equipment when the second response data does not pass the verification of the verification model, so that a user of the back-end equipment can correct the response data in time, the accuracy of the response data is ensured, and the subsequent development work is facilitated.
It is understood that, in the case that it is determined that the second response data is not verified, the response data corrected by the back-end device may be returned to the front-end device after being verified, or the first response data indicating an abnormality of the response data may be returned to the front-end device, thereby reducing the waiting time of the user of the front-end device.
In this embodiment, a verification model may be preset in the analog interface platform, after the request data sent by the requester is acquired, the request data may be input to the verification model, and the verification model verifies the request data, so as to obtain a first verification result that represents that the request data passes verification of the verification model or fails verification of the verification model; and then, returning corresponding response data according to the first verification result. Therefore, in the embodiment, the request data of the requester can be constrained forcibly to meet the requirement of the simulation interface platform, which is beneficial to improving the development efficiency of the requester using the simulation interface platform and reducing the difficulty of subsequent maintenance.
The embodiment of the present disclosure further provides a data processing method suitable for an analog interface platform, which is suitable for scenarios such as joint debugging, testing and the like of front-end equipment and back-end equipment, referring to fig. 7, where the front-end equipment is a requester and the back-end equipment is a responder. FIG. 8 is a flow diagram illustrating a data processing method suitable for an analog interface platform in accordance with an exemplary embodiment. Referring to fig. 8, a data processing method suitable for an analog interface platform includes steps 81 to 83, where:
in step 81, response data is obtained, which is generated by the responder upon receiving the request data sent by the requester.
When the responder is a back-end device, the responder can communicate with the front-end device, and when the request parameter sent by the front-end device is obtained, response data is obtained (or generated) in response to the request parameter, and the response data is uploaded to the mock platform. In this embodiment, the mock platform may communicate with a responder, i.e., a backend device, to acquire response data.
In step 82, inputting the response data into a preset verification model, and verifying the response data by the verification model to obtain a third verification result; the third verification result is used for representing that the response data passes the verification of the verification model, or the third verification result is used for representing that the response data does not pass the verification of the verification model.
In this embodiment, the mock platform may preset a verification model, wherein the content of the preset verification model may refer to the content of the embodiment shown in step 12 and fig. 1 and 2, which is not described herein again.
In this embodiment, the mock platform may input the response data into the verification model, and the verification model verifies the response data to obtain a verification result indicating that the response data passes or fails verification by the verification model, which is referred to as a third verification result to show differences.
It should be noted that, the front-end device sends the request parameter to the mock platform or the back-end device sends the response data to the mock platform, and the verification process of the request parameter and the response data may refer to the content in step 12, which is not described herein again.
In step 83, corresponding response data is returned according to the third verification result.
In this embodiment, with reference to fig. 7, when the third verification result indicates that the request data does not pass the verification of the verification model, third response data indicating that the response data is abnormal is returned to the responder, that is, the back-end device; and when the third verification result represents that the response data passes the verification of the verification model, returning the response data to the requesting party, namely the front-end equipment.
Therefore, in this embodiment, the front-end device and the back-end device can perform scenarios such as joint debugging and testing, the front-end device can directly request response data from the back-end device, the response data acquired by the back-end device can be sent to the mock platform for verification, and the response data is sent to the front-end device by the mock platform after the verification is passed, so that the reliability of the preset protocol can be improved, and the efficiency of parallel development can be improved.
On the basis of the data processing method suitable for the analog interface platform provided by the embodiment of the present disclosure, the embodiment of the present disclosure further provides a data processing apparatus suitable for the analog interface platform, referring to fig. 9, including:
a request data obtaining module 91 configured to perform obtaining request data sent by a requester;
a first result obtaining module 92, configured to perform input of the request data into a preset verification model, and verify the request data by the verification model to obtain a first verification result; the first verification result is used for representing that the request data passes the verification of the verification model, or the first verification result is used for representing that the request data does not pass the verification of the verification model;
and the response data obtaining module 93 is configured to execute returning of response data corresponding to the first verification result.
In one embodiment, referring to fig. 10, a data processing apparatus adapted to simulate an interface platform further includes a verification model obtaining module 94, where the verification model obtaining module 94 includes:
a protocol acquisition unit 101 configured to execute acquisition of a preset protocol of the analog interface platform; the preset protocol prescribes a plurality of data structure bodies, each data structure body comprises a plurality of objects and is used for describing a data structure of request data;
an object acquisition unit 102 configured to execute acquisition of a plurality of objects of the respective data structures;
a model generation unit 103 configured to execute generation of a verification model for verifying each of the data structure bodies based on a plurality of objects of the each data structure body.
In one embodiment, referring to fig. 11, the first result obtaining module 92 includes:
a structure acquiring unit 111 configured to perform acquiring the request data and a data structure corresponding to the request data in the preset protocol;
an object comparison unit 112 configured to perform a sequential comparison of an object in the data structure and an object in the request data;
a result obtaining unit 113 configured to perform verification that the request data satisfies the preset protocol and passes the verification model when all objects in the request data pass comparison; when at least one object in the request data fails to pass the comparison, determining that the request data does not meet the preset protocol and passes the verification of the verification model.
In one embodiment, the response data obtaining module 93 includes:
the data sending unit is configured to execute the step of returning first response data representing the request data abnormity to the requester when the first verification result represents that the request data does not pass the verification of the verification model.
In one embodiment, the response data obtaining module 93 includes:
the data acquisition unit is configured to acquire second response data corresponding to the request data when the first verification result represents that the request data passes the verification of the verification model;
a data sending unit configured to perform returning the second response data to the requester.
In one embodiment, referring to fig. 12, the response data obtaining module 93 includes:
a data obtaining unit 121, configured to obtain second response data corresponding to the request data when the first verification result represents that the request data passes verification of the verification model;
a data verification unit 122 configured to perform input of the second response data to the verification model, perform verification on the second response data by the verification model, and obtain a second verification result, where the second verification result is used to represent that the second response data passes verification of the verification model, or the second verification result is used to represent that the request data fails verification of the verification model;
a data sending unit 123 configured to perform, when the second verification result represents that the second response data passes the verification of the verification model, returning the second response data to the requester; and when the second check result represents that the second response data does not pass the verification of the check model, returning abnormal data representing the abnormality of the second response data to the requester as response data.
On the basis of the data processing method suitable for the analog interface platform provided by the embodiment of the present disclosure, the embodiment of the present disclosure further provides a data processing apparatus suitable for the analog interface platform, referring to fig. 13, including:
a response data obtaining module 131 configured to perform obtaining response data, the response data being generated by a responder upon receiving request data sent by a requester;
a third result obtaining module 132, configured to perform input of the response data into a preset verification model, and perform verification on the response data by using the verification model to obtain a third verification result; the third verification result is used for representing that the response data passes the verification of the verification model, or the third verification result is used for representing that the response data does not pass the verification of the verification model;
a response data sending module 133 configured to execute returning of corresponding response data according to the third verification result.
In one embodiment, the response data sending module 133 includes:
the data sending unit is configured to execute the third response data which represents the response data abnormity to be returned to the responder when the third verification result represents that the request data passes the verification of the verification model; and when the third verification result represents that the response data does not pass the verification of the verification model, returning the response data to the requester.
With regard to the apparatus in the above embodiments, the specific implementation manner of each step in the apparatus has been described in detail in the description of the method embodiments, and will not be elaborated here.
FIG. 14 is a block diagram illustrating a server in accordance with an example embodiment. Referring to fig. 14, a server 1400 may include one or more of the following components: a processing component 1402, a memory 1404, a power component 1406, a multimedia component 1408, an audio component 1410, an input/output (I/O) interface 1412, a sensor component 1414, and a communication component 1416.
The processing component 1402 generally controls the overall operation of the server 1400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. Processing component 1402 may include one or more processors 1420 to execute instructions to perform all or a portion of the steps of the methods shown in fig. 1-8. Further, processing component 1402 can include one or more modules that facilitate interaction between processing component 1402 and other components. For example, the processing component 1402 can include a multimedia module to facilitate interaction between the multimedia component 1408 and the processing component 1402.
The memory 1404 is configured to store various types of data to support operations at the server 1400. Examples of such data include instructions for any application or method operating on the server 1400, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1404 may be implemented by any type of volatile or non-volatile storage device or combination of devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power component 1406 provides power to the various components of the server 1400. The power components 1406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the server 1400.
The multimedia component 1408 includes a screen that provides an output interface between the server 1400 and the user, hi some embodiments, the screen may include a liquid crystal display (L CD) and a Touch Panel (TP). if the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
The audio component 1410 is configured to output and/or input audio signals. For example, the audio component 1410 includes a Microphone (MIC) configured to receive external audio signals when the server 1400 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 1404 or transmitted via the communication component 1416. In some embodiments, audio component 1410 further includes a speaker for outputting audio signals.
I/O interface 1412 provides an interface between processing component 1402 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 1414 includes one or more sensors for providing various aspects of status assessment for the server 1400. For example, the sensor component 1414 may detect an open/closed state of the server 1400, a relative positioning of components, such as a display and keypad of the server 1400, a change in location of the server 1400 or a component of the server 1400, the presence or absence of user contact with the server 1400, an orientation or acceleration/deceleration of the server 1400, and a change in temperature of the server 1400. The sensor assembly 1414 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 1414 may also include a photosensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 1416 is configured to facilitate wired or wireless communication between the server 1400 and other devices. The server 1400 may access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 1416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1416 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an embodiment of the present disclosure, the server 1400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), programmable logic devices (P L D), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components for performing the above-described methods.
In an embodiment of the present disclosure, a non-transitory computer readable storage medium, such as the memory 1404, is also provided that includes a computer program executable by the processor 1420 of the server 1400 to perform the steps of the above-described method. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an embodiment of the present disclosure, there is also provided an application program, which when executed by a processor of a server, enables the server to perform the steps of: acquiring request data sent by a requester; inputting the request data into a preset verification model, and verifying the request data by the verification model to obtain a first verification result; the first verification result is used for representing that the request data passes the verification of the verification model, or the first verification result is used for representing that the request data does not pass the verification of the verification model; and returning response data corresponding to the first verification result.
In an embodiment of the present disclosure, there is also provided a computer program product, which when executed by a processor of a server, enables the server to perform the steps of: acquiring request data sent by a requester; inputting the request data into a preset verification model, and verifying the request data by the verification model to obtain a first verification result; the first verification result is used for representing that the request data passes the verification of the verification model, or the first verification result is used for representing that the request data does not pass the verification of the verification model; and returning response data corresponding to the first verification result.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the device/server/storage medium embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the embodiments discussed above that follow in general the principles of the disclosure and include such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A data processing method adapted to an analog interface platform, comprising:
acquiring request data sent by a requester;
inputting the request data into a preset verification model, and verifying the request data by the verification model to obtain a first verification result; the first verification result is used for representing that the request data passes the verification of the verification model, or the first verification result is used for representing that the request data does not pass the verification of the verification model;
and returning response data corresponding to the first verification result.
2. The data processing method of claim 1, wherein the verification model is obtained by: acquiring a preset protocol of the analog interface platform; the preset protocol prescribes a plurality of data structure bodies, each data structure body comprises a plurality of objects and is used for describing a data structure of request data;
acquiring a plurality of objects of each data structure;
and generating a verification model for verifying each data structure body based on the plurality of objects of each data structure body.
3. The data processing method of claim 2, wherein the verification model verifies the requested data, comprising:
acquiring the request data and a data structure body corresponding to the request data in the preset protocol;
sequentially comparing the object in the data structure body with the object in the request data;
when all objects in the request data pass comparison, determining that the request data meet the preset protocol and pass verification of the verification model; when at least one object in the request data fails to pass the comparison, determining that the request data does not satisfy the preset protocol and fails the verification of the verification model.
4. The data processing method of claim 1, wherein returning response data corresponding to the first check result comprises:
when the first verification result represents that the request data passes the verification of the verification model, second response data corresponding to the request data are obtained;
and returning the second response data to the requester.
5. The data processing method of claim 1, wherein returning response data corresponding to the first check result comprises:
when the first verification result represents that the request data passes the verification of the verification model, second response data corresponding to the request data are obtained;
inputting the second response data into the verification model, and verifying the second response data by the verification model to obtain a second verification result, wherein the second verification result is used for representing that the second response data passes the verification of the verification model, or the second verification result is used for representing that the request data does not pass the verification of the verification model;
when the second check result represents that the second response data passes the verification of the check model, returning the second response data to the requester; and when the second check result represents that the second response data does not pass the verification of the check model, returning abnormal data representing the abnormality of the second response data to the requester as response data.
6. A data processing method adapted to an analog interface platform, comprising:
acquiring response data, wherein the response data is generated by a response party when the response party receives request data sent by a request party;
inputting the response data into a preset verification model, and verifying the response data by the verification model to obtain a third verification result; the third verification result is used for representing that the response data passes the verification of the verification model, or the third verification result is used for representing that the response data does not pass the verification of the verification model;
and returning corresponding response data according to the third verification result.
7. A data processing apparatus adapted for an analog interface platform, comprising:
the request data acquisition module is configured to acquire the request data sent by the requester;
the first result obtaining module is configured to input the request data into a preset verification model, and the verification model verifies the request data to obtain a first verification result; the first verification result is used for representing that the request data passes the verification of the verification model, or the first verification result is used for representing that the request data does not pass the verification of the verification model;
and the response data acquisition module is configured to execute the response data corresponding to the returned first verification result.
8. A data processing apparatus adapted for an analog interface platform, comprising:
a response data acquisition module configured to perform acquisition of response data, the response data being generated by a responder upon receiving request data sent by a requester;
the third result acquisition module is configured to input the response data into a preset verification model, and the verification model verifies the response data to obtain a third verification result; the third verification result is used for representing that the response data passes the verification of the verification model, or the third verification result is used for representing that the response data does not pass the verification of the verification model;
and the response data sending module is configured to execute the corresponding response data returned according to the third verification result.
9. A server, comprising:
a processor;
a memory for storing a computer program executable by the processor; wherein the processor is configured to execute a computer program in the memory to implement the steps of the method according to any of claims 1-6.
10. A storage medium, wherein when the executable computer program in the storage medium is executed, the steps of the method according to any one of claims 1 to 6 are implemented.
CN202010192218.7A 2020-03-18 2020-03-18 Data processing method and device suitable for analog interface platform and server Pending CN111427566A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010192218.7A CN111427566A (en) 2020-03-18 2020-03-18 Data processing method and device suitable for analog interface platform and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010192218.7A CN111427566A (en) 2020-03-18 2020-03-18 Data processing method and device suitable for analog interface platform and server

Publications (1)

Publication Number Publication Date
CN111427566A true CN111427566A (en) 2020-07-17

Family

ID=71548082

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010192218.7A Pending CN111427566A (en) 2020-03-18 2020-03-18 Data processing method and device suitable for analog interface platform and server

Country Status (1)

Country Link
CN (1) CN111427566A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016058556A1 (en) * 2014-10-17 2016-04-21 腾讯科技(深圳)有限公司 Service processing method and device
CN107451460A (en) * 2017-06-28 2017-12-08 努比亚技术有限公司 Interface processing method, equipment, server and computer-readable recording medium
CN108345511A (en) * 2017-01-24 2018-07-31 阿里巴巴集团控股有限公司 A kind of application data verification method, device and electronic equipment
CN109165017A (en) * 2018-07-05 2019-01-08 平安科技(深圳)有限公司 Data verification method, device and computer storage medium
CN110020381A (en) * 2018-02-23 2019-07-16 中国平安财产保险股份有限公司 Method of calibration, device, equipment and computer storage medium based on configuration file
CN110275831A (en) * 2019-06-18 2019-09-24 广州华多网络科技有限公司 The mock data verification method and device of protocol interface
WO2019205280A1 (en) * 2018-04-24 2019-10-31 平安科技(深圳)有限公司 Server testing method, apparatus, and device, and computer readable storage medium
CN110516258A (en) * 2019-08-30 2019-11-29 北京明略软件系统有限公司 Data verification method and device, storage medium, electronic device
CN110766160A (en) * 2019-10-21 2020-02-07 北京明略软件系统有限公司 Data verification method and device, storage medium and electronic equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016058556A1 (en) * 2014-10-17 2016-04-21 腾讯科技(深圳)有限公司 Service processing method and device
CN108345511A (en) * 2017-01-24 2018-07-31 阿里巴巴集团控股有限公司 A kind of application data verification method, device and electronic equipment
CN107451460A (en) * 2017-06-28 2017-12-08 努比亚技术有限公司 Interface processing method, equipment, server and computer-readable recording medium
CN110020381A (en) * 2018-02-23 2019-07-16 中国平安财产保险股份有限公司 Method of calibration, device, equipment and computer storage medium based on configuration file
WO2019205280A1 (en) * 2018-04-24 2019-10-31 平安科技(深圳)有限公司 Server testing method, apparatus, and device, and computer readable storage medium
CN109165017A (en) * 2018-07-05 2019-01-08 平安科技(深圳)有限公司 Data verification method, device and computer storage medium
CN110275831A (en) * 2019-06-18 2019-09-24 广州华多网络科技有限公司 The mock data verification method and device of protocol interface
CN110516258A (en) * 2019-08-30 2019-11-29 北京明略软件系统有限公司 Data verification method and device, storage medium, electronic device
CN110766160A (en) * 2019-10-21 2020-02-07 北京明略软件系统有限公司 Data verification method and device, storage medium and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
丁振凡;吴根斌;: "Spring 3.x MVC模型的数据校验国际化处理", 计算机时代, no. 08, 15 August 2012 (2012-08-15), pages 26 - 28 *

Similar Documents

Publication Publication Date Title
CN109359056B (en) Application program testing method and device
KR20160023628A (en) Method and device for verification using verification code
EP3236469B1 (en) Object monitoring method and device
CN109726108B (en) Front-end code testing method, device, system and medium based on analog data
CN111274131A (en) Interface testing method and device, electronic equipment and storage medium
CN103916468B (en) Method for upgrading system, terminal, server and upgrade-system
WO2018161540A1 (en) Fingerprint registration method and related product
CN106375096A (en) Short message verification method and device
CN111461304A (en) Training method for classifying neural network, text classification method, text classification device and equipment
CN115185717B (en) Interface calling method and device, electronic equipment and storage medium
CN107562500B (en) Debugging device, method and equipment
CN105100096A (en) Verification method and apparatus
CN112131079A (en) Data monitoring method and device, electronic equipment and storage medium
CN107819740A (en) Verification method, terminal device, audio amplifier and the server of terminal device
CN109684112B (en) Program file operation method, device, terminal and storage medium
CN105183571A (en) Function calling method and device
CN108600559B (en) Control method and device of mute mode, storage medium and electronic equipment
CN111338971B (en) Application testing method and device, electronic equipment and storage medium
CN113157256A (en) Interface code generation method and device, electronic equipment, storage medium and product
CN106909481B (en) Interface test method, interface test device and electronic equipment
CN106357520A (en) Instant messaging method and instant messaging device
CN113626321B (en) Bridging test method, device, system and storage medium
CN111427566A (en) Data processing method and device suitable for analog interface platform and server
CN114186894A (en) Project risk detection method and device, electronic equipment and storage medium
CN114817076A (en) Data processing method, device, equipment, medium and product of vehicle-mounted operating system

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