Interface review and automatic modification suggestion generation method, system and computer readable storage medium for industrial vision SDK

CN122963959APending Publication Date: 2026-10-23GUANGDONG AOPUTE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611163160.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0005]本发明的目的在于提供面向工业视觉SDK的接口审查与自动修改建议生成方法、系统和计算机可读存储介质,以解决现有工业视觉SDK接口审查方法因缺乏接口与算法实现行为的联合建模能力,导致深层不一致问题难以自动检出、且无法生成可执行修改建议的技术问题

Benefits of technology

本发明一方面通过构建参数参与路径图,并基于该路径图对接口结构模型与算法结构模型执行一致性对齐分析,能够自动检出SDK接口与底层算法实现之间的深层不一致问题,显著提升了接口审查的覆盖深度和检出准确性;另一方面,通过将问题检测结果、对齐结果以及参数参与路径图联合作为输入,自动生成包含修改目标、修改动作、影响范围、兼容性风险和优先级的结构化修改建议项,克服了现有工具仅能发现问题而无法给出解决方案的局限,大幅降低了SDK维护人员的人工成本;再一方面,参数参与路径图为每条修改建议提供了基于代码真实执行路径的证据链,使建议具有可解释性与可验证性,有助于工业视觉SDK的规模化工程落地。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122963959A_ABST
    Figure CN122963959A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of industrial vision software engineering, and particularly relates to an interface review and automatic modification suggestion generation method, system and computer readable storage medium for industrial vision SDK. The method comprises the following steps: obtaining interface definition information, interface description information and implementation side information of the SDK to be reviewed; constructing an interface structure model and an algorithm structure model; constructing a parameter participation path graph based on the interface structure model and the algorithm structure model; performing problem detection and consistency alignment analysis based on the interface structure model, the algorithm structure model and the parameter participation path graph to obtain a problem detection result and an alignment result; and generating a structured modification suggestion item according to the problem detection result, the alignment result and the parameter participation path graph. Through interface-algorithm bilateral modeling and parameter participation path analysis, the present application automatically detects deep inconsistencies between the SDK interface and the underlying algorithm implementation, and generates a structured modification suggestion with an evidence chain, thereby greatly reducing the manual review cost of the industrial vision SDK.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial vision software engineering technology, and in particular to a method, system, and computer-readable storage medium for interface review and automatic modification suggestion generation for industrial vision SDKs. Background Technology

[0002] Industrial vision SDKs are core components for developing industrial vision systems. They provide interfaces for various algorithms, including image processing, object detection and localization, and measurement analysis, and are widely used in industrial inspection, robot guidance, and defect identification. With the increasing adoption of industrial vision applications, the number of SDK interfaces continues to grow, and the semantics of these interfaces are becoming increasingly complex. The quality of interface design directly impacts downstream development efficiency and system stability.

[0003] During SDK development and maintenance, deep inconsistencies often exist between interface design and underlying algorithm implementation: some interface parameters are not actually involved in the algorithm calculation, default parameter values ​​do not match the normal execution path of the algorithm, the output semantics described in the interface documentation do not match the actual output of the algorithm, and the value range of mode control parameters is misaligned with the internal branch logic of the algorithm. These problems are hidden in the details of the code and are difficult to discover systematically through manual code review. Existing interface review methods mainly rely on naming convention checks, static syntax scanning, or documentation comparison, which have the following main limitations: First, these tools can only mark problems and cannot provide specific modification suggestions. Engineers still need to manually analyze the root causes of the problems and formulate modification plans, resulting in low review efficiency. Second, they lack the ability to jointly model the semantics of the interface layer and the implementation behavior of the algorithm layer, and cannot detect deep inconsistencies between interface design and algorithm logic. Third, for large-scale industrial vision SDKs containing hundreds or even thousands of interfaces, manual review is extremely costly, and existing tools also lack scalable automated reasoning capabilities.

[0004] Therefore, there is an urgent need for a method that can jointly model the behavior of industrial vision SDK interfaces and underlying algorithm implementations, automatically detect deep inconsistencies, and directly generate executable modification suggestions to overcome the above-mentioned shortcomings. Summary of the Invention

[0005] The purpose of this invention is to provide a method, system, and computer-readable storage medium for interface review and automatic modification suggestion generation for industrial vision SDKs, in order to solve the technical problem that existing industrial vision SDK interface review methods lack the ability to jointly model interface and algorithm implementation behavior, resulting in the difficulty in automatically detecting deep inconsistencies and the inability to generate executable modification suggestions.

[0006] To achieve this objective, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for interface review and automatic modification suggestion generation for industrial vision SDKs, which includes the following steps: S1. Obtain the interface definition information, interface description information, and implementation information of the SDK to be reviewed; S2. Construct an interface structure model based on the interface definition information, and construct an algorithm structure model based on the implementation side information; S3. Based on the interface structure model and the algorithm structure model, construct a parameter participation path graph. The parameter participation path graph includes a parameter participation path for each interface parameter. The parameter participation path represents the participation process of the interface parameter from input to output. S4. Based on the interface structure model, the algorithm structure model, and the parameter participation path graph, perform problem detection and consistency alignment analysis to obtain problem detection results and alignment results; S5. Based on the problem detection results, the alignment results, and the parameter participation path graph, generate structured modification suggestions.

