A configuration method, storage medium, and terminal for an intelligent interface.
By constructing a functional structure tree and a parameter rule tree, multiple interface call paths are generated and the path with the shortest overall execution time is selected, which solves the problem of fixed interface call methods and improves the flexibility and execution efficiency of interface calls.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FUJIAN TQ ONLINE INTERACTIVE INC
- Filing Date
- 2026-03-03
- Publication Date
- 2026-06-30
AI Technical Summary
In existing technologies, the interface calling methods are fixed, making it difficult to adjust according to changes in the operating environment. This leads to decreased execution efficiency and uneven resource utilization. Furthermore, the lack of a structured description of the hierarchical relationship between interfaces, modules, and functions affects system stability.
The system collects interface packets from the target software system, obtains interface definition information, constructs a functional structure tree and parameter rule tree, generates multiple interface call paths, and selects the path with the least overall time consumption based on interface context information, thereby realizing multi-path modeling and optimization selection of the target function.
Without modifying the original interface implementation logic, improve the flexibility of interface calls and overall execution efficiency, ensure that the system has multiple optional implementation methods under different operating scenarios, and improve the stability and maintainability of the system.
Smart Images

Figure CN122308823A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent resource allocation technology, and in particular to a method for configuring an intelligent interface, a storage medium, and a terminal. Background Technology
[0002] As software systems evolve towards platformization and service-oriented architectures, the number of callable interfaces in a system is constantly increasing, and the same function often needs to be completed collaboratively through multiple interfaces or modules. In existing technologies, the calling relationships between interfaces are typically planned manually by developers during the design phase and configured in the program in a fixed order or with fixed logic. When the system operating environment, data scale, or call frequency changes, the existing interface calling methods are difficult to adjust according to the actual operating conditions, easily leading to decreased execution efficiency or uneven resource utilization. Furthermore, existing technologies primarily manage interfaces using interface lists or simple configuration methods, lacking a structured description of the hierarchical relationships between interfaces, modules, and functions. The rationality and executability of interface combinations rely on manual experience, making it difficult to adapt to complex application scenarios. With a large number of interfaces and complex calling relationships, parameter mismatches or insufficient exception handling can also affect system stability. Therefore, how to achieve structured configuration of interface calling relationships without changing the original interface implementation logic, and how to select a better interface calling path based on the operating scenario, has become a pressing technical problem to be solved in this field. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a configuration method, storage medium and terminal for an intelligent interface, which can improve the flexibility of interface calls.
[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for configuring a smart interface, comprising the following steps: S1. Collect the interface packets of the target software system and obtain the interface definition information of each interface in the interface packets; S2. In response to the requirements of the target function, based on the interface definition information, the target function is decomposed and a functional structure tree is constructed; S3. Based on the interface definition information, construct parameter rule trees at different levels of the functional structure tree; S4. Based on the functional structure tree, generate at least one interface call path for implementing the target function; S5. Configure corresponding interface context information for the interface call path, and based on the parameter rule tree and the interface context information, select the interface call path with the least overall time consumption as the target path to achieve the target function.
[0005] To solve the above-mentioned technical problems, the present invention adopts other technical solutions as follows: A storage medium storing a computer program that, when executed by a processor, implements the steps in the configuration method of the aforementioned smart interface.
[0006] A configuration terminal for a smart interface includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps in the configuration method for the smart interface.
[0007] The beneficial effects of this invention are as follows: A configuration method, storage medium, and terminal for an intelligent interface, by collecting interface packets from the target software system and obtaining interface definition information, decomposing the target function and constructing a functional structure tree, simultaneously constructing parameter rule trees at different levels, generating multiple interface call paths based on the functional structure tree, and comprehensively filtering the interface call paths based on interface context information, can achieve multi-path modeling and optimization selection of the target function without modifying the original interface implementation logic. Compared with existing technologies that rely on fixed interface call methods or manually set execution order, this invention can uniformly configure interfaces at both the structural and call rule levels, enabling the same target function to have multiple optional implementation methods in different operating scenarios, thereby improving the flexibility of interface calls and overall execution efficiency. Attached Figure Description
[0008] Figure 1 This is a flowchart illustrating a method for configuring a smart interface according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the functional structure tree and parameter rule tree in a configuration method of an intelligent interface according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a configuration terminal for an intelligent interface according to an embodiment of the present invention; Label Explanation: 1. A configuration terminal for an intelligent interface; 2. A memory; 3. A processor. Detailed Implementation
[0009] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0010] In existing technologies, as software systems grow in scale, the same target function often needs to be implemented through a combination of multiple interfaces or modules. The calling relationships between these interfaces are usually manually defined by developers during the design phase and written into the program code in a fixed order. When the system operating environment, data scale, or call frequency changes, this fixed interface calling method is difficult to adjust according to the actual situation, easily leading to decreased execution efficiency or increased resource consumption. Furthermore, some existing solutions attempt to automatically generate or rewrite code or interface call logic using artificial intelligence, but this method requires direct modification of the original code, resulting in insufficient controllability and difficulty in tracing the execution process. In application scenarios with a large number of interfaces and complex dependencies, the lack of a structured description of the relationships between interfaces, modules, and functions can easily lead to unreasonable interface combinations or parameter mismatches, affecting the stable operation of the system. Therefore, existing technologies urgently need a technical solution that can structurally configure interfaces without modifying the original interface implementation logic and optimize interface call paths according to the operating scenario.
[0011] To at least solve the above problems, please refer to Figure 1 This invention provides a method for configuring a smart interface, including the following steps: S1. Collect the interface packets of the target software system and obtain the interface definition information of each interface in the interface packets; S2. In response to the requirements of the target function, based on the interface definition information, the target function is decomposed and a functional structure tree is constructed; S3. Based on the interface definition information, construct parameter rule trees at different levels of the functional structure tree; S4. Based on the functional structure tree, generate at least one interface call path for implementing the target function; S5. Configure corresponding interface context information for the interface call path, and based on the parameter rule tree and the interface context information, select the interface call path with the least overall time consumption as the target path to achieve the target function.
[0012] As described above, the beneficial effects of this invention are as follows: By collecting interface packets from the target software system and obtaining interface definition information, the target function is decomposed and a functional structure tree is constructed. Simultaneously, parameter rule trees are constructed at different levels. Multiple interface call paths are then generated based on the functional structure tree, and the interface call paths are comprehensively filtered for time consumption based on interface context information. This enables multi-path modeling and optimization selection of the target function without modifying the original interface implementation logic. Compared to existing technologies that rely on fixed interface call methods or manually set execution order, this invention can uniformly configure interfaces at both the structural and call rule levels, allowing the same target function to have multiple optional implementation methods in different operating scenarios, thereby improving the flexibility of interface calls and overall execution efficiency.
[0013] Preferably, the interface definition information includes at least the interface identifier, the type and order of the interface input parameters, the interface return type, and the interface exception type information.
[0014] In some implementations, step S5, selecting the interface call path with the lowest overall time consumption as the target path for achieving the target function, specifically includes: For each of the aforementioned interface call paths, the execution time of each interface in the interface call path is calculated, and the execution times are summarized to generate the corresponding path time of the interface call path, which is regarded as the comprehensive time. The interface call path with the shortest overall time is selected as the target path to achieve the target function.
[0015] As described above, by evaluating and filtering paths based solely on the execution time of each interface in the interface call path, the path selection process becomes simpler and more efficient. This approach is suitable for application scenarios where the interface context has little impact or the call relationship is relatively stable. While reducing the complexity of path evaluation, it can still effectively filter out interface call paths with high execution efficiency, thereby improving the system's responsiveness in scenarios with high real-time requirements.
[0016] In some implementations, step S5, selecting the interface call path with the lowest overall time consumption as the target path for achieving the target function, specifically includes: For each of the aforementioned interface call paths, the execution time of each interface in the interface call path is calculated, and the execution times are summarized to generate the corresponding path time of the interface call path; Calculate the processing time required for establishing, transmitting, or switching the interface context information for each interface in the interface call path, and summarize the processing time to calculate the context processing time corresponding to the interface call path; Based on the path time and the context processing time, the total time of the interface call path is calculated, and the interface call path with the shortest total time is selected as the target path to achieve the target function.
[0017] As described above, the path evaluation process considers both the interface execution time and the interface context processing time, making the evaluation results of the interface call path closer to the actual operation. By comprehensively reflecting the overhead of the interface execution process and the establishment, transmission, or switching of the context, it avoids bias caused by selecting paths based solely on the single dimension of execution time, thus helping to select interface call paths with better overall execution efficiency and more stable operation.
[0018] In some implementations, the step of summarizing the execution time to generate the path time of the corresponding interface call path specifically includes: Based on the data scale or number of executions involved in the interface call path, the execution time is summarized to generate the corresponding path time of the interface call path.
[0019] As described above, by incorporating data size or execution frequency factors into the summary interface execution time, the execution cost assessment of the interface call path can be dynamically adjusted according to changes in the operating load. This approach avoids continuing to use paths that perform well in small-scale scenarios but result in decreased overall efficiency when the data size is large or the number of executions is high, thereby improving the adaptability and stability of the interface call path under different load conditions.
[0020] Specifically, in one embodiment, after generating the interface call path and configuring the interface context, the system performs time statistics and comparisons on different interface call paths based on the execution status of each interface call path during actual operation, thereby determining the target path to be registered as an interface execution blueprint.
[0021] In this embodiment, for the same target function, the system generates at least two optional interface call paths based on the function structure tree. One interface call path is path one, which implements the target function through module one. Module one is formed by further processing the combination of interface one and interface two through interface three. The other interface call path is path two, which implements the target function through module N1. Module N1 is formed by directly combining interface one and interface two.
[0022] When evaluating the two interface call paths mentioned above, the system, under the same operating environment and data conditions, statistically analyzed the processing time consumed by each interface call path during execution. Specifically, the system used data size or execution count as statistical benchmarks to record and compare the execution time of path one and path two under different data sizes.
[0023] When the data scale is relatively small, such as when the execution is performed only once, the system calculates the execution time of path one as the first time value and the execution time of path two as the second time value, where the execution time of path one is less than that of path two. In this case, path one has higher execution efficiency in small-scale data processing scenarios.
[0024] When the data scale increases, for example, when the number of executions increases to one hundred, the system again calculates the execution time of path one and path two. The statistical results show that as the number of executions increases, the execution time of path one increases more significantly, while the execution time of path two increases relatively less. In this case, the execution time of path two is less than that of path one.
[0025] Furthermore, when the data scale continues to increase, for example, when the number of executions increases to two hundred, the system statistics show that the execution time of path one is still greater than that of path two, indicating that in scenarios with a large data scale or high frequency of calls, path two has better overall execution efficiency than path one.
[0026] Based on the above statistical results, it can be seen that the execution efficiency of different interface call paths varies under different data scales or execution counts. Based on the statistics and comparison of the execution time of each interface call path, the system determines the interface call path with the minimum overall execution time under the current data scale as the target path, and registers the target path as the interface execution blueprint for implementing the target function.
[0027] In some implementations, the functional structure tree is used to represent the hierarchical relationship between the target function and the interface; the parameter rule tree is used to represent the parameter types, number of parameters, and parameter order rules required when the interface is called.
[0028] As described above, by using a functional structure tree to represent the hierarchical relationship between the target function and the interface, and using a parameter rule tree to represent the parameter types, number of parameters, and parameter order rules required for interface calls, separate modeling of functional structure information and call constraint information is achieved. This approach helps to identify unexecutable interface combinations in advance during path generation and filtering, reduces call failures caused by parameter mismatches, and improves the accuracy and reliability of interface call configuration.
[0029] In some implementations, the interface call path is used to represent a path diagram that combines multiple interfaces in a preset order to achieve the target function.
[0030] As described above, by representing the interface call path as a path diagram composed of multiple interfaces in a preset order, the implementation process of the target function has a clear call order and dependencies. This path diagram format facilitates the system's analysis, recording, and reuse of the interface call flow, and also helps to optimize and adjust the interface call process in the future, thereby improving the system's maintainability and scalability.
[0031] In some implementations, step S5 further includes: When a parameter mismatch or an exception occurs during the interface call process corresponding to the target path, the interface call path with the second shortest overall time consumption and that meets the call conditions is selected from the remaining interface call paths as the alternative target path.
[0032] As described above, when parameter mismatches or exceptions occur during the execution of the target path, the path with the second-lowest overall execution time and meeting the calling conditions is selected as the alternative target path from the remaining interface call paths. This allows the target function to switch paths without interrupting execution. This approach effectively reduces the risk of function execution failure due to the unavailability of a single path, improving the fault tolerance of the interface call process and the stability of system operation.
[0033] In some implementations, step S5 is followed by step S6: Register the target path as an interface execution blueprint to implement the target function and store it.
[0034] As described above, by registering and storing the selected target paths as interface execution blueprints, verified interface call paths can be directly reused when executing the same or similar target functions, reducing the need for repetitive path generation and evaluation processes. This approach not only reduces system overhead but also ensures the consistency and controllability of the interface call process, thereby improving overall execution efficiency and providing a foundation for the traceability and optimization of the interface call process.
[0035] A storage medium storing a computer program that, when executed by a processor, implements the steps in the configuration method of the aforementioned smart interface.
[0036] A smart interface configuration terminal 1 includes a memory 2, a processor 3, and a computer program stored on the memory 2 and running on the processor 3. When the processor 3 executes the computer program, it implements the steps in the smart interface configuration method.
[0037] Please refer to Figure 1 and Figure 2 Embodiment 1 of the present invention is as follows: A method for configuring intelligent interfaces is applied to a target software system (SDK) to configure and invoke interfaces for target functions. The target software system pre-provides multiple interfaces, each used to perform different basic processing operations. Each interface has corresponding interface definition information, which includes at least the interface identifier, the type and order of interface input parameters, the interface return type, and interface exception type information. It can be understood that an interface is the most basic execution unit, used to complete specific data processing, calculation, or status acquisition operations; a module consists of at least one interface, used to complete a relatively complete sub-function; a function is formed by combining one or more modules to achieve the target function required by the user or system.
[0038] In this embodiment, the system first collects the interface packets of the target software system and obtains the interface definition information corresponding to each interface from the interface packets. Based on the interface definition information, the system can clarify the parameter constraints and execution characteristics of each interface when it is called, providing basic data support for subsequent interface configuration.
[0039] After obtaining the interface definition information, the system responds to the requirements of the target function by decomposing the target function and constructing a functional structure tree based on the decomposition results. The functional structure tree represents the hierarchical relationship between the target function (e.g., user-selected function 2), modules, and interfaces. The target function is formed by combining at least one module, and each module consists of at least one interface. Through this functional structure tree, the system can clearly understand the composition of the target function and the hierarchical position of each module and interface within the target function, thereby avoiding treating the target function as an indivisible whole.
[0040] Based on the constructed functional structure tree, the system further constructs parameter rule trees at different levels of the functional structure tree based on interface definition information. The parameter rule tree describes the parameter types, number of parameters, and parameter order rules required when calling modules or interfaces at different levels (for example, the SDK parameter structure tree includes module 1 and module 2, both of which can call data with parameters of type int). Through the parameter rule tree, the system can identify the parameter changes of the target function at different decomposition levels, thereby avoiding parameter mismatches when generating subsequent interface call paths.
[0041] Subsequently, the system generates at least one interface call path to implement the target function based on the functional structure tree. The interface call path represents a path diagram for implementing the target function, formed by combining multiple interfaces in a preset order. Different interface call paths correspond to different implementation methods of the target function. By generating multiple interface call paths, the target function no longer depends on a single fixed interface call order, thus providing candidate space for subsequent path selection.
[0042] After generating the interface call path, the system configures corresponding interface context information for each interface call path. This interface context information characterizes the preceding and following call relationships of interfaces within the interface call path, including the preceding and following interfaces. By configuring the interface context information, the system can clearly define the call position of an interface within the path and its association with adjacent interfaces.
[0043] Based on the configured interface context information, the system evaluates each interface call path using a parameter rule tree. Specifically, for each interface call path, the system calculates the execution time of each interface within that path, and in some implementations, further calculates the processing time required for establishing, transmitting, or switching the interface context information, thereby obtaining the overall execution time for each interface call path. The system compares the overall execution times of multiple interface call paths and selects the interface call path with the minimum overall execution time as the target path for achieving the desired function.
[0044] In some implementations, when summarizing the execution time of an interface, the system calculates the execution time based on the data size or number of executions involved in the interface call path. This allows the execution cost of the interface call path to dynamically reflect changes in the operating load, thereby avoiding the continued use of interface call paths that result in overall reduced efficiency when the data size is large or the number of executions is high.
[0045] In a further implementation, when a parameter mismatch or interface exception occurs during the execution of the target path, the system selects the interface call path with the second shortest overall time consumption and that meets the call conditions from the remaining interface call paths based on the interface definition information and parameter rule tree, so as to ensure that the target function can continue to execute under abnormal circumstances.
[0046] After selecting the target path, the system registers and stores the target path as an interface execution blueprint for implementing the target function. The interface execution blueprint includes at least the interface call order, parameter passing rules, and interface context information. When executing the same or similar target functions subsequently, the system can directly call the registered interface execution blueprint, thereby reducing repetitive path generation and evaluation processes, improving overall execution efficiency, and facilitating unified management and traceability analysis of the interface call process.
[0047] Embodiment 2 of the present invention is as follows: A storage medium storing a computer program that, when executed by a processor, implements the steps in the configuration method of the aforementioned smart interface.
[0048] Please refer to Figure 3 Embodiment 3 of the present invention is as follows: A smart interface configuration terminal 1 includes a memory 2, a processor 3, and a computer program stored on the memory 2 and running on the processor 3. When the processor 3 executes the computer program, it implements the steps in the smart interface configuration method.
[0049] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method of configuring an intelligent interface, characterized by, Including the following steps: S1. Collect the interface packets of the target software system and obtain the interface definition information of each interface in the interface packets; S2. In response to the requirements of the target function, based on the interface definition information, the target function is decomposed and a functional structure tree is constructed; S3. Based on the interface definition information, construct parameter rule trees at different levels of the functional structure tree; S4. Based on the functional structure tree, generate at least one interface call path for implementing the target function; S5. Configure corresponding interface context information for the interface call path, and based on the parameter rule tree and the interface context information, select the interface call path with the least overall time consumption as the target path to achieve the target function.
2. The method of claim 1, wherein, In step S5, the interface call path with the lowest overall time consumption is selected as the target path for implementing the target function. Specifically, this includes: For each of the aforementioned interface call paths, the execution time of each interface in the interface call path is calculated, and the execution times are summarized to generate the corresponding path time of the interface call path, which is regarded as the comprehensive time. The interface call path with the shortest overall time is selected as the target path to achieve the target function.
3. The configuration method for an intelligent interface according to claim 1, characterized in that, In step S5, the interface call path with the lowest overall time consumption is selected as the target path for implementing the target function. Specifically, this includes: For each of the aforementioned interface call paths, the execution time of each interface in the interface call path is calculated, and the execution times are summarized to generate the corresponding path time of the interface call path; Calculate the processing time required for establishing, transmitting, or switching the interface context information for each interface in the interface call path, and summarize the processing time to calculate the context processing time corresponding to the interface call path; Based on the path time and the context processing time, the total time of the interface call path is calculated, and the interface call path with the shortest total time is selected as the target path to achieve the target function.
4. A method for configuring an intelligent interface according to claim 2 or 3, characterized in that, The process of summarizing the execution time to generate the path time corresponding to the interface call path specifically includes: Based on the number of executions involved in the interface call path, the execution time is summarized to generate the corresponding path time of the interface call path.
5. The configuration method for an intelligent interface according to claim 1, characterized in that, The functional structure tree is used to represent the hierarchical relationship between the target function and the interface; the parameter rule tree is used to represent the parameter types, number of parameters and parameter order rules required when the interface is called.
6. The configuration method for an intelligent interface according to claim 5, characterized in that, The interface call path is used to represent a path diagram that combines multiple interfaces in a preset order to achieve the target function.
7. The configuration method for an intelligent interface according to claim 1, characterized in that, Step S5 further includes: When a parameter mismatch or an exception occurs during the interface call process corresponding to the target path, the interface call path with the second shortest overall time consumption and that meets the call conditions is selected from the remaining interface call paths as the alternative target path.
8. The configuration method for a smart interface according to claim 1, characterized in that, Step S5 is followed by step S6: Register the target path as an interface execution blueprint to implement the target function and store it.
9. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps in the configuration method of an intelligent interface as described in any one of claims 1-8.
10. A configuration terminal for an intelligent interface, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps in the configuration method of an intelligent interface as described in any one of claims 1-8.