Interface Compatibility Detection Method, Device, Electronic Device and Storage Medium

By layering the key value set of the second characteristic value of the interface, the problems of low efficiency and incompleteness of traditional detection methods are solved, and more efficient and accurate interface compatibility detection is achieved.

CN114741260BActive Publication Date: 2025-06-20PINGAN INT SMART CITY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210368672.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-08
Publication Date
2025-06-20
Estimated Expiration
2042-04-08

AI Technical Summary

Technical Problem

Traditional interface compatibility detection methods have problems such as incomplete detection and low efficiency, and it is difficult to effectively solve the compatibility problems of interfaces in different versions.

Method used

Hierarchical detection is performed through the key value set of the second characteristic value of each interface to be detected to reduce the risk of missed detection and improve the accuracy and efficiency of compatibility detection.

Benefits of technology

It improves the accuracy and efficiency of interface compatibility detection, reduces the risk of missed detection, can quickly determine interface compatibility, and improves maintenance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114741260B_ABST
    Figure CN114741260B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of data testing, and provides an interface compatibility detection method, device, electronic device and storage medium. The method includes: obtaining a first characteristic value of each interface to be detected in a list of interfaces to be detected; based on the first characteristic value of each interface to be detected, when it is determined to perform hierarchical comparison on the structural data of each interface to be detected, receiving a second characteristic value of the structural data of each interface to be detected; identifying the type of the second characteristic value of the structural data of each interface to be detected; performing hierarchical detection on the key value set of the second characteristic value of the structural data of each interface to be detected based on the type of the second characteristic value of the structural data of each interface to be detected, so as to obtain a compatibility detection result. By performing hierarchical detection on the key value set of the second characteristic value of the structural data of each interface to be detected, the present invention reduces the risk of missed detection and improves the accuracy and efficiency of interface compatibility detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data testing, and in particular, to an interface compatibility detection method, device, electronic device, and storage medium. Background Art

[0002] During the software development process, code refactoring, database type compatibility, or migration operations are often performed, resulting in different database types or different versions, which causes differences in the structured data returned by the interfaces. These differences are caused by the compatibility issues of interfaces with different versions. To solve the compatibility issues of interfaces with different versions, traditional technologies detect hidden compatibility issues during user usage or perform compatibility testing by simulating user operations. However, both of these traditional compatibility detection methods have the problems of incomplete detection and low efficiency. Summary of the Invention

[0003] In view of the above, it is necessary to propose an interface compatibility detection method, device, electronic device, and storage medium, which perform hierarchical detection through the key-value set of the second eigenvalue of each interface to be detected, reducing the risk of missed detection and improving the accuracy and efficiency of interface compatibility detection.

[0004] The first aspect of the present invention provides an interface compatibility detection method, which includes:

[0005] Parse the received interface compatibility detection request to obtain the first eigenvalue of each interface to be detected in the list of interfaces to be detected;

[0006] Based on the first eigenvalue of each interface to be detected, determine whether to perform hierarchical comparison on the structured data of each interface to be detected;

[0007] When it is determined to perform hierarchical comparison on the structured data of each interface to be detected, receive the second eigenvalue of the structured data of each interface to be detected;

[0008] Identify the type of the second eigenvalue of the structured data of each interface to be detected;

[0009] Based on the type of the second eigenvalue of the structured data of each interface to be detected, perform hierarchical detection on the key-value set of the second eigenvalue of the structured data of each interface to be detected to obtain a compatibility detection result.

[0010] Optionally, the determining whether to perform hierarchical comparison on the structured data of each interface to be detected based on the first eigenvalue of each interface to be detected includes:

[0011] Extract the first status code value and the first MSG type value of the interface of the first version, and the second status code value and the second MSG type value of the interface of the second version from the first eigenvalue of each of the interfaces to be detected;

[0012] According to the preset conversion rules, convert the first status code value and the first MSG type value of each of the interfaces to be detected, and the second status code value and the second MSG type value, to obtain the eigenvalue of the interface of the first version and the eigenvalue of the interface of the second version of each of the interfaces to be detected;

[0013] Compare the eigenvalue of the interface of the first version of each of the interfaces to be detected with the eigenvalue of the interface of the second version;

[0014] When the eigenvalue of the interface of the first version of each of the interfaces to be detected is exactly the same as the eigenvalue of the interface of the second version, determine to perform hierarchical comparison on the structure data of each of the interfaces to be detected.

[0015] Optionally, the receiving the second eigenvalue of the structure data of each of the interfaces to be detected includes:

[0016] Send the first trigger request of the interface of the first version and the second trigger request of the interface of the second version of each of the interfaces to be detected;

[0017] In response to the first trigger request, receive the eigenvalue of the structure data of the first version returned by the interface of the first version, and in response to the second trigger request, receive the eigenvalue of the structure data of the second version returned by the interface of the second version;

[0018] Determine the eigenvalue of the structure data of the first version and the eigenvalue of the structure data of the second version as the second eigenvalue of the structure data of each of the interfaces to be detected.

[0019] Optionally, the hierarchical detection of the key value set of the second eigenvalue of the structure data of each of the interfaces to be detected based on the type of the second eigenvalue of the structure data of each of the interfaces to be detected, and the obtained compatibility detection result includes:

[0020] Obtain the first data type of the interface of the first version and the second data type of the interface of the second version from the type of the second eigenvalue of the structure data of each of the interfaces to be detected;

[0021] Compare the first data type of the interface of the first version with the second data type of the interface of the second version;

[0022] When the first data type of the interface of the first version is inconsistent with the second data type of the interface of the second version, it is determined that the compatibility detection result is that the interface of the first version and the interface of the second version of each to-be-detected interface are incompatible.

[0023] Optionally, the comparison of the first data type of the interface of the first version with the second data type of the interface of the second version includes:

[0024] When the first data type of the interface of the first version is consistent with the second data type of the interface of the second version, and the first data type and the second data type are of a first preset type, at least one iterative hierarchical comparison detection is performed on the key-value set corresponding to the eigenvalue of the structural data of the first version and the key-value set corresponding to the eigenvalue of the structural data of the second version until the compatibility detection result is obtained, where the at least one iterative hierarchical comparison detection includes:

[0025] Determine whether the first-level key values of the key-value set corresponding to the eigenvalue of the structural data of the first version are consistent with the first-level key values of the key-value set corresponding to the eigenvalue of the structural data of the second version;

[0026] When the first-level key values of the key-value set corresponding to the eigenvalue of the structural data of the first version are consistent with the first-level key values of the key-value set corresponding to the eigenvalue of the structural data of the second version, perform the next iterative comparison detection on the next-level key values of the first-level key values;

