Dynamic extension algorithm parameter visual configuration method
By using the JSON+JSON Schema method, algorithm parameter pages are dynamically generated and their validity is verified. This solves the problems of frequent interface adjustments and insufficient parameter restrictions in traditional solutions, and achieves efficient and flexible algorithm parameter configuration and improved system stability.
Patent Information
- Application Number
- CN202511109279.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-11-28
AI Technical Summary
Traditional algorithm parameter visualization solutions lack versatility and cannot flexibly limit parameters, requiring interface adjustments for each algorithm modification. Furthermore, they cannot effectively prevent user input errors, impacting system stability and efficiency.
The algorithm parameter page is generated using JSON + JSON Schema. The interface is dynamically generated through predefined rules and schema structure, and the validity is verified when the user makes modifications. It supports fine-grained restrictions and attribute configurations for different parameter types.
This eliminates the need to develop separate interfaces for each algorithm, reducing repetitive work, improving configuration accuracy and system security, lowering maintenance complexity, and enhancing system stability.
Smart Images

Figure CN121029149A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer software, in particular to a method for dynamically expanding algorithm parameter visual configuration. BACKGROUND
[0002] As the core technology of intelligent manufacturing, machine vision installs intelligent eyes for industrial detection, recognition and positioning analysis, greatly improving the degree of intelligent automation. Based on the current situation of various industrial detection objects and complex detection environment, algorithm users often need to adjust different algorithm parameters to improve the detection rate and accuracy of industrial detection. Different algorithms often have different algorithm parameters. Traditional parameter visualization schemes are mainly divided into two types. One is to adapt an independent display page for each algorithm, and the other is to read algorithm files and then use a common page display. The former method needs to modify the interface for each algorithm, and each modification of the algorithm needs to modify the interface to adapt to the changes, which is not universal. The latter scheme can dynamically generate a display interface, but only the value can be modified, and some special parameters cannot be limited, such as setting a range for numerical parameters and only specific parameters for path parameters.
[0003] Therefore, there is an urgent need in the industry for a better way to solve the above problems. SUMMARY
[0004] Therefore, the present application proposes a method for dynamically expanding algorithm parameter visual configuration. The present application generates algorithm parameter pages using the Json+Json Schema method. Using a Json file as a parameter, customized solutions can be generated for different customers, and the Json format is simple and has strong structure, making it easy to generate a universal interface. The technical scheme of the present application is as follows:
[0005] A method for dynamically expanding algorithm parameter visual configuration, comprising the following steps:
[0006] S1, predefine a Json Schema rule, and read a Json file of algorithm parameters;
[0007] S2, the Json file generates a corresponding Schema structure according to the pre-defined Json Schema rule;
[0008] S3, configure the Schema field corresponding to each parameter item in the Schema structure, and save the Schema structure;
[0009] S4, reload the Json file and apply the Schema structure to generate a visual user interface.
[0010] Specifically, it further comprises the S5 step, which is specifically:
[0011] S5, when the user modifies the algorithm parameters, the modified parameters are checked for legality according to the Schema structure.
[0012] Specifically, the legality check includes the following steps:
[0013] If the parameter value modified by the user does not meet the constraint rules defined by the Schema structure, the save operation is prevented, and an error prompt message is returned to the user.
[0014] Specifically, in the S2 step, the parameter types of the Schema structure include Boolean type, numerical type, character type, object type and array type.
[0015] Specifically, in the S3 step, the Schema fields include type, default value, and visibility.
[0016] Specifically, the numerical type parameter defines the numerical range constraint of the maximum value and the minimum value, and contains a unit attribute.
[0017] Specifically, the character type parameter defines the optional item list.
[0018] Specifically, the array type parameter defines the type and constraint rules of its elements through the items field.
[0019] Specifically, the object type parameter defines the sub-parameter items in it through the properties field.
[0020] Specifically, the sub-parameter items are independently configured with types and constraint rules.
[0021] The advantages of the present application are as follows:
[0022] 1. By combining the Json file with the Json Schema, there is no need to develop a customized interface for each algorithm. The system can automatically generate a configuration page according to the Schema, significantly reducing the repeated development workload, and is especially suitable for multi-algorithm scenarios.
[0023] 2. Support for defining fine-grained limit rules (such as numerical range, optional list, path format, etc.) for different parameter types (numerical, character, array, etc.), effectively preventing user input errors and improving configuration accuracy and system security.
[0024] 3. The Schema structure allows flexible addition of general attributes (such as visibility, editability) and type-specific attributes (such as unit, option list), which can meet existing needs and adapt to future algorithm parameter expansion or changes.
[0025] 4. When the user saves the parameters, the system automatically checks the legality of the input through the Schema, avoiding invalid or out-of-bound parameters from entering the execution flow, thereby reducing algorithm running errors and enhancing system stability.
[0026] 5. The adjustment of algorithm parameters only requires modifying the Json file and the corresponding Schema rules, without the need to rewrite the code or interface logic, greatly reducing the maintenance complexity and shortening the iteration cycle. BRIEF DESCRIPTION OF DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only a part of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of these drawings.
[0028] Figure 1 The structural diagram of the Schema in the embodiments of the present application. DETAILED DESCRIPTION
[0029] The technical solutions of the present application will be described clearly and completely in combination with the embodiments of the present application and the drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of the present application.
[0030] Unless otherwise defined, all technical and scientific terms used in the present application have the same meaning as commonly understood by those skilled in the art to which the present application belongs; the terms used in the specific embodiments are only for the purpose of describing the specific embodiments, and are not intended to limit the present application; the terms in the specification and claims of the present application and the above drawing description, and any modification thereof, are intended to cover non-exclusive inclusion.
[0031] In the description of the specific embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise explicitly specified.
[0032] Reference to "an embodiment" or "the embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of the phrase "in an embodiment" or "in the embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily mutually exclusive.
[0033] In the description of the embodiments of the application, the term "and / or" is merely used to describe associated objects, and can represent that three conditions can exist, for example, A and / or B can represent that the three conditions of A alone, A and B, and B alone can exist. In addition, the character " / " in the application generally represents that the preceding and following associated objects have a relationship of "or".
[0034] It should be noted that, for the convenience of description, in the following embodiments, all the same technical features are marked with the same symbol.
[0035] As the core technology of intelligent manufacturing, machine vision installs intelligent eyes for industrial detection, recognition and positioning analysis, greatly improving the degree of intelligent automation. Based on the current situation of various industrial detection objects and complex detection environment, algorithm users often need to adjust different algorithm parameters to improve the detection rate and accuracy of industrial detection. Different algorithms often have different algorithm parameters. Traditional parameter visualization schemes are mainly divided into two types. One is to adapt an independent display page for each algorithm, and the other is to read the algorithm file and then use a common page display. The former method needs to modify the interface for each algorithm, and each modification of the algorithm needs to modify the interface to adapt to the changes, which is not universal. The latter scheme can dynamically generate a display interface, but only the value can be modified, and some special parameters cannot be limited, such as setting a range for numerical parameters and only a specific parameter for some path parameters.
[0036] Therefore, there is an urgent need in the industry for a better way to solve the above problems.
[0037] Therefore, the application provides a method for dynamically expanding algorithm parameter visualization configuration. The application generates an algorithm parameter page by using the method of Json+Json Schema. By using a Json file as a parameter, customized solutions can be generated for different customers. The Json format is simple and has strong structure, and it is easy to generate a universal interface. The technical scheme of the application can be implemented as follows:
[0038] The embodiment
[0039] A method for dynamically expanding algorithm parameter visualization configuration includes the following steps:
[0040] S1, predefine Json Schema rule, read Json file of algorithm parameter;
[0041] S2, generate corresponding Schema structure according to predefine Json Schema rule;
[0042] S3, configure Schema field corresponding to each parameter item in Schema structure, and save Schema structure;
[0043] S4, reload Json file and apply Schema structure to generate visual user interface.
[0044] In an implementable embodiment, S5 is further included, specifically:
[0045] S5, when user modifies algorithm parameter, perform legality verification on modified parameter according to Schema structure.
[0046] In an implementable embodiment, legality verification includes the following steps:
[0047] If parameter value modified by user does not conform to constraint rule defined by Schema structure, prevent saving operation, and return error prompt information to user.
[0048] In an implementable embodiment, parameter type of Schema structure includes Boolean type, numerical value type, character type, object type and array type.
[0049] In an implementable embodiment, Schema field includes type, default value and visibility.
[0050] Further, type is used to distinguish each parameter category, parameters of different categories have different limit rules, default value is used to provide default value of parameter, and visibility is used to control whether each parameter item is visible to user. In addition, general field can be added, such as adding editable field to control whether user can edit corresponding parameter.
[0051] In an implementable embodiment, numerical value type parameter defines numerical range constraint of maximum value and minimum value, and contains unit attribute.
[0052] In an implementable embodiment, character type parameter defines optional item list.
[0053] In an implementable embodiment, array type parameter defines type and constraint rule of element thereof through items field.
[0054] In an implementable embodiment, the parameter of the object type is defined by a sub-parameter item in the properties field.
[0055] Further explanation, corresponding to the general attribute, different restrictions can be added for each category of parameters. For example, the application adds maximum and minimum value restrictions, unit attributes for numerical type parameters; we add a list of optional items for character type parameters to limit unreasonable input; the application adds the items field under the array type, which can limit each parameter individually or limit the same type of parameters generally. For object type, we provide the properties field specification containing specific parameters.
[0056] In an implementable embodiment, the sub-parameter item is independently configured with type and constraint rules.
[0057] Further explanation, for each set of algorithm parameters, the application generates corresponding schema information. Because each parameter can find the corresponding field in the schema file, when modifying a parameter, the corresponding constraint condition can be found in the schema file for verification.
[0058] The advantages of the application are as follows:
[0059] 1. By combining the Json file with the Json Schema, there is no need to develop a custom interface for each algorithm. The system can automatically generate a configuration page according to the Schema, significantly reducing the repeated development workload, especially suitable for multi-algorithm scenarios.
[0060] 2. Support for defining fine-grained restriction rules for different parameter types (numerical, character, array, etc.) (such as numerical range, optional list, path format, etc.), effectively preventing user input errors and improving configuration accuracy and system security.
[0061] 3. The Schema structure allows flexible addition of general attributes (such as visibility, editability) and type-specific attributes (such as units, option lists), which can meet existing needs and adapt to future algorithm parameter expansion or changes.
[0062] 4. When the user saves the parameters, the system automatically checks the legality of the input through the Schema, avoiding invalid or out-of-range parameters from entering the execution process, thereby reducing algorithm running errors and enhancing system stability.
[0063] 5. Adjustment of algorithm parameters only requires modification of the Json file and the corresponding Schema rules, without the need to rewrite code or interface logic, significantly reducing maintenance complexity and shortening iteration cycles.
Claims
1. A method for dynamically expanding algorithm parameters with visual configuration, characterized in that, The steps include the following: S1. Predefine JSON Schema rules and read the JSON file containing the algorithm parameters; S2, Json files generate corresponding schema structures based on predefined Json schema rules; S3. Configure the schema field corresponding to each parameter item in the schema structure and save the schema structure; S4. Reload the JSON file and apply the schema structure to generate a visual user interface.
2. The method for visually configuring dynamically expanding algorithm parameters according to claim 1, characterized in that, It also includes step S5, which is as follows: S5. When a user modifies the algorithm parameters, the modified parameters are validated according to the schema structure.
3. A method for visually configuring dynamically expanding algorithm parameters according to claim 2, characterized in that, The validity verification includes the following steps: If the modified parameter value does not conform to the constraint rules defined in the schema structure, the save operation will be blocked and an error message will be returned to the user.
4. A method for visually configuring dynamically expanding algorithm parameters according to claim 3, characterized in that, In step S2, the parameter types of the Schema structure include Boolean, numeric, character, object, and array types.
5. A method for visually configuring dynamically expanding algorithm parameters according to claim 1, characterized in that, In the S3 step, the Schema fields include type, default value, and visibility.
6. A method for visually configuring dynamically expanding algorithm parameters according to claim 4, characterized in that, Numeric type parameters define the range constraints of maximum and minimum values and include unit attributes.
7. A method for visually configuring dynamically expanding algorithm parameters according to claim 4, characterized in that, List of optional parameters for character types.
8. A method for visually configuring dynamically expanding algorithm parameters according to claim 4, characterized in that, Array type parameters define the type and constraint rules of their elements through the items field.
9. A method for visually configuring dynamically expanding algorithm parameters according to claim 4, characterized in that, Parameters of object types are defined through sub-parameter items in the properties field.
10. A method for visually configuring dynamically expanding algorithm parameters according to claim 9, characterized in that, Sub-parameter items have independent configuration types and constraint rules.