Interface parameter checking method and device, equipment and storage medium

By parsing the interface documentation to construct a parameter association graph and generate validation rules, the problem of existing interface parameter validation relying on manual configuration and lacking adaptability is solved. This enables automatic extraction and dynamic improvement of interface parameter constraints, thereby improving the adaptability and completeness of interface parameter validation.

CN123178262APending Publication Date: 2026-11-27广州三七极创网络科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611312236.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

The existing interface parameter validation relies on manual configuration, which makes it difficult to identify implicit constraints and lacks adaptability, making it unable to adapt to changes in interface documentation and continuously discover abnormal patterns.

Method used

By parsing the interface documentation to construct a parameter relationship graph, generating validation rules, automatically extracting and dynamically improving interface parameter constraints, and learning implicit parameter constraints by combining interface data, the validation rules are updated.

Benefits of technology

It enables automatic extraction and dynamic improvement of interface parameter constraints, enhances the adaptability and completeness of interface parameter validation, and can identify implicit parameter constraints and validate interface parameter data in real time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178262A_ABST
    Figure CN123178262A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a method, device and equipment for checking interface parameters, and a storage medium. The method comprises: obtaining an interface document of a target interface, parsing the interface document, and extracting interface parameter information, parameter constraint information and parameter correlation of the target interface; constructing a parameter correlation graph based on the interface parameter information, the parameter constraint information and the parameter correlation; generating an interface parameter checking rule of the target interface based on the parameter correlation graph, and checking interface parameter data generated by the target interface during operation according to the interface parameter checking rule to obtain a parameter checking result. The present scheme realizes automatic extraction and dynamic improvement of interface parameter constraints.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for verifying interface parameters. Background Technology

[0002] With the development of internet services, different business systems typically interact with each other through interfaces. The type, value range, and relationships between interface parameters directly affect the accuracy of interface calls and the stability of business processing. Therefore, during interface development, testing, and operation, it is necessary to validate request and response parameters to promptly identify issues such as incorrect parameter formats, abnormal values, or parameter combinations that do not meet business requirements.

[0003] Existing API parameter validation typically relies on manually written test cases or pre-configured fixed validation rules, and performs validation according to the parameter types, value ranges, and mandatory statuses declared in the API documentation. When the API documentation changes, the corresponding rules need to be manually modified, resulting in high maintenance costs. Furthermore, existing methods primarily target single-parameter constraints explicitly stated in the documentation, making it difficult to identify implicit relationships between multiple parameters that are not explicitly defined, and also making it difficult to continuously discover new anomaly patterns based on API runtime data. This leads to insufficient adaptability and completeness of API parameter validation. Summary of the Invention

[0004] This application provides a method, apparatus, device, and storage medium for verifying interface parameters. It can generate interface parameter verification rules by parsing interface documents and constructing parameter association graphs, and verify interface parameter data during operation. Simultaneously, it learns parameter association anomaly patterns based on interface parameter data and verification results, identifies undefined implicit parameter constraints, and updates the verification rules. Therefore, it achieves automatic extraction and dynamic improvement of interface parameter constraints, effectively solving the problems of existing verification methods relying on manual configuration, difficulty in identifying implicit constraints, and insufficient adaptability.

[0005] Firstly, embodiments of this application provide a method for verifying interface parameters, the method comprising: Obtain the interface document of the target interface, parse the interface document, and extract the interface parameter information, parameter constraint information, and parameter association relationship of the target interface; Based on the interface parameter information, the parameter constraint information, and the parameter association relationships, a parameter association graph is constructed. Based on the parameter association graph, interface parameter verification rules for the target interface are generated, and the interface parameter data generated by the target interface during operation is verified according to the interface parameter verification rules to obtain the parameter verification results.

[0006] In one embodiment, parsing the interface document to extract the interface parameter information, parameter constraint information, and parameter associations of the target interface includes: Identify the structured interface definition area and unstructured description area in the interface document, extract parameter name, parameter type and parameter hierarchy information from the structured interface definition area to obtain the interface parameter information of the target interface, and extract constraint description information from the unstructured description area; The constraint description information and the interface parameter information are semantically aligned, and the condition parameters, constrained parameters and corresponding constraint conditions are determined from the constraint description information to obtain the parameter constraint information of the target interface. Based on the condition parameters, the constrained parameters, and the constraints, the conditional dependencies between multiple interface parameters are determined, and the parameter associations of the target interface are obtained.

[0007] In one embodiment, constructing a parameter association graph based on the interface parameter information, the parameter constraint information, and the parameter association relationships includes: Each interface parameter in the interface parameter information is converted into a parameter node, and the corresponding parameter type, parameter level, and parameter constraint information are configured as the node attributes of the parameter node. Identify conditional parameters and constrained parameters according to the parameter association relationship, establish directed association edges between the corresponding parameter nodes from the conditional parameters to the constrained parameters, and convert the corresponding constraint conditions into constraint expressions that match the parameter type of the constrained parameters, as the edge attributes of the directed association edges; Directed edges with the same parameters or continuous pointing relationships are merged to generate a parameter association graph.

[0008] In one embodiment, generating the interface parameter verification rules for the target interface based on the parameter association graph includes: Based on the parameter nodes, parameter constraint information, and parameter association relationships in the parameter association graph, multiple rule branches are generated, and version identifiers are configured for each rule branch according to the document version of the interface document to construct a versioned rule tree; When the interface document is updated, a new rule branch is generated in the versioned rule tree based on the differences in interface parameter information before and after the update, while the historical rule branches are retained. The corresponding rule weight is determined based on the historical call frequency of each rule branch, and the activation status and execution order of each rule branch are determined based on the version identifier, the rule weight and the preset gray scale ratio, so as to obtain the interface parameter verification rules of the target interface.

[0009] In one embodiment, the step of validating the interface parameter data generated by the target interface during operation according to the interface parameter validation rules to obtain the parameter validation result includes: Obtain the interface parameter data generated by the target interface during operation, and input the interface parameter data into a real-time verification pipeline built based on a distributed stream processing framework; According to the activation status and execution order of each rule branch in the interface parameter verification rules, the rule branch to be executed is determined, the rule branch to be executed is compiled into binary verification instructions, and the binary verification instructions are executed by just-in-time compilation to verify the parameter values ​​and parameter associations in the interface parameter data. Summarize the verification outputs of each rule branch to be executed, identify abnormal parameters that do not meet the parameter constraint information or the parameter association relationship, and obtain the parameter verification results.

[0010] In one embodiment, after verifying the interface parameter data generated by the target interface during operation according to the interface parameter verification rules and obtaining the parameter verification result, the method further includes: According to the parameter association relationship in the parameter association map, the interface parameter data are associated and combined, and a parameter combination sample sequence is formed by combining the corresponding parameter verification results; For each parameter combination sample in the parameter combination sample sequence, multiple segments are performed based on multiple parameter dimensions. The degree of anomaly is determined based on the number of segments required for each parameter combination sample to be independently separated. The parameter temporal correlation state is determined based on the parameter changes between adjacent parameter combination samples, thus obtaining the parameter correlation anomaly pattern. Extract parameter value relationships from recurring abnormal parameter association patterns, and identify parameter value relationships not included in the parameter constraint information as implicit parameter constraint information; The interface parameter verification rules are updated based on the implicit parameter constraint information, and the interface parameter verification is performed based on the updated interface parameter verification rules.