[0027] When the first-level key values of the key-value set corresponding to the eigenvalue of the structural data of the first version are inconsistent with the first-level key values of the key-value set corresponding to the eigenvalue of the structural data of the second version, it is determined that the compatibility detection result is that the interface of the first version and the interface of the second version of each to-be-detected interface are incompatible.

[0028] Optionally, the comparison of the first data type of the interface of the first version with the second data type of the interface of the second version includes:

[0029] When the first data type of the interface of the first version is consistent with the second data type of the interface of the second version, and the first data type and the second data type are of a second preset type, at least one iterative hierarchical comparison detection is performed on the key-value set corresponding to the eigenvalue of the structural data of the first version and the key-value set corresponding to the eigenvalue of the structural data of the second version until the compatibility detection result is obtained, where the at least one iterative hierarchical comparison detection includes:

[0030] Obtain the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the first version and the first-level key value of the key value set corresponding to the eigenvalue of the structure data of the second version;

[0031] When the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the first version is included in the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the second version, perform the next iteration comparison detection on the next-level key value set of the first-level key value set;

[0032] When the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the first version is not included in the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the second version, determine that the compatibility detection result is that the interface of the first version of each of the to-be-detected interfaces is not compatible with the interface of the second version.

[0033] Optionally, the parsing the received interface compatibility detection request and obtaining the first eigenvalue of each of the to-be-detected interfaces in the to-be-detected interface list includes:

[0034] Parse the interface compatibility detection request to obtain an interface compatibility detection message;

[0035] Obtain the to-be-detected interface list of the to-be-detected system from the interface compatibility detection message;

[0036] Read the to-be-detected use case set of each of the to-be-detected interfaces in the to-be-detected interface list;

[0037] Trigger access to the interfaces of each of the to-be-detected use cases in the to-be-detected use case set, and obtain the first status code value and the first MSG type value of the interface of the first version of each of the to-be-detected use cases and the second status code value and the second MSG type value of the interface of the second version;

[0038] Determine the first status code value and the first MSG type value of the interface of the first version of each of the to-be-detected use cases and the second status code value and the second MSG type value of the interface of the second version as the first eigenvalue of each of the to-be-detected interfaces.

[0039] The second aspect of the present invention provides an interface compatibility detection device, and the device includes:

[0040] A parsing and obtaining module, configured to parse the received interface compatibility detection request and obtain the first eigenvalue of each of the to-be-detected interfaces in the to-be-detected interface list;

[0041] A judgment module, configured to judge whether to perform hierarchical comparison on the structure data of each of the to-be-detected interfaces based on the first eigenvalue of each of the to-be-detected interfaces;

[0042] A receiving module, configured to receive second eigenvalue of the structure data of each of the to-be-detected interfaces when it is determined to perform hierarchical comparison on the structure data of each of the to-be-detected interfaces;

[0043] An identification module, configured to identify the type of the second eigenvalue of the structure data of each of the to-be-detected interfaces;

[0044] A hierarchical detection module, configured to perform hierarchical detection on the key value set of the second eigenvalue of the structure data of each of the to-be-detected interfaces based on the type of the second eigenvalue of the structure data of each of the to-be-detected interfaces, so as to obtain a compatibility detection result.

[0045] A third aspect of the present invention provides an electronic device, which includes a processor and a memory. The processor is configured to implement the interface compatibility detection method when executing a computer program stored in the memory.

[0046] A fourth aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored. The computer program, when executed by a processor, implements the interface compatibility detection method.

[0047] In summary, for the interface compatibility detection method, device, electronic device and storage medium of the present invention, based on the first eigenvalue of each of the to-be-detected interfaces, it is initially determined whether the interfaces of the first version and the second version of each of the to-be-detected interfaces are compatible. There is no need to compare the structure data of each of the to-be-detected interfaces again, and it is directly determined that the interfaces of the first version and the second version of each of the to-be-detected interfaces are incompatible, improving the efficiency of interface compatibility testing. When it is determined to perform hierarchical comparison on each of the to-be-detected interfaces, hierarchical detection is performed on the key value set of the second eigenvalue of the structure data of each of the to-be-detected interfaces based on the type of the second eigenvalue of the structure data of each of the to-be-detected interfaces, so as to obtain a compatibility detection result. For the types of eigenvalues of structure data of different versions, by performing hierarchical detection on the key value sets corresponding to the eigenvalues of structure data of different versions, the risk of missed detection can be reduced, and the accuracy and efficiency of interface compatibility detection are improved. At the same time, when performing hierarchical detection on the key value sets corresponding to the eigenvalues of structure data of different versions, when any layer of key value sets of different versions is inconsistent, the interface compatibility detection result can be quickly obtained and the eigenvalue of the incompatible interface can be determined, improving the efficiency of interface compatibility detection and maintenance efficiency. Description of the Drawings

[0048] Figure 1 is a flowchart of the interface compatibility detection method provided in Embodiment 1 of the present invention.

[0049] Figure 2It is a structural diagram of the interface compatibility detection device provided in the second embodiment of the present invention.

[0050] Figure 3 It is a schematic structural diagram of the electronic device provided in the third embodiment of the present invention. Detailed implementation manners

[0051] In order to more clearly understand the above objects, features and advantages of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, without conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments, and are not intended to limit the present invention.

[0053] Embodiment 1

[0054] Figure 1 It is a flowchart of the interface compatibility detection method provided in the first embodiment of the present invention.

[0055] In this embodiment, the interface compatibility detection method can be applied to an electronic device. For an electronic device that needs to perform interface compatibility detection, the function of interface compatibility detection provided by the method of the present invention can be directly integrated on the electronic device, or run in the electronic device in the form of a software development kit (SDK).

[0056] As Figure 1 shown, the interface compatibility detection method specifically includes the following steps. According to different requirements, the order of the steps in this flowchart can be changed, and some can be omitted.

[0057] S11. Analyze the received interface compatibility detection request, and obtain the first feature value of each of the to-be-detected interfaces in the to-be-detected interface list.

[0058] In this embodiment, the interface compatibility detection request includes a to-be-detected interface list of the to-be-detected system, and the first feature value includes the status code values and MSG type values of different versions of each to-be-detected interface.

[0059] In an optional embodiment, the analyzing the received interface compatibility detection request and obtaining the first feature value of each of the to-be-detected interfaces in the to-be-detected interface list includes:

[0060] Analyze the interface compatibility detection request to obtain an interface compatibility detection message;