[0007] In some preferred embodiments, the interface structure model includes an interface name field, a parameter list field, a parameter type field, a default value field, an input / output direction field, a return value definition field, an optional output field, an overload group field, a mode flag field, a parameter constraint field, and a document item field. The parameter list field is used to record the name and order of the interface parameters; the input / output direction field is used to identify the interface parameters as input parameters, output parameters, or input / output multiplexing parameters; the mode flag field is used to identify the mode switching parameters, behavior control parameters, or function switch parameters in the interface parameters; and the parameter constraint field is used to record the explicit constraints or inferable constraints of the interface parameters.

[0008] In some preferred embodiments, the algorithm structure model includes a control flow graph, a data flow graph, a variable semantic role table, an algorithm pattern, a parameter participation path field, a branch condition field, a default execution path field, an output generation path field, and a risk point field. The control flow graph includes basic blocks, sequential paths, conditional branches, loop back edges, early return paths, exception handling paths, and parallel regions. The data flow graph includes parameter input nodes, intermediate variable nodes, output nodes, computation nodes, dependency edges, and semantic edges; The variable semantic role table is used to record the semantic roles of the interface parameters and intermediate variables. The semantic roles include threshold, normalization term, search boundary, output container, candidate result, stability protection term, error amount, objective function amount, and mode control term.

[0009] In some preferred embodiments, the algorithm modes include at least one of template matching, FFT acceleration, iterative optimization, geometric fitting, point cloud processing, Top-K truncation, and nonmaximum suppression.

[0010] In some preferred embodiments, the parameter participation path includes entry point, dependent basic block, dependent variable, dependent operation, and influence output.

[0011] In some preferred embodiments, the problem detection includes interface-level problem detection performed based on the interface structure model and algorithm-level problem detection performed based on the algorithm structure model, and the problem detection results include an interface-level problem set and an algorithm-level problem set; The consistency alignment analysis is performed on the interface structure model and the algorithm structure model based on the parameter participation path graph, and the alignment result includes at least one of parameter participation consistency, parameter semantic consistency, output consistency, and pattern consistency.

[0012] In some preferred embodiments, the parameter participation consistency is used to determine whether each of the interface parameters is in a fully participated state, a partially participated state, a path-restricted participated state, or a non-participated state. The parameter semantic consistency is used to determine whether the semantics of the interface parameter in the interface description information are consistent with the actual role of the interface parameter in the algorithm structure model; The output consistency is used to determine whether the output recorded in the interface structure model is consistent with the output generation path recorded in the algorithm structure model. The pattern consistency is used to determine whether the functional pattern described in the interface description information is consistent with the algorithm pattern identified in the algorithm structure model.

[0013] In some preferred embodiments, the interface layer problem set includes at least one of the following: naming consistency problem, parameter semantic clarity problem, default value rationality problem, output definition integrity problem, and interface complexity problem; The naming consistency issue is used to characterize whether similar semantic parameters use a unified name, and whether there is a naming method that is inconsistent with commonly used terms in the field of industrial vision. The parameter semantic clarity issue is used to characterize whether the interface parameter carries multiple semantics, and whether the parameter description clearly describes its unit, value range, action stage and effective conditions; The default value rationality issue is used to characterize whether the default value falls within the reasonable range of the algorithm mode, whether it causes the default path to enter an extreme branch, and whether it conflicts with the semantic role of the parameter. The output definition completeness question is used to characterize whether the return value or output parameter fully expresses the algorithm result, and whether it explains the sorting rules, the meaning of confidence, the coordinate system definition, the unit definition, and the output behavior when it fails; The interface complexity problem is used to characterize whether there are too many positional parameters, multiple highly coupled parameters, and excessive overloading.

[0014] In some preferred embodiments, the algorithm layer problem set includes at least one of the following: parameter combination conflict problem, default path anomaly problem, numerical stability problem, boundary handling problem, complexity and performance problem, and output consistency problem; The parameter combination conflict problem is used to characterize whether there are mutual exclusion relationships, implicit dependencies, conditional dependencies, master-slave relationships, and conflicting combinations among the interface parameters; The default path anomaly issue is used to characterize whether the default path is the main recommended path, whether it enters a low-stability branch, whether it bypasses key checks, and whether it is consistent with the interface description information. The numerical stability problem is used to characterize whether there is precision loss caused by normalized denominators approaching zero, division by zero, accumulation overflow, subtraction of large numbers, and unprotected square root, division or exponentiation operations. The boundary processing problem is used to characterize whether the input is empty, whether the image or template size is valid, whether the point set is empty, whether there are no valid candidates, whether the result container is uninitialized, whether the index is out of bounds, and whether the accessed region is out of bounds. The complexity and performance issues are used to characterize whether there are duplicate computations, inefficient paths, cacheable intermediate quantities, loops that can be parallelized but are not, and parameter participation paths that do not contribute to the output. The output consistency problem is used to characterize whether the output is truly calculated by the algorithm, whether the output fields are consistent with the interface declaration, whether the output declared in the documentation exists in the implementation, and whether the additional information of the output generated by the implementation has not been disclosed to the public.

