A custom search help component based on multiple data sources and its operation method
By designing a custom search help component based on multiple data sources, the performance issues of dropdown lists in big data environments were resolved. This enabled flexible data source switching and efficient monitoring under a microservice architecture, reducing development difficulty and improving the system's versatility and maintainability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-24
- Publication Date
- 2026-03-06
AI Technical Summary
The existing dropdown list component performs poorly in big data environments, causing page lag, and cannot support complex search conditions and multiple data sources. It also does not support flexible switching of data sources, making it difficult to meet the needs of microservice architecture systems.
Design a custom search help component based on multiple data sources. It adopts a component-based design and includes an online customization module, a multi-data source switching module, an extended function module, and a monitoring module. It supports online preview and migration scripts. It uses MybatisPlusConfig, AbstractRoutingDataSource, ThreadLocal, and AOP to implement data source switching and provides search help logs and performance analysis test cases.
It enables flexible switching between multiple data sources in a microservice architecture, reduces the difficulty of business development, supports zero-code or low-code development, reduces code adjustment costs, improves the versatility and maintainability of the system, and provides efficient performance monitoring and business analysis tools.
Smart Images

Figure CN116756188B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of microservice search help technology, and in particular to a custom search help component and its operation method based on multiple data sources. Background Technology
[0002] Drop-down lists typically consist of four main parts: a container box, a down arrow button, a list of options, and labels. Users can click the down arrow to display a list of options side-by-side. The drop-down menu may also scroll, depending on the number of options contained in the expanded drop-down list and its default height. For drop-down lists, the selected option or default value remains visible in the container box, while other list options only appear after clicking the down arrow. Selecting an option or clicking outside the drop-down list collapses the list items.
[0003] Search Help simplifies user input while enhancing data accuracy, and is used to provide input assistance for screen fields. With input help, users can see all possible input values and enhance them with supplementary information.
[0004] Search help is another form of dropdown list component. It's an extension of dropdown list components, addressing issues such as limited result columns, performance and user-friendliness limitations with large datasets, and lack of support for complex search criteria and data sources. In systems where large amounts of randomly repeated data need to be entered, dropdown menus can help easily select and input this data.
[0005] With the rapid expansion of business systems and the development and deepening of microservice architecture, considering the characteristics of microservices such as technical heterogeneity, autonomy, and microservice partitioning principles, and to avoid coupling at the database level, microservices need to have independent databases, leading to the emergence of multiple data sources within the system. Search assistance from a single data source can no longer meet the needs of microservice architecture systems. Summary of the Invention
[0006] This invention proposes a custom search help component and its operation method based on multiple data sources to address the following issues: existing dropdown lists are unsuitable for large datasets; each data load is a full load without pagination; initial loads may cause page lag or freezing; even with scrolling, large amounts of data are difficult to view and select; search results have limited fields, and long fields restrict display; searches can only be performed on fixed fields within the expandable container, lacking support for complex search conditions and related fields; and data sources typically only support fixed values and JSON data, hindering reusability.
[0007] Firstly, a custom search help component based on multiple data sources includes a client and a server. The client provides relevant properties, events, and methods, as well as component rendering. The server includes:
[0008] Online custom modules: Utilizes a component-based design, allowing customization of multiple sub-module components;
[0009] Multi-data source switching module: Supports searching to help switch data sources for multiple datasets;
[0010] Expanded functionality modules: The search help component has been expanded to support online preview and script migration;
[0011] Monitoring module: Monitors the operation of high-frequency components.
[0012] Furthermore, the online customization module also includes the following sub-modules:
[0013] Basic search help information: including search help name, description, value attributes, display attributes, description attributes, query conditions, result column configuration, and field information;
[0014] Data source and dataset definition: By specifying dictionary item names, you can directly bind to dictionary items within the system; it also supports binding data sources using custom SQL datasets.
[0015] Condition definition: includes fixed conditions and query conditions;
[0016] Aggregate functions: include row headers for row-to-column conversion, grouping column names, statistical fields, and aggregate functions.
[0017] Furthermore, the fixed condition is a system context fixed parameter that varies with different system front-end contexts.
[0018] Furthermore, the extended functional module also includes:
[0019] Simulated execution: Supports online preview of search help by dynamically specifying the search help name and fixed conditions;
[0020] Migration Script: The system searches for and assists in data migration in different environments, generating search-aided migration scripts.
[0021] Furthermore, the monitoring module adds a search help request tracking point, providing search help log use cases to record search request information, facilitating business analysis and optimization.
[0022] Furthermore, the search request information includes: search help name, execution status, request time, time consumed, link ID, personnel information, input parameters and output parameters.
[0023] On the other hand, a method for running a custom search helper component based on multiple data sources, implemented using a custom search helper component based on multiple data sources, includes the following steps:
[0024] Step S1: Start running and configure the online search help data source;
[0025] Step S2: Define search help information, including: specifying the data source, defining the name, query statement, search domain, result domain, condition parameters, and aggregation information;
[0026] Step S3: Execute the simulation, view the results, and verify them;
[0027] Step S4: Use the search help component in the business interface;
[0028] Step S5: Monitor the search results to see performance and exception information.
[0029] Furthermore, step S4 also includes the following sub-steps:
[0030] Step S41: Import the component;
[0031] Step S42: Register the component;
[0032] Step S43: Use the specified search help name in the table or field screen;
[0033] Step S44: Intercept the close event.
[0034] The beneficial effects of this invention are as follows: This invention proposes a custom search help component and its operation method based on multiple data sources. It adopts a component-based design, reducing the difficulty of business development, and provides a compact UI interaction component that allows users to input and select data, ensuring that users input data in the correct format. It also provides online customization functionality, allowing users to define basic search help information, query conditions, result columns, datasets, and their aggregation functions online, achieving zero-code or low-code development and reducing code adjustments and release costs caused by repeated changes in requirements. It supports multiple datasets for search help, allowing direct binding to dictionary items within the system and binding to custom SQL datasets. Utilizing MybatisPlusConfig+AbstractRoutingDataSource+ThreadLocal+AOP, when the front-end requests search help data, the AOP aspect configures an execution regular expression interception based on the package name of the request class. It determines which data source to switch to through the search help data source parameters in the ProceedingJoinPoint context, and changes the ThreadLocal parameter accordingly. The value enables data source switching and supports search help from multiple data sources in a microservice architecture. It also provides simulation execution and migration script functions to facilitate the verification and migration of search help. For complex business systems, monitoring of high-frequency components is crucial. Adding search help request tracking points and providing "search help logs" and "search help performance analysis" use cases facilitates business analysis and optimization. Attached Figure Description
[0035] Figure 1 This is a server-side architecture diagram of a custom search help component based on multiple data sources according to the present invention;
[0036] Figure 2 This is a diagram of the server-side and client-side architecture of a custom search help component based on multiple data sources according to the present invention;
[0037] Figure 3 This is a flowchart of a custom search help component operation method based on multiple data sources according to the present invention. Detailed Implementation
[0038] To provide a clearer understanding of the technical features, objectives, and effects of the present invention, specific embodiments of the present invention will now be described with reference to the accompanying drawings.
[0039] This invention proposes a custom search help component and its operation method based on multiple data sources. The architecture diagram of the custom search help component is as follows: Figure 2 As shown, it includes a client and a server. The client provides relevant properties, events, and methods, as well as component rendering; the server, as... Figure 1 As shown, it includes:
[0040] Online custom modules: Utilizes a component-based design, allowing customization of multiple sub-module components;
[0041] Multi-data source switching module: Supports searching to help switch data sources for multiple datasets;
[0042] Expanded functionality modules: The search help component has been expanded to support online preview and script migration;
[0043] Monitoring module: Monitors the operation of high-frequency components.
[0044] Furthermore, the online customization module also includes the following sub-modules:
[0045] Basic search help information: including search help name, description, value attributes, display attributes, description attributes, query conditions, result column configuration, and field information;
[0046] Data source and dataset definition: By specifying dictionary item names, you can directly bind to dictionary items within the system; it also supports binding data sources using custom SQL datasets.
[0047] Condition definition: includes fixed conditions and query conditions;
[0048] Aggregate functions: include row headers for row-to-column conversion, grouping column names, statistical fields, and aggregate functions.
[0049] Furthermore, the fixed condition is a system context fixed parameter that varies with different system front-end contexts.
[0050] Furthermore, the extended functional module also includes:
[0051] Simulated execution: Supports online preview of search help by dynamically specifying the search help name and fixed conditions;
[0052] Migration Script: The system searches for and assists in data migration in different environments, generating search-aided migration scripts.
[0053] Furthermore, the monitoring module adds a search help request tracking point, providing search help log use cases to record search request information, facilitating business analysis and optimization.
[0054] Furthermore, the search request information includes: search help name, execution status, request time, time consumed, link ID, personnel information, input parameters and output parameters.
[0055] On the other hand, a method for running a custom search helper component based on multiple data sources is implemented based on a custom search helper component based on multiple data sources, such as... Figure 3 As shown, it includes the following steps:
[0056] Step S1: Start running and configure the online search help data source;
[0057] Step S2: Define search help information, including: specifying the data source, defining the name, query statement, search domain, result domain, condition parameters, and aggregation information;
[0058] Step S3: Execute the simulation, view the results, and verify them;
[0059] Step S4: Use the search help component in the business interface;
[0060] Step S5: Monitor the search results to see performance and exception information.
[0061] Furthermore, step S4 also includes the following sub-steps:
[0062] Step S41: Import the component;
[0063] Step S42: Register the component;
[0064] Step S43: Use the specified search help name in the table or field screen;
[0065] Step S44: Intercept the close event.
[0066] In this embodiment, the components are configured as follows: Figure 2 As shown, the system mainly consists of two parts: a client and a server. The client provides relevant attributes, events, and methods, as well as component rendering. The server primarily handles the acquisition and parsing of search help definitions; switching and processing multiple data sources; parsing SQL statements and processing parameters; acquiring business data; and crawling and statistically analyzing logs. A component-based design and low-code development model are used to encapsulate the search help component. During use, business developers typically only need to specify the search help name; all other attributes can be customized online through the "Search Help Management" use case, as shown below.
[0067] Search help basic information: Search help name, description, value attributes (persistent corresponding attributes), display attributes (values displayed in the container box after selection), description attributes (values displayed in the label after the search icon after selection), query conditions (fields in the search field above the table in the search pop-up), result column configuration (columns displayed in the table in the search pop-up), and field information. Data source and dataset definition: By specifying dictionary item names, you can directly bind dictionary items within the system; it also supports binding data sources using custom SQL datasets. Specifically, you can define the data source information (including data source driver, data source URL, username, password, etc.) for each microservice through the "Data Source Configuration" use case, and then define the SQL dataset after selecting the data source defined above through the "Search Help Management" use case. If it is a join query, nested subqueries are required. Fixed conditions need to be defined using "#1" placeholders, and the number of parameter placeholders is the same as the number of fields in the "Fixed Conditions".
[0068] Fixed conditions: System context fixed parameters: Language code - lang; Company code - companyId; Application ID - appId; User ID - userId. These can vary depending on the different system front-end contexts. During the request, the front-end architecture automatically places these fields in the header and passes them to the back-end for unified processing; business development does not need to consider them. Custom fixed parameters need to be defined in the parameter placeholders of the "SQL statement" and reflected in the fixed condition fields. The corresponding parameter values are bound to the business page via searchHelper->params->fixCondition.
[0069] Query conditions: It is not necessary to define the parameter placeholder "#1" in the "SQL statement" or in the "fixed conditions"; the fields of the query conditions only need to exist in the fields of the outermost select of the "query statement"; this is mainly to ensure that the search conditions or table filters can be correctly appended and automatically processed by the backend search engine.
[0070] Aggregate functions: including row headers for row-to-column conversion, grouping column names, statistical fields, and aggregate functions.
[0071] Multiple data sources: When the application starts, it reads all data source information for the search help and initializes the system's dynamic data source DynamicDataSourceInit; it initializes the default data source through MybatisPlusConfig; and it uses ThreadLocal to store the data source key corresponding to the current search help through the dynamic data source context DynamicDataSourceContextHolder.
[0072] When the frontend requests search help data, the AOP aspect uses the package name of the request class and the execution method to intercept the request with a regular expression. In the doAround interception method, the data source parameter for the search help is used to determine which data source to switch to, and the data source is switched by changing the value of ThreadLocal.
[0073] Extended functionality: Simulated execution: After the search help is defined online, to verify its usability, "simulated execution" is added to the "Search Help Management" use case. This allows for online previewing of the search help by dynamically specifying the search help name and fixed conditions.
[0074] Migration Scripts: To facilitate searching for and generating migration scripts in different system environments (sit, uat, prod, etc.), a function to search for and generate migration scripts is provided.
[0075] Monitoring: For complex business systems, monitoring high-frequency components is crucial. This article provides a "Search Help Performance Analysis" use case for monitoring search help performance, which allows you to view the number of times search help is executed and its average execution time. For search help execution, a "Search Help Log" use case is provided, which adds a tracking point to search help requests and records search request information (search help name, execution status, request time, execution time, link ID, personnel information, input parameters, and output parameters, etc.) to facilitate business analysis and optimization.
[0076] This invention proposes a custom search help component and its operation method based on multiple data sources, aiming to improve versatility, achieve reusability, and provide complete lifecycle management for the component. It adopts a component-based design to reduce business development difficulty, provides a compact UI interaction component, allows user input and selection, ensures users input data in the correct format, and offers online customization capabilities. Users can define basic search help information, query conditions, result columns, datasets, and their aggregation functions online, enabling zero-code or low-code development and reducing code adjustments and release costs due to repeated changes in requirements. It supports multiple datasets for search help, allowing direct binding to dictionary items within the system and binding to custom SQL datasets. Utilizing MybatisPlusConfig+AbstractRoutingDataSource+ThreadLocal+AOP, when the frontend requests search help data, the AOP aspect configures execution regular expressions to intercept requests based on the package name of the request class. It determines which data source to switch to by using the search help data source parameters in the ProceedingJoinPoint context, and modifies the ThreadLocal parameter accordingly. The value enables data source switching and supports search help from multiple data sources in a microservice architecture. It also provides simulation execution and migration script functions to facilitate the verification and migration of search help. For complex business systems, monitoring of high-frequency components is crucial. Adding search help request tracking points and providing "search help logs" and "search help performance analysis" use cases facilitates business analysis and optimization.
[0077] The foregoing description and illustrations have shown and described the basic principles, main features, and advantages of this invention. Those skilled in the art should understand that this invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to this invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.
Claims
1. A multi-data source based custom search help component, comprising: The client provides relevant attributes, events and methods, and rendering of components; and the server includes: An online customization module that customizes multiple sub-module components using component-based design, including the following sub-modules: Search help basic information, including search help name, description, value attribute, display attribute, description attribute, query condition, result column configuration and field information; Data source and data set definition, which directly binds dictionary items in the system by specifying dictionary item names, and supports binding data sources in the form of custom SQL data sets; Condition definition, including fixed conditions and query conditions; Aggregation function, including row-to-column corresponding row header, grouping column name, statistical field and aggregation function; Multi-data source switching module that supports switching of data sources for multiple data sets of search help; Extended function module that extends the function of the search help component, supports online preview and migration of scripts; Monitoring module that monitors the operation of high-frequency components.
2. The self-defined search help component based on multiple data sources according to claim 1, characterized in that, The fixed conditions are system context fixed parameters that change with different system front-end contexts.
3. The self-defined search help component based on multiple data sources according to claim 1, characterized in that, The extended function module further includes: Simulated execution that supports online preview of search help by dynamically specifying search help name and fixed conditions; Migration script that generates a search help migration script for search help data migration in different system environments.
4. The self-defined search help component based on multiple data sources according to claim 1, characterized in that, The monitoring module adds search help request burying points, provides search help log use cases, records search request information, and facilitates business analysis and optimization.
5. The self-defined search help component based on multiple data sources according to claim 4, characterized in that, The search request information includes search help name, execution status, request time, time consumption, link ID, personnel information, input parameter and output parameter information.
6. A method for running a multi-data-source based custom search help component, based on the multi-data-source based custom search help component of any one of claims 1-5, characterized in that, The method includes the following steps: Step S1: Start running, and configure search help data sources online; Step S2: Define search help information, including specifying data sources, defining name, query statement, search domain, result domain, condition parameter and aggregation information; Step S3: View results and perform verification through simulated execution; Step S4: Use the search help component in the business interface, including the following sub-steps: Step S41: Import the component; Step S42: Register the component; Step S43: Use the specified search help name in the table or domain screen; Step S44: Intercept the close event; Step S5: View search help execution performance and exception information through the monitoring use case.
Citation Information
Patent Citations
Web data management system
CN101833568A
Read-write separation multi-data source component and working method thereof
CN113835690A