[0061] Obtain a list of interfaces to be detected for the system to be detected from the interface compatibility detection report;

[0062] Read the set of test cases to be detected for each interface to be detected in the list of interfaces to be detected;

[0063] Trigger access to the interfaces of each test case to be detected in the set of test cases to be detected, and obtain the first status code value and the first MSG type value of the interface of the first version of each test case to be detected, as well as the second status code value and the second MSG type value of the interface of the second version;

[0064] Determine the first status code value and the first MSG type value of the interface of the first version of each test case to be detected, as well as the second status code value and the second MSG type value of the interface of the second version as the first characteristic values of each interface to be detected.

[0065] In this embodiment, the set of test cases to be detected is constructed by pre-inputting the status code values and MSG type values of each interface to be detected in the list of interfaces to be detected.

[0066] S12. Based on the first characteristic values of each interface to be detected, determine whether to perform hierarchical comparison on the structural data of each interface to be detected.

[0067] In this embodiment, since the first characteristic values of each interface to be detected include the first status code value and the first MSG type value of the interface of the first version, as well as the second status code value and the second MSG type value of the interface of the second version, by comparing whether the second status code value and the second MSG type value of the interfaces of the first version and the second version are consistent, determine whether to perform hierarchical comparison on the structural data of each interface to be detected according to the comparison result.

[0068] In an optional embodiment, the determining whether to perform hierarchical comparison on the structural data of each interface to be detected based on the first characteristic values of each interface to be detected includes:

[0069] Extract the first status code value and the first MSG type value of the interface of the first version, as well as the second status code value and the second MSG type value of the interface of the second version from the first characteristic values of each interface to be detected;

[0070] According to a preset conversion rule, convert the first status code value and the first MSG type value, as well as the second status code value and the second MSG type value of each interface to be detected, to obtain the characteristic values of the interface of the first version and the characteristic values of the interface of the second version of each interface to be detected;

[0071] Compare the characteristic values of the interface of the first version of each interface to be detected with the characteristic values of the interface of the second version;

[0072] When the eigenvalue of the interface of the first version of each interface to be detected is exactly the same as the eigenvalue of the interface of the second version, it is determined to perform hierarchical comparison on the structure data of each interface to be detected.

[0073] Further, the method further includes:

[0074] When the eigenvalue of the interface of the first version of each interface to be detected is not exactly the same as the eigenvalue of the interface of the second version, it is determined not to perform hierarchical comparison on the structure data of each interface to be detected.

[0075] In this embodiment, a conversion rule can be preset, and the preset conversion rule is to convert the first status code value and the first MSG type value of the interface of the first version of each interface to be detected and the second status code value and the second MSG type value of the interface of the second version into eigenvalue of string type.

[0076] In this embodiment, when the eigenvalue of the interface of the first version of each interface to be detected is not exactly the same as the eigenvalue of the interface of the second version, there is no need to compare the structure data of each interface to be detected anymore, and it is directly determined that the interface of the first version of each interface to be detected is not compatible with the interface of the second version, which improves the efficiency of interface compatibility testing.

[0077] S13. When it is determined to perform hierarchical comparison on the structure data of each interface to be detected, receive the second eigenvalue of the structure data of each interface to be detected.

[0078] In this embodiment, when the first status code value and the first MSG type value of the interface of the first version of each interface to be detected are exactly the same as the second status code value and the second MSG type value of the interface of the second version, it cannot be determined whether the interface of the first version of each interface to be detected is compatible with the interface of the second version, and it is necessary to perform hierarchical comparison on each interface to be detected.

[0079] In this embodiment, the second eigenvalue refers to the eigenvalue of the structure data of the first version of each interface to be detected and the eigenvalue of the structure data of the second version.

[0080] In an alternative embodiment, the receiving the second eigenvalue of the structure data of each interface to be detected includes:

[0081] Send the first trigger request of the interface of the first version of each interface to be detected and the second trigger request of the interface of the second version;

[0082] Receiving the eigenvalue of the structure data of the first version returned by the interface in response to the first trigger request, and receiving the eigenvalue of the structure data of the second version returned by the interface in response to the second trigger request;

[0083] Determining the eigenvalue of the structure data of the first version and the eigenvalue of the structure data of the second version as the second eigenvalue of the structure data of each of the interfaces to be detected.

[0084] In this embodiment, when determining to perform hierarchical comparison on each of the interfaces to be detected, obtaining a list of interfaces to be detected, traversing each of the interfaces to be detected in the list of interfaces to be detected, connecting to the first version service of each of the interfaces to be detected, sending an interface request to trigger the first version, and obtaining the eigenvalue of the structure data of the first version returned by the interface of the first version; and connecting to the second version service of each of the interfaces to be detected, sending an interface request to trigger the second version, and obtaining the eigenvalue of the structure data of the second version returned by the interface of the second version.

[0085] S14. Identifying the type of the second eigenvalue of the structure data of each of the interfaces to be detected.

[0086] In this embodiment, the types of the second eigenvalue include the string type, the dict type, or the list type. Among them, the string type belongs to the string type, and the key-value sets corresponding to the eigenvalues of the structure data of different versions are stored in the form of strings; the dict type belongs to a mapping type, and the key-value sets corresponding to the eigenvalues of the structure data of different versions are stored in the form of dictionaries; the list type is a list type, and the key-value sets corresponding to the eigenvalues of the structure data of different versions are stored in the form of lists.

[0087] In an alternative embodiment, the identifying the type of the second eigenvalue of the structure data of each of the interfaces to be detected includes:

[0088] Performing type identification on the eigenvalue of the structure data of the first version and the eigenvalue of the structure data of the second version in the second eigenvalue of the structure data of each of the interfaces to be detected by using a preset type function, to obtain the first data type of the eigenvalue of the structure data of the first version and the second data type of the eigenvalue of the structure data of the second version;

[0089] Determining the first data type of the eigenvalue of the structure data of the first version and the second data type of the eigenvalue of the structure data of the second version as the type of the second eigenvalue.

[0090] In this embodiment, the preset type function can be the type() function. By using the type() function, the types of the eigenvalue of the structure data of the first version of each of the to-be-detected interfaces and the types of the eigenvalue of the structure data of the second version can be identified.

[0091] S15. Perform hierarchical detection on the key value set of the second eigenvalue of the structure data of each of the to-be-detected interfaces based on the type of the second eigenvalue of the structure data of each of the to-be-detected interfaces, and obtain a compatibility detection result.