[0015] In some preferred embodiments, the structured modification suggestions are generated by establishing a modification suggestion generation model. The modification suggestion generation model is based on a suggestion generation rule base and establishes a mapping relationship between the problem and the structured modification suggestions according to the problem type, parameter semantic roles, parameter participation paths, algorithm modes, current interface design, risk levels, and output dependencies, so as to generate the structured modification suggestions.

[0016] In some preferred embodiments, the structured modification proposal includes the modification target, modification action, scope of impact, compatibility risks, and priority.

[0017] In some preferred embodiments, the priority is determined based on a combination of problem severity, risk level, output impact, compatibility cost, and usage frequency, and is divided into high priority, medium priority, and low priority.

[0018] In some preferred embodiments, the modification type of the structured modification suggestion includes at least one of parameter-level suggestions, interface-level suggestions, behavior-level suggestions, and document-level suggestions; The parameter-level suggestions include adjusting default values, adding range restrictions, changing implicit parameters to explicit parameters, splitting multi-semantic parameters into multiple single-semantic parameters, and replacing names with domain-common names. The interface-level recommendations include encapsulating multiple loose parameters into a parameter structure, introducing pattern enumeration to replace integer pattern parameters, splitting input-output multiplexed parameters into independent input and output parameters, and adding an optional output structure. The behavioral recommendations include adding an automatic threshold mode, adding a boundary check branch, adding stability protection items, and enabling a normalization process in the default execution path. The document-level recommendations include supplementary pattern descriptions, supplementary parameter dependency descriptions, supplementary output sorting rules and confidence definitions, and supplementary failure behavior descriptions.

[0019] In some preferred embodiments, the method for interface review and automatic modification suggestion generation for industrial vision SDKs further includes: Output a modification suggestion report, which includes the structured modification suggestion items, as well as an interface quality summary and modification priority ranking.

[0020] In some preferred embodiments, the method for interface review and automatic modification suggestion generation for industrial vision SDKs further includes: An interface refactoring scheme is generated based on the structured modification suggestions. The interface refactoring scheme includes the modified function signature, parameter structure definition, field description, migration strategy for compatibility with the old interface, example calling code, and mapping relationship between the old and new interfaces. The modification suggestion report also includes the interface refactoring scheme.

[0021] In some preferred embodiments, the method for interface review and automatic modification suggestion generation for industrial vision SDKs further includes: Based on the interface refactoring scheme, an executable modification result is generated. The executable modification result includes modified function declarations, modified structure declarations, code modification patches, document update results, and unit test update suggestions. The document update result includes at least one of a document update draft for review and document update content that can be directly published. The modification suggestion report also includes the executable modification result.

[0022] In some preferred embodiments, the modification suggestion report also includes a comprehensive score, which includes an interface quality score, an algorithm consistency score, and a refactoring priority score.

[0023] Secondly, the present invention provides an interface review and automatic modification suggestion generation system for industrial vision SDKs, comprising: The information acquisition module is used to acquire the interface definition information, interface description information, and implementation information of the SDK to be reviewed. The model building module is used to build an interface structure model based on the interface definition information and to build an algorithm structure model based on the implementation side information. The path analysis module is used to construct a parameter participation path graph based on the interface structure model and the algorithm structure model. The parameter participation path graph includes a parameter participation path for each interface parameter, and the parameter participation path represents the participation process of the interface parameter from input to output. The review module is used to perform problem detection and consistency alignment analysis on the path graph based on the interface structure model, the algorithm structure model and the parameters, and to obtain problem detection results and alignment results. The suggestion generation module is used to generate structured modification suggestions based on the problem detection results, the alignment results, and the parameter participation path graph.

[0024] In some preferred embodiments, the problem detection performed by the review module includes interface-level problem detection based on the interface structure model and algorithm-level problem detection based on the algorithm structure model, and the problem detection results include an interface-level problem set and an algorithm-level problem set; The consistency alignment analysis is performed on the interface structure model and the algorithm structure model based on the parameter participation path graph. The interface review and automatic modification suggestion generation system for industrial vision SDKs also includes a report generation module, which is used to output a modification suggestion report based on the structured modification suggestion items.

[0025] Thirdly, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the interface review and automatic modification suggestion generation method for industrial vision SDKs as described above.

[0026] Compared with the prior art, the present invention has the following beneficial effects: This invention addresses several key issues. Firstly, by constructing a parameter participation path graph and performing consistency alignment analysis on the interface structure model and algorithm structure model based on this graph, it can automatically detect deep inconsistencies between the SDK interface and the underlying algorithm implementation, significantly improving the coverage depth and detection accuracy of interface reviews. Secondly, by combining problem detection results, alignment results, and the parameter participation path graph as input, it automatically generates structured modification suggestions that include modification targets, modification actions, scope of impact, compatibility risks, and priorities. This overcomes the limitation of existing tools that can only identify problems but not provide solutions, greatly reducing the labor costs for SDK maintenance personnel. Thirdly, the parameter participation path graph provides an evidence chain for each modification suggestion based on the actual code execution path, making the suggestions interpretable and verifiable, which is conducive to the large-scale engineering implementation of industrial vision SDKs.