[0011] In one embodiment, updating the interface parameter validation rules based on the implicit parameter constraint information includes: Extract the condition parameters, constrained parameters and their corresponding value relationships from the implicit parameter constraint information, and establish corresponding candidate association edges in the parameter association graph to generate candidate rule branches; The candidate rule branch is matched with the existing rule branch in the interface parameter verification rule for triggering conditions and constraint content. Based on the frequency of recurrence of the corresponding parameter-associated abnormal mode, the merging method of the candidate rule branch and the existing rule branch is determined. The candidate rule branches are written into the interface parameter verification rules according to the merging method described above, resulting in the updated interface parameter verification rules.

[0012] Secondly, embodiments of this application also provide an interface parameter verification device, including: The parsing module is configured to obtain the interface document of the target interface, parse the interface document, and extract the interface parameter information, parameter constraint information, and parameter association relationship of the target interface. The construction module is configured to construct a parameter association graph based on the interface parameter information, the parameter constraint information, and the parameter association relationship; The verification module is configured to generate interface parameter verification rules for the target interface based on the parameter association graph, and to verify the interface parameter data generated by the target interface during operation based on the interface parameter verification rules to obtain the parameter verification result.

[0013] Thirdly, embodiments of this application also provide an interface parameter verification device, the device comprising: One or more processors; Storage device, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the interface parameter verification method described in the embodiments of this application.

[0014] Fourthly, embodiments of this application also provide a non-volatile storage medium for storing computer-executable instructions, which, when executed by a computer processor, are configured to perform the interface parameter verification method described in embodiments of this application.

[0015] Fifthly, embodiments of this application also provide a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of the device reads from the computer-readable storage medium and executes the computer program, causing the device to perform the interface parameter verification method described in embodiments of this application.

[0016] In this embodiment, by parsing the interface documentation of the target interface, interface parameter information, parameter constraint information, and parameter relationships are extracted to construct a parameter relationship graph. Based on this graph, interface parameter verification rules are generated to verify the interface parameter data generated during the operation of the target interface. Simultaneously, by combining the interface parameter data and parameter verification results, abnormal parameter relationship patterns are learned to identify implicit parameter constraints not defined in the interface documentation, and the interface parameter verification rules are updated accordingly. Thus, collaborative verification of explicit document constraints and implicit parameter constraints is achieved, enabling the verification rules to be continuously improved based on interface operation data. Attached Figure Description

[0017] Figure 1 A flowchart illustrating an interface parameter verification method provided in an embodiment of this application; Figure 2 A flowchart illustrating a specific implementation process for parsing an interface document, as provided in this application embodiment; Figure 3 A flowchart illustrating a specific implementation process for constructing a parameter association map, provided in this application embodiment; Figure 4 A flowchart illustrating the specific implementation process of generating interface parameter verification rules, as provided in this application embodiment; Figure 5 A flowchart illustrating the specific implementation process of real-time verification of interface parameters provided in this application embodiment; Figure 6 A flowchart illustrating a specific implementation process for implicit parameter constraint identification and rule updating provided in this application embodiment; Figure 7 A flowchart illustrating the specific implementation process of a parameter verification rule for an interface based on implicit parameter constraint information, provided in this application embodiment; Figure 8 A structural block diagram of an interface parameter verification device provided in an embodiment of this application; Figure 9 This is a schematic diagram of the structure of an interface parameter verification device provided in an embodiment of this application. Detailed Implementation

[0018] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this application and are not intended to limit the scope of the embodiments. Furthermore, it should be noted that, for ease of description, only the parts relevant to the embodiments of this application are shown in the accompanying drawings, not the entire structure.

[0019] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and are not limited in number; for example, a first object can be one or more. The term "several" means one or more, and multiple means two or more. Furthermore, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0020] The interface parameter verification method provided in this application can be applied to scenarios such as interface development, interface testing, interface operation monitoring, and interface version iteration. The aforementioned application scenarios are merely exemplary and illustrative. In practical applications, this interface parameter verification method can also be used in other scenarios, and this application does not limit these applications.

[0021] The interface parameter verification method provided in this application embodiment can be executed by a computer device. The computer device refers to any electronic device with data computing, processing and storage capabilities, such as a server or other terminal device. This application embodiment does not limit this.

[0022] Figure 1 This is a flowchart illustrating an interface parameter verification method provided in an embodiment of this application. This interface parameter verification method can be applied to an interface verification service, which can be an independently running service module within an interface management platform, such as... Figure 1 As shown, the verification method for this interface parameter specifically includes the following steps: Step S101: Obtain the interface document of the target interface, parse the interface document, and extract the interface parameter information, parameter constraint information, and parameter association relationship of the target interface.

[0023] The target interface can be the application interface that requires parameter validation. The interface documentation can be a document describing the call path, request method, request parameters, response parameters, and business constraints of the target interface. Interface parameter information can include at least one of the following: parameter name, parameter type, parameter level, whether the parameter is required, default value, and parameter enumeration values. Parameter constraint information can be constraints used to limit the values ​​or combinations of interface parameters, such as numerical range constraints, length constraints, format constraints, required field constraints, and conditional triggering constraints. Parameter relationships can be conditional dependencies between multiple interface parameters; for example, the value of one interface parameter determines whether another interface parameter is required or determines the allowed value range of another interface parameter.

[0024] Optionally, parsing the interface document to extract the interface parameter information, parameter constraint information, and parameter relationships of the target interface can be done as follows: obtaining the structured interface definition content and unstructured description content corresponding to the target interface; reading the parameter name, parameter type, and parameter level from the structured interface definition content; performing semantic analysis on the unstructured description content to identify the conditional parameters, constrained parameters, and constraint conditions contained therein; and associating the two types of parsing results to obtain the interface parameter information, parameter constraint information, and parameter relationships of the target interface.

[0025] In one embodiment, a specific implementation process for parsing interface documentation is described. Please refer to [reference needed]. Figure 2 , Figure 2 This is a flowchart illustrating a specific implementation process for parsing an interface document, as provided in an embodiment of this application. Figure 2 As shown, the specific implementation steps for parsing the interface documentation are as follows: Step S201: Identify the structured interface definition area and unstructured description area in the interface document, extract parameter name, parameter type and parameter hierarchy information from the structured interface definition area to obtain the interface parameter information of the target interface, and extract constraint description information from the unstructured description area.

[0026] The structured interface definition area can be a document area that records interface fields according to a preset interface description format, such as parameter lists, request structures, response structures, and data object definition areas. The unstructured description area can be a document area that describes the purpose of the interface, business logic, or parameter usage conditions using natural language. Parameter hierarchy information can be used to indicate the nesting position of interface parameters within the request or response data structure. For example, an order object may include user objects, and user objects may further include user level parameters; therefore, the parameter hierarchy of the user level parameter can be used to indicate that it resides within the user objects under the order object. Constraint description information can be text content in the unstructured description area related to parameter values ​​or relationships between parameters.