[0092] In this embodiment, the compatibility detection result includes that the interfaces of the first version of each of the to-be-detected interfaces are compatible with the interfaces of the second version or the interfaces of the first version of each of the to-be-detected interfaces are not compatible with the interfaces of the second version.

[0093] In an alternative embodiment, the performing hierarchical detection on the key value set of the second eigenvalue of the structure data of each of the to-be-detected interfaces based on the type of the second eigenvalue of the structure data of each of the to-be-detected interfaces and obtaining a compatibility detection result includes:

[0094] Obtain the first data type of the interface of the first version and the second data type of the interface of the second version from the types of the second eigenvalue of the structure data of each of the to-be-detected interfaces;

[0095] Compare the first data type of the interface of the first version with the second data type of the interface of the second version;

[0096] When the first data type of the interface of the first version is inconsistent with the second data type of the interface of the second version, determine that the compatibility detection result is that the interfaces of the first version of each of the to-be-detected interfaces are not compatible with the interfaces of the second version.

[0097] Further, the comparing the first data type of the interface of the first version with the second data type of the interface of the second version includes:

[0098] When the first data type of the interface of the first version is consistent with the second data type of the interface of the second version, and the first data type and the second data type are of a first preset type, perform at least one iterative hierarchical comparison detection on the key value set corresponding to the eigenvalue of the structure data of the first version and the key value set corresponding to the eigenvalue of the structure data of the second version until a compatibility detection result is obtained, where the at least one iterative hierarchical comparison detection includes:

[0099] Judge whether the first-level key values of the key value set corresponding to the eigenvalue of the structure data of the first version are consistent with the first-level key values of the key value set corresponding to the eigenvalue of the structure data of the second version;

[0100] When the first-level key values of the key value set corresponding to the eigenvalue of the structure data of the first version are the same as the first-level key values of the key value set corresponding to the eigenvalue of the structure data of the second version, perform the next iteration comparison detection on the next-level key values of the first-level key values;

[0101] When the first-level key values of the key value set corresponding to the eigenvalue of the structure data of the first version are not the same as the first-level key values of the key value set corresponding to the eigenvalue of the structure data of the second version, determine that the compatibility detection result is that the interface of the first version and the interface of the second version of each of the to-be-detected interfaces are not compatible.

[0102] In this embodiment, the first preset type is the string type.

[0103] Further, the comparison of the first data type of the interface of the first version with the second data type of the interface of the second version includes:

[0104] When the first data type of the interface of the first version is the same as the second data type of the interface of the second version, and the first data type and the second data type are of the second preset type, perform at least one iterative hierarchical comparison detection on the key value set corresponding to the eigenvalue of the structure data of the first version and the key value set corresponding to the eigenvalue of the structure data of the second version until the compatibility detection result is obtained, where the at least one iterative hierarchical comparison detection includes:

[0105] Obtain the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the first version and the first-level key values of the key value set corresponding to the eigenvalue of the structure data of the second version;

[0106] When the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the first version is included in the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the second version, perform the next iteration comparison detection on the next-level key value set of the first-level key value set;

[0107] When the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the first version is not included in the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the second version, determine that the compatibility detection result is that the interface of the first version and the interface of the second version of each of the to-be-detected interfaces are not compatible.

[0108] In this embodiment, the first version refers to the old version, the second version refers to the version after the old version is upgraded, and the second preset type is the dict type or the list type.

[0109] In this embodiment, for the types of eigenvalue of the structure data of different versions, by performing hierarchical detection on the key-value sets corresponding to the eigenvalues of the structure data of different versions, the risk of missed detection can be reduced, and the accuracy and efficiency of the compatibility detection of the interface are improved. At the same time, when performing hierarchical detection on the key-value sets corresponding to the eigenvalues of the structure data of different versions, when any layer of the key-value sets of different versions is inconsistent, the compatibility detection result of the interface can be quickly obtained and the eigenvalues that are not compatible with the interface can be determined, improving the efficiency of the compatibility detection of the interface and the maintenance efficiency.

[0110] In other optional embodiments, record the compatibility detection results of each of the to-be-detected interfaces in the to-be-detected interface list, map the compatibility detection results to the compatibility detection result template of the to-be-detected system, generate a target compatibility detection report for the interface, and push the target compatibility detection report for the interface to the client.

[0111] S16. When it is determined not to perform hierarchical comparison on the structure data of each of the to-be-detected interfaces, end the compatibility detection of each of the to-be-detected interfaces.

[0112] In this embodiment, when it is directly determined not to perform hierarchical comparison on the structure data of each of the to-be-detected interfaces, it is determined that the interface of the first version and the interface of the second version of each of the to-be-detected interfaces are not compatible, and the compatibility detection of each of the to-be-detected interfaces is ended, improving the efficiency of the interface compatibility test.

[0113] In summary, for the interface compatibility detection method described in this embodiment, based on the first eigenvalue of each of the to-be-detected interfaces, it is initially determined whether the interface of the first version and the interface of the second version of each of the to-be-detected interfaces are compatible. There is no need to compare the structure data of each of the to-be-detected interfaces anymore, and it is directly determined that the interface of the first version and the interface of the second version of each of the to-be-detected interfaces are not compatible, improving the efficiency of the interface compatibility test. When it is determined to perform hierarchical comparison on each of the to-be-detected interfaces, hierarchical detection is performed on the key-value sets of the second eigenvalues of the structure data of each of the to-be-detected interfaces based on the type of the second eigenvalues of the structure data of each of the to-be-detected interfaces to obtain the compatibility detection result. For the types of eigenvalues of the structure data of different versions, by performing hierarchical detection on the key-value sets corresponding to the eigenvalues of the structure data of different versions, the risk of missed detection can be reduced, and the accuracy and efficiency of the compatibility detection of the interface are improved. At the same time, when performing hierarchical detection on the key-value sets corresponding to the eigenvalues of the structure data of different versions, when any layer of the key-value sets of different versions is inconsistent, the compatibility detection result of the interface can be quickly obtained and the eigenvalues that are not compatible with the interface can be determined, improving the efficiency of the compatibility detection of the interface and the maintenance efficiency.

[0114] Embodiment 2

[0115] Figure 2 It is the structural diagram of the interface compatibility detection device provided in the second embodiment of the present invention.

[0116] In some embodiments, the interface compatibility detection device 20 may include multiple functional modules composed of program code segments. The program code of each program segment in the interface compatibility detection device 20 can be stored in the memory of the electronic device and executed by the at least one processor to perform the function of interface compatibility detection (see Figure 1 description).

