Computing component and method based on general character string expression
By combining a visual configurator and AI-assisted module with a DSL editor, the complexity and scalability issues of string expression calculation in existing technologies are resolved, enabling efficient and intelligent expression generation and optimization, and improving the reliability and maintainability of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-13
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies suffer from problems such as unclear expression, poor readability and maintainability, poor scalability, and low level of intelligence when processing complex string expression calculations. In particular, they are difficult to achieve intuitive and visual representation when dealing with multi-level conditions, joint conditions, and nested conditions, and manual configuration is prone to errors.
It adopts a general string expression calculation component, combined with a visual expression configurator, editor and AI-assisted module, to achieve automated expression generation and optimization through visual configuration, flexible DSL editing and AI technology.
It improves the intelligence and efficiency of string expression calculation, reduces the error rate of manual configuration, enhances the readability and maintainability of expressions, supports the rapid expansion of new calculation functions, and optimizes the execution efficiency of nested conditions.
Smart Images

Figure CN121635864A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer technology, and in particular to a general string expression calculation component and method. BACKGROUND
[0002] In modern data systems, such as big data monitoring systems, big data assessment systems, and the like, there is a wide range of computing needs for string expression evaluation. Existing technologies mainly rely on traditional computing query scripts (such as SQL scripts) to implement related calculations. For example, in a specific scenario, when a result value needs to be mapped to an enumerable value space through a threshold value, the existing technology usually implements it by hard coding a large number of CASE WHEN statements in the SQL script. For example, if you want to map the score to four levels of excellent, good, medium, and poor, you will write a script similar to "CASE WHEN score >= 90 THEN 'excellent' WHEN score >= 80 AND score < 90 THEN 'good'... ELSE 'poor' END". For scenarios involving mathematical operations on multiple input result values, the existing technology will directly write the corresponding operation formula in the SQL script, such as "(a + b) × c / d", and these formulas are also in the form of hard coding in the script. When it comes to multi-level conditions, joint conditions, and nested conditions, multiple CASE WHEN statements or complex logical operator combinations are used to implement them. There are several problems: Expression is not clear: When dealing with multi-level conditions, joint conditions, and nested conditions, due to the reliance on hard-coded CASE WHEN statements and complex logical operator combinations, the expression structure is chaotic, the logical relationship is not intuitive, and it is difficult to implement intuitive and visual display of complex nested rules.
[0003] Poor readability and maintainability: Hard-coded string expressions are mixed in SQL scripts. When the expression is complex, the code is lengthy and difficult to understand, and later maintenance personnel need to spend a lot of time combing the logic, which is not conducive to maintenance and debugging. Poor scalability: If the business rules change, the hard-coded expressions in the corresponding SQL scripts need to be modified. For complex scenarios, you may need to modify a large area of code or even redevelop related modules, which cannot easily extend new computing functions.
[0004] Low degree of intelligence: Complete reliance on manual writing and configuration of expressions, in the face of a large number of similar business scenarios or complex computing needs, is inefficient and prone to errors due to human error.
[0005] The prior art completely relies on manual expression writing and configuration in the face of complex business scenarios, lacks intelligent auxiliary means, the expression method is not clear, and it is difficult to cope with the increasing complex computing demand, and the reliability is poor. SUMMARY
[0006] The present application aims at the deficiencies of the prior art, and proposes a general string expression calculation component, which is composed of a visual expression configurator, an editor and an AI auxiliary module. By introducing visual configuration, flexible DSL editing method and AI technology, the technical problem of traditional hard coding method completely relying on manual expression writing and configuration and being difficult to cope with the increasing complex computing demand is solved.
[0007] To achieve the purpose of the present application, in a first aspect, the present application provides a general string expression calculation component, comprising: A starting module for starting a visual expression configurator or an editor according to the complexity of the calculation demand; A visual expression configurator, the page of which is set as: A calculation source configuration item, a general expression configuration item, a calculation task configuration item and an AI auxiliary configuration module; The calculation source configuration item is used to select data fields, the AI auxiliary configuration module is used to analyze the data fields selected by the calculation source configuration item and historical configuration records, and recommend a visual expression template according to the analysis result, the general expression configuration item is used to configure the multi-layer conditions of the visual expression, and the calculation task configuration item is used to set the execution strategy of the visual expression; An editor, which has an AI code auxiliary module built-in, the editor calls the AI code auxiliary module to load syntax rules and historical script library to automatically complete the script and recommend an optimized structure according to the input part of the script content, and obtains an editor script; A conversion module for converting the visual expression or the editor script into a calculable expression; A calculation module for performing calculation according to the calculable expression.
[0008] Further, the calculation component further comprises: An AI auxiliary module, which has an expression intelligent generation engine built-in, the engine is used to convert the calculation demand text into a structured logical relationship, and generate a preliminary expression according to the structured logical relationship. Natural language processing is combined with preset rules to realize automatic conversion from business demand to expression, and reduce the manual translation error rate.
[0009] Further, the AI auxiliary module further comprises: The performance optimization module performs calculation data according to the computable expression, proposes operation optimization suggestions, and analyzes and optimizes the logical structure of nested conditions or joint conditions by recording the execution time and resource occupation data of the computable expression. The performance analysis based on the execution data can identify logical structure bottlenecks and optimize nested / joint conditions to improve expression execution efficiency.
[0010] Further, the AI-assisted configuration module is used to analyze configuration conditions in real time and detect logical conflicts, and give optimization suggestions according to the detection results. The real-time logical conflict detection mechanism can prevent configuration errors, and the optimization suggestion function helps users quickly correct configuration conditions, improving the accuracy and reliability of system configuration.
[0011] Further, the AI-assisted configuration module is also used to recommend execution strategies according to the characteristics of the computing task. According to the characteristics of the computing task (such as data volume, complexity, etc.), the execution strategy is dynamically recommended to realize intelligent scheduling of computing resources and improve the overall execution efficiency of the system.
[0012] Further, the computing task characteristics include data volume, computing complexity, and system load. By quantifying the computing task characteristics (data volume / complexity / system load), precise parameter support is provided for strategy recommendation, enhancing the adaptability of the execution strategy.
[0013] Further, the method for selecting to start the visual expression configurator or start the editor according to the complexity of the computing requirement comprises: analyzing the computing requirement to obtain an analyzed expression or an analyzed indication, and determining whether it is a complex computing according to the analyzed expression or the analyzed indication; when the determination result is a complex computing, starting the editor; when the determination result is a non-complex computing, starting the visual expression configurator.
[0014] The system automatically matches the tool with the complexity of the requirement, preventing the function from being limited (simple tools failing to handle complex tasks) and avoiding resource waste (complex tools handling simple tasks redundantly).
[0015] In a second aspect, the present application provides a computing method based on a general string expression, which comprises: The starting module selects to start the visual expression configurator or start the editor according to the complexity of the computing requirement; The visual expression configurator selects data fields by using the computing source configuration item, analyzes the data fields selected by the computing source configuration item and the historical configuration record by using the AI-assisted configuration module, recommends a visual expression template according to the analysis result, configures multiple conditions of the visual expression by using the general expression configuration item, and sets the execution strategy of the visual expression by using the computing task configuration item; The editor script is obtained by calling an AI code auxiliary module to load syntax rules and a historical script library to automatically complete the script and recommend an optimized structure according to the input part script content; The conversion module converts the visual expression or the editor script into a computable expression. The calculation module performs calculation according to the computable expression.
[0016] Through the dual-mode cooperation of the visual interface and the editor, the full-process AI assistance from data field selection to expression construction to execution strategy recommendation is realized, the operation threshold of the user is reduced, and the configuration efficiency is improved. The AI assisted configuration module verifies logical conflicts in real time and gives optimization suggestions, so that the execution failure caused by configuration errors is avoided. The performance optimization module dynamically adjusts the operation order and operator based on execution data, and the expression execution efficiency is improved.
[0017] In addition, the expression intelligent generation engine realizes automatic conversion from natural language to structured expression, reduces the manual translation error rate, supports drag-and-drop visual configuration (suitable for basic users) and code editor advanced customization (satisfies professional requirements), and ensures that the configuration results of the two modes can be interchanged and converted through a data interface.
[0018] At the same time, the execution strategy is automatically recommended according to the data characteristics (such as field type and data volume), the dynamic matching of computing resources and task complexity is realized, and the overall load of the system is optimized.
[0019] Further, the visual expression configurator or the editor is started according to the complexity of the calculation demand. Through intelligent judgment of the complexity of the calculation demand (such as the number of condition nesting layers and the number of operator types), the user is automatically guided to select the most suitable configuration entry.
[0020] The beneficial effects of the present application are as follows: The present application uses the visual expression configurator combined with the AI assisted configuration module, not only presents the complex condition relationship with intuitive interface elements, but also further clarifies the logic through the real-time analysis and suggestions of AI, so that the expression of complex nested rules is clearer. The preliminary expression generated by AI assistance can also provide a clear starting point for the user, solving the problems of unclear expression, difficulty in dealing with complex calculation and poor reliability in the prior art. For example, the multi-level condition configuration combined with the logic verification of AI can make it easier for maintenance personnel to understand and adjust the level and logical relationship between conditions. Meanwhile, the expression of the visual configuration, the concise Groovy DSL script and the specification expression generated with the assistance of AI are easier to understand than the traditional hard-coded SQL script. The AI code assistance module and the logic checking function reduce errors in the expression. When modification is needed, the maintainer can directly adjust the configuration or modify the DSL script on the visual interface, and the optimization suggestions of AI can help the maintainer to maintain more efficiently, thereby significantly improving the poor readability and maintainability of the prior art. In addition, when the business rule changes, if the visual configuration is used, the corresponding configuration item only needs to be adjusted, and the template and strategy recommended by AI can accelerate the speed of adapting to new business; if the Groovy DSL editor is used, the AI code assistance module can help to quickly write a new script. The expression intelligent generation engine driven by AI can directly generate an expression according to new business requirements, without the need to modify the system code in a large area, conveniently extend new computing functions, and significantly improve the configuration efficiency, thereby solving the problems of poor expandability and low efficiency of the prior art. Finally, the real-time checking and syntax error correction prompt of the AI assistance module can discover and correct errors in time during the expression configuration and writing process, reduce expression errors caused by human operation errors, and improve the reliability of the component. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 The application is a flowchart of a general string expression calculation component. DETAILED DESCRIPTION
[0022] Embodiments of the application are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference signs represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and are only used to explain the application, and cannot be understood as a limitation of the application.
[0023] In the description of the application, it should be understood that the terms "longitudinal", "transverse", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only used to facilitate the description of the application and simplify the description, and therefore cannot be understood as indicating or implying that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation of the application.
[0024] In the description of the present application, unless otherwise specified and limited, it is necessary to explain that the terms "mounting", "connection", "connection" should be understood broadly, for example, it can be mechanical connection or electrical connection, it can be the communication between two elements, it can be direct connection or indirect connection through intermediate medium, and the specific meaning of the above terms can be understood by the person skilled in the art according to the specific circumstances.
[0025] Referring to the drawings Figure 1 In one embodiment, the present application discloses a kind of based on general string expression calculation component, comprising: Start module, for selecting the start visual expression configurator or starting editor according to the complexity of calculation demand; Parsing the calculation demand, obtain parsed expression or parsed indication, determine whether it is complex calculation according to parsed expression or parsed indication; When the determination result is complex calculation, start editor; When the determination result is non-complex calculation, start visual expression configurator.
[0026] If the expression length or structure layer number of parsed expression is greater than threshold value, then it is determined as complex calculation; If parsed expression contains non-basic mathematical operator, then it is determined as complex calculation; If parsed indication includes complex calculation keyword, then it is determined as complex calculation.
[0027] Specifically, when the length of parsed expression is detected to exceed a preset threshold value (such as 50 characters), or contains multiple layers of nested bracket structure (such as more than 2 layers), or contains multiple consecutive operators, it is determined as complex calculation demand, otherwise it is non-complex calculation.
[0028] When it is detected that parsed expression contains non-basic mathematical operator (such as only contains +, -, ×, / ), but programming logic function (such as IF, CASE, AND, OR) is introduced, string processing function (such as SUBSTRING,CONCAT), date function or user-defined function, it is determined as complex calculation, otherwise it is non-complex calculation.
[0029] When parsed indication includes "advanced formula", "custom script", "logical judgment" and the like, then it is determined as complex calculation, otherwise it is non-complex calculation.
[0030] When the determination result is complex calculation, start editor, when the determination result is non-complex calculation, start visual expression configurator. Visual expression configurator, its page setting: The computing source configuration item, the general expression configuration item, the computing task configuration item and the AI auxiliary configuration module are connected through the program interface data interaction and linkage in the system. The AI auxiliary configuration module is used for analyzing the data field selected by the computing source configuration item and the historical configuration record, and recommending an expression template according to the analysis result. Meanwhile, the AI auxiliary configuration module is used for real-time analysis of the configuration condition and detection of logical conflicts, and gives optimization suggestions according to the detection result. In addition, the AI auxiliary configuration module is also used for recommending an execution strategy according to the computing task characteristics. The computing task characteristics include data volume, computing complexity and system load.
[0031] When starting the visual expression configurator, the user is in the expression configuration page, first selects the data source through the computing source configuration item, and can select the data field participating in the calculation from different tables or views of the system database; the AI auxiliary configuration module analyzes the characteristics of the selected data field and the historical configuration record in real time, and recommends a possible applicable expression template for the user.
[0032] Then in the general expression configuration item, the user can configure the condition expression in a visual operation mode such as dragging, clicking to select the operator, etc., combined with the recommended template, support multi-level configuration, for example, when configuring nested conditions, the method of adding a sub-condition module can be used to realize each sub-condition module and the parent condition module are associated through a logical connector (and, or, etc.), and the AI auxiliary configuration module will check the rationality of the visual expression logic in real time during the configuration process, and give optimization suggestions.
[0033] Finally, in the computing task configuration item, set the trigger condition, execution frequency and other parameters of the calculation, and the AI auxiliary configuration module will recommend a suitable visual expression execution strategy according to the characteristics of the computing task to optimize the performance. After the configuration is completed, the conversion module will convert the visual configuration into an internal recognizable string expression format, that is, a computing expression.
[0034] An editor with an AI code auxiliary module, the editor is connected with the visual expression configurator through a data interface, the AI code auxiliary module is used for automatically completing the code, providing syntax error correction prompts and recommending optimization structures according to the input part of the script content.
[0035] In some embodiments, a Groovy DSL editor is selected as the editor. When the visual expression configurator cannot meet the demand of complex business scenarios, start the Groovy DSL editor, which provides a set of simplified domain-specific language syntax, and the user can write expressions according to the preset syntax rules.
[0036] The editor has an AI code assistance module that can automatically complete code, provide syntax error correction prompts, and recommend more concise and efficient expression methods based on the user's input of partial script content. The editor is connected to the visual expression configurator through a data interface. When the user finishes writing in the editor, the conversion module will parse and convert the Groovy DSL script, and the visual configuration generated expression will be processed uniformly. For example, for extremely complex mathematical operations and logical judgment combinations, the AI code assistance module will automatically complete the remaining content and optimize the structure after the user inputs part of the script.
[0037] A conversion module for converting visual expressions or editor scripts into computable expressions. Finally, the calculation module performs calculations based on the computable expressions.
[0038] The AI assistance module includes: The expression intelligent generation engine can generate a preliminary string expression based on the user's input of business requirement description text by training a large amount of expression sample data. The user can fine-tune the preliminary string expression. Specifically, the engine converts the business requirement text into a structured logical relationship and generates a preliminary expression based on the structured logical relationship. Furthermore, the expression intelligent generation engine converts the business requirement text into a structured logical relationship based on natural language processing and generates a corresponding expression based on preset expression generation rules.
[0039] The performance optimization module provides optimization suggestions for operation order adjustment and inefficient operator replacement based on expression execution data. The performance optimization module analyzes and optimizes the logical structure of nested conditions or joint conditions by recording expression execution time and resource occupation data. Specifically, the module records the execution of the expression, including execution time, resource occupation, and other data, and analyzes the relationship between the expression structure and performance using machine learning algorithms. When a performance bottleneck is detected in the expression, the module automatically provides optimization suggestions, such as adjusting the operation order and replacing inefficient operators. The user can choose whether to apply the optimization suggestions.
[0040] The AI assistance module and the visual expression configurator communicate bidirectionally, and the AI assistance module and the editor communicate bidirectionally.
[0041] The overall scheme based on the general string expression calculation component solves the technical problems of complex configuration, low execution efficiency, poor reliability and the like in traditional expression calculation through a three-layer architecture system of "visual configuration + intelligent assistance + dynamic optimization". The core workflow starts from the selection of a calculation source data field by a user through a visual expression configuration device, an AI-assisted configuration module analyzes field characteristics and historical configuration records in real time, and intelligently recommends a matched expression template to reduce the construction threshold.
[0042] When the user configures multiple layers of conditions through a drag-and-drop manner, the system performs real-time logical conflict detection and gives optimization suggestions, and simultaneously dynamically recommends an optimal execution strategy according to the data volume, complexity and the like of the calculation task, which significantly reduces the error rate of traditional manual configuration. For a complex scenario, the user can switch to an editor assisted by an AI code, the system realizes code automatic completion and structure optimization recommendation based on syntax rules and a historical script library, and improves the development efficiency of a professional expression.
[0043] In the expression generation link, an expression intelligent generation engine automatically converts a business demand text into a structured logical relationship tree through a natural language processing technology, and then outputs a preliminary expression in combination with a preset generation rule. This conversion mechanism of "natural language → logical structure → executable code" solves the semantic gap problem between business personnel and technical implementation. A performance optimization module intelligently identifies performance bottlenecks in nested conditions or joint conditions by continuously monitoring data such as CPU occupancy, memory consumption and execution time during expression execution, and proposes optimization suggestions such as operator replacement and operation sequence adjustment. The whole system realizes flexible switching between simple configuration and professional development through a bidirectional data channel of the visual configuration device and the editor, and forms a closed loop of "configuration-generation-optimization" in combination with the real-time feedback mechanism of the AI assistance module.
[0044] The present application enables non-technical personnel to quickly build complex expressions through visual drag-and-drop configuration and natural language translation functions; in terms of execution efficiency, the combination of dynamic strategy recommendation and real-time performance optimization ensures that the calculation task is always running in the optimal way; in terms of system adaptability, the continuous learning ability of the AI assistance module enables it to continuously optimize the recommended strategy according to the evolution of enterprise business. The whole mechanism finally realizes the paradigm upgrade of expression calculation from manual coding to intelligent generation, and has significant application value in fields such as financial risk control and industrial Internet of Things that require high-frequency configuration of calculation rules.
[0045] In one embodiment, the present application discloses a calculation method based on a general string expression, which comprises the following steps: The starting module selects to start the visual expression configuration device or start the editor according to the complexity of the calculation demand; The visual expression configurator selects data fields by using a computing source configuration item, analyzes the data fields selected by the computing source configuration item and historical configuration records by using an AI-assisted configuration module, and recommends a visual expression template according to an analysis result, configures multiple layers of conditions of the visual expression by using a general expression configuration item, and sets an execution strategy of the visual expression by using a computing task configuration item; The editor automatically completes the script and recommends an optimized structure by calling the AI code-assisted module to load syntax rules and a historical script library according to input partial script content, to obtain an editor script; The conversion module converts the visual expression or the editor script into a computable expression; The computing module performs computation according to the computable expression.
[0046] The key technical point of the application is to break through the traditional hard coding mode, deeply integrate visual configuration, flexible DSL editing and AI technology, and significantly improve the intelligence, convenience and efficiency of string expression computation.
[0047] The AI-driven expression intelligent generation engine: can automatically generate a preliminary expression according to a business requirement text, is the core of improving the intelligence and efficiency of components, and is the most important innovation point.
[0048] Example: when the input business requirement text is “calculate the total order amount, order total amount = product unit price × product quantity + freight”, the engine can automatically generate the expression orderTotalAmount=productUnitPrice×productQuantity+freight The AI-assisted configuration module in the visual expression configurator: it is actually a logic verification, optimization suggestion and template recommendation mechanism, enhances the accuracy and convenience of configuration, and is the second important innovation point. Example: when configuring the expression for judging whether the user age is adult, if the input is age>16, the module real-time logic verification prompts “the legal adult age in China is 18 years old”, and recommends the template age>=18, and gives the optimization suggestion “add a logic or condition to be compatible with adult standards in other countries”.
[0049] The AI code-assisted module built in the Groovy DSL editor: it includes automatic completion, syntax error correction and optimization recommendation functions, improves the efficiency and quality of complex script writing, and is an important innovation point. Example: When writing a Groovy script to calculate the Fibonacci sequence, input def fibonacci(n) { if (n <=1), the module automatically completes return n;} return fibonacci(n - 1) + fibonacci(n - 2); If you input def fibonacci(n) { if (n <= 1) retrun n;}, the module prompts "Syntax error: retrun should be return" and recommends optimization to def fibonacci(n) { return n <= 1? n : fibonacci(n - 1) + fibonacci(n - 2);} Machine learning-based expression performance optimization module: can automatically analyze and optimize expression performance, is a key innovation to support the efficient operation of components. Example: For a complex expression ((a + b) × c / d) + (e - f) × g, the module analyzes and finds that there is repeated calculation, and automatically optimizes it to temp1 = (a + b); temp2 = (e - f); (temp1 × c / d) + (temp2 × g), reducing the number of calculation steps and improving execution efficiency.
[0050] Collaboration mechanism of visual configuration, Groovy DSL script and AI assistance module: ensures seamless connection of each part of the function, and is the basis for the intelligent operation of the whole component. Example: In the visual configuration, set "Calculate discount according to user level", the AI assistance module recommends configuration logic, and generates Groovy DSL script if (userLevel == "VIP1") { discount = 0.8;} else if(userLevel == "VIP2") { discount = 0.7;}, realizing real-time synchronization and collaboration of visual operation and script code.
[0051] Embodiment 1 The entire data processing flow starts with user-initiated computing requirements, and is divided into two paths: visualization configuration and complex scenario editing, both of which ultimately point to expression calculation execution and return results. In the visualization configuration path, starting from selecting data fields, the steps include AI-assisted analysis of data characteristics to recommend templates, drag-and-drop configuration conditions, AI real-time verification, setting task conditions, and AI-recommended execution strategies. The complex scenario editing path is completed through the Groovy DSL editor, combined with AI code assistance for script writing. On this basis, each link is expanded and supplemented, including data access and preprocessing, computing task management, result storage and application, making the process more complete.
[0052] After the user initiates the computing requirement, the system first provides data access options, supporting multiple data source types such as relational databases (MySQL, Oracle), file storage (CSV, Excel, JSON), API interfaces (RESTful, WebSocket), and real-time stream data (Kafka, Flume). The user needs to select the data source and configure the connection parameters, such as the host address, port, username, password, and database name when connecting to MySQL, and the system will automatically verify the connection availability.
[0053] Example: A user of an e-commerce platform needs to analyze the relationship between "user consumption amount and purchase frequency", selects the "user_orders" table in the MySQL database as the data source, and after configuring the connection parameters, the system tests the connection successfully and loads the table structure.
[0054] The system performs basic cleaning operations on the loaded raw data, including deduplication (deleting duplicate order records), missing value handling (filling missing values in the "consumption amount" field according to user-set rules such as mean filling or marking as "to be confirmed"), and format conversion (converting the "order date" field from a string type to a date type "yyyy-MM-dd").
[0055] If the data contains sensitive information (such as user mobile number, ID number), the system automatically applies desensitization rules, such as replacing the middle 4 digits of the mobile number with "××××" and keeping only the first 6 digits and the last 4 digits of the ID number.
[0056] Example: There are 5 duplicate order records (order number same) in the "user_orders" table, and the system automatically deletes duplicates; the "user mobile number" field is uniformly desensitized to the "138××××5678" format.
[0057] The user expands the "user_orders" table in the data source list of the visualization interface, checks the required analysis fields such as "user_id" (user ID), "order_amount" (order amount), "order_date" (order date), and "purchase_frequency" (purchase frequency). The system provides real-time preview of sample data (the first 10 rows) and statistical information (maximum value, minimum value, and average value) of the selected fields.
[0058] If multi-table joint analysis is required (such as associating the "user_info" table to obtain user age and gender), the user can establish the association relationship between tables (such as inner joining through "user_id") by dragging and dropping the fields. The system automatically generates a JOIN statement and verifies the association method.
[0059] The AI module performs multi-dimensional analysis on the selected fields, including field types ("order_amount" is a numerical type, and "order_date" is a date type), distribution characteristics (order amount shows a right-skewed distribution, with a mean of 500 yuan and a median of 300 yuan), and business semantics (combining historical task labels to identify that "order_amount" is related to "consumption ability").
[0060] Based on the analysis results, expression templates are recommended, such as for the numerical fields "order_amount" and "purchase_frequency", the "consumption level division" template (such as "when order_amount > 1000 and purchase_frequency > 5, mark as 'high-value user'") and the "trend analysis" template (such as "calculate the year-on-year growth rate of order_amount in the past 30 days") are recommended.
[0061] Example: The AI identifies that "order_amount" and "purchase_frequency" are commonly used for user segmentation and recommends the template "IF(order_amount > X AND purchase_frequency > Y, 'high-value user', 'ordinary user')", and prompts that X and Y can be set based on data quantiles (such as X=75% quantile 800 yuan, Y=5 times).
[0062] The user drags operators from the operator library (including comparison operators >, <, =, IN, logical operators AND, OR, NOT, mathematical operators +, -, ×, / , aggregation functions SUM, AVG, COUNT, etc.) to the editing area to construct multi-level conditions.
[0063] Example: After the user selects the "High-value user" template, configure conditions by dragging: First layer condition: order_amount > 800 (numeric comparison) Second layer condition: purchase_frequency > 5 (numeric comparison) The two conditions are connected by "AND", and a third layer condition order_date >= '2023-01-01' (date comparison) is added, which is connected to the previous two conditions by "AND", forming the complete rule "When order amount > 800 yuan and purchase frequency > 5 times and order date after 2023, mark as high-value user".
[0064] The AI module analyzes the user-configured conditions in real time, detects logical conflicts (such as "order_amount >1000" and "order_amount < 500" exist at the same time), redundant conditions (such as "order_date >= '2023-01-01' AND order_date >= '2023-06-01' " can be simplified to the latter) and data type mismatch (such as comparing string fields with ">").
[0065] For "order_amount > 800 AND purchase_frequency > 5", the AI prompts "You can add index to optimize query efficiency, suggest creating time range index on 'order_date' field"; found that "purchase_frequency" has abnormal value (a user's frequency is 100 times, far exceeding the average), suggest adding "purchase_frequency <= 30" reasonable verification condition.
[0066] Compute task configuration item (set trigger condition, execution frequency) This trigger condition supports multiple trigger methods, including timing trigger (such as executing every day at 2 am), event trigger (such as "user_orders" table has new data inserted), manual trigger (user clicks "Execute immediately" button).
[0067] The execution frequency can be configured by timing task, such as hour level (every 6 hours), day level (every day), week level (every Monday), month level (every 1st), and support setting validity period (such as 2023-01-01 to 2023-12-31).
[0068] Users can set task priority (high, medium, low), maximum parallelism (number of data shards processed at the same time) and timeout time (such as 30 minutes not completed will be automatically terminated).
[0069] Example: User sets the "High-Value User Identification" task to be triggered at 3 AM every day with a priority of "Medium" and a timeout of 1 hour. When the "user_orders" table has more than 1000 new orders added daily, the priority is automatically raised to "High".
[0070] The AI-assisted configuration module recommends execution strategies based on data volume (e.g., 10 million rows in the "user_orders" table), computational complexity (multi-level conditional nesting), and system load. For example, data sharding (hashing by "user_id" to 10 parallel tasks), incremental calculation (processing only new data for the day, not full table scanning), and cache reuse (caching user basic information from the "user_info" table to avoid repeated queries).
[0071] When the AI-assisted configuration module predicts the task execution time (e.g., 2 hours for full table scanning and 10 minutes for incremental calculation), it suggests delaying the task to 4 AM to reduce resource competition.
[0072] Start the Groovy DSL editor, which provides syntax highlighting, code folding, line number display, and automatic indentation, supports shortcut operations (such as Ctrl+S save, Ctrl+F find and replace). The left panel shows the historical script library (classified by business type, such as "User Analysis" and "Order Statistics") and syntax rule documents (common functions, variable definition examples).
[0073] Example: User needs to write complex logic to "calculate the average consumption of users in the past 3 months and sort by region", open Groovy DSL editor, import "User Consumption Analysis Base Template" from historical script library for modification.
[0074] AI code assistance module (load syntax rules, historical script library) The system has built-in Groovy DSL syntax rules, including variable declaration (def avgAmount = 0.0), loop structure (for (order in orders) {}), conditional judgment (if (order.date >= startDate) {}), and aggregate function call (sum(orderAmount) / count(orders)).
[0075] Load scripts written by user team history, support keyword search (such as search "average consumption"), and display script creation time, author, execution success rate and other meta information, user can directly reuse or modify.
[0076] Example: AI code assistant module loads "Recent 6 Months Consumption Amount Calculation" historical script, which contains date range filtering, amount accumulation logic. User modifies the date range to "Recent 3 Months" and adds region grouping logic based on this.
[0077] When the user inputs code, the AI code assistant module provides real-time code completion suggestions. For example, when "order." is entered, the field names (orderAmount, orderDate, userId) are automatically listed. When the function prefix "sum" is entered, the complete function "sum(fieldName)" and parameter explanations are prompted.
[0078] Example: User inputs "def startDate =", AI prompts "startDate = LocalDate.now().minusMonths(3)" (get date 3 months ago) and automatically imports the java.time.LocalDate class.
[0079] In addition, the AI code assistant module also completes code snippets based on context. For example, when the user inputs "if(orderAmount >", the AI completes "1000) { highValueCount++}" (reference "high-value order threshold" in historical script).
[0080] Real-time detection of syntax errors, such as missing parentheses, undefined variables, and type mismatches, highlights the error line in red and provides correction suggestions, such as changing "orderDate > '2023-01-01'" to "orderDate.isAfter(LocalDate.parse('2023-01-01'))" (date type comparison).
[0081] For "for loop to traverse the entire table to calculate the average amount", AI recommends using stream processing (orders.stream().filter(...).mapToDouble(...).average().orElse(0.0)), and prompts "streaming calculation can reduce memory usage, and when processing 10 million rows of data, efficiency is improved by about 30%"; find repeated intermediate variables, suggest extracting as public methods (def calculateAvg(List <order>orders) {}).
[0082] After the user finishes writing, they can click the "Debug" button, and the system will execute the script and output intermediate variable values (such as "Total orders in the past 3 months: 1500") and execution time ("Debug execution time: 20 seconds"). It also supports breakpoint debugging (setting breakpoints at key lines and executing step by step to view variable changes).
[0083] After the user confirms that the script is correct, they can save it and generate a version number (such as V1.0). The system records modification history and supports version rollback (such as rolling back to V0.9).
[0084] Example: When the user debugs the script, they find that the "region" field is misspelled (regin instead of region). The AI prompts "Variable regin is not defined" in the debug log. After the user corrects it, they re-debug the script, and it successfully outputs "Average consumption amount in North China: 850 yuan".
[0085] The system converts it into an internally recognizable string expression format. For conditions configured in the visualization path (such as "order_amount > 800 AND purchase_frequency > 5"), the system automatically converts it into an abstract syntax tree (AST) and then compiles it into executable SQL or Spark SQL statements (such as SELECT user_id, 'high-value user' AS user_level FROM user_orders WHERE order_amount > 800 AND purchase_frequency > 5 AND order_date >= '2023-01-01').
[0086] For Groovy DSL scripts edited in complex scenarios, the system converts them into Java bytecode or MapReduce tasks through a parser, ensuring efficient execution in distributed computing engines (such as Spark, Flink).Example: The "high-value user identification" rule configured in the visualization is converted into a Spark SQL statement, and the complex script "average consumption amount of users in the past 3 months by region" is converted into a Flink batch processing task.
[0087] The system automatically selects a computing engine based on the task type. Simple queries (single table filtering and aggregation) use the MySQL engine, large data processing (over 10 million) uses the Spark engine, and real-time stream computing uses the Flink engine.
[0088] For large data volume tasks, the system shards the data and distributes it to multiple computing nodes for parallel processing, schedules resources through YARN or Kubernetes, and monitors the progress of each node (success / failure / in progress).
[0089] If a computing node fails, the system automatically retries (default 3 times), and if the retry fails, the task is assigned to other nodes, and the failure reason (such as node memory overflow) is recorded.
[0090] Example: "high_value_users" table with 10 million rows, "high_value_users" task, system uses Spark engine, hashes "user_id" into 10 shards, and executes in parallel by 10 computing nodes, total time about 15 minutes. The system supports multiple storage methods, including relational databases (results "high_value_users" stored in MySQL), data warehouses (such as Hive table "dw.user_consumption_analysis"), caches (Redis stores hot results such as "real-time high-value user list"), and file exports (CSV, Excel format downloaded to local).
[0091] Configure the retention policy of the result data, such as the "high_value_users" table retains data for nearly 12 months, and automatically deletes historical records over 1 year; important result tables enable backup mechanism (daily incremental backup, weekly full backup).
[0092] Example: "high_value_users" result stored in MySQL "high_value_users" table, containing "user_id" "user_level" "last_update_time" fields, and synchronized to Redis cache, with 2-hour expiration time.
[0093] The system provides a task monitoring panel to display task execution status (success, failure, in progress), time consumption statistics (average execution time, longest / shortest time consumption), resource occupation (CPU usage, memory occupation), and result data volume (number of rows, storage size).
[0094] For failed tasks, the system automatically generates an exception report containing error stack information, failure time, affected data volume, and AI-assisted cause location (such as "database connection timeout" "script syntax error" "data format exception").
[0095] Based on historical execution data, AI periodically generates optimization reports like "The 'User Consumption Calculation' task has been consuming 30 minutes on average in the last 3 months. It is recommended to add an 'order_date' index to reduce the execution time to 15 minutes"; "A certain scheduled task is executed during the system peak hours (9-10 am), causing increased resource contention and execution time. It is recommended to adjust the execution time to non-peak hours (1-2 am)".
[0096] Example: The monitoring panel displays "High-value user identification" task failed to execute today, with an exception report indicating "MySQL connection timeout". AI analysis finds that the database server load is too high, and recommends temporarily expanding the database connection pool or adjusting the task execution time. In the description of the present specification, the description referring to the terms "one embodiment", "some embodiments", "example", "specific example", "one implementation", "one preferred implementation" or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0097] Although the embodiments of the present application have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations can be made thereto without departing from the principles and spirit of the present application, and the scope of the present application is defined by the claims and their equivalents.< / order>
Claims
1. A generic string expression based computation component, comprising: Comprise: a starting module for selecting to start a visual expression configurator or an editor according to the complexity of a computing requirement; the visual expression configurator is provided with: a computing source configuration item, a general expression configuration item, a computing task configuration item, and an AI auxiliary configuration module; the computing source configuration item is used for selecting a data field, the AI auxiliary configuration module is used for analyzing the data field selected by the computing source configuration item and historical configuration records, and recommending a visual expression template according to an analysis result, the general expression configuration item is used for configuring multi-layer conditions of the visual expression, and the computing task configuration item is used for setting an execution strategy of the visual expression; the editor is provided with an AI code auxiliary module, the editor calls the AI code auxiliary module to load syntax rules and a historical script library to automatically complete a script and recommend an optimized structure according to input partial script content, and obtains an editor script; a conversion module for converting the visual expression or the editor script into a computable expression; a computing module for performing computation according to the computable expression. The computing component further comprises:
2. The computing component based on general string expression according to claim 1, characterized in that, an AI auxiliary module provided with an expression intelligent generation engine, which is used for converting a computing requirement text into a structured logical relationship, and generating a preliminary expression according to the structured logical relationship. The AI auxiliary module further comprises:
3. The computing component based on general string expression according to claim 2, characterized in that, a performance optimization module for executing computing data according to the computable expression, proposing operation optimization suggestions, and analyzing and optimizing a logical structure of nested conditions or joint conditions by recording computing time and resource occupation data of the computable expression. The AI auxiliary configuration module is further used for real-time analysis of configuration conditions and detection of logical conflicts, and giving optimization suggestions according to a detection result.
4. The computing component based on general string expression according to claim 1, wherein, The AI auxiliary configuration module is further used for recommending an execution strategy according to a computing task feature.
5. The computing component based on general string expression according to claim 4, characterized in that, The computing task feature comprises a data volume, a computing complexity, and a system load.
6. The computing component based on general string expression according to claim 5, characterized in that, The method comprises:
7. The computing component based on general string expression according to claim 6, characterized in that, a starting module for selecting to start a visual expression configurator or an editor according to the complexity of a computing requirement; the visual expression configurator is provided with: a computing source configuration item, a general expression configuration item, a computing task configuration item, and an AI auxiliary configuration module; the computing source configuration item is used for selecting a data field, the AI auxiliary configuration module is used for analyzing the data field selected by the computing source configuration item and historical configuration records, and recommending a visual expression template according to an analysis result, the general expression configuration item is used for configuring multi-layer conditions of the visual expression, and the computing task configuration item is used for setting an execution strategy of the visual expression; 8. A method of computing based on a general string expression, implemented based on the computing component of any one of claims 1-7, characterized in that, the editor is provided with an AI code auxiliary module, the editor calls the AI code auxiliary module to load syntax rules and a historical script library to automatically complete a script and recommend an optimized structure according to input partial script content, and obtains an editor script; a conversion module for converting the visual expression or the editor script into a computable expression; a computing module for performing computation according to the computable expression. The computing component further comprises: an AI auxiliary module provided with an expression intelligent generation engine, which is used for converting a computing requirement text into a structured logical relationship, and generating a preliminary expression according to the structured logical relationship. The AI auxiliary module further comprises: a performance optimization module for executing computing data according to the computable expression, proposing operation optimization suggestions, and analyzing and optimizing a logical structure of nested conditions or joint conditions by recording computing time and resource occupation data of the computable expression. The AI auxiliary configuration module is further used for real-time analysis of configuration conditions and detection of logical conflicts, and giving optimization suggestions according to a detection result. The AI auxiliary configuration module is further used for recommending an execution strategy according to a computing task feature. The computing task feature comprises a data volume, a computing complexity, and a system load. The method comprises: a starting module for selecting to start a visual expression configurator or an editor according to the complexity of a computing requirement; the visual expression configurator is provided with: a computing source configuration item, a general expression configuration item, a computing task configuration item, and an AI auxiliary configuration module; the computing source configuration item is used for selecting a data field, the AI auxiliary configuration module is used for analyzing the data field selected by the computing source configuration item and historical configuration records, and recommending a visual expression template according to an analysis result, the general expression configuration item is used for configuring multi-layer conditions of the visual expression, and the computing task configuration item is used for setting an execution strategy of the visual expression; the editor is provided with an AI code auxiliary module, the editor calls the AI code auxiliary module to load syntax rules and a historical script library to automatically complete a script and recommend an optimized structure according to input partial script content, and obtains an editor script; a conversion module for converting the visual expression or the editor script into a computable expression; a computing module for performing computation according to the computable expression.