CN112732471A - Error correction method and error correction device for interface return data - Google Patents

Error correction method and error correction device for interface return data Download PDF

Info

Publication number
CN112732471A
CN112732471A CN201911033568.2A CN201911033568A CN112732471A CN 112732471 A CN112732471 A CN 112732471A CN 201911033568 A CN201911033568 A CN 201911033568A CN 112732471 A CN112732471 A CN 112732471A
Authority
CN
China
Prior art keywords
field
target
interface
error correction
field value
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.)
Granted
Application number
CN201911033568.2A
Other languages
Chinese (zh)
Other versions
CN112732471B (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 Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun 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 Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201911033568.2A priority Critical patent/CN112732471B/en
Priority claimed from CN201911033568.2A external-priority patent/CN112732471B/en
Publication of CN112732471A publication Critical patent/CN112732471A/en
Application granted granted Critical
Publication of CN112732471B publication Critical patent/CN112732471B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses an error correction method and an error correction device for interface return data, and relates to the technical field of computers. One embodiment of the method comprises: determining an interface protocol list, and pulling an interface protocol file corresponding to the interface protocol list from an interface protocol management service according to a preset pulling rule; acquiring data returned by a target interface, and determining at least one target field contained in the returned data; and searching the protocol information of the target interface from the interface protocol file, and carrying out error correction processing on at least one target field according to the protocol information of the target interface. According to the embodiment, the interface protocol file is pulled in advance, the interface protocol information of the target interface can be found after the data returned by the target interface is received, and then the error correction processing is carried out on the target field of the returned data, so that the data can be immediately subjected to the error correction processing after the returned data is received, the accuracy of the returned data can be ensured, the user experience is improved, and the labor cost and the time cost are reduced.

Description

Error correction method and error correction device for interface return data
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an error correction method and an error correction apparatus for interface return data.
Background
With the development of internet technology, in the development of current applications, the front end and the back end are basically completely separated, and the two ends perform data communication through interfaces. Meanwhile, with the development of a back-end service architecture, different functional units of a back-end application program are increasingly and finely split, and a large number of services are in data communication through a predefined interface. Therefore, it is important to ensure the accuracy of the interface return data.
At present, the existing problems are mainly solved by adopting a testing method before an application program is online, namely, the accuracy of interface data is ensured by adopting a multi-party joint debugging, interface testing and automatic testing mode, and if data is abnormal after the application program is online, the problem is solved by adopting a method of issuing an emergency version or thermal repairing.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: firstly, the method for testing before online involves a plurality of systems, the problem of occurrence of undetected phenomena can be caused, and the labor cost and the time cost in joint debugging and testing are higher; secondly, the issuing of the emergency version can cause disturbance to the user, and the issuing cost is high; thirdly, the hot repair scheme has limitations, not all platforms support hot repair, and the hot repair causes modification of online codes and may introduce new problems.
Disclosure of Invention
In view of this, embodiments of the present invention provide an error correction method and an error correction apparatus for interface return data, which can implement error correction processing on data immediately after receiving the return data, thereby ensuring accuracy of the return data, improving user experience, and reducing labor and time costs.
To achieve the above object, according to a first aspect of the embodiments of the present invention, a method for error correction of interface return data is provided.
The error correction method for the interface return data of the embodiment of the invention comprises the following steps: determining an interface protocol list, and pulling an interface protocol file corresponding to the interface protocol list from an interface protocol management service according to a preset pulling rule; acquiring data returned by a target interface, and determining at least one target field contained in the returned data; and searching the protocol information of the target interface from the interface protocol file, and carrying out error correction processing on the at least one target field according to the protocol information of the target interface.
Optionally, the performing, according to the protocol information of the target interface, an error correction process on the at least one target field includes: and aiming at any one target field, carrying out error correction processing by adopting the following method: acquiring the name of the target field; acquiring target protocol information corresponding to the target field from the protocol information of the target interface according to the name; and carrying out error correction processing on the field type and the field value of the target field according to the target protocol information.
Optionally, the performing, according to the target protocol information, error correction processing on the field type and the field value of the target field includes: judging whether the field type of the target field is abnormal or not according to a field type rule in the target protocol information; under the condition that the field type of the target field is abnormal, carrying out error correction processing on the field type of the target field according to the field importance level in the target protocol information; under the condition that the field type of the target field is normal or the field type is successfully corrected, judging whether the field value of the target field is abnormal or not according to a field value-taking rule in the target protocol information; and if so, carrying out error correction processing on the field value of the target field according to the field importance level, and if not, confirming that the target field is normal.
Optionally, the field value rule includes: a field value mode rule and a field value range rule; and the step of judging whether the field value of the target field is abnormal according to the field value rule in the target protocol information comprises the following steps: judging whether the field value mode of the target field is abnormal or not according to the field value mode rule; under the condition that the field value mode of the target field is abnormal, carrying out error correction processing on the field value mode of the target field according to the field importance level; under the condition that the field value mode of the target field is normal or the error correction of the field value mode is successful, judging whether the field value range of the target field is abnormal or not according to the field value range rule; and if so, carrying out error correction processing on the field value range of the target field according to the field importance level, and if not, confirming that the target field is normal.
Optionally, the performing, according to the field importance level in the target protocol information, an error correction process on the field type of the target field includes: judging whether the field importance level is greater than a preset field type error correction level or not; if so, confirming that the error correction of the field type fails, and if not, performing error correction processing on the field type according to a field type exception processing rule in the target protocol information.
Optionally, the performing, according to the field importance level, an error correction process on a field value mode of the target field includes: judging whether the field importance level is greater than a preset field value mode error correction level or not; if so, confirming that error correction of the field value mode fails, and if not, performing error correction processing on the field value mode according to a field value mode exception processing rule in the target protocol information.
Optionally, the performing, according to the field importance level, an error correction process on the field value range of the target field includes: judging whether the field importance level is greater than a preset field value range error correction level or not; if so, confirming that error correction on the field value range fails, and if not, performing error correction on the field value range according to a field value range exception handling rule in the target protocol information.
Optionally, the determining an interface protocol list, and pulling an interface protocol file corresponding to the interface protocol list from an interface protocol management service according to a preset pull rule includes: determining an interface contained in the interface protocol list, and acquiring an interface name, an interface version and an interface priority of the interface; and according to the interface priority, pulling the protocol file of the interface from the interface protocol management service according to the interface name and the interface version.
To achieve the above object, according to a second aspect of the embodiments of the present invention, there is provided an error correction apparatus for interface return data.
The error correction device for interface return data of the embodiment of the invention comprises: the pull module is used for determining an interface protocol list and pulling an interface protocol file corresponding to the interface protocol list from an interface protocol management service according to a preset pull rule; the determining module is used for acquiring data returned by a target interface and determining at least one target field contained in the returned data; and the error correction module is used for searching the protocol information of the target interface from the interface protocol file and carrying out error correction processing on the at least one target field according to the protocol information of the target interface.
Optionally, the error correction module is further configured to: and aiming at any one target field, carrying out error correction processing by adopting the following method: acquiring the name of the target field; acquiring target protocol information corresponding to the target field from the protocol information of the target interface according to the name; and carrying out error correction processing on the field type and the field value of the target field according to the target protocol information.
Optionally, the error correction module is further configured to: judging whether the field type of the target field is abnormal or not according to a field type rule in the target protocol information; under the condition that the field type of the target field is abnormal, carrying out error correction processing on the field type of the target field according to the field importance level in the target protocol information; under the condition that the field type of the target field is normal or the field type is successfully corrected, judging whether the field value of the target field is abnormal or not according to a field value-taking rule in the target protocol information; and if so, carrying out error correction processing on the field value of the target field according to the field importance level, and if not, confirming that the target field is normal.
Optionally, the field value rule includes: a field value mode rule and a field value range rule; and the error correction module is further configured to: judging whether the field value mode of the target field is abnormal or not according to the field value mode rule; under the condition that the field value mode of the target field is abnormal, carrying out error correction processing on the field value mode of the target field according to the field importance level; under the condition that the field value mode of the target field is normal or the error correction of the field value mode is successful, judging whether the field value range of the target field is abnormal or not according to the field value range rule; and if so, carrying out error correction processing on the field value range of the target field according to the field importance level, and if not, confirming that the target field is normal.
Optionally, the error correction module is further configured to: judging whether the field importance level is greater than a preset field type error correction level or not; if so, confirming that the error correction of the field type fails, and if not, performing error correction processing on the field type according to a field type exception processing rule in the target protocol information.
Optionally, the error correction module is further configured to: judging whether the field importance level is greater than a preset field value mode error correction level or not; if so, confirming that error correction of the field value mode fails, and if not, performing error correction processing on the field value mode according to a field value mode exception processing rule in the target protocol information.
Optionally, the error correction module is further configured to: judging whether the field importance level is greater than a preset field value range error correction level or not; if so, confirming that error correction on the field value range fails, and if not, performing error correction on the field value range according to a field value range exception handling rule in the target protocol information.
Optionally, the pulling module is further configured to: determining an interface contained in the interface protocol list, and acquiring an interface name, an interface version and an interface priority of the interface; and according to the interface priority, pulling the protocol file of the interface from the interface protocol management service according to the interface name and the interface version.
To achieve the above object, according to a third aspect of embodiments of the present invention, there is provided an electronic apparatus.
An electronic device of an embodiment of the present invention includes: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by one or more processors, the one or more processors implement the error correction method of the interface return data of the embodiment of the invention.
To achieve the above object, according to a fourth aspect of embodiments of the present invention, there is provided a computer-readable medium.
A computer-readable medium of an embodiment of the present invention stores thereon a computer program, and when the program is executed by a processor, the computer program implements an error correction method for interface return data of an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: interface protocol files of all interfaces which can be requested by a client are pre-pulled through an interface protocol list, so that interface protocol information of a target interface can be found after the target interface is called and data returned by the target interface is received, then error correction processing is carried out on a target field of the returned data according to the interface protocol information of the target interface, and the data can be immediately subjected to error correction processing after the returned data are received, so that the accuracy of the returned data can be ensured, timely processing can be carried out when the data are abnormal, the user experience is improved, and the labor cost and the time cost are reduced. In addition, the pulled interface protocol file contains the field rules, the field importance levels and the field exception handling rules of each interface, so that the effects of checking the data returned by the interfaces according to the rules in the protocol and automatically correcting the fields with exceptions are achieved, the accuracy of the returned data is further improved, and the user experience is improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of the main steps of an error correction method of interface return data according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a main flow of an error correction method of interface return data according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a main flow of a method for performing error correction processing on a field type and a field value of a target field according to target protocol information according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the overall structure of an error correction system for interface return data according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of the main modules of an error correction device for interface return data according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 7 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of main steps of an error correction method for interface return data according to an embodiment of the present invention. As shown in fig. 1, the main steps of the error correction method for interface return data of the embodiment of the present invention may include step S101 to step S103.
Step S101: and determining an interface protocol list, and pulling an interface protocol file corresponding to the interface protocol list from the interface protocol management service according to a preset pulling rule.
In the embodiment of the invention, an interface protocol list is maintained at the client, and all interface information possibly requested by the client is recorded into the interface protocol list. When the client is initialized, the client determines an interface list, namely determines interfaces which may be requested, and sends the determined interface protocol list to the interface protocol management service of the back end, so that the interface protocol files corresponding to the list can be pulled to the client. The interface protocol management service maintains the specific contents of the interface protocols of different versions, and is the description of the final form of the interface of the version finally determined by multi-party communication in the product design and research and development processes. In addition, the interface protocol file in the embodiment of the present invention may be defined as a json schema file, which is also json data (i.e., a lightweight data exchange format), where a plurality of fields with fixed meanings are explicitly defined to represent interface rule definitions, and an example of describing interface rules using the json schema file is as follows (hereinafter, referred to as annotation content):
Figure BDA0002250818490000071
Figure BDA0002250818490000081
Figure BDA0002250818490000091
as a reference embodiment of the present invention, the step S101 determines an interface protocol list, and pulls an interface protocol file corresponding to the interface protocol list from the interface protocol management service according to a preset pull rule, where the interface protocol file may include: determining an interface contained in an interface protocol list, and acquiring an interface name, an interface version and an interface priority of the interface; and according to the interface priority, pulling the protocol file of the interface from the interface protocol management service according to the interface name and the interface version.
In the embodiment of the invention, an interface protocol list is maintained at the client, and all information such as the names, versions and priorities of interfaces possibly requested in the client can be input into the interface protocol list of the client. In the process of pulling the interface protocol file, all the interfaces contained in the interface protocol class table need to be determined first, and then the interface name, version and priority of each interface are obtained respectively. The version and name are used to determine the protocol files of the interface from the interface protocol management service, while the priority is used to determine the pull order of the protocol files of the interface. In the embodiment of the invention, the priorities can be set to be the same, that is, the protocol files of all the interfaces can be pulled to the client at one time, or different priorities can be set, and then the protocol files are pulled to the client in batches according to the priorities.
Step S102: and acquiring data returned by the target interface, and determining at least one target field contained in the returned data.
In the normal operation process of a client program, the interface is continuously accessed and data is pulled, and after the data is obtained from the interface every time, the pulled data is checked and corrected, namely whether an abnormal field exists in the pulled data or not is judged. Therefore, in step S102, the data returned by the target interface is acquired, and then the target fields included in the data returned by the target interface are determined, so that each target field can be subjected to the check and error correction processing. Since the returned interface data has a field name for each field, the field included in the returned data can be determined according to the field name, that is, the returned data is divided into a plurality of fields according to the field names. For example, the returned interface data may be:
{
id:1001,
name 'a certain brand P30',
price:'5999',
tags [ { id:1001, content: 'Mobile phone' ], { id:1001, content: 'certain Brand' ]
}
And the id, the name and the price are field names, so that a target field contained in the returned data can be determined according to the field names, and then the determined target field is checked and corrected.
Step S103: and searching the protocol information of the target interface from the interface protocol file, and carrying out error correction processing on at least one target field according to the protocol information of the target interface.
In the embodiment of the present invention, the interface protocol file corresponding to the interface protocol list is obtained in step S101, and then the protocol information of the target interface can be found from the interface protocol list. In step S102, the target field included in the returned data is determined, so that the error correction processing can be performed on the target field by using the protocol information of the target interface.
In the embodiment of the invention, at least one target field contained in the returned data is determined, then each target field is checked and error-corrected, if the target field is abnormal, the abnormal field in the original data is subjected to data error correction, the abnormal field is returned to a calling party for loading and analysis after being modified, otherwise, the original data is directly returned without being processed. In addition, the embodiment of the invention can record the checking and error correcting process, is convenient for monitoring the data change and recording abnormal information which cannot be automatically corrected, can trigger log report if the field data is found to be abnormal, and can trigger log report if the field content is modified or cannot be modified.
It can be found in the above steps S101 to S103 that, in the embodiment of the present invention, the interface protocol files of all interfaces that can be requested by the client are pre-fetched according to the interface protocol list, so that the interface protocol information of the target interface can be found after the target interface is called and the data returned by the target interface is received, and then the error correction processing is performed on the target field of the returned data according to the interface protocol information of the target interface, so as to implement the error correction processing on the data immediately after the returned data is received, thereby ensuring the accuracy of the returned data, and being capable of processing in time when the data is abnormal, improving the user experience, and reducing the labor and time costs.
It can be seen that the main innovation point of the embodiment of the present invention is to perform error correction processing on the target field. Therefore, as still another reference embodiment of the present invention, the step S103 of performing error correction processing on at least one target field according to the protocol information of the target interface may include: and aiming at any one target field, carrying out error correction processing by adopting the following method: acquiring the name of a target field; acquiring target protocol information corresponding to a target field from the protocol information of the target interface according to the name; and carrying out error correction processing on the field type and the field value of the target field according to the target protocol information.
Considering that the data returned by the target interface may contain a plurality of target fields, each target field needs to be subjected to error correction processing. For any one target field, the target protocol information corresponding to the target field can be found in the protocol information of the target interface according to the noun of the target field, that is, for different target fields, there are different protocol specifications. After the target protocol information of the target field is acquired, the field type and the field value of the target field can be corrected by using the target protocol information.
In an optional embodiment of the present invention, performing error correction processing on the field type and the field value of the target field according to the target protocol information may include: judging whether the field type of the target field is abnormal or not according to the field type rule in the target protocol information; under the condition that the field type of the target field is abnormal, carrying out error correction processing on the field type of the target field according to the field importance level in the target protocol information; under the condition that the field type of the target field is normal or the error correction on the field type is successful, judging whether the field value of the target field is abnormal or not according to the field value-taking rule in the target protocol information; and if so, carrying out error correction processing on the field value of the target field according to the field importance level, and if not, confirming that the target field is normal.
In the embodiment of the invention, only under the condition of ensuring that the field type of the target field is normal, whether the value of the target field is normal is judged. Thus, if the field type is abnormal, the value of the field is meaningless. Therefore, first, according to the field type rule in the target protocol information, it is determined whether the field type of the target field is abnormal. For example, the field type in the json data may include five types, i.e., number, string, array, object, and coolan, each field must be a certain specified type, and is explicitly defined in the field type rule of the target protocol information, and if the target field type of the returned data is not consistent with the type defined in the field type rule, the field type is considered to be abnormal, for example, the field type rule defines a certain field type as number type, but actually issues the field type as string type, and such an error mostly occurs on an error related to data conversion of the daemon code.
Under the condition that the field type is abnormal, the field value of the target field needs to be subjected to error correction processing according to the field importance level. The field importance level is an evaluation criterion of the importance of the target field, and reflects the importance of the field. Assume that a field importance level of 1 indicates that the field is very important, such as an order price field; the field importance level is 2, which indicates that the field poisoning is important, such as fields of historical prices of some articles, the residual quantity of the articles and the like; a field importance rating of 3 indicates that the field is of slight importance, such as a reference field for the number of items evaluated, the number of items purchased, etc.
In the embodiment of the present invention, when a field type is abnormal, an error correction process needs to be performed on the field type of a target field according to a field importance level, and a specific implementation method is as follows: judging whether the field importance level is greater than a preset field type error correction level or not; if so, confirming that the error correction of the field type fails, and if not, performing error correction processing on the field type according to the field type exception processing rule in the target protocol information. In the embodiment of the invention, the importance level of the target field is compared with the preset field type error correction level. If the field importance level is greater than the field type error correction level, the field is very important, the error correction cannot be performed on the field type abnormality, and the error correction failure is confirmed. If the field importance level is not greater than the field type error correction level, the field type of the field is indicated to be abnormal, and error correction processing can be performed on the field type according to the field type abnormal processing rule in the target protocol information. For example, the field type rule defines that a certain field type is a number type, but actually issued as a string type, and judges that the importance level of the field is not greater than the error correction level of the field type, at this time, the issued string type can be modified into the number type. However, it should be noted that in the embodiment of the present invention, the error correction record, that is, the modification record, needs to be recorded.
In the embodiment of the present invention, under the condition that the field type of the target field is normal or the error correction on the field type is successful, the field value needs to be determined. Wherein, the field value rule may include: a field value mode rule and a field value range rule. In the embodiment of the invention, when the field value is judged to be abnormal, two parts of a field value mode and a field value range need to be judged, and the condition that the field value mode passes the verification is the precondition for verifying the field value range needs to be noticed.
Therefore, as another referential embodiment of the present invention, judging whether the field value of the target field is abnormal according to the field value rule in the target protocol information may include: judging whether the field value mode of the target field is abnormal or not according to the field value mode rule; under the condition that the field value mode of the target field is abnormal, carrying out error correction processing on the field value mode of the target field according to the field importance level; under the condition that the field value mode of the target field is normal or the error correction of the field value mode is successful, judging whether the field value range of the target field is abnormal or not according to the field value range rule; and if so, carrying out error correction processing on the field value range of the target field according to the field importance level, and if not, confirming that the target field is normal.
In an optional embodiment of the present invention, first, whether the field value mode of the target field is abnormal is determined according to the field value mode rule. The field value mode refers to a value method of the field. The field value modes corresponding to different field types are different, specifically, the value mode of the number type field is mainly to define the value type and the display form, for example, x.2 represents the integer number without limitation, and the decimal point is followed by a two-bit decimal; the value mode of string type field is mainly to define the string matching rule, and to express it by regular expression, if a certain string field rule is defined as: \ { d 3} - \ d 8} \\ { d 4} - \ {7,8} represents that the value of the field is the mobile phone number; the object type field is mainly valued in a manner of defining key values which must be contained in the object, such as k1_ k2_ k 3; the value of the array type field is mainly to define the element type in the array, such as [ k1_ k2_ k3, k4_ k5], when the array includes a wildcard character, it represents that the array can contain any type of element [ ]; the bolean type field is limited to binary values of true and false, and has no other value mode limitation. Therefore, the field value mode rule defines the value mode of the target field, and if the actual value mode of the target field is different from that defined in the rule, the value mode of the target field is abnormal. For example, a field price value rule is defined as ^ (([1-9] {1} \ d) | (0{1}) (\\ d {2}) $inthe field value mode rule, which indicates that the field needs to reserve two decimal places, and the field in the actually returned data only has one decimal place, and the value mode is abnormal at this time.
Under the condition that the field value mode of the target field is abnormal, the field value mode of the target field needs to be corrected according to the field importance level, and the specific implementation method is as follows: judging whether the field importance level is greater than a preset field value mode error correction level or not; if so, confirming that error correction of the field value mode fails, and if not, performing error correction processing on the field value mode according to a field value mode exception processing rule in the target protocol information. In the embodiment of the invention, the importance level of the target field is compared with the error correction level of the preset field value-taking mode. And if the field importance level is greater than the field value mode error correction level, indicating that the field value mode abnormality of the field cannot be corrected, and confirming that the error correction fails. If the field importance level is not greater than the field value mode error correction level, it is indicated that if the field value mode of the field is abnormal, the field value mode can be subjected to error correction processing according to the field value mode abnormality processing rule in the target protocol information. For example, the field value mode rule defines that a certain field value mode is reserved with two digits, but the field in the actually returned data has only one digit, and judges that the field importance level is not greater than the field value mode error correction level, and at this time, the issued field value mode one digit can be modified into two digits. However, it should be noted that in the embodiment of the present invention, the error correction record, that is, the modification record, needs to be recorded.
In the embodiment of the present invention, under the condition that the field value mode of the target field is normal or the error correction on the field value mode is successful, whether the field value range of the target field is abnormal or not needs to be determined according to the field value range rule. The field value range refers to a content range of a field value, and the value range may include an enumeration value definition and a size range, and the value range definition modes corresponding to different field types are different, specifically as follows: the number type field has two modes of an enumeration value and a range value, when the number type field is defined as the enumeration value, such as [1,2,3.0], the field only takes on three conditions of 1,2 and 3.0, and when the number type field is defined as the range value, such as 0-299, the field can take any value of 0-299; the string type field has two modes of enumeration value and range value, when the string type field is defined as the enumeration value, for example [ 'a', 'b', 'c' ] represents that the field has three conditions of a, b and c, and when the string type field is defined as the range, for example 0-299, represents that the string can have any length of 0-299; the array type field has only one definition mode of range values, such as 0-20, and represents that the array elements are at least 0 and at most 20; object type and bolean type do not take value back restrictions. Therefore, the value range of the target field is defined in the field value range rule, and if the actual value of the target field does not meet the defined range in the rule, the value range of the target field is abnormal. For example, a field count value range is defined as 1 to 10 in the field value range rule, and the field is 20 in the actually returned data, and the value range is abnormal at this time.
Under the condition that the field value range of the target field is abnormal, the field value range of the target field needs to be subjected to error correction processing according to the field importance level, and the specific implementation method comprises the following steps: judging whether the field importance level is greater than a preset field value range error correction level or not; if so, confirming that error correction on the field value range fails, and if not, performing error correction on the field value range according to the field value range exception handling rule in the target protocol information. In the embodiment of the invention, the importance level of the target field is compared with the error correction level of the preset field value range. And if the field importance level is greater than the field value range error correction level, indicating that the field value range abnormality of the field cannot be corrected, and confirming that the error correction fails. If the field importance level is not greater than the field value range error correction level, it is indicated that if the field value range of the field is abnormal, the field value range can be subjected to error correction processing according to the field value range abnormality processing rule in the target protocol information. For example, a field count value range is defined as 1 to 10 in the field value range rule, but the field is 20 in the actually returned data, and the importance level of the field is judged to be not greater than the error correction level of the field value range, and then the issued field value can be modified.
Fig. 2 is a schematic diagram of a main flow of an error correction method of interface return data according to an embodiment of the present invention. As shown in fig. 2, the main flow of the error correction method for interface return data according to the embodiment of the present invention may include:
step S201: determining an interface contained in an interface protocol list, and acquiring an interface name, an interface version and an interface priority of the interface;
step S202: according to the interface priority, according to the interface name and the interface version, pulling the protocol file of the interface from the interface protocol management service, and searching the protocol information of the target interface from the protocol file of the interface;
step S203: acquiring data returned by a target interface, and determining at least one target field contained in the returned data;
step S204: randomly selecting a target field which is not subjected to error correction processing, and acquiring the name of the target field;
step S205: acquiring target protocol information corresponding to the target field from the protocol information of the target interface according to the acquired name of the target field;
step S206: according to the target protocol information, carrying out error correction processing on the field type and the field value of the target field;
step S207: judging whether target fields which are not subjected to error correction processing exist, if so, executing a step S204, otherwise, executing a step S208;
step S208: and outputting the result.
It should be noted that, if the target field exception can be handled, the data error correction is performed on the exception field in the original data, the exception field is returned to the caller for loading and parsing after being modified, and the output result in step S208 is the modified data and the error correction record at this time; if the target field is abnormal and can not be processed, the output result in step S208 is the abnormal type of the original data and the target field; if the target field is not abnormal, the original data is directly returned to the caller for loading and analysis, and the output result in step S208 is the original data.
In addition, as can be seen from step S201 to step S208, the importance of the embodiment of the present invention is to perform error correction processing on the target field. Fig. 3 is a schematic diagram of a main flow of a method for performing error correction processing on a field type and a field value of a target field according to target protocol information according to an embodiment of the present invention. As shown in fig. 3, the main process of the method for performing error correction processing on the field type and the field value of the target field according to the target protocol information in the embodiment of the present invention may include:
step S301: judging whether the field type of the target field is abnormal or not according to a field type rule in the target protocol information, if so, executing a step S302, and if not, executing a step S304;
step S302: judging whether the field importance level is greater than a preset field type error correction level, if so, executing a step S310, and if not, executing a step S303;
step S303: according to field type exception handling rules in the target protocol information, carrying out error correction processing on the field type;
step S304: judging whether the field value mode of the target field is abnormal or not according to the field value mode rule, if so, executing the step S305, and if not, executing the step S307;
step S305: judging whether the field importance level is greater than a preset field value mode error correction level, if so, executing a step S310, and if not, executing a step S306;
step S306: according to a field value mode exception handling rule in the target protocol information, carrying out error correction processing on the field value mode;
step S307: judging whether the field value range of the target field is abnormal or not according to the field value range rule, if so, executing step S308, and if not, executing step S310;
step S308: judging whether the field importance level is greater than a preset field value range error correction level, if so, executing a step S310, and if not, executing a step S309;
step S309: according to a field value range exception handling rule in the target protocol information, carrying out error correction processing on the field value range;
step S310: confirming that error correction processing of the target field fails;
step S311: the confirmation target field is normal.
It should be noted that the error correction records involved in steps S301 to S311 all need to be recorded and reported, and it is confirmed in step S311 that the target field normally includes two cases, namely the target field is originally normal and the target field after error correction is normal.
In addition, it may also be found that the protocol information of the interface in the embodiment of the present invention includes protocol information of each field, and the protocol information of each field may include: the field rule, the field importance level and the field exception handling rule, wherein the field rule describes the field type, the value mode and the value range. The field importance level describes the importance of each field in the interface, for example, the importance level can be divided into 1,2 and 3 levels, and level 1 indicates that the client cannot modify the field when the value of the field is abnormal; level 2 indicates that when the type error occurs in the field, the forced type conversion is carried out on the value; the 3-level representation shows that the value can be automatically corrected according to the field exception handling rule under the conditions of wrong type, exceeding value range, exception of value mode and the like. The field exception handling rule describes how to generate a new value according to an error reason and an old value when various exception conditions occur in the field during checking, and may include: a field type exception handling rule, a field value mode exception handling rule and a field value range exception handling rule.
Fig. 4 is a schematic diagram of the overall structure of an error correction system for interface return data according to an embodiment of the present invention. As shown in fig. 4, the system for error correction of interface return data according to the embodiment of the present invention may include: the system comprises a protocol loading part, a data checking part, an exception handling and error correcting part and a log reporting part.
The protocol loading part is responsible for maintaining an interface protocol management service at the back end and an interface protocol list at the client. All information such as interface names and versions related to interfaces possibly requested in the client are entered into an interface protocol list of the client. When the client is initialized, the interface protocol list is sent to the interface protocol management service of the back end, and the protocol files of all the interfaces in the list are pulled to the client. The interface protocol management service maintains the specific contents of the interface protocols of different versions, and is the description of the final form of the interface of the version finally determined by multi-party communication in the processes of product design and research and development.
The data checking part is used for continuously accessing the interface and pulling data in the normal operation process of the client program, and the data needs to be checked before loading and processing the data after the data is acquired from the interface every time. If the data completely conforms to the interface protocol, returning the original data for the calling party to load and analyze, and if the data has an abnormal field, throwing the original data and the abnormal information into an automatic error correction system for further data error correction.
The automatic error correction part is responsible for carrying out exception classification on the abnormal data after receiving the interface data and the check result, and inquiring the importance level of the field and exception handling rule information from the interface protocol. If the field exception can be processed, the exception field in the original data is corrected and returned to the calling party for loading and analysis after being modified, otherwise, the field is not processed and the original data is directly returned.
The log reporting part is responsible for recording the checking and error correcting processes, so that the data change is conveniently monitored, and abnormal information which cannot be automatically corrected is conveniently recorded, thereby helping to perfect error correction. When field data are found to be abnormal in data verification, log reporting is triggered, and when field contents are modified or cannot be modified in automatic error correction, log reporting is also triggered.
According to the technical scheme for error correction of the interface return data, the interface protocol files of all the interfaces which can be requested by the client can be pre-pulled through the interface protocol list, so that the interface protocol information of the target interface can be found after the target interface is called and the data returned by the target interface is received, then the error correction processing is carried out on the target field of the returned data according to the interface protocol information of the target interface, and the error correction processing is carried out on the data immediately after the returned data is received, so that the accuracy of the returned data can be ensured, the data can be timely processed when the data is abnormal, the user experience is improved, and the labor and time costs are reduced. In addition, the pulled interface protocol file contains the field rules, the field importance levels and the field exception handling rules of each interface, so that the effects of checking the data returned by the interfaces according to the rules in the protocol and automatically correcting the fields with exceptions are achieved, the accuracy of the returned data is further improved, and the user experience is improved.
Fig. 5 is a schematic diagram of main blocks of an error correction apparatus for interface return data according to an embodiment of the present invention. As shown in fig. 5, the error correction apparatus 500 for interface return data according to the embodiment of the present invention mainly includes the following modules: a pull module 501, a determination module 502 and an error correction module 503.
The pulling module 501 may be configured to determine an interface protocol list, and pull an interface protocol file corresponding to the interface protocol list from the interface protocol management service according to a preset pulling rule; the determining module 502 may be configured to obtain data returned by the target interface, and determine at least one target field included in the returned data; the error correction module 503 may be configured to search the protocol information of the target interface from the interface protocol file, and perform error correction processing on at least one target field according to the protocol information of the target interface.
In this embodiment of the present invention, the error correction module 503 may further be configured to: and aiming at any one target field, carrying out error correction processing by adopting the following method: acquiring the name of a target field; acquiring target protocol information corresponding to a target field from the protocol information of the target interface according to the name; and carrying out error correction processing on the field type and the field value of the target field according to the target protocol information.
In this embodiment of the present invention, the error correction module 503 may further be configured to: judging whether the field type of the target field is abnormal or not according to the field type rule in the target protocol information; under the condition that the field type of the target field is abnormal, carrying out error correction processing on the field type of the target field according to the field importance level in the target protocol information; under the condition that the field type of the target field is normal or the error correction on the field type is successful, judging whether the field value of the target field is abnormal or not according to the field value-taking rule in the target protocol information; and if so, carrying out error correction processing on the field value of the target field according to the field importance level, and if not, confirming that the target field is normal.
In the embodiment of the present invention, the field value rule may include: a field value mode rule and a field value range rule. And, the error correction module 503 may also be configured to: judging whether the field value mode of the target field is abnormal or not according to the field value mode rule; under the condition that the field value mode of the target field is abnormal, carrying out error correction processing on the field value mode of the target field according to the field importance level; under the condition that the field value mode of the target field is normal or the error correction of the field value mode is successful, judging whether the field value range of the target field is abnormal or not according to the field value range rule; and if so, carrying out error correction processing on the field value range of the target field according to the field importance level, and if not, confirming that the target field is normal.
In this embodiment of the present invention, the error correction module 503 may further be configured to: judging whether the field importance level is greater than a preset field type error correction level or not; if so, confirming that the error correction of the field type fails, and if not, performing error correction processing on the field type according to the field type exception processing rule in the target protocol information.
In this embodiment of the present invention, the error correction module 503 may further be configured to: judging whether the field importance level is greater than a preset field value mode error correction level or not; if so, confirming that error correction of the field value mode fails, and if not, performing error correction processing on the field value mode according to a field value mode exception processing rule in the target protocol information.
In this embodiment of the present invention, the error correction module 503 may further be configured to: judging whether the field importance level is greater than a preset field value range error correction level or not; if so, confirming that error correction on the field value range fails, and if not, performing error correction on the field value range according to the field value range exception handling rule in the target protocol information.
In this embodiment of the present invention, the error correction module 503 may further be configured to: determining an interface contained in an interface protocol list, and acquiring an interface name, an interface version and an interface priority of the interface; and according to the interface priority, pulling the protocol file of the interface from the interface protocol management service according to the interface name and the interface version.
As can be seen from the above description, the error correction device for interface returned data in the embodiment of the present invention can pull interface protocol files of all interfaces that can be requested by the client in advance through the interface protocol list, so that the interface protocol information of the target interface can be found after the target interface is called and the data returned by the target interface is received, and then error correction processing is performed on the target field of the returned data according to the interface protocol information of the target interface, so as to implement error correction processing on the data immediately after the returned data is received, thereby ensuring the accuracy of the returned data, and being capable of processing the returned data in time when the data is abnormal, improving user experience, and reducing labor and time costs. In addition, the pulled interface protocol file contains the field rules, the field importance levels and the field exception handling rules of each interface, so that the effects of checking the data returned by the interfaces according to the rules in the protocol and automatically correcting the fields with exceptions are achieved, the accuracy of the returned data is further improved, and the user experience is improved.
Fig. 6 shows an exemplary system architecture 600 to which an error correction method for interface return data or an error correction apparatus for interface return data of an embodiment of the present invention may be applied.
As shown in fig. 6, the system architecture 600 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 supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 601, 602, 603. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the error correction method for the interface return data provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the error correction device for the interface return data is generally disposed in 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.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to the embodiments 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 can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium 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 invention, 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 the present invention, however, 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 invention. 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.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a pull module, a determination module, and an error correction module. For example, the pull module may also be described as a "module that determines an interface protocol list and pulls an interface protocol file corresponding to the interface protocol list from the interface protocol management service according to a preset pull rule".
As another aspect, the present invention also provides a computer-readable medium that 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 comprise: determining an interface protocol list, and pulling an interface protocol file corresponding to the interface protocol list from an interface protocol management service according to a preset pulling rule; acquiring data returned by a target interface, and determining at least one target field contained in the returned data; and searching the protocol information of the target interface from the interface protocol file, and carrying out error correction processing on at least one target field according to the protocol information of the target interface.
According to the technical scheme of the embodiment of the invention, the interface protocol files of all the interfaces which can be requested by the client are pre-pulled through the interface protocol list, so that the interface protocol information of the target interface can be found after the target interface is called and the data returned by the target interface is received, and then the error correction processing is carried out on the target field of the returned data according to the interface protocol information of the target interface, so that the error correction processing is carried out on the data immediately after the returned data is received, the accuracy of the returned data can be ensured, the data can be processed in time when the data is abnormal, the user experience is improved, and the labor and time cost is reduced. In addition, the pulled interface protocol file contains the field rules, the field importance levels and the field exception handling rules of each interface, so that the effects of checking the data returned by the interfaces according to the rules in the protocol and automatically correcting the fields with exceptions are achieved, the accuracy of the returned data is further improved, and the user experience is improved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. An error correction method for interface return data, comprising:
determining an interface protocol list, and pulling an interface protocol file corresponding to the interface protocol list from an interface protocol management service according to a preset pulling rule;
acquiring data returned by a target interface, and determining at least one target field contained in the returned data;
and searching the protocol information of the target interface from the interface protocol file, and carrying out error correction processing on the at least one target field according to the protocol information of the target interface.
2. The method according to claim 1, wherein said performing error correction processing on said at least one target field according to the protocol information of said target interface comprises: and aiming at any one target field, carrying out error correction processing by adopting the following method:
acquiring the name of the target field;
acquiring target protocol information corresponding to the target field from the protocol information of the target interface according to the name;
and carrying out error correction processing on the field type and the field value of the target field according to the target protocol information.
3. The method according to claim 2, wherein the performing error correction processing on the field type and the field value of the target field according to the target protocol information includes:
judging whether the field type of the target field is abnormal or not according to a field type rule in the target protocol information;
under the condition that the field type of the target field is abnormal, carrying out error correction processing on the field type of the target field according to the field importance level in the target protocol information;
under the condition that the field type of the target field is normal or the field type is successfully corrected, judging whether the field value of the target field is abnormal or not according to a field value-taking rule in the target protocol information;
and if so, carrying out error correction processing on the field value of the target field according to the field importance level, and if not, confirming that the target field is normal.
4. The method of claim 3, wherein the field value rule comprises: a field value mode rule and a field value range rule; and
the determining whether the field value of the target field is abnormal according to the field value rule in the target protocol information includes:
judging whether the field value mode of the target field is abnormal or not according to the field value mode rule;
under the condition that the field value mode of the target field is abnormal, carrying out error correction processing on the field value mode of the target field according to the field importance level;
under the condition that the field value mode of the target field is normal or the error correction of the field value mode is successful, judging whether the field value range of the target field is abnormal or not according to the field value range rule;
and if so, carrying out error correction processing on the field value range of the target field according to the field importance level, and if not, confirming that the target field is normal.
5. The method according to claim 3, wherein said performing error correction processing on the field type of the target field according to the field importance level in the target protocol information comprises:
judging whether the field importance level is greater than a preset field type error correction level or not;
if so, confirming that the error correction of the field type fails, and if not, performing error correction processing on the field type according to a field type exception processing rule in the target protocol information.
6. The method according to claim 4, wherein the performing error correction processing on the field value mode of the target field according to the field importance level includes:
judging whether the field importance level is greater than a preset field value mode error correction level or not;
if so, confirming that error correction of the field value mode fails, and if not, performing error correction processing on the field value mode according to a field value mode exception processing rule in the target protocol information.
7. The method according to claim 4, wherein the performing error correction processing on the field value range of the target field according to the field importance level includes:
judging whether the field importance level is greater than a preset field value range error correction level or not;
if so, confirming that error correction on the field value range fails, and if not, performing error correction on the field value range according to a field value range exception handling rule in the target protocol information.
8. The method of claim 1, wherein the determining the interface protocol list, and pulling the interface protocol file corresponding to the interface protocol list from the interface protocol management service according to a preset pull rule comprises:
determining an interface contained in the interface protocol list, and acquiring an interface name, an interface version and an interface priority of the interface;
and according to the interface priority, pulling the protocol file of the interface from the interface protocol management service according to the interface name and the interface version.
9. An error correction apparatus for interface return data, comprising:
the pull module is used for determining an interface protocol list and pulling an interface protocol file corresponding to the interface protocol list from an interface protocol management service according to a preset pull rule;
the determining module is used for acquiring data returned by a target interface and determining at least one target field contained in the returned data;
and the error correction module is used for searching the protocol information of the target interface from the interface protocol file and carrying out error correction processing on the at least one target field according to the protocol information of the target interface.
10. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
11. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN201911033568.2A 2019-10-28 Error correction method and error correction device for interface return data Active CN112732471B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911033568.2A CN112732471B (en) 2019-10-28 Error correction method and error correction device for interface return data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911033568.2A CN112732471B (en) 2019-10-28 Error correction method and error correction device for interface return data

Publications (2)

Publication Number Publication Date
CN112732471A true CN112732471A (en) 2021-04-30
CN112732471B CN112732471B (en) 2024-07-16

Family

ID=

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120041932A1 (en) * 2010-08-10 2012-02-16 International Business Machines Corporation Method for validating equivalent data structures
US20130014267A1 (en) * 2011-07-07 2013-01-10 Farrugia Augustin J Computer protocol generation and obfuscation
CN106549917A (en) * 2015-09-21 2017-03-29 中兴通讯股份有限公司 The method and apparatus of distinct interface protocol massages conversion processing
CN108664388A (en) * 2017-03-31 2018-10-16 北京京东尚科信息技术有限公司 Dynamic field data return to test system, method, electronic equipment and the readable storage medium storing program for executing of interface
CN109344642A (en) * 2018-08-31 2019-02-15 平安科技(深圳)有限公司 Interface rules method of calibration, device, computer equipment and storage medium
CN109885180A (en) * 2019-02-21 2019-06-14 北京百度网讯科技有限公司 Error correction method and device, computer-readable medium
CN110069364A (en) * 2019-04-17 2019-07-30 中广核核电运营有限公司 Spare part data error-correcting method, device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120041932A1 (en) * 2010-08-10 2012-02-16 International Business Machines Corporation Method for validating equivalent data structures
US20130014267A1 (en) * 2011-07-07 2013-01-10 Farrugia Augustin J Computer protocol generation and obfuscation
CN106549917A (en) * 2015-09-21 2017-03-29 中兴通讯股份有限公司 The method and apparatus of distinct interface protocol massages conversion processing
CN108664388A (en) * 2017-03-31 2018-10-16 北京京东尚科信息技术有限公司 Dynamic field data return to test system, method, electronic equipment and the readable storage medium storing program for executing of interface
CN109344642A (en) * 2018-08-31 2019-02-15 平安科技(深圳)有限公司 Interface rules method of calibration, device, computer equipment and storage medium
CN109885180A (en) * 2019-02-21 2019-06-14 北京百度网讯科技有限公司 Error correction method and device, computer-readable medium
CN110069364A (en) * 2019-04-17 2019-07-30 中广核核电运营有限公司 Spare part data error-correcting method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110225104B (en) Data acquisition method and device and terminal equipment
CN111460129B (en) Method, device, electronic equipment and storage medium for generating identification
CN109901987B (en) Method and device for generating test data
CN110895472A (en) Method and device for identifying service change
CN110244963B (en) Data updating method and device and terminal equipment
CN110599277A (en) Inventory deduction method and device
CN109325002B (en) Text file processing method, device and system, electronic equipment and storage medium
CN112825096A (en) Data desensitization method and device
CN114297278A (en) Method, system and device for quickly writing batch data
CN113761565B (en) Data desensitization method and device
CN113282589A (en) Data acquisition method and device
CN116450622B (en) Method, apparatus, device and computer readable medium for data warehouse entry
CN112559024A (en) Method and device for generating transaction code change list
CN110851343A (en) Test method and device based on decision tree
CN116069725A (en) File migration method, device, apparatus, medium and program product
CN112800006B (en) Log storage method and device for network equipment
CN112783903B (en) Method and device for generating update log
CN112732471B (en) Error correction method and error correction device for interface return data
CN112732471A (en) Error correction method and error correction device for interface return data
CN109656519B (en) Method and device for automatically accessing service data
CN113900895B (en) Information processing method, information processing apparatus, storage medium, and electronic device
CN113420037B (en) Asset data real-time changing method and device
CN111339097B (en) Data processing method and related equipment
CN113778503B (en) Software maintenance method and device
CN111291038B (en) Data query 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
GR01 Patent grant