[0117] In this embodiment, the interface compatibility detection device 20 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: a parsing and obtaining module 201, a judgment module 202, a receiving module 203, an identification module 204, a hierarchical detection module 205, and an end module 206. The module referred to in the present invention means a series of computer-readable instruction segments that can be executed by at least one processor and can complete fixed functions, and are stored in the memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.

[0118] The parsing and obtaining module 201 is used to parse the received interface compatibility detection request and obtain the first eigenvalue of each of the to-be-detected interfaces in the to-be-detected interface list.

[0119] In this embodiment, the interface compatibility detection request includes a to-be-detected interface list of the to-be-detected system, and the first eigenvalue includes the status code values and MSG type values of different versions of each to-be-detected interface.

[0120] In an optional embodiment, the parsing and obtaining module 201 parsing the received interface compatibility detection request and obtaining the first eigenvalue of each of the to-be-detected interfaces in the to-be-detected interface list includes:

[0121] Parsing the interface compatibility detection request to obtain an interface compatibility detection message;

[0122] Obtaining the to-be-detected interface list of the to-be-detected system from the interface compatibility detection message;

[0123] Reading the to-be-detected use case set of each of the to-be-detected interfaces in the to-be-detected interface list;

[0124] Triggering to access the interfaces of each of the to-be-detected use cases in the to-be-detected use case set, and obtaining the first status code value and the first MSG type value of the first version of the interface of each of the to-be-detected use cases and the second status code value and the second MSG type value of the second version of the interface;

[0125] Determine the first status code value and the first MSG type value of the interface of the first version of each of the test cases to be detected, and the second status code value and the second MSG type value of the interface of the second version as the first characteristic value of each of the interfaces to be detected.

[0126] In this embodiment, the set of test cases to be detected is constructed by pre-inputting the status code values and MSG type values of each of the interfaces to be detected in the list of interfaces to be detected.

[0127] The determination module 202 is configured to determine whether to perform hierarchical comparison on the structural data of each of the interfaces to be detected based on the first characteristic value of each of the interfaces to be detected.

[0128] In this embodiment, since the first characteristic value of each of the interfaces to be detected includes the first status code value and the first MSG type value of the interface of the first version and the second status code value and the second MSG type value of the interface of the second version, by comparing whether the second status code value and the second MSG type value of the interfaces of the first version and the second version are consistent, determine whether to perform hierarchical comparison on the structural data of each of the interfaces to be detected according to the comparison result.

[0129] In an alternative embodiment, the determination module 202 determining whether to perform hierarchical comparison on the structural data of each of the interfaces to be detected based on the first characteristic value of each of the interfaces to be detected includes:

[0130] Extract the first status code value and the first MSG type value of the interface of the first version and the second status code value and the second MSG type value of the interface of the second version from the first characteristic value of each of the interfaces to be detected;

[0131] According to a preset conversion rule, convert the first status code value and the first MSG type value and the second status code value and the second MSG type value of each of the interfaces to be detected to obtain the characteristic value of the interface of the first version and the characteristic value of the interface of the second version of each of the interfaces to be detected;

[0132] Compare the characteristic value of the interface of the first version of each of the interfaces to be detected with the characteristic value of the interface of the second version;

[0133] When the characteristic value of the interface of the first version of each of the interfaces to be detected is exactly the same as the characteristic value of the interface of the second version, determine to perform hierarchical comparison on the structural data of each of the interfaces to be detected.

[0134] Further, when the characteristic value of the interface of the first version of each of the interfaces to be detected is not exactly the same as the characteristic value of the interface of the second version, determine not to perform hierarchical comparison on the structural data of each of the interfaces to be detected.

[0135] In this embodiment, a conversion rule can be preset. The preset conversion rule is to convert the first status code value and the first MSG type value of the interface of the first version of each interface to be detected, and the second status code value and the second MSG type value of the interface of the second version into a feature value of string type.

[0136] In this embodiment, when the feature values of the interfaces of the first version of each interface to be detected are not completely consistent with the feature values of the interfaces of the second version, there is no need to compare the structure data of each interface to be detected anymore, and it can be directly determined that the interfaces of the first version and the second version of each interface to be detected are not compatible, which improves the efficiency of interface compatibility testing.

[0137] The receiving module 203 is configured to receive the second feature value of the structure data of each interface to be detected when it is determined to perform hierarchical comparison on the structure data of each interface to be detected.

[0138] In this embodiment, when the first status code value and the first MSG type value of the interface of the first version of each interface to be detected are completely consistent with the second status code value and the second MSG type value of the interface of the second version, it is impossible to determine whether the interfaces of the first version and the second version of each interface to be detected are compatible, and it is necessary to perform hierarchical comparison on each interface to be detected.

[0139] In this embodiment, the second feature value refers to the feature value of the structure data of the first version of each interface to be detected and the feature value of the structure data of the second version.

[0140] In an optional embodiment, the receiving module 203 receiving the second feature value of the structure data of each interface to be detected includes:

[0141] Sending the first trigger request of the interface of the first version of each interface to be detected and the second trigger request of the interface of the second version;

[0142] Receiving the feature value of the structure data of the first version returned by the interface of the first version in response to the first trigger request, and receiving the feature value of the structure data of the second version returned by the interface of the second version in response to the second trigger request;

[0143] Determining the feature value of the structure data of the first version and the feature value of the structure data of the second version as the second feature value of the structure data of each interface to be detected.

[0144] In this embodiment, when determining to perform hierarchical comparison on each of the to-be-detected interfaces, a list of to-be-detected interfaces is obtained, and each to-be-detected interface in the list of to-be-detected interfaces is traversed. The first-version service of each to-be-detected interface is connected, an interface request triggering the first version is sent, and the eigenvalue of the first-version structure data returned by the first-version interface is obtained; and the second-version service of each to-be-detected interface is connected, an interface request triggering the second version is sent, and the eigenvalue of the second-version structure data returned by the second-version interface is obtained.

[0145] The recognition module 204 is configured to recognize the type of the second eigenvalue of the structure data of each of the to-be-detected interfaces.

[0146] In this embodiment, the types of the second eigenvalue include the string type, the dict type, or the list type. Among them, the string type belongs to the string type, and the key-value set corresponding to the eigenvalue of the structure data of different versions is stored in the form of a string; the dict type belongs to a mapping type, and the key-value set corresponding to the eigenvalue of the structure data of different versions is stored in the form of a dictionary; the list type is a list type, and the key-value set corresponding to the eigenvalue of the structure data of different versions is stored in the form of a list.