[0027] Optionally, the structured interface definition area and unstructured description area in the interface document can be identified as follows: the structured interface definition area is identified according to the tags, field structure, indentation relationship and object nesting relationship of the interface document, and the name field, type field and parent object field corresponding to each parameter are read to form interface parameter information; the unstructured description area is processed by sentence segmentation, and the description statements containing parameter names, range words, condition words or required words are filtered to obtain constraint description information.

[0028] Step S202: Semantically align the constraint description information with the interface parameter information, determine the condition parameters, constrained parameters and corresponding constraint conditions from the constraint description information, and obtain the parameter constraint information of the target interface.

[0029] Semantic alignment involves establishing a correspondence between parameter names, aliases, or meanings appearing in constraint description information and standard parameter names recorded in interface parameter information. Condition parameters are interface parameters that trigger parameter constraints. Constrained parameters are interface parameters that require value, format, or mandatory validation when condition parameters meet corresponding conditions. Constraints can include the triggering values ​​of condition parameters and the restrictions that constrained parameters must meet.

[0030] Optionally, the semantic alignment of constraint description information and interface parameter information can be achieved by: converting the parameter names and meanings in the interface parameter information into parameter semantic features; extracting candidate parameter entities from the constraint description information and generating descriptive semantic features corresponding to the candidate parameter entities; calculating the matching degree between the parameter semantic features and the descriptive semantic features, and aligning the candidate parameter entities that meet the matching conditions with the corresponding interface parameters; further identifying the condition expressions, restriction expressions, and pointing relationships in the constraint description information to determine the condition parameters, constrained parameters, and constraint conditions.

[0031] Step S203: Based on the condition parameters, constrained parameters, and constraints, determine the conditional dependencies between multiple interface parameters to obtain the parameter associations of the target interface.

[0032] In this context, conditional dependency can be used to indicate that the validation content of a constrained parameter depends on the value of a conditional parameter. A conditional parameter can correspond to one or more constrained parameters, and a constrained parameter can also depend on multiple conditional parameters simultaneously.

[0033] Optionally, based on condition parameters, constrained parameters, and constraints, the conditional dependencies between multiple interface parameters are determined, and the parameter associations of the target interface are obtained by: binding the conditional expressions in the constraint description information to the conditional parameters, and binding the restriction expressions to the constrained parameters; determining the association direction based on the semantic connection between the conditional expressions and the restriction expressions; and encapsulating the conditional parameters, constrained parameters, triggering conditions, and restriction content into parameter association records to obtain the parameter associations.

[0034] As can be seen from the above, by parsing the structured interface definition region and the unstructured description region respectively, and performing semantic alignment on the two types of parsing results, the parameter constraints recorded in natural language in the interface document can be identified, thereby obtaining the conditional dependencies between multiple interface parameters.

[0035] Step S102: Construct a parameter association graph based on interface parameter information, parameter constraint information, and parameter association relationships.

[0036] The parameter association graph can be a graph structure with interface parameters as parameter nodes and the conditional dependencies between interface parameters as association edges. Parameter nodes can record the parameter type, parameter level, and parameter constraint information of the corresponding interface parameter, while association edges can record the pointing relationships between conditional parameters and constrained parameters, as well as the corresponding constraint conditions.

[0037] Optionally, the parameter association graph can be constructed based on interface parameter information, parameter constraint information, and parameter association relationships as follows: Each interface parameter in the interface parameter information is read sequentially, a corresponding parameter node is generated for each interface parameter, and the parameter type, parameter level, and corresponding parameter constraint information are written into the node attributes of the parameter node; Conditional parameters and constrained parameters are determined based on the parameter association relationships, directed association edges pointing from the conditional parameters to the constrained parameters are established between the corresponding parameter nodes, and the constraint conditions are converted into corresponding constraint expressions based on the parameter type of the constrained parameters, and written into the edge attributes of the directed association edges; each directed association edge is traversed according to the parameter node identifier, and directed association edges with the same parameter node or continuous pointing relationships are merged to obtain a parameter association graph containing parameter nodes, node attributes, directed association edges, and edge attributes.

[0038] In one embodiment, a specific implementation process for constructing a parameter association graph is described. Please refer to [reference needed]. Figure 3 , Figure 3 This is a flowchart illustrating a specific implementation process for constructing a parameter association map, as provided in an embodiment of this application. Figure 3 As shown, the specific implementation steps for constructing the parameter association map are as follows: Step S301: Convert each interface parameter in the interface parameter information into a parameter node, and configure the corresponding parameter type, parameter level, and parameter constraint information as the node attributes of the parameter node.

[0039] Parameter nodes can be graph data units in a parameter association graph used to represent a single interface parameter. Node attributes can be information related to the corresponding interface parameter itself, such as parameter name, parameter type, parameter level, whether it is required, allowed value range, and default value.

[0040] Optionally, the method for converting each interface parameter in the interface parameter information into a parameter node and configuring the corresponding parameter type, parameter level, and parameter constraint information as node attributes of the parameter node can be as follows: generating a unique parameter node identifier for each interface parameter; associating the parameter name with the parameter node identifier; generating a type attribute according to the parameter type field; generating a parameter level attribute according to the nesting path of the interface parameter in the request or response structure; and configuring single parameter constraints as constraint attributes of the corresponding parameter node.

[0041] Step S302: Identify conditional parameters and constrained parameters according to parameter association relationships, establish directed association edges between corresponding parameter nodes from conditional parameters to constrained parameters, and convert the corresponding constraint conditions into constraint expressions that match the parameter types of constrained parameters, as edge attributes of directed association edges.

[0042] Directed edges can be used to represent the constraint that a conditional parameter places on a constrained parameter. Edge attributes can be used to record the triggering conditions and constraint expressions for this constraint relationship. The constraint expression matching the parameter type of the constrained parameter can be a natural language constraint converted into an executable comparison form based on the parameter type. For example, for numeric parameters, it can be converted into a numeric range expression; for character parameters, it can be converted into a length, character format, or enumeration value expression; and for object parameters, it can be converted into a field existence expression.

[0043] Optionally, conditional parameters and constrained parameters are identified according to parameter association relationships. Directed association edges pointing from conditional parameters to constrained parameters are established between corresponding parameter nodes. The corresponding constraints are then converted into constraint expressions matching the parameter type of the constrained parameters. This can be achieved by: determining conditional parameter nodes and constrained parameter nodes based on parameter association relationships; establishing directed association edges according to the direction in which conditional parameters affect constrained parameters; parsing the trigger values ​​and restrictions in the constraints; selecting the corresponding expression template based on the parameter type of the constrained parameters; writing the restrictions into the expression template to obtain the constraint expression; and configuring the trigger values ​​and constraint expressions together as edge attributes of the directed association edges.

[0044] Step S303: Merge directed edges with the same parameter nodes or continuous pointing relationships to generate a parameter association graph.

[0045] In this context, directed edges with the same parameter nodes can be multiple edges with the same condition parameter nodes or the same constrained parameter nodes. A continuous pointing relationship can be a multi-level association where the first parameter node points to the second parameter node, and the second parameter node further points to the third parameter node.

[0046] Optionally, the directed association edges with the same parameter nodes or continuous pointing relationships can be merged to generate a parameter association graph. This can be done by: grouping directed association edges according to condition parameter nodes and constrained parameter nodes; merging directed association edges with the same triggering conditions into a multi-objective association structure; concatenating multiple continuously pointing directed association edges to form a multi-level conditional dependency path; and encapsulating parameter nodes, node attributes, directed association edges, edge attributes, and conditional dependency paths into a parameter association graph.

[0047] As can be seen from the above, the parameter association graph can not only record the parameter attributes of each interface parameter, but also record the conditional dependency direction between parameters and the executable constraint expressions, providing a structured basis for the subsequent generation of interface parameter verification rules.

[0048] Step S103: Generate interface parameter verification rules for the target interface based on the parameter association graph, and verify the interface parameter data generated by the target interface during operation according to the interface parameter verification rules to obtain the parameter verification results.

[0049] Interface parameter validation rules can be a set of executable rules used to determine whether interface parameter data conforms to the requirements of the interface documentation. Interface parameter validation rules can include validation rules for individual interface parameters and correlation validation rules for conditional dependencies between multiple interface parameters. Interface parameter data can be request parameter data or response parameter data generated during one or more calls to the target interface. Parameter validation results can be used to indicate whether the interface parameter data meets the interface parameter validation rules, and can also include abnormal parameters, abnormal rule branches, and abnormal reasons.

[0050] Optionally, the method for generating interface parameter verification rules for the target interface based on the parameter association graph can be as follows: traverse the parameter nodes, node attributes, and directed association edges in the parameter association graph; convert the parameter constraint information corresponding to each parameter node into single-parameter rule branches; and convert the trigger conditions and constraint expressions corresponding to each directed association edge into association rule branches; organize each rule branch according to the condition dependency hierarchy between parameter nodes; configure version identifiers for each rule branch according to the document version of the interface document; construct a versioned rule tree; when the interface document is updated, add rule branches according to the differences in interface parameter information before and after the update and retain historical rule branches; determine the rule weights based on the historical call frequency of each rule branch; and determine the activation status and execution order of each rule branch in combination with the version identifier and preset grayscale ratio to obtain the interface parameter verification rules for the target interface.

[0051] Optionally, the interface parameter data generated by the target interface during operation can be verified according to the interface parameter verification rules. The method to obtain the parameter verification result can be as follows: continuously acquire the interface parameter data generated during the operation of the target interface; select the rule branch to be executed according to the rule branch activation status and execution order in the interface parameter verification rules; verify the parameter values ​​of each interface parameter and the correlation between multiple interface parameters in turn; summarize the verification output of each rule branch to obtain the parameter verification result.

[0052] As can be seen from the above, the embodiments of this application parse the interface document, extract the interface parameters, parameter constraints and parameter relationships, and convert them into parameter relationship graphs and interface parameter verification rules. This allows for single parameter verification and relationship verification of the parameter data generated during the operation of the target interface, thereby improving the completeness of interface parameter verification.

[0053] In one embodiment, a specific implementation process for generating interface parameter validation rules is described. Please refer to [reference needed]. Figure 4 , Figure 4 This is a flowchart illustrating the specific implementation process of generating interface parameter validation rules according to an embodiment of this application. Figure 4 As shown, the specific implementation steps for generating interface parameter validation rules are as follows: Step S401: Generate multiple rule branches based on parameter nodes, parameter constraint information and parameter association relationships in the parameter association graph, and configure version identifiers for each rule branch according to the document version of the interface document to build a versioned rule tree.

[0054] A rule branch can be a rule unit used to perform a single-parameter constraint or a cross-parameter conditional dependency validation. A version identifier can be used to indicate the version of the interface document corresponding to the rule branch. A versioned rule tree can be a data structure that organizes multiple rule branches according to the parameter dependency hierarchy and retains the version information of each rule branch.

[0055] Optionally, the method for generating multiple rule branches based on parameter nodes, parameter constraint information, and parameter association relationships in the parameter association graph can be as follows: traverse each parameter node in the parameter association graph, convert the parameter type, value range, and required state corresponding to the parameter node into single-parameter validation conditions, and generate single-parameter rule branches; determine the condition parameters, constrained parameters, and corresponding constraint expressions along each directed association edge, set the value conditions of the condition parameters as rule triggering conditions, and set the constraint expressions of the constrained parameters as validation operations after triggering, and generate association rule branches; merge association rule branches with the same rule triggering conditions, and arrange each rule branch according to the order of conditional dependencies between parameters.

[0056] Optionally, version identifiers can be configured for each rule branch according to the document version of the interface document. The method for constructing a versioned rule tree can be as follows: obtain the document version number corresponding to the interface document and write the document version number into the version attribute of each rule branch; configure single-parameter rule branches and associated rule branches as rule nodes with parent-child relationships according to the condition dependency order between parameters; for rule branches with the same validation object under different document versions, establish corresponding version nodes respectively, and associate each version node with the same parameter rule node to obtain a versioned rule tree.

[0057] Step S402: When the interface document is updated, generate a new rule branch in the versioned rule tree based on the differences in interface parameter information before and after the update, and retain the historical rule branches.

[0058] Differences in interface parameter information can include the addition or deletion of parameters, changes in parameter types, changes in parameter hierarchy, or changes in parameter constraints. Historical rule branches are rule branches generated from the interface documentation before the update and retained in the versioned rule tree. New rule branches are rule branches generated from the updated interface parameter information.

[0059] Optionally, the method for generating new rule branches in the versioned rule tree based on the differences in interface parameter information before and after the update, while retaining historical rule branches, can be as follows: perform field-level comparison of the interface parameter information before and after the update to determine the target parameter that has changed; locate the historical rule branch in the versioned rule tree corresponding to the target parameter; generate new rule branches based on the updated parameter type, parameter constraint information, or parameter association; write the new rule branches into the versioned rule tree, configure the updated version identifier for the new rule branches, and retain historical rule branches.

[0060] Step S403: Determine the corresponding rule weight based on the historical call frequency of each rule branch, and determine the activation status and execution order of each rule branch based on the version identifier, rule weight and preset gray scale ratio, so as to obtain the interface parameter verification rules of the target interface.

[0061] Among these, historical call frequency can be the number of times a rule branch is invoked and executed within a preset historical time range. Rule weight can be used to represent the execution priority of a rule branch. Preset grayscale ratio can be the proportion of interface parameter data applicable to a newly added rule branch before it is officially enabled. Enablement status can include enabled, grayscale enabled, or disabled. Execution order can be the order in which multiple enabled rule branches validate the same batch of interface parameter data.

[0062] Optionally, the method for determining the corresponding rule weight based on the historical call frequency of each rule branch can be as follows: count the number of times each rule branch is called during the historical verification process; determine the rule weight based on the number of calls, so that the rule branch with a higher call frequency has a higher rule weight.

[0063] Optionally, the activation status and execution order of each rule branch can be determined based on the version identifier, rule weight, and preset grayscale ratio to obtain the interface parameter verification rules for the target interface. This can be achieved by: matching the rule branch of the corresponding version according to the version identifier of the interface parameter data; determining the grayscale activation range of the newly added rule branch according to the preset grayscale ratio; and arranging the activated rule branches from high to low according to the rule weight to obtain the interface parameter verification rules.

[0064] As can be seen from the above, by constructing a versioned rule tree and retaining historical rule branches, we can adapt to changes in the version of the interface document; by combining rule weights and grayscale ratios to determine the activation status and execution order of rule branches, we can reduce the impact of rule updates on the interface running and verification process.

[0065] In one embodiment, a specific implementation process for real-time validation of interface parameters is described. Please refer to [reference needed]. Figure 5 , Figure 5 This is a flowchart illustrating the specific implementation process of real-time verification of interface parameters provided in an embodiment of this application. Figure 5 As shown, the specific implementation steps for real-time validation of interface parameters are as follows: Step S501: Obtain the interface parameter data generated by the target interface during operation, and input the interface parameter data into the real-time verification pipeline built based on the distributed stream processing framework.

[0066] The distributed stream processing framework can be a computing framework capable of continuously receiving and processing data streams. The real-time validation pipeline can be a processing chain that receives, parses, matches, executes, and outputs interface parameter data according to the order in which the interface parameter data is generated.

[0067] Optionally, the interface parameter data can be input into the real-time verification pipeline built on the distributed stream processing framework by: continuously obtaining the interface parameter data of the target interface from the interface gateway, interface service, or interface call log; classifying the interface parameter data according to the interface identifier of the target interface; transmitting the interface parameter data of the same target interface to the corresponding real-time verification pipeline; and having the real-time verification pipeline read the parameter name and parameter value from the interface parameter data.

[0068] Step S502: According to the activation status and execution order of each rule branch in the interface parameter verification rules, determine the rule branch to be executed, compile the rule branch to be executed into binary verification instructions, and execute the binary verification instructions through just-in-time compilation to verify the parameter values ​​and parameter relationships in the interface parameter data.

[0069] The rule branch to be executed can be a rule branch that is enabled in the current verification process and applicable to the current interface parameter data. The binary verification instruction can be a computer-executable instruction converted from the triggering conditions, parameter reading operations, comparison operations, and verification output operations in the rule branch. The just-in-time compilation method can convert the rule content into directly executable instructions when the rule branch is loaded or executed for the first time, and repeatedly call the generated instructions in subsequent verification processes.

[0070] Optionally, the execution branch of the rule to be executed is determined according to the activation status and execution order of each rule branch in the interface parameter verification rule. The method of compiling the execution branch of the rule to be executed into binary verification instructions can be as follows: filter rule branches that are in a disabled state; determine the applicable rule branch according to the version identifier corresponding to the current interface parameter data; select the execution branch of the rule to be executed according to the execution order corresponding to the rule weight; and compile the parameter reading expression, trigger condition and constraint expression in the execution branch of the rule to be executed into binary verification instructions respectively.

[0071] Optionally, the method of verifying the parameter values ​​and parameter relationships in the interface parameter data by executing binary verification instructions through just-in-time compilation can be as follows: first check whether the conditional parameters meet the triggering conditions, and then check whether the constrained parameters meet the corresponding parameter constraints.

[0072] Step S503: Summarize the verification output of each rule branch to be executed, identify abnormal parameters that do not meet the parameter constraint information or parameter association relationship, and obtain the parameter verification result.

[0073] The verification output can include the rule branch identifier, the parameter being verified, the verification status, and the reason for the exception. Exceptional parameters can be interface parameters whose values ​​do not meet their own parameter constraints, or interface parameters whose combinations with other parameters do not satisfy the parameter association relationship.

[0074] Optionally, the verification outputs of each rule branch to be executed are summarized to identify abnormal parameters that do not meet the parameter constraint information or parameter association relationship. The parameter verification results can be obtained by: collecting the verification status output of each rule branch to be executed; associating the rule branch that failed the verification with its corresponding parameter node or directed association edge; determining the parameter name, parameter value, triggering condition and constraint expression of the abnormal parameter; and summarizing the verification outputs belonging to the same interface call to generate parameter verification results.

[0075] As can be seen from the above, by compiling the rule branches into binary verification instructions and executing them in the real-time verification pipeline according to their enabled status and execution order, the continuously generated interface parameter data can be verified in real time, and specific abnormal parameters and reasons for the abnormality can be output.

[0076] In one embodiment, a specific implementation process for implicit parameter constraint identification and rule updating is described. Please refer to [reference needed]. Figure 6 , Figure 6 This is a flowchart illustrating a specific implementation process for implicit parameter constraint identification and rule updating provided in an embodiment of this application. Figure 6 As shown, after validating the interface parameter data generated by the target interface during operation according to the interface parameter validation rules and obtaining the parameter validation result, the following steps are also included: Step S601: According to the parameter association relationship in the parameter association map, the interface parameter data is associated and combined, and the corresponding parameter verification results are combined to form a parameter combination sample sequence.

[0077] Parameter combinations can be data sets obtained by combining multiple associated parameters and their values ​​from the same API call based on a directed edge or a conditional dependency path in the parameter association graph. Parameter combination samples can include conditional parameter values, constrained parameter values, parameter validation results, and the API call time. A parameter combination sample sequence can be a sample set formed by arranging multiple parameter combination samples in the order of API call times.

[0078] Optionally, the method of associating and combining interface parameter data according to the parameter association relationship in the parameter association graph, and forming a parameter combination sample sequence by combining the corresponding parameter verification results, can be as follows: determine the associated parameters to be combined according to the parameter association graph; read the parameter values ​​of the associated parameters from the interface parameter data generated by each interface call; encapsulate the associated parameter values ​​and the parameter verification results corresponding to the call to form a parameter combination sample; arrange multiple parameter combination samples according to the interface call time to obtain a parameter combination sample sequence.

[0079] Step S602: For each parameter combination sample in the parameter combination sample sequence, perform multiple segmentations based on multiple parameter dimensions, determine the degree of anomaly based on the number of segmentations required for each parameter combination sample to be independently separated, and determine the parameter temporal correlation state based on the parameter changes between adjacent parameter combination samples to obtain the parameter correlation anomaly pattern.

[0080] The parameter dimension can include at least one of the following: parameter value, parameter existence, parameter length, parameter type, and parameter validation status. Segmentation can be the process of dividing multiple parameter combination samples into different sample sets according to the selected parameter dimension and corresponding segmentation conditions. Anomaly degree can be used to represent the degree of deviation of a parameter combination sample from other parameter combination samples. The fewer segmentations required to independently separate a parameter combination sample, the more significant the difference between that parameter combination sample and most samples, and the higher its anomaly degree. Parameter temporal correlation state can be used to represent whether the parameter changes between conditional parameters and constrained parameters maintain a stable correlation pattern at adjacent call times. Parameter correlation anomaly pattern can be the parameter combination change pattern where the anomaly degree reaches a certain condition and the parameter temporal correlation state recurs.

[0081] Optionally, for each parameter combination sample in the parameter combination sample sequence, multiple segmentations are performed based on multiple parameter dimensions. The method to determine the degree of anomaly based on the number of segmentations required for each parameter combination sample to be independently separated can be as follows: select a target parameter dimension from multiple parameter dimensions; divide the parameter combination sample sequence into multiple sample subsets according to the parameter values ​​of the target parameter dimension; continue to select other parameter dimensions for segmentation of each sample subset until the target parameter combination sample is separated individually; record the number of segmentations required for each parameter combination sample to be separated individually, and determine the corresponding degree of anomaly.

[0082] Optionally, the parameter temporal correlation state can be determined based on the parameter changes between adjacent parameter combination samples, and the parameter correlation anomaly mode can be obtained by: comparing the value changes of conditional parameters and constrained parameters in adjacent parameter combination samples, updating the parameter temporal correlation state; and associating the anomaly degree with the parameter temporal correlation state to obtain the parameter correlation anomaly mode.

[0083] Step S603: Extract parameter value relationships from recurring parameter association anomaly patterns, and determine the parameter value relationships not included in the parameter constraint information as implicit parameter constraint information.

[0084] Among these, recurring parameter association anomaly patterns can be those that occur multiple times across multiple interface calls, exhibiting the same or similar conditional parameter values ​​and constrained parameter anomaly states. Parameter value relationships can be the correspondence between specific values ​​of conditional parameters and the mandatory status, value range, or parameter format of constrained parameters. Implicit parameter constraint information can be parameter condition dependencies identified through interface runtime data but not explicitly recorded in the parameter constraint information of the interface documentation.

[0085] Optionally, extracting parameter value relationships from recurring parameter association anomaly patterns and identifying parameter value relationships not included in parameter constraint information as implicit parameter constraint information can be achieved by: aggregating condition parameters, constrained parameters, and anomaly states in multiple parameter association anomaly patterns; counting the number of recurrences of the same parameter value relationship; extracting parameter value relationships that satisfy the recurrence condition; matching the extracted parameter value relationships with existing parameter constraint information in the interface documentation; and identifying the parameter value relationship as implicit parameter constraint information when no matching constraint content is found.

[0086] Step S604: Update the interface parameter verification rules based on the implicit parameter constraint information, and perform interface parameter verification based on the updated interface parameter verification rules.

[0087] The updated interface parameter validation rules can be rule branches corresponding to implicit constraints added to the original interface parameter validation rules, or rule sets obtained by adjusting the triggering conditions and constraint content of existing rule branches.

[0088] Optionally, the method of updating the interface parameter verification rules based on implicit parameter constraint information and performing interface parameter verification based on the updated interface parameter verification rules can be as follows: convert the implicit parameter constraint information into condition parameters, constrained parameters, and corresponding constraint expressions; establish corresponding relationships in the parameter relationship graph; generate new rule branches based on the newly added relationships; write the new rule branches into the interface parameter verification rules; and perform parameter verification according to the updated interface parameter verification rules when subsequent interface parameter data enters the real-time verification pipeline.

[0089] As can be seen from the above, by associating and combining interface parameter data and parameter verification results and learning abnormal patterns, we can discover parameter value relationships that are not explicitly recorded in the interface documentation but are stable during the interface operation, and use these parameter value relationships to continuously update the interface parameter verification rules.

[0090] In one embodiment, a specific implementation process for updating interface parameter validation rules based on implicit parameter constraint information is described. Please refer to [reference needed]. Figure 7 , Figure 7 This is a flowchart illustrating a specific implementation process of a parameter verification rule for an interface based on implicit parameter constraint information, as provided in an embodiment of this application. Figure 7 As shown, the specific implementation steps for updating interface parameter validation rules based on implicit parameter constraint information are as follows: Step S701: Extract the condition parameters, constrained parameters and their corresponding value relationships from the implicit parameter constraint information, and establish corresponding candidate association edges in the parameter association graph to generate candidate rule branches.

[0091] Candidate association edges can be temporarily added to the parameter association graph based on implicit parameter constraint information to represent newly discovered parameter conditional dependencies. Candidate rule branches can be rule branches to be merged generated based on the triggering conditions and constraint content in the candidate association edges.

[0092] Optionally, the method for extracting conditional parameters, constrained parameters, and their corresponding value relationships from implicit parameter constraint information, and establishing corresponding candidate association edges in the parameter association graph to generate candidate rule branches can be as follows: parse the implicit parameter constraint information to identify the conditional parameters used to trigger the constraints and the constrained parameters that are constrained; convert the triggering values ​​of the conditional parameters and the restriction content of the constrained parameters into corresponding value relationships; locate the parameter nodes corresponding to the conditional parameters and constrained parameters in the parameter association graph; establish candidate association edges between the two parameter nodes and convert the value relationships into edge attributes; and generate candidate rule branches based on the candidate association edges.

[0093] Step S702: Match the candidate rule branches with the existing rule branches in the interface parameter verification rules in terms of trigger conditions and constraint content, and determine the merging method between the candidate rule branches and the existing rule branches based on the recurrence frequency of the corresponding parameter-associated abnormal patterns.

[0094] Among these, existing rule branches can be rule branches that are already enabled or in a gray-scale enabled state in the interface parameter validation rules. Trigger condition matching can determine whether a candidate rule branch and an existing rule branch are triggered by the same condition parameters and the same condition values. Constraint content matching can determine whether two rule branches set the same or similar constraints on the same constrained parameters. Merging methods can include adding a new rule branch, supplementing an existing rule branch, or adjusting an existing rule branch. The frequency of recurrence of parameter association anomaly patterns can be used to indicate the stability of the corresponding implicit parameter constraint information in historical interface call data.

[0095] Optionally, the method for matching the candidate rule branch with the existing rule branches in the interface parameter validation rules in terms of trigger conditions and constraint content, and determining the merging method between the candidate rule branch and the existing rule branch based on the recurrence frequency of the corresponding parameter-related exception patterns, can be as follows: compare the condition parameters, trigger values, constrained parameters, and constraint expressions of the candidate rule branch with each existing rule branch; when there are no existing rule branches with the same trigger conditions and constraint content, the merging method is determined to add a new rule branch; when there are existing rule branches with the same trigger conditions but incomplete constraint content, the merging method is determined to supplement the existing rule branch; when there are differences in the constraint content between the candidate rule branch and the existing rule branch, determine whether to adjust the existing rule branch based on the recurrence frequency of the parameter-related exception patterns.

[0096] Step S703: Write the candidate rule branches into the interface parameter verification rules according to the merging method to obtain the updated interface parameter verification rules.

[0097] The process of writing candidate rule branches into interface parameter validation rules can be either writing the candidate rule branch as a new independent rule branch into the versioned rule tree, or writing the triggering conditions or constraint expressions in the candidate rule branch into an existing rule branch.

[0098] Optionally, the updated interface parameter validation rules can be obtained by writing candidate rule branches into the interface parameter validation rules according to the merging method as follows: when the merging method is to add a new rule branch, write the candidate rule branch into the versioned rule tree and configure the corresponding version identifier, activation status and rule weight; when the merging method is to supplement an existing rule branch, add the constraint content in the candidate rule branch to the existing rule branch; when the merging method is to adjust an existing rule branch, update the trigger conditions or constraint expressions in the existing rule branch according to the candidate rule branch; after completing the rule writing, the updated interface parameter validation rules are obtained.

[0099] Optionally, the updated rule branch can first be in a gray-scale enabled state according to a preset gray-scale ratio, and the enabled scope can be gradually expanded according to the call situation during the subsequent interface parameter verification process.

[0100] As can be seen from the above, by converting implicit parameter constraint information into candidate associated edges and candidate rule branches, and combining the matching relationship between candidate rule branches and existing rule branches with the frequency of recurrence of abnormal patterns to determine the merging method, it is possible to avoid directly overwriting existing validation rules and to gradually improve the interface parameter validation rules based on the running data.

[0101] In summary, this application's embodiments obtain interface parameter information, parameter constraint information, and parameter relationships by parsing the interface document, construct a parameter relationship graph that can characterize parameter attributes and conditional dependencies, and generate versioned interface parameter verification rules based on the parameter relationship graph. During interface operation, interface parameter verification is performed through a real-time verification pipeline, and further parameter relationship anomaly patterns are learned based on interface parameter data and parameter verification results. Implicit parameter constraint information not defined in the interface document is identified, and the interface parameter verification rules are updated, thereby forming a closed-loop processing process of interface document parsing, parameter verification, and rule updating.

[0102] Figure 8 This is a structural block diagram of an interface parameter verification device provided in an embodiment of this application. The device is configured to execute the interface parameter verification method provided in the above embodiment, and has corresponding functional modules and beneficial effects for executing the method. Figure 8 As shown, the device specifically includes: The parsing module 801 is configured to obtain the interface document of the target interface, parse the interface document, and extract the interface parameter information, parameter constraint information, and parameter association relationship of the target interface. Module 802 is configured to construct a parameter association graph based on interface parameter information, parameter constraint information, and parameter association relationships. The verification module 803 is configured to generate interface parameter verification rules for the target interface based on the parameter association graph, and to verify the interface parameter data generated by the target interface during operation based on the interface parameter verification rules, so as to obtain the parameter verification results.

[0103] As described above, by parsing the target interface's documentation, extracting interface parameter information, parameter constraint information, and parameter relationships, a parameter relationship graph is constructed. Based on this graph, interface parameter validation rules are generated to validate the interface parameter data generated during the target interface's operation. Simultaneously, by combining the interface parameter data and validation results, abnormal parameter relationship patterns are learned, identifying implicit parameter constraints not defined in the interface documentation, and updating the interface parameter validation rules accordingly. This achieves collaborative validation of explicit document constraints and implicit parameter constraints, enabling the validation rules to continuously improve based on interface runtime data.

[0104] In one possible embodiment, the parsing module 801 is specifically configured as follows: Identify the structured interface definition area and unstructured description area in the interface document, extract parameter name, parameter type and parameter hierarchy information from the structured interface definition area to obtain the interface parameter information of the target interface, and extract constraint description information from the unstructured description area; Semantically align constraint description information with interface parameter information, determine condition parameters, constrained parameters and corresponding constraint conditions from constraint description information, and obtain parameter constraint information of the target interface; Based on conditional parameters, constrained parameters, and constraints, the conditional dependencies between multiple interface parameters are determined, and the parameter associations of the target interface are obtained.

[0105] In one possible embodiment, the construction module 802 is specifically configured as follows: Each interface parameter in the interface parameter information is converted into a parameter node, and the corresponding parameter type, parameter level, and parameter constraint information are configured as node attributes of the parameter node. Identify conditional parameters and constrained parameters according to parameter association relationships, establish directed association edges between corresponding parameter nodes from conditional parameters to constrained parameters, and convert the corresponding constraint conditions into constraint expressions that match the parameter type of the constrained parameters, as edge attributes of the directed association edges. Directed edges with the same parameters or continuous pointing relationships are merged to generate a parameter association graph.

[0106] In one possible embodiment, the verification module 803 is specifically configured as follows: Multiple rule branches are generated based on the parameter nodes, parameter constraint information, and parameter relationships in the parameter association graph. Version identifiers are configured for each rule branch according to the document version of the interface document to build a versioned rule tree. When the API documentation is updated, a new rule branch is generated in the versioned rule tree based on the differences in API parameter information before and after the update, while historical rule branches are retained. The corresponding rule weight is determined based on the historical call frequency of each rule branch. Based on the version identifier, rule weight, and preset grayscale ratio, the activation status and execution order of each rule branch are determined to obtain the interface parameter verification rules for the target interface.

[0107] In one possible embodiment, the verification module 803 is further configured as follows: Obtain the interface parameter data generated by the target interface during operation, and input the interface parameter data into a real-time verification pipeline built on a distributed stream processing framework; According to the activation status and execution order of each rule branch in the interface parameter verification rules, the rule branch to be executed is determined, the rule branch to be executed is compiled into binary verification instructions, and the binary verification instructions are executed through just-in-time compilation to verify the parameter values ​​and parameter relationships in the interface parameter data. Summarize the verification output of each rule branch to be executed, identify abnormal parameters that do not meet the parameter constraint information or parameter association relationship, and obtain the parameter verification results.

[0108] In one possible embodiment, the device further includes: The combination module 804 is configured to combine interface parameter data according to the parameter association relationship in the parameter association graph, and form a parameter combination sample sequence by combining the corresponding parameter verification results; The determination module 805 is configured to perform multiple segmentations based on multiple parameter dimensions for each parameter combination sample in the parameter combination sample sequence, determine the degree of anomaly based on the number of segmentations required for each parameter combination sample to be independently separated, and determine the parameter temporal correlation state based on the parameter changes between adjacent parameter combination samples to obtain the parameter correlation anomaly mode. The extraction module 806 is configured to extract parameter value relationships from recurring parameter association anomaly patterns and identify parameter value relationships not included in parameter constraint information as implicit parameter constraint information. Update module 807, configure it to update interface parameter validation rules based on implicit parameter constraint information, and perform interface parameter validation based on the updated interface parameter validation rules.

[0109] In one possible embodiment, the update module 807 is specifically configured as follows: Extract condition parameters, constrained parameters, and their corresponding value relationships from implicit parameter constraint information, and establish corresponding candidate association edges in the parameter association graph to generate candidate rule branches; The candidate rule branch is matched with the existing rule branch in the interface parameter validation rules for triggering conditions and constraint content. Based on the frequency of recurrence of the corresponding parameter association exception mode, the merging method between the candidate rule branch and the existing rule branch is determined. The candidate rule branches are written into the interface parameter validation rules according to the merging method to obtain the updated interface parameter validation rules. Figure 9 This is a schematic diagram of the structure of an interface parameter verification device provided in an embodiment of this application, as shown below. Figure 9 As shown, the device includes a processor 901, a memory 902, an input device 903, and an output device 904.

[0110] The number of processors 901 can be one or more. Figure 9 Taking a processor 901 as an example; the processor 901, memory 902, input device 903, and output device 904 can be connected via a bus or other means. Figure 9 Taking a bus connection as an example, the memory 902, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the interface parameter verification method in this embodiment. The processor 901 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 902, thereby implementing the aforementioned interface parameter verification method. The input device 903 can be configured to receive input digital or character information and generate key signal inputs related to user settings and function control of the device. The output device 904 may include a display screen or other display device.