[0027] The present invention has other features and advantages, which will be apparent from or will be set forth in detail in the accompanying drawings and the following detailed description, which together serve to explain the particular principles of the invention. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is a flowchart of the interface review and automatic modification suggestion generation method for industrial vision SDK according to Embodiment 1 of the present invention.

[0030] Figure 2 This is a structural block diagram of the interface review and automatic modification suggestion generation system for industrial vision SDKs according to Embodiment 2 of the present invention. Detailed Implementation

[0031] To illustrate the possible application scenarios, technical principles, implementable specific solutions, and achievable objectives and effects of this application in detail, the following description, in conjunction with the listed specific embodiments and accompanying drawings, provides a detailed explanation. The embodiments described herein are merely illustrative of the technical solutions of this application and are therefore intended to limit the scope of protection of this application.

[0032] Example 1 Please see Figure 1The interface review and automatic modification suggestion generation method for industrial vision SDKs in this embodiment is executed by a computer, and includes the following steps: S1. Obtain the interface definition information, interface description information, and implementation information of the SDK to be reviewed.

[0033] Interface definition information refers to the formal description of the interfaces exposed by the SDK, including function names, parameter lists, parameter types, return value types, overload declarations, and mode flags, which are usually extracted from header files or interface description files.

[0034] Interface description information refers to the documentation content corresponding to the interface, which includes the semantic description of each parameter, the range of values, the explanation of default values, the meaning of output and the explanation of abnormal behavior. It can be obtained from API documentation, code comments or independent documentation files.

[0035] Implementation-side information refers to the underlying algorithm implementation code corresponding to the interface, which is usually a C++ source file, or a compiled intermediate representation, used for subsequent static analysis.

[0036] It is understandable that the joint acquisition of the above three types of information is a prerequisite for performing subsequent two-sided modeling; without any one of them, the deep consistency analysis of the interface and algorithm cannot be completed.

[0037] S2. Construct an interface structure model based on the interface definition information, and construct an algorithm structure model based on the implementation side information.

[0038] An interface structure model is a structured representation of interface definition information. For each interface in the SDK, an interface structure model record is constructed, including fields such as interface name, parameter list, parameter type, default value, input / output direction, return value definition, optional output, overload group, mode flag, parameter constraint, and document item. Specifically, the parameter list field records the names and declaration order of parameters; the input / output direction field identifies each interface parameter as an input parameter, output parameter, or input / output multiplexed parameter; the mode flag field identifies parameters that carry the semantics of mode switching, behavior control, or function on / off; and the parameter constraint field records explicit constraints or implicit constraints that can be inferred from the interface semantics.

[0039] The algorithm structure model is a static analysis result of the implementation-side information. Specifically, by performing lexical analysis, syntax analysis, and semantic analysis on the implementation code, control flow graphs, data flow graphs, variable semantic role tables, and algorithm patterns are constructed, and parameter participation path fields, branch condition fields, default execution path fields, output generation path fields, and risk point fields are extracted.

[0040] Control flow graphs, with basic blocks as nodes and control transfers as edges, fully depict the execution path of code. They include sequential paths, conditional branches, loop back edges, early return paths, exception handling paths, and parallel regions. Data flow graphs, on the other hand, focus on the definition and usage relationships of variables, and include parameter input nodes, intermediate variable nodes, output nodes, computation nodes, dependency edges, and semantic edges.

[0041] The variable semantic role table categorizes variables in the implementation code semantically. Common roles include threshold, normalization term, search boundary, output container, candidate result, stability protection term, error quantity, objective function quantity, and mode control term. Algorithm patterns are identified by analyzing the core data structure, key function calls, and control flow structure of the code. Common industrial vision algorithm patterns include template matching, FFT acceleration, iterative optimization, geometric fitting, point cloud processing, Top-K truncation, and non-maximum suppression.

[0042] S3. Based on the interface structure model and the algorithm structure model, construct the parameter participation path graph.

[0043] The parameter participation path diagram includes the parameter participation path for each interface parameter, which represents the participation process of the interface parameter from input to output.

[0044] Specifically, for each interface parameter, by combining the declaration information of the parameter in the interface structure model with the control flow graph and data flow graph in the algorithm structure model, we can gradually trace which basic blocks the parameter is read from after entering the algorithm from the function entry point (depending on basic blocks), which intermediate variables it depends on for calculation (depending on variables), which operations it undergoes (depending on operations), and whether it ultimately affects the output node (affecting the output).

[0045] Understandably, by using the parameter participation path graph, it is possible to determine whether each interface parameter is in a fully participated state, a partially participated state, a path-restricted participated state, or a non-participated state, thereby providing a basis for subsequent problem detection and suggestion generation based on the actual code execution path.

[0046] S4. Based on the interface structure model, the algorithm structure model, and the parameter participation path graph, perform problem detection and consistency alignment analysis to obtain problem detection results and alignment results.

[0047] Problem detection is divided into two dimensions: interface layer problem detection and algorithm layer problem detection. The problem detection results are output as interface layer problem sets and algorithm layer problem sets, respectively.

[0048] Interface layer problem detection is performed based on the interface structure model. It compares each interface parameter and the interface as a whole against a predefined interface quality rule library to determine whether there are problems such as naming consistency, parameter semantic clarity, reasonableness of default values, completeness of output definition, and interface complexity.