[0147] In an alternative embodiment, the recognition module 204 recognizes the type of the second eigenvalue of the structure data of each of the to-be-detected interfaces, including:

[0148] Using a preset type function to perform type recognition on the eigenvalue of the first-version structure data and the eigenvalue of the second-version structure data in the second eigenvalue of the structure data of each of the to-be-detected interfaces, to obtain the first data type of the eigenvalue of the first-version structure data and the second data type of the eigenvalue of the second-version structure data;

[0149] Determine the first data type of the eigenvalue of the first-version structure data and the second data type of the eigenvalue of the second-version structure data as the type of the second eigenvalue.

[0150] In this embodiment, the preset type function can be the type() function. Using the type() function, the type of the eigenvalue of the first-version structure data and the type of the eigenvalue of the second-version structure data of each of the to-be-detected interfaces can be recognized.

[0151] The hierarchical detection module 205 is configured to perform hierarchical detection on the key-value set of the second eigenvalue of the structure data of each of the to-be-detected interfaces based on the type of the second eigenvalue of the structure data of each of the to-be-detected interfaces, to obtain a compatibility detection result.

[0152] In this embodiment, the compatibility detection result includes that the interfaces of the first version of each of the to-be-detected interfaces are compatible with the interfaces of the second version or the interfaces of the first version of each of the to-be-detected interfaces are not compatible with the interfaces of the second version.

[0153] In an alternative embodiment, the hierarchical detection module 205 performs hierarchical detection on the key value sets of the second feature values of the structural data of each of the to-be-detected interfaces based on the types of the second feature values of the structural data of each of the to-be-detected interfaces, and the obtained compatibility detection result includes:

[0154] Obtain the first data type of the interface of the first version and the second data type of the interface of the second version from the types of the second feature values of the structural data of each of the to-be-detected interfaces;

[0155] Compare the first data type of the interface of the first version with the second data type of the interface of the second version;

[0156] When the first data type of the interface of the first version is inconsistent with the second data type of the interface of the second version, determine that the compatibility detection result is that the interfaces of the first version of each of the to-be-detected interfaces are not compatible with the interfaces of the second version.

[0157] Further, the comparing the first data type of the interface of the first version with the second data type of the interface of the second version includes:

[0158] When the first data type of the interface of the first version is consistent with the second data type of the interface of the second version, and the first data type and the second data type are of a first preset type, perform at least one iterative hierarchical comparison detection on the key value set corresponding to the feature value of the structural data of the first version and the key value set corresponding to the feature value of the structural data of the second version until a compatibility detection result is obtained, where the at least one iterative hierarchical comparison detection includes:

[0159] Determine whether the first-level key values of the key value set corresponding to the feature value of the structural data of the first version are consistent with the first-level key values of the key value set corresponding to the feature value of the structural data of the second version;

[0160] When the first-level key values of the key value set corresponding to the feature value of the structural data of the first version are consistent with the first-level key values of the key value set corresponding to the feature value of the structural data of the second version, perform the next iterative comparison detection on the next-level key values of the first-level key values;

[0161] When the first-level key values of the key value set corresponding to the eigenvalue of the structure data of the first version are inconsistent with the first-level key values of the key value set corresponding to the eigenvalue of the structure data of the second version, it is determined that the compatibility detection result is that the interfaces of the first version and the second version of each to-be-detected interface are incompatible.

[0162] In this embodiment, the first preset type is the string type.

[0163] Further, the comparison of the first data type of the interface of the first version with the second data type of the interface of the second version includes:

[0164] When the first data type of the interface of the first version is the same as the second data type of the interface of the second version, and the first data type and the second data type are the second preset type, at least one iterative hierarchical comparison detection is performed on the key value set corresponding to the eigenvalue of the structure data of the first version and the key value set corresponding to the eigenvalue of the structure data of the second version until a compatibility detection result is obtained, where the at least one iterative hierarchical comparison detection includes:

[0165] Obtain the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the first version and the first-level key values of the key value set corresponding to the eigenvalue of the structure data of the second version;

[0166] When the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the first version is included in the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the second version, perform the next iterative comparison detection on the next-level key value set of the first-level key value set;

[0167] When the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the first version is not included in the first-level key value set of the key value set corresponding to the eigenvalue of the structure data of the second version, it is determined that the compatibility detection result is that the interfaces of the first version and the second version of each to-be-detected interface are incompatible.

[0168] In this embodiment, the first version refers to the old version, the second version refers to the version after the old version is upgraded, and the second preset type is the dict type or the list type.

[0169] In this embodiment, for the types of eigenvalue of the structure data of different versions, by performing hierarchical detection on the key-value sets corresponding to the eigenvalues of the structure data of different versions, the risk of missed detection can be reduced, and the accuracy and efficiency of the compatibility detection of the interface are improved. At the same time, when performing hierarchical detection on the key-value sets corresponding to the eigenvalues of the structure data of different versions, when any layer of the key-value sets of different versions is inconsistent, the compatibility detection result of the interface can be quickly obtained and the eigenvalues that are not compatible with the interface can be determined, which improves the efficiency of the compatibility detection of the interface and the maintenance efficiency.

[0170] In other alternative embodiments, record the compatibility detection results of each of the to-be-detected interfaces in the to-be-detected interface list, map the compatibility detection results to the compatibility detection result template of the to-be-detected system to generate a target compatibility detection report for the interface, and push the target compatibility detection report for the interface to the client.

[0171] The end module 206 is used to end the compatibility detection of each of the to-be-detected interfaces when it is determined that hierarchical comparison is not performed on the structure data of each of the to-be-detected interfaces.

[0172] In this embodiment, when it is directly determined that hierarchical comparison is not performed on the structure data of each of the to-be-detected interfaces, it is determined that the interface of the first version of each of the to-be-detected interfaces is not compatible with the interface of the second version, and the compatibility detection of each of the to-be-detected interfaces is ended, which improves the efficiency of the interface compatibility test.