[0111] This application also provides a non-volatile storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are configured to perform an interface parameter verification method described in the above embodiments. The method includes: obtaining an interface document of a target interface; parsing the interface document to extract interface parameter information, parameter constraint information, and parameter association relationships of the target interface; constructing a parameter association graph based on the interface parameter information, parameter constraint information, and parameter association relationships; generating interface parameter verification rules for the target interface based on the parameter association graph; and verifying the interface parameter data generated by the target interface during operation according to the interface parameter verification rules to obtain parameter verification results.

[0112] It is worth noting that in the embodiments of the above-mentioned interface parameter verification device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not configured to limit the protection scope of the embodiments of this application.

[0113] In some possible implementations, various aspects of the methods provided in this application can also be implemented as a program product comprising program code that, when run on a computer device, is configured to cause the computer device to perform the steps of the methods according to the various exemplary embodiments of this application described above. For example, the computer device may perform the interface parameter verification method described in the embodiments of this application. The program product may be implemented using a combination of one or more readable media.

Claims

1. A method for verifying interface parameters, characterized in that, include: Obtain the interface document of the target interface, parse the interface document, and extract the interface parameter information, parameter constraint information, and parameter association relationship of the target interface; Based on the interface parameter information, the parameter constraint information, and the parameter association relationships, a parameter association graph is constructed. Based on the parameter association graph, interface parameter verification rules for the target interface are generated, and the interface parameter data generated by the target interface during operation is verified according to the interface parameter verification rules to obtain the parameter verification results.

2. The method for verifying interface parameters according to claim 1, characterized in that, The step of parsing the interface document to extract the interface parameter information, parameter constraint information, and parameter associations of the target interface includes: Identify the structured interface definition area and unstructured description area in the interface document, extract parameter name, parameter type and parameter hierarchy information from the structured interface definition area to obtain the interface parameter information of the target interface, and extract constraint description information from the unstructured description area; The constraint description information and the interface parameter information are semantically aligned, and the condition parameters, constrained parameters and corresponding constraint conditions are determined from the constraint description information to obtain the parameter constraint information of the target interface. Based on the condition parameters, the constrained parameters, and the constraints, the conditional dependencies between multiple interface parameters are determined, and the parameter associations of the target interface are obtained.

3. The method for verifying interface parameters according to claim 2, characterized in that, The step of constructing a parameter association graph based on the interface parameter information, the parameter constraint information, and the parameter association relationships includes: Each interface parameter in the interface parameter information is converted into a parameter node, and the corresponding parameter type, parameter level, and parameter constraint information are configured as the node attributes of the parameter node. Identify conditional parameters and constrained parameters according to the parameter association relationship, establish directed association edges between the corresponding parameter nodes from the conditional parameters to the constrained parameters, and convert the corresponding constraint conditions into constraint expressions that match the parameter type of the constrained parameters, as the edge attributes of the directed association edges; Directed edges with the same parameters or continuous pointing relationships are merged to generate a parameter association graph.

4. The method for verifying interface parameters according to claim 1, characterized in that, The interface parameter verification rules for generating the target interface based on the parameter association graph include: Based on the parameter nodes, parameter constraint information, and parameter association relationships in the parameter association graph, multiple rule branches are generated, and version identifiers are configured for each rule branch according to the document version of the interface document to construct a versioned rule tree; When the interface document is updated, a new rule branch is generated in the versioned rule tree based on the differences in interface parameter information before and after the update, while the historical rule branches are retained. The corresponding rule weight is determined based on the historical call frequency of each rule branch, and the activation status and execution order of each rule branch are determined based on the version identifier, the rule weight and the preset gray scale ratio, so as to obtain the interface parameter verification rules of the target interface.

5. The method for verifying interface parameters according to claim 1, characterized in that, The step of verifying the interface parameter data generated by the target interface during operation according to the interface parameter verification rules to obtain the parameter verification result includes: Obtain the interface parameter data generated by the target interface during operation, and input the interface parameter data into a real-time verification pipeline built based on a distributed stream processing framework; According to the activation status and execution order of each rule branch in the interface parameter verification rules, the rule branch to be executed is determined, the rule branch to be executed is compiled into binary verification instructions, and the binary verification instructions are executed by just-in-time compilation to verify the parameter values ​​and parameter associations in the interface parameter data. Summarize the verification outputs of each rule branch to be executed, identify abnormal parameters that do not meet the parameter constraint information or the parameter association relationship, and obtain the parameter verification results.

6. The method for verifying interface parameters according to claim 1, characterized in that, After verifying the interface parameter data generated by the target interface during operation according to the interface parameter verification rules and obtaining the parameter verification result, the method further includes: According to the parameter association relationship in the parameter association map, the interface parameter data are associated and combined, and a parameter combination sample sequence is formed by combining the corresponding parameter verification results; For each parameter combination sample in the parameter combination sample sequence, multiple segments are performed based on multiple parameter dimensions. The degree of anomaly is determined based on the number of segments required for each parameter combination sample to be independently separated. The parameter temporal correlation state is determined based on the parameter changes between adjacent parameter combination samples, thus obtaining the parameter correlation anomaly pattern. Extract parameter value relationships from recurring abnormal parameter association patterns, and identify parameter value relationships not included in the parameter constraint information as implicit parameter constraint information; The interface parameter verification rules are updated based on the implicit parameter constraint information, and the interface parameter verification is performed based on the updated interface parameter verification rules.

7. The method for verifying interface parameters according to claim 6, characterized in that, The step of updating the interface parameter validation rules based on the implicit parameter constraint information includes: Extract the condition parameters, constrained parameters and their corresponding value relationships from the implicit parameter constraint information, and establish corresponding candidate association edges in the parameter association graph to generate candidate rule branches; The candidate rule branch is matched with the existing rule branch in the interface parameter verification rule for triggering conditions and constraint content. Based on the frequency of recurrence of the corresponding parameter-associated abnormal mode, the merging method of the candidate rule branch and the existing rule branch is determined. The candidate rule branches are written into the interface parameter verification rules according to the merging method described above, resulting in the updated interface parameter verification rules.

8. A device for verifying interface parameters, characterized in that, include: The parsing module is configured to obtain the interface document of the target interface, parse the interface document, and extract the interface parameter information, parameter constraint information, and parameter association relationship of the target interface. The construction module is configured to construct a parameter association graph based on the interface parameter information, the parameter constraint information, and the parameter association relationship; The verification module is configured to generate interface parameter verification rules for the target interface based on the parameter association graph, and to verify the interface parameter data generated by the target interface during operation based on the interface parameter verification rules to obtain the parameter verification result.

9. A device for verifying interface parameters, characterized in that, The device includes: one or more processors; and a storage device configured to store one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the method for verifying the interface parameters according to any one of claims 1-7.

10. A non-volatile storage medium for storing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are configured to perform the method for verifying the interface parameters as described in any one of claims 1-7.