[0049] For example, if the documentation for a certain interface parameter describes it as "similarity score", but the variable semantic role table identifies the corresponding variable in the same algorithm as "normalized confidence", then a naming consistency problem or a parameter semantic clarity problem is triggered.

[0050] The algorithm-level problem detection is based on the execution of the algorithm structure model and checks for problems such as parameter combination conflicts, default path anomalies, numerical stability issues, boundary handling issues, complexity and performance issues, and output consistency issues according to the algorithm quality rule base.

[0051] For example, if the default value of a certain parameter is set to 0, and the algorithm implementation enters this path, it will bypass all iteration logic and directly return an empty result, thus triggering a default path exception problem.

[0052] Consistency alignment analysis is based on the parameter participation path graph. It performs a four-dimensional alignment check on the interface structure model and the algorithm structure model to obtain the alignment results.

[0053] The parameter participation consistency check verifies the actual participation status of each interface parameter in the algorithm. If an interface declares a parameter as a functional input, but the parameter participation path graph shows that it has not participated in the calculation, it is marked as parameter participation inconsistency.

[0054] The parameter semantic consistency check compares the parameter semantic descriptions in the interface specification information with the role classifications in the variable semantic role table. If the semantic roles they point to are inconsistent, the corresponding problem is marked.

[0055] The output consistency check verifies whether the output fields declared in the interface match the actual output of the algorithm's output generation path.

[0056] Pattern consistency compares the functional patterns described in the interface documentation with the algorithm patterns identified from the algorithm code to determine whether the two are consistent.

[0057] S5. Based on the problem detection results, the alignment results, and the parameter participation path graph, generate structured modification suggestions.

[0058] Understandably, this step achieves the automatic generation of structured modification suggestion items by establishing a modification suggestion generation model.

[0059] Specifically, the modification suggestion generation model establishes a mapping relationship between problems and modification suggestion items based on multi-dimensional input information, which includes at least problem type, parameter semantic role, parameter participation path, algorithm mode, current interface design, risk level, and output dependency relationship.

[0060] In one implementation, the modification suggestion generation model is implemented using a rule matching method, which is as follows: Predefine modification suggestion rules for each combination of question type and parameter semantic roles; When a specific issue is detected, the corresponding modification suggestion template is matched from the rule base; Fill in the parameters, path, current interface design, and other information into the fields of the template to generate complete modification suggestions.

[0061] In another implementation, the modification suggestion generation model is achieved using template filling, which is as follows: For each problem type, a pre-defined modification suggestion template is provided. The problem type determines the candidate set of modification targets and actions. The influence range field of the parameter participation path is used to determine the influence range. The compatibility risk is assessed by the risk point field of the algorithm structure model. The structured modification suggestion items are generated in a comprehensive manner.

[0062] In another implementation, the modification suggestion generation model introduces a multi-factor scoring mechanism, which comprehensively scores candidate modification suggestions based on problem severity, risk level, output impact, compatibility cost, and usage frequency. The suggestion with the highest comprehensive score is taken as the final output, and the priority is divided into high priority, medium priority, and low priority.

[0063] The structured modification suggestions generated in this embodiment include the modification target, modification actions, scope of impact, compatibility risks, and priority. Preferably, the modification suggestions also include information such as a problem description field, alternative modification action fields, and expected benefit fields to provide richer decision support information.

[0064] Furthermore, the modification type of the modification suggestion can include one or more of the following: parameter-level suggestion, interface-level suggestion, behavior-level suggestion, and document-level suggestion.

[0065] Understandably, parameter-level suggestions address design flaws in individual parameters, such as adjusting default values, adding range restrictions, changing implicit parameters to explicit parameters, splitting multi-semantic parameters into multiple single-semantic parameters, and replacing names with domain-common names.

[0066] Interface-level recommendations address improvements to the overall interface structure, such as encapsulating multiple loose parameters into a parameter structure, introducing pattern enumerations to replace integer pattern parameters, splitting input / output multiplexed parameters into independent input and output parameters, and adding optional output structures.

[0067] Behavioral recommendations are made to optimize the algorithm's execution behavior, such as adding an automatic threshold mode, adding a boundary check branch, adding stability protection items, and enabling a normalization process in the default execution path.

[0068] Documentation-level suggestions include improving the interface description information, such as supplementing the mode description, supplementing the parameter dependency description, supplementing the output sorting rules and confidence definition, and supplementing the failure behavior description.

[0069] Furthermore, this method also includes the step of outputting a modification suggestion report. Specifically, the modification suggestion report includes the structured modification suggestion items, an interface quality summary, and a modification priority ranking, summarizing all detected issues and corresponding suggestions to facilitate SDK maintenance personnel in advancing modification work step by step according to priority.

[0070] In other implementations, this method further includes the step of generating an interface refactoring scheme based on structured modification suggestions. Specifically, the interface refactoring scheme includes the modified function signature, parameter structure definition, field description, migration strategy for compatibility with the old interface, example calling code, and mapping relationship between the old and new interfaces, directly providing a reference implementation form for interface modification, significantly reducing the understanding cost for engineers.

[0071] Based on this, executable modification results can be further generated, specifically including modified function declarations, modified structure declarations, code modification patches, document update results, and unit test update suggestions. The document update results include at least one of a document update draft for review and document update content that can be directly published, thereby achieving full-link automated support from problem detection to code-level modification solutions.

[0072] Preferably, the modification suggestion report in this embodiment also includes a comprehensive score, which includes an interface quality score, an algorithm consistency score, and a refactoring priority score, making it easier for administrators to quantitatively evaluate and track the overall interface quality of the SDK.

[0073] Example 2 Please see Figure 2The interface review and automatic modification suggestion generation system for industrial vision SDKs in this embodiment is used to execute the various steps of the interface review and automatic modification suggestion generation method for industrial vision SDKs in Embodiment 1. This interface review and automatic modification suggestion generation system for industrial vision SDKs includes multiple modules, which work together to achieve automated review of the quality of industrial vision SDK interfaces.

[0074] Specifically, this interface review and automatic modification suggestion generation system for industrial vision SDKs includes: The information acquisition module 10 is used to acquire the interface definition information, interface description information, and implementation information of the SDK to be reviewed. Specifically, the information acquisition module 10 supports extracting the above three types of information from SDK source files in various forms, such as C++, C, Python, and industrial vision-specific packaging interfaces, and preprocesses and standardizes the information for use by subsequent modules.

[0075] The model building module 20 is used to build an interface structure model based on the interface definition information and an algorithm structure model based on the implementation-side information. Specifically, the model building module 20 performs structured parsing of the interface definition information to generate an interface structure model record corresponding to each interface. At the same time, it uses static code analysis technology to perform control flow analysis, data flow analysis, and semantic analysis on the implementation-side information to build an algorithm structure model.

[0076] The path analysis module 30 is used to construct a parameter participation path graph based on the interface structure model and the algorithm structure model. Specifically, for each interface parameter, the path analysis module 30 combines the control flow graph and the data flow graph to gradually trace its participation trajectory in the algorithm, generating a parameter participation path that includes entry points, dependent basic blocks, dependent variables, dependent operations, and fields affecting the output, and then aggregates the parameter participation paths of all interface parameters into a parameter participation path graph.

[0077] The review module 40 is used to perform problem detection and consistency alignment analysis based on the interface structure model, the algorithm structure model, and the parameter participation path graph, to obtain problem detection results and alignment results. Specifically, the review module 40 is internally divided into an interface layer detection submodule, an algorithm layer detection submodule, and a consistency alignment submodule, which respectively perform interface layer problem detection, algorithm layer problem detection, and interface-algorithm consistency alignment analysis, and output the results as a unified problem detection result and alignment result.

[0078] The suggestion generation module 50 is used to generate structured modification suggestions based on the problem detection results, the alignment results, and the parameter participation path graph. Specifically, the suggestion generation module 50, based on the modification suggestion generation model, takes the problem type, parameter semantic roles, parameter participation paths, algorithm modes, current interface design, risk level, and output dependencies as multiple inputs, and outputs structured modification suggestions that include modification targets, modification actions, scope of impact, compatibility risks, and priorities.

[0079] In other embodiments, the interface review and automatic modification suggestion generation system for industrial vision SDKs also includes: The report generation module 60 is used to output a modification suggestion report based on the structured modification suggestion items; The interface reconstruction module 70 is used to generate an interface reconstruction scheme based on the structured modification suggestions. An executable modification output module 80 is used to generate executable modification results based on the interface refactoring scheme. The executable modification results include modified function declarations, modified structure declarations, code modification patches, documentation update results, and unit test update suggestions. The documentation update results include at least one of a draft documentation update for review and documentation update content that can be directly published.

[0080] It is worth noting that the modules of the system in this embodiment can be centrally deployed on a single server or distributed as needed, and no limitation is made here.

[0081] Combination Figure 1 and Figure 2 This invention, on the one hand, constructs a parameter participation path graph and performs consistency alignment analysis on the interface structure model and algorithm structure model based on this path graph. This automatically detects deep inconsistencies between the SDK interface and the underlying algorithm implementation, significantly improving the coverage depth and detection accuracy of interface review. On the other hand, by combining the problem detection results, alignment results, and parameter participation path graph as input, it automatically generates structured modification suggestions that include modification targets, modification actions, scope of impact, compatibility risks, and priorities. This overcomes the limitation of existing tools that can only identify problems but cannot provide solutions, greatly reducing the labor costs for SDK maintenance personnel. Furthermore, the parameter participation path graph provides an evidence chain for each modification suggestion based on the actual code execution path, making the suggestions interpretable and verifiable, which is conducive to the large-scale engineering implementation of industrial vision SDKs.

[0082] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for interface review and automatic modification suggestion generation for industrial vision SDKs, characterized in that, Includes the following steps: Obtain the interface definition information, interface description information, and implementation information of the SDK to be reviewed; An interface structure model is constructed based on the interface definition information, and an algorithm structure model is constructed based on the implementation side information. Based on the interface structure model and the algorithm structure model, a parameter participation path graph is constructed. The parameter participation path graph includes a parameter participation path for each interface parameter, and the parameter participation path represents the participation process of the interface parameter from input to output. Based on the interface structure model, the algorithm structure model, and the parameter participation path graph, problem detection and consistency alignment analysis are performed to obtain problem detection results and alignment results. Based on the problem detection results, the alignment results, and the parameter participation path graph, structured modification suggestions are generated.

2. The method for interface review and automatic modification suggestion generation for industrial vision SDK as described in claim 1, characterized in that, The interface structure model includes an interface name field, a parameter list field, a parameter type field, a default value field, an input / output direction field, a return value definition field, an optional output field, an overload group field, a mode flag field, a parameter constraint field, and a document item field. The parameter list field is used to record the name and order of the interface parameters; the input / output direction field is used to identify the interface parameters as input parameters, output parameters, or input / output multiplexing parameters; the mode flag field is used to identify the mode switching parameters, behavior control parameters, or function switch parameters in the interface parameters; and the parameter constraint field is used to record the explicit constraints or inferable constraints of the interface parameters.

3. The method for interface review and automatic modification suggestion generation for industrial vision SDK as described in claim 1, characterized in that, The algorithm structure model includes a control flow graph, a data flow graph, a variable semantic role table, an algorithm pattern, a parameter participation path field, a branch condition field, a default execution path field, an output generation path field, and a risk point field. The control flow graph includes basic blocks, sequential paths, conditional branches, loop back edges, early return paths, exception handling paths, and parallel regions. The data flow graph includes parameter input nodes, intermediate variable nodes, output nodes, computation nodes, dependency edges, and semantic edges; The variable semantic role table is used to record the semantic roles of the interface parameters and intermediate variables. The semantic roles include threshold, normalization term, search boundary, output container, candidate result, stability protection term, error amount, objective function amount, and mode control term.

4. The method for interface review and automatic modification suggestion generation for industrial vision SDK as described in claim 3, characterized in that, The algorithm modes include at least one of template matching, FFT acceleration, iterative optimization, geometric fitting, point cloud processing, Top-K truncation, and nonmaximum suppression.

5. The method for interface review and automatic modification suggestion generation for industrial vision SDK as described in claim 1, characterized in that, The parameters involved in the path include the entry point, dependent basic blocks, dependent variables, dependent operations, and factors affecting the output.

6. The method for interface review and automatic modification suggestion generation for industrial vision SDK as described in claim 1, characterized in that, The problem detection includes interface-level problem detection based on the interface structure model and algorithm-level problem detection based on the algorithm structure model. The problem detection results include an interface-level problem set and an algorithm-level problem set. The consistency alignment analysis is performed on the interface structure model and the algorithm structure model based on the parameter participation path graph, and the alignment result includes at least one of parameter participation consistency, parameter semantic consistency, output consistency, and pattern consistency.

7. The method for interface review and automatic modification suggestion generation for industrial vision SDKs as described in claim 6, characterized in that, The parameter participation consistency is used to determine whether each interface parameter is in a fully participated state, a partially participated state, a path-restricted participated state, or a non-participated state. The parameter semantic consistency is used to determine whether the semantics of the interface parameter in the interface description information are consistent with the actual role of the interface parameter in the algorithm structure model; The output consistency is used to determine whether the output recorded in the interface structure model is consistent with the output generation path recorded in the algorithm structure model. The pattern consistency is used to determine whether the functional pattern described in the interface description information is consistent with the algorithm pattern identified in the algorithm structure model.

8. The method for interface review and automatic modification suggestion generation for industrial vision SDK as described in claim 6, characterized in that, The interface layer problem set includes at least one of the following: naming consistency problem, parameter semantic clarity problem, default value rationality problem, output definition completeness problem, and interface complexity problem; The naming consistency issue is used to characterize whether similar semantic parameters use a unified name, and whether there is a naming method that is inconsistent with commonly used terms in the field of industrial vision. The parameter semantic clarity issue is used to characterize whether the interface parameter carries multiple semantics, and whether the parameter description clearly describes its unit, value range, action stage and effective conditions; The default value rationality issue is used to characterize whether the default value falls within the reasonable range of the algorithm mode, whether it causes the default path to enter an extreme branch, and whether it conflicts with the semantic role of the parameter. The output definition completeness question is used to characterize whether the return value or output parameter fully expresses the algorithm result, and whether it explains the sorting rules, the meaning of confidence, the coordinate system definition, the unit definition, and the output behavior when it fails; The interface complexity problem is used to characterize whether there are too many positional parameters, multiple highly coupled parameters, and excessive overloading.

9. The method for interface review and automatic modification suggestion generation for industrial vision SDK as described in claim 6, characterized in that, The algorithm layer problem set includes at least one of the following: parameter combination conflict problem, default path anomaly problem, numerical stability problem, boundary handling problem, complexity and performance problem, and output consistency problem; The parameter combination conflict problem is used to characterize whether there are mutual exclusion relationships, implicit dependencies, conditional dependencies, master-slave relationships, and conflicting combinations among the interface parameters; The default path anomaly issue is used to characterize whether the default path is the main recommended path, whether it enters a low-stability branch, whether it bypasses key checks, and whether it is consistent with the interface description information. The numerical stability problem is used to characterize whether there is precision loss caused by normalized denominators approaching zero, division by zero, accumulation overflow, subtraction of large numbers, and unprotected square root, division or exponentiation operations. The boundary processing problem is used to characterize whether the input is empty, whether the image or template size is valid, whether the point set is empty, whether there are no valid candidates, whether the result container is uninitialized, whether the index is out of bounds, and whether the accessed region is out of bounds. The complexity and performance issues are used to characterize whether there are duplicate computations, inefficient paths, cacheable intermediate quantities, loops that can be parallelized but are not, and parameter participation paths that do not contribute to the output. The output consistency problem is used to characterize whether the output is truly calculated by the algorithm, whether the output fields are consistent with the interface declaration, whether the output declared in the documentation exists in the implementation, and whether the additional information of the output generated by the implementation has not been disclosed to the public.

10. The method for interface review and automatic modification suggestion generation for industrial vision SDK as described in claim 1, characterized in that, The structured modification suggestions are generated by establishing a modification suggestion generation model. The modification suggestion generation model is based on a suggestion generation rule base and establishes a mapping relationship between the problem and the structured modification suggestion based on the problem type, parameter semantic roles, parameter participation paths, algorithm modes, current interface design, risk level, and output dependencies, so as to generate the structured modification suggestion.

11. The method for interface review and automatic modification suggestion generation for industrial vision SDK as described in claim 1, characterized in that, The structured modification suggestions include the modification target, modification actions, scope of impact, compatibility risks, and priority.

12. The method for interface review and automatic modification suggestion generation for industrial vision SDK as described in claim 11, characterized in that, The priority is determined based on a comprehensive assessment of the problem severity, risk level, output impact, compatibility cost, and usage frequency, and is divided into high priority, medium priority, and low priority.

13. The method for interface review and automatic modification suggestion generation for industrial vision SDK as described in claim 1, characterized in that, The modification types of the structured modification suggestions include at least one of parameter-level suggestions, interface-level suggestions, behavior-level suggestions, and document-level suggestions; The parameter-level suggestions include adjusting default values, adding range restrictions, changing implicit parameters to explicit parameters, splitting multi-semantic parameters into multiple single-semantic parameters, and replacing names with domain-common names. The interface-level recommendations include encapsulating multiple loose parameters into a parameter structure, introducing pattern enumeration to replace integer pattern parameters, splitting input-output multiplexed parameters into independent input and output parameters, and adding an optional output structure. The behavioral recommendations include adding an automatic threshold mode, adding a boundary check branch, adding stability protection items, and enabling a normalization process in the default execution path. The document-level recommendations include supplementary pattern descriptions, supplementary parameter dependency descriptions, supplementary output sorting rules and confidence definitions, and supplementary failure behavior descriptions.

14. The method for interface review and automatic modification suggestion generation for industrial vision SDK as described in claim 1, characterized in that, Also includes: Output a modification suggestion report, which includes the structured modification suggestion items, as well as an interface quality summary and modification priority ranking.

15. The method for interface review and automatic modification suggestion generation for industrial vision SDKs as described in claim 14, characterized in that, Also includes: An interface refactoring scheme is generated based on the structured modification suggestions. The interface refactoring scheme includes the modified function signature, parameter structure definition, field description, migration strategy for compatibility with the old interface, example calling code, and mapping relationship between the old and new interfaces. The modification suggestion report also includes the interface refactoring scheme.

16. The method for interface review and automatic modification suggestion generation for industrial vision SDKs as described in claim 15, characterized in that, Also includes: Based on the interface refactoring scheme, an executable modification result is generated. The executable modification result includes modified function declarations, modified structure declarations, code modification patches, document update results, and unit test update suggestions. The document update result includes at least one of a document update draft for review and document update content that can be directly published. The modification suggestion report also includes the executable modification result.

17. The method for interface review and automatic modification suggestion generation for industrial vision SDK as described in claim 14, characterized in that, The modification suggestion report also includes a comprehensive score, which includes an interface quality score, an algorithm consistency score, and a refactoring priority score.

18. A system for interface review and automatic modification suggestion generation for industrial vision SDKs, characterized in that, include: The information acquisition module is used to acquire the interface definition information, interface description information, and implementation information of the SDK to be reviewed. The model building module is used to build an interface structure model based on the interface definition information and to build an algorithm structure model based on the implementation side information. The path analysis module is used to construct a parameter participation path graph based on the interface structure model and the algorithm structure model. The parameter participation path graph includes a parameter participation path for each interface parameter, and the parameter participation path represents the participation process of the interface parameter from input to output. The review module is used to perform problem detection and consistency alignment analysis on the path graph based on the interface structure model, the algorithm structure model and the parameters, and to obtain problem detection results and alignment results. The suggestion generation module is used to generate structured modification suggestions based on the problem detection results, the alignment results, and the parameter participation path graph.

19. The interface review and automatic modification suggestion generation system for industrial vision SDKs as described in claim 18, characterized in that, The problem detection performed by the review module includes interface layer problem detection based on the interface structure model and algorithm layer problem detection based on the algorithm structure model. The problem detection results include an interface layer problem set and an algorithm layer problem set. The consistency alignment analysis is performed on the interface structure model and the algorithm structure model based on the parameter participation path graph. The interface review and automatic modification suggestion generation system for industrial vision SDKs also includes a report generation module, which is used to output a modification suggestion report based on the structured modification suggestion items.

20. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the interface review and automatic modification suggestion generation method for an industrial vision SDK as described in any one of claims 1 to 17.