[0173] In summary, for the interface compatibility detection device described in this embodiment, based on the first eigenvalue of each of the to-be-detected interfaces, it is initially determined whether the interface of the first version and the interface of the second version of each of the to-be-detected interfaces are compatible, without the need to compare the structure data of each of the to-be-detected interfaces again. It is directly determined that the interface of the first version of each of the to-be-detected interfaces is not compatible with the interface of the second version, which improves the efficiency of the interface compatibility test. When it is determined to perform hierarchical comparison on each of the to-be-detected interfaces, hierarchical detection is performed on the key-value sets of the second eigenvalues of the structure data of each of the to-be-detected interfaces based on the type of the second eigenvalues of the structure data of each of the to-be-detected interfaces to obtain the compatibility detection result. For the types of eigenvalues of the structure data of different versions, by performing hierarchical detection on the key-value sets corresponding to the eigenvalues of the structure data of different versions, the risk of missed detection can be reduced, and the accuracy and efficiency of the compatibility detection of the interface are improved. At the same time, when performing hierarchical detection on the key-value sets corresponding to the eigenvalues of the structure data of different versions, when any layer of the key-value sets of different versions is inconsistent, the compatibility detection result of the interface can be quickly obtained and the eigenvalues that are not compatible with the interface can be determined, which improves the efficiency of the compatibility detection of the interface and the maintenance efficiency.

[0174] Embodiment III

[0175] Refer to Figure 3 As shown, it is a schematic structural diagram of an electronic device provided in Embodiment 3 of the present invention. In a preferred embodiment of the present invention, the electronic device 3 includes a memory 31, at least one processor 32, at least one communication bus 33, and a transceiver 34.

[0176] Those skilled in the art should understand that Figure 3 The structure of the shown electronic device does not constitute a limitation on the embodiments of the present invention. It can be a bus structure or a star structure. The electronic device 3 may further include more or fewer other hardware or software than shown, or different component arrangements.

[0177] In some embodiments, the electronic device 3 is an electronic device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, a microprocessor, an application-specific integrated circuit, a programmable gate array, a digital signal processor, and an embedded device, etc. The electronic device 3 may further include a client device, and the client device includes, but is not limited to, any electronic product that can perform human-computer interaction with the client through means such as a keyboard, a mouse, a remote control, a touchpad, or a voice control device. For example, a personal computer, a tablet computer, a smart phone, a digital camera, etc.

[0178] It should be noted that the electronic device 3 is only an example. Other existing or future possible electronic products that can be adapted to the present invention should also be included within the protection scope of the present invention and are hereby incorporated by reference.

[0179] In some embodiments, the memory 31 is used to store program codes and various data, such as the interface compatibility detection device 20 installed in the electronic device 3, and to achieve high-speed and automatic access to programs or data during the operation of the electronic device 3. The memory 31 includes a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electrically-erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or other optical disc memories, magnetic disk memories, tape memories, or any other computer-readable medium capable of carrying or storing data.

[0180] In some embodiments, the at least one processor 32 may be composed of integrated circuits. For example, it may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same or different functions packaged, including a combination of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The at least one processor 32 is the control core (Control Unit) of the electronic device 3, connecting various components of the entire electronic device 3 through various interfaces and lines, and executing various functions of the electronic device 3 and processing data by running or executing programs or modules stored in the memory 31 and calling data stored in the memory 31.

[0181] In some embodiments, the at least one communication bus 33 is provided to enable connection communication between the memory 31 and the at least one processor 32, etc.

[0182] Although not shown, the electronic device 3 may further include a power source (such as a battery) for supplying power to each component. Optionally, the power source may be logically connected to the at least one processor 32 through a power management device, so as to manage functions such as charging, discharging, and power consumption management through the power management device. The power source may further include any components such as one or more DC or AC power sources, a recharge device, a power failure detection circuit, a power converter or inverter, and a power status indicator. The electronic device 3 may further include various sensors, a Bluetooth module, a Wi-Fi module, etc., which will not be elaborated herein.

[0183] It should be understood that the above embodiments are only for illustration purposes and are not limited by this structure in the scope of the patent application.

[0184] The integrated units implemented in the form of software function modules as described above may be stored in a computer-readable storage medium. The above software function modules are stored in a storage medium and include several instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device, etc.) or a processor to execute a part of the methods described in various embodiments of the present invention.

[0185] In a further embodiment, in combination with Figure 2 , the at least one processor 32 may execute the operating device of the electronic device 3 and various installed application programs (such as the interface compatibility detection device 20), program codes, etc. For example, the above-mentioned various modules.

[0186] Program codes are stored in the memory 31, and the at least one processor 32 may call the program codes stored in the memory 31 to execute related functions. For example, Figure 2 the various modules described in

[0187] are program codes stored in the memory 31 and are executed by the at least one processor 32, so as to implement the functions of the various modules to achieve the purpose of interface compatibility detection. Exemplarily, the program codes may be divided into one or more modules / units. The one or more modules / units are stored in the memory 31 and are executed by the processor 32 to complete the present application. The one or more modules / units may be a series of computer-readable instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the program codes in the electronic device 3. For example, the program codes may be divided into a parsing and obtaining module 201, a judgment module 202, a receiving module 203, an identification module 204, a hierarchical detection module 205, and an end module 206.

[0188] In one embodiment of the present invention, the memory 31 stores a plurality of computer-readable instructions, and the at least one processor 32 executes the plurality of computer-readable instructions to implement the function of interface compatibility detection.

[0189] Specifically, for the specific implementation method of the at least one processor 32 for the above instructions, reference may be made to Figure 1 the description of the relevant steps in the corresponding embodiment, which will not be elaborated here.

[0190] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0191] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units. They may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0192] In addition, in each embodiment of the present invention, the functional modules can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of a combination of hardware and software functional modules.

[0193] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and can be implemented in other specific forms without departing from the spirit or basic characteristics of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be encompassed by the present invention. Any reference signs in the claims should not be regarded as limiting the claimed rights. In addition, obviously the word "including" does not exclude other units, and the singular does not exclude the plural. The multiple units or devices described in the present invention can also be implemented by one unit or device through software or hardware. First, second, etc. are used to represent names and do not represent any specific order.

[0194] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. An interface compatibility detection method, characterized in that, The method includes: Parsing the received interface compatibility detection request to obtain the first eigenvalue of each of the to-be-detected interfaces in the to-be-detected interface list; Based on the first eigenvalue of each of the to-be-detected interfaces, determining whether to perform hierarchical comparison on the structure data of each of the to-be-detected interfaces; When it is determined to perform hierarchical comparison on the structure data of each of the to-be-detected interfaces, receiving the second eigenvalue of the structure data of each of the to-be-detected interfaces; Identifying the type of the second eigenvalue of the structure data of each of the to-be-detected interfaces; Performing hierarchical detection on the key value set of the second eigenvalue of the structure data of each of the to-be-detected interfaces based on the type of the second eigenvalue of the structure data of each of the to-be-detected interfaces to obtain a compatibility detection result, including: obtaining the first data type of the interface of the first version and the second data type of the interface of the second version from the type of the second eigenvalue of the structure data of each of the to-be-detected interfaces; Comparing the first data type of the interface of the first version with the second data type of the interface of the second version, including: when the first data type of the interface of the first version is consistent with the second data type of the interface of the second version, and the first data type and the second data type are of a second preset type, performing at least one iterative hierarchical comparison detection on the key value set corresponding to the eigenvalue of the structure data of the first version and the key value set corresponding to the eigenvalue of the structure data of the second version until a compatibility detection result is obtained, where the at least one iterative hierarchical comparison detection includes: obtaining the first-layer key value set of the key value set corresponding to the eigenvalue of the structure data of the first version and the first-layer key value of the key value set corresponding to the eigenvalue of the structure data of the second version; when the first-layer key value set of the key value set corresponding to the eigenvalue of the structure data of the first version is included in the first-layer key value set of the key value set corresponding to the eigenvalue of the structure data of the second version, performing the next iterative comparison detection on the next-layer key value set of the first-layer key value set; or, when the first-layer key value set of the key value set corresponding to the eigenvalue of the structure data of the first version is not included in the first-layer key value set of the key value set corresponding to the eigenvalue of the structure data of the second version, determining that the compatibility detection result is that the interface of the first version and the interface of the second version of each of the to-be-detected interfaces are incompatible; When the first data type of the interface of the first version is inconsistent with the second data type of the interface of the second version, determining that the compatibility detection result is that the interface of the first version and the interface of the second version of each of the to-be-detected interfaces are incompatible.

2. The interface compatibility detection method according to claim 1, characterized in that, The determining whether to perform hierarchical comparison on the structure data of each of the to-be-detected interfaces based on the first eigenvalue of each of the to-be-detected interfaces includes: Extracting the first status code value and the first MSG type value of the interface of the first version and the second status code value and the second MSG type value of the interface of the second version from the first eigenvalue of each of the to-be-detected interfaces; According to the preset conversion rules, convert the first status code value, the first MSG type value, the second status code value, and the second MSG type value of each of the to-be-detected interfaces to obtain the characteristic values of the interfaces of the first version and the characteristic values of the interfaces of the second version of each of the to-be-detected interfaces; Compare the characteristic values of the interfaces of the first version of each of the to-be-detected interfaces with the characteristic values of the interfaces of the second version; When the characteristic values of the interfaces of the first version of each of the to-be-detected interfaces are exactly the same as the characteristic values of the interfaces of the second version, determine to perform hierarchical comparison on the structural data of each of the to-be-detected interfaces.

3. The interface compatibility detection method according to claim 1, characterized in that, The receiving the second characteristic values of the structural data of each of the to-be-detected interfaces includes: Send the first trigger request of the interface of the first version and the second trigger request of the interface of the second version of each of the to-be-detected interfaces; In response to the first trigger request, receive the characteristic values of the structural data of the first version returned by the interface of the first version, and in response to the second trigger request, receive the characteristic values of the structural data of the second version returned by the interface of the second version; Determine the characteristic values of the structural data of the first version and the characteristic values of the structural data of the second version as the second characteristic values of the structural data of each of the to-be-detected interfaces.

4. The interface compatibility detection method according to claim 1, characterized in that, The comparing the first data type of the interface of the first version with the second data type of the interface of the second version includes: When the first data type of the interface of the first version is the same as the second data type of the interface of the second version, and the first data type and the second data type are of the first preset type, perform at least one iterative hierarchical comparison detection on the key value sets corresponding to the characteristic values of the structural data of the first version and the key value sets corresponding to the characteristic values of the structural data of the second version until a compatibility detection result is obtained, where the at least one iterative hierarchical comparison detection includes: Judge whether the first-layer key values of the key value set corresponding to the characteristic values of the structural data of the first version are the same as the first-layer key values of the key value set corresponding to the characteristic values of the structural data of the second version; When the first-layer key values of the key value set corresponding to the characteristic values of the structural data of the first version are the same as the first-layer key values of the key value set corresponding to the characteristic values of the structural data of the second version, perform the next iterative comparison detection on the next-layer key values of the first-layer key values; When the first-layer key values of the key value set corresponding to the characteristic values of the structural data of the first version are not the same as the first-layer key values of the key value set corresponding to the characteristic values of the structural data of the second version, determine that the compatibility detection result is that the interface of the first version and the interface of the second version of each of the to-be-detected interfaces are incompatible.

5. The interface compatibility detection method according to claim 1, characterized in that, The parsing the received interface compatibility detection request to obtain the first characteristic values of each of the to-be-detected interfaces in the to-be-detected interface list includes: Parse the interface compatibility detection request to obtain an interface compatibility detection message; Obtain the to-be-detected interface list of the to-be-detected system from the interface compatibility detection message; Read the to-be-detected use case sets of each of the to-be-detected interfaces in the to-be-detected interface list; Trigger the interfaces for accessing each of the test cases to be detected, and obtain the first status code value and the first MSG type value of the interfaces of the first version of each of the test cases to be detected, as well as the second status code value and the second MSG type value of the interfaces of the second version; Determine the first status code value and the first MSG type value of the interfaces of the first version of each of the test cases to be detected, as well as the second status code value and the second MSG type value of the interfaces of the second version as the first characteristic values of each of the test interfaces to be detected.

6. An interface compatibility detection device, characterized in that, The device is used to implement the interface compatibility detection method according to any one of claims 1 to 5, and the device includes: A parsing and obtaining module, configured to parse the received interface compatibility detection request and obtain the first characteristic values of each of the test interfaces in the list of test interfaces to be detected; A judgment module, configured to judge whether to perform hierarchical comparison on the structural data of each of the test interfaces based on the first characteristic values of each of the test interfaces; A receiving module, configured to receive the second characteristic values of the structural data of each of the test interfaces when it is determined to perform hierarchical comparison on the structural data of each of the test interfaces; An identification module, configured to identify the types of the second characteristic values of the structural data of each of the test interfaces; A hierarchical detection module, configured to perform hierarchical detection on the key value sets of the second characteristic values of the structural data of each of the test interfaces based on the types of the second characteristic values of the structural data of each of the test interfaces to obtain a compatibility detection result.

7. An electronic device, characterized in that, The electronic device includes a processor and a memory, and the processor is used to implement the interface compatibility detection method according to any one of claims 1 to 5 when executing the computer program stored in the memory.

8. A computer-readable storage medium, on which a computer program is stored, characterized in that, The computer program, when executed by the processor, implements the interface compatibility detection method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Compatibility test method and device, storage medium and computer equipment

    CN111382070A

  • Binary interface compatibility automatic checking method and device

    CN113688045A