Visual configuration generation database code method, system, device, and storage medium
By using a visual configuration method that generates data on the client side and processes it on the server side, the system achieves automated generation and scheduling of database code. This solves the problems of low efficiency and frequent errors in traditional methods, and improves the maintainability and data link management capabilities of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA CICC WEALTH MANAGEMENT SECURITIES CO LTD
- Filing Date
- 2026-01-07
- Publication Date
- 2026-05-19
AI Technical Summary
Traditional database operations are inefficient, have inconsistent coding styles, chaotic scheduling dependencies, and messy log formats. Manual modifications can easily lead to a chain of errors, affecting system stability. Existing visual configuration generation methods lack unified data link management, making problem tracing time-consuming and error-prone.
The client responds to the user's visual configuration operations to generate a structured configuration file. The server generates and stores the target stored procedure data based on the file, including basic business code and log code. The two are associated through a unique configuration ID and are automatically triggered to execute and log, thus realizing data link management.
It improves the maintainability of the database system, increases the efficiency and accuracy of configuration work, reduces the workload of manual coding, ensures the coordination and consistency of business processing, logging and scheduling control, and supports full-link data traceability.
Smart Images

Figure CN121478263B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of database technology, and in particular to a method, system, device, and storage medium for generating database code through visual configuration. Background Technology
[0002] As business complexity increases, database operations account for a growing proportion of business systems. In the traditional model, developers must manually write stored procedures, configure scheduling tasks, and embed logging code. This is not only inefficient but also leads to inconsistent coding styles, chaotic scheduling dependencies, and disorganized log formats. Especially in scenarios with rapid business iterations, manual modifications can easily cause a chain of errors, severely impacting system stability.
[0003] Existing methods for generating database code from visual configurations suffer from fragmented storage of configuration information, generated code, scheduling records, and log data, lacking unified data link management. When business issues arise, manual tracing across systems is required, which is time-consuming and error-prone. Therefore, an improved method for generating database code from visual configurations is needed to enhance system maintainability. Summary of the Invention
[0004] This application provides a method, system, device, and storage medium for generating database code through visual configuration. By generating database code through visual configuration of business processes, scheduling tasks, and log functions, data link management is achieved, thereby improving the maintainability of the system.
[0005] In a first aspect, embodiments of this application provide a method for generating database code through visual configuration, applied to a system for generating database code through visual configuration, the system comprising a client and a server, the method comprising:
[0006] The client responds to the user's visual configuration operation and obtains the structured configuration file corresponding to the visual configuration operation; the structured configuration file is sent to the server; the structured configuration file includes: a unique configuration ID, business rule parameters, scheduling parameters, and log rule parameters;
[0007] After receiving the structured configuration file from the server, the server generates target stored procedure data based on the structured configuration file. The target stored procedure data includes: basic business code and log code. The basic business code and the log code are associated with each other based on the unique configuration ID.
[0008] The target stored procedure data is stored in the target database through the server; the scheduling task corresponding to the target stored procedure data is determined; the execution of the basic business code is triggered according to the execution rules corresponding to the scheduling task, and structured log data is generated through the log code during the execution process.
[0009] Secondly, embodiments of this application provide a visual configuration database code generation system, which includes a client and a server. The system comprises a visual configuration unit, a stored procedure generation unit, and a stored procedure execution unit, wherein:
[0010] The visual configuration unit is used to respond to the user's visual configuration operation through the client, obtain the structured configuration file corresponding to the visual configuration operation, and send the structured configuration file to the server; the structured configuration file includes: unique configuration ID, business rule parameters, scheduling parameters, and log rule parameters;
[0011] The stored procedure generation unit is used to receive the structured configuration file from the server and generate target stored procedure data based on the structured configuration file; the target stored procedure data includes: basic business code and log code; the basic business code and the log code are associated with each other based on the unique configuration ID;
[0012] The stored procedure execution unit is used to store the target stored procedure data in the target database through the server; determine the scheduling task corresponding to the target stored procedure data; trigger the execution of the basic business code according to the execution rules corresponding to the scheduling task; and generate structured log data through the log code during the execution process.
[0013] Thirdly, embodiments of this application provide an electronic device, including: a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing the steps in the first aspect of embodiments of this application.
[0014] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in the first aspect of embodiments of this application.
[0015] Fifthly, embodiments of this application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the first aspect of embodiments of this application. The computer program product may be a software installation package.
[0016] It can be seen that the embodiments of this application have the following beneficial effects:
[0017] By implementing the embodiments of this application, a structured configuration file corresponding to a user's visual configuration operation is obtained through a client response; the structured configuration file is then sent to a server; the structured configuration file includes: a unique configuration ID, business rule parameters, scheduling parameters, and log rule parameters; after receiving the structured configuration file, the server generates target stored procedure data based on the structured configuration file; the target stored procedure data includes: basic business code and log code; the basic business code and the log code are mutually associated based on the unique configuration ID; the server stores the target stored procedure data in a target database; a scheduling task corresponding to the target stored procedure data is determined; the execution of the basic business code is triggered according to the execution rules corresponding to the scheduling task, and structured log data is generated through the log code during the execution process. It is evident that by generating database code for data link management through visual configuration of business processes, scheduling tasks, and log functions, the maintainability of the system is improved. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.
[0019] Figure 1 This is a flowchart illustrating a method for generating database code through visual configuration, as provided in an embodiment of this application.
[0020] Figure 2 This is a system architecture diagram of a visual configuration-based database code generation system provided in an embodiment of this application;
[0021] Figure 3 This is a schematic diagram of a visual interface provided in an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of stored procedure data provided in an embodiment of this application;
[0023] Figure 5 This is a schematic diagram of a task scheduling and log generation process provided in an embodiment of this application;
[0024] Figure 6 This is a schematic diagram illustrating a scenario of a method for generating database code through visual configuration, as provided in an embodiment of this application.
[0025] Figure 7 This is a schematic diagram of the structure of a visual configuration-based database code generation system provided in an embodiment of this application;
[0026] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0028] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0029] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0030] The following describes the relevant content, concepts, meanings, technical issues, technical solutions, and beneficial effects involved in the embodiments of this application.
[0031] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for generating database code through visual configuration, provided in an embodiment of this application. The method is applied to a system for generating database code through visual configuration, which includes a client and a server. The method includes, but is not limited to, the following steps:
[0032] S101. The client responds to the user's visual configuration operation to obtain the structured configuration file corresponding to the visual configuration operation; the structured configuration file is sent to the server; the structured configuration file includes: unique configuration ID, business rule parameters, scheduling parameters, and log rule parameters.
[0033] In this embodiment of the application, the visual configuration database code generation system is a system used to automatically generate database-related code through visual configuration. Its core components include a client and a server. The client is mainly used to provide users with an interactive interface for visual configuration. Subsequently, log retrieval operations can be performed based on the provided log retrieval interactive interface. The server is used for configuration data parsing, code generation, and other tasks.
[0034] Please see Figure 2 , Figure 2 This is a system architecture diagram of a visual configuration database code generation system provided in an embodiment of this application. As shown in the figure, the visual configuration database code generation system adopts a client-server architecture. The server can receive structured configuration files sent by the client, generate database code, and provide feedback on the results. The client provides a visual interface that supports users in performing visual configuration operations and log retrieval operations. The visual configuration operations include configuring business rule parameters, scheduling parameters, log rule parameters, and other parameters. After the user initiates an operation through the client's visual interface, the client and server interact to implement processes such as uploading configuration data, downloading code generation results, and returning log retrieval results.
[0035] In a specific embodiment, the client responds to the user-initiated visual configuration operation, which is a series of configuration behaviors performed by the user in the client's visual interface, such as selecting source data table information, setting the field mapping relationship of the target data table, configuring the time period for task execution, and determining the log business dimensions to be recorded.
[0036] Based on the user's configuration operations, the client automatically generates the corresponding structured configuration file. Within this structured configuration file, a unique configuration ID is automatically assigned by the system to uniquely identify the configuration file, which can be used for data association and traceability in subsequent code generation, task scheduling, logging, and other stages. Business rule parameters are a set of parameters defining the core logic of database operations, including data extraction conditions and data processing modes. Scheduling parameters specify the timing and dependencies of task execution, such as task execution cycle, task start time, other dependent prerequisite tasks, and dependency conditions. Log rule parameters specify the content and format of log records, such as the business date and business code to be recorded.
[0037] After the structured configuration file is generated, the client sends the file to the server so that the server can generate database code based on the structured configuration file.
[0038] It is evident that obtaining structured configuration files through client-side visual operations and sending them to the server reduces the technical barrier for user configuration operations, eliminating the need for users to manually write complex configuration scripts. On the other hand, it ensures the integrity and standardization of configuration information, effectively improving the efficiency and accuracy of early-stage database development configuration work.
[0039] Optionally, the client includes a visual interface; the visual interface includes: a business rule configuration box, a scheduling parameter configuration box, and a log rule configuration box; the above step: by responding to the user's visual configuration operation through the client, the structured configuration file corresponding to the visual configuration operation is obtained, which may specifically include the following steps:
[0040] A101. The step of obtaining the structured configuration file corresponding to the visual configuration operation by responding to the user's visual configuration operation through the client includes:
[0041] A102. In response to the user's operation on the business rule configuration box, determine the business rule parameters; the business rule parameters include: source data table information, field combination, filtering conditions, target data table information, field mapping relationship, and data processing mode;
[0042] A103. In response to the user's operation on the scheduling parameter configuration box, determine the scheduling parameters; the scheduling parameters include: task execution cycle, task start time, task end time, dependent process, and dependent conditions.
[0043] A104. In response to the user's operation on the log rule configuration box, determine the log rule parameters; the log rule parameters include: business date, business code, and execution status.
[0044] A105. Generate the structured configuration file including the unique configuration ID based on the business rule parameters, the scheduling parameters, and the log rule parameters.
[0045] In this embodiment, the visual interface includes: a business rule configuration box, a scheduling parameter configuration box, and a log rule configuration box. These three boxes are interactive areas within the client's visual interface used to configure business rules, scheduling rules, and log rules, respectively.
[0046] Please see Figure 3 , Figure 3This is a schematic diagram of a visual interface provided in an embodiment of this application. As shown in the figure, this visual interface is used to generate a structured configuration file in response to the user's visual configuration operations. The visual interface includes a business rule configuration box, a scheduling parameter configuration box, and a log rule configuration box. Users can configure business rule parameters, scheduling parameters, and log rule parameters respectively by interacting with the above three configuration boxes. After the user completes the operation of each configuration box, the client automatically generates a structured configuration file based on the configured business rule parameters, scheduling parameters, and log rule parameters. This structured configuration file contains a unique configuration ID and is used for subsequent server database code generation, automatic scheduling, and structured log processing.
[0047] In a specific embodiment, the client responds to user actions in the business rule configuration box to determine business rule parameters, which include: source data table information, field combinations, filtering conditions, target data table information, field mapping relationships, and data processing mode; it also responds to user actions in the scheduling parameter configuration box to determine scheduling parameters, which include: task execution cycle, task start time, task end time, dependent processes, and dependent conditions; and it responds to user actions in the log rule configuration box to determine log rule parameters, which include: business date, business code, and execution status. After obtaining the business rule parameters, scheduling parameters, and log rule parameters, the client generates a structured configuration file containing a unique configuration ID based on these parameters.
[0048] In one possible embodiment, the structured configuration file specifically includes, but is not limited to, the following parameters: Parent level: Parameters for hierarchical organization, used to assemble sub-items of the same parent level together; Category: Includes independent, main item, and sub-item, where independent indicates only one step, main item is used to define parameters at the overall level, and sub-item is used to identify detailed configuration items belonging to the same parent level; Sequence number: Used to determine the order of sub-items; Code: A unique process name used when generating code; Name: The Chinese identifier of the process; Schedule: Start, end time, and interval (day, hour, minute); Dependency conditions: Predefined custom conditions that the scheduled task execution must meet, which can be configured with any SQL query statement with a return value; Dependent processes: Specifies other processes that the scheduled task execution depends on; Schema: The model for generating database code, which can be truncated_insert, incremental_insert, deleted_insert, archive, merge, update, delete, etc.; Source: The user (code, name), table (code, name), and field combination of the source data. Conditions, which can be combined statements; Target: User (code, name), table (code, name), and field combination of target data; Incremental Conditions: Define the conditions for incremental data filtering; Merge Join: Define the join statement for merge-type statements; Update Statement: Define the update statement content for update-type and merge-type operations; Update Conditions: Define the conditions for data updates when the mode is update or merge; Parallelism: The degree of parallelism during querying and data operations; Run Start Time: The start time of the most recent run of the process; Run End Time: The end time of the most recent run of the process; Run Time: The run time of the most recent run of the process; Run Result: The result of the most recent run of the process; Run Status: The status of the most recent run of the process; Write Log: Whether to record run logs, selectable yes or no; Automatic Statement Optimization: Whether to automatically optimize the generated database statements, selectable yes or no; Compile to Database: Whether to compile code directly from the front end to the database; Status: Indicates the validity of the configuration, selectable valid or invalid; Remarks: Provide supplementary explanations for the configuration.
[0049] As can be seen, by responding to user operations through multiple configuration boxes in the client's visual interface to determine parameters in various dimensions and generate structured configuration files, users can complete complex database code generation and configuration in an intuitive and convenient way. This ensures the comprehensiveness and accuracy of configuration parameters, covering various needs such as business logic, scheduling logic, and logging logic, while also reducing the technical threshold for configuration operations and improving the efficiency and standardization of configuration work.
[0050] S102. After receiving the structured configuration file through the server, target stored procedure data is generated according to the structured configuration file; the target stored procedure data includes: basic business code and log code; the basic business code and the log code are associated with each other based on the unique configuration ID.
[0051] In this embodiment, the target stored procedure data is a set of code generated by the server based on a structured configuration file, which can be directly used for database execution and integrates relevant code for business processing, logging, and scheduling control. Specifically, the target stored procedure data includes: basic business code and log code, wherein the basic business code is used to implement core business processing; and the log code is used to record key information during business execution.
[0052] In a specific embodiment, after receiving the structured configuration file sent by the client, the server first parses the configuration file to extract business rule parameters, log rule parameters, scheduling parameters, and a unique configuration ID. Based on the parsed business rule parameters, the server can generate basic business code, and based on the log rule parameters, it can generate log code.
[0053] During the generation of basic business code and log code, the server embeds a unique configuration ID into the metadata of each type of code, enabling the basic business code and log code to establish a relationship through this unique configuration ID, ultimately forming the target stored procedure data.
[0054] Please see Figure 4 , Figure 4 This is a schematic diagram of a stored procedure data provided in an embodiment of this application. As shown in the figure, the stored procedure data consists of a variable declaration segment, a dependency verification segment, a business logic segment, a log embedding segment, a scheduling task segment, and an exception handling segment. Each segment is associated through a unique configuration ID to form a traceable integrated code unit.
[0055] The variable declaration section is used to define temporary variables required during execution, such as dependency state variables for recording the execution status of dependent tasks and business date variables for marking the time dimension of business processing, so as to provide a data storage foundation.
[0056] The dependency validation section is used to verify the status of dependent tasks. Specifically, it queries the status of dependent tasks to determine whether they have been executed successfully. If a dependent task has not been executed successfully, an exception is thrown and logged to ensure that the preset dependency conditions are met before the stored procedure is executed.
[0057] The business logic segment includes core data processing logic, such as multi-source table data extraction, group calculation, and incremental insertion into the target table, to achieve a closed loop of business processing from source data to target data.
[0058] Log embedding segments associate log rule parameters, such as business date and execution status (i.e., business execution status), which can record execution information at key nodes in the execution of business logic.
[0059] The scheduling task segment is associated with scheduling task parameters, such as task start time and execution status (i.e., task execution status), which can deeply integrate the execution timing of stored procedures with scheduling logic.
[0060] The exception handling section is used to capture errors during execution and record exception logs, such as error nodes and error descriptions, to facilitate problem tracing and handling in abnormal scenarios.
[0061] Each segment is associated through a unique configuration ID, ensuring that the generation, execution, and logging of stored procedure data form a traceable closed loop with the original structured configuration file. This not only guarantees the independence and collaboration of each functional module of the stored procedure, but also provides a core identifier for end-to-end data traceability, thereby achieving a closed loop of processes for visual configuration, code generation, automatic scheduling, and log management.
[0062] It is evident that by automatically generating target stored procedure data that integrates basic business code and log code through the server, and achieving precise association between codes based on unique configuration IDs, the consistency of business processing, log recording, and scheduling control logic is ensured. This lays the foundation for subsequent automatic task execution and end-to-end data traceability, while significantly reducing the workload of manually writing and associating code, and improving the efficiency and standardization of database code generation.
[0063] Optionally, the above step of generating target stored procedure data based on the structured configuration file may specifically include the following steps:
[0064] A201. The server generates first stored procedure data according to the business rule parameters; the first stored procedure data is used to characterize the execution code of the basic business; the basic business is the business related to the basic business code;
[0065] A202. Determine the log code according to the log rule parameters, and embed the log code into the first stored procedure data to obtain the target stored procedure data.
[0066] In a specific embodiment, after the server receives and parses the structured configuration file, it first extracts the business rule parameters from the file and generates the first stored procedure data based on these parameters. During the generation process, it strictly follows the core requirements of the source data information, target data information, and data processing mode defined by the business rule parameters to ensure that the basic business execution code contained in the first stored procedure data can accurately realize the expected data processing logic.
[0067] Next, the server extracts the log rule parameters from the structured configuration file, determines the business dimension, format, and trigger node of the log record based on the parameters, generates the corresponding log code, and then embeds the log code into the key execution steps of the first stored procedure data, such as the start of data extraction, the completion of data transformation, and the end of data loading, to form the target stored procedure data, so that the basic business execution and log recording are synchronized.
[0068] It is evident that by generating and embedding various types of code in stages, the independence and accuracy of basic business, logging, and scheduling control functions are ensured, while also achieving deep integration and collaborative relationship among the three, thus avoiding the problem of chaotic and piled-up logic.
[0069] Optionally, the above step of generating first stored procedure data based on the business rule parameters may specifically include the following steps:
[0070] B201. Determine the processing mode in the business rule parameters;
[0071] B202. Obtain a preset database code generation template according to the processing mode;
[0072] B203. Determine the first stored procedure data based on the business rule parameters and the preset database code generation template;
[0073] The step of determining the first stored procedure data based on the business rule parameters and the preset database code generation template includes:
[0074] B2031. Identify the target database type specified in the business rule parameters;
[0075] B2032. Call the corresponding syntax template according to the target database type;
[0076] B2033. Convert the business rule parameters according to the syntax rules corresponding to the target database type to obtain the target fill parameters;
[0077] B2034. Fill the target filling parameters into the reserved parameter positions of the syntax template to obtain the initial stored procedure code;
[0078] B2035. Perform statement optimization on the initial stored procedure code to obtain the first stored procedure data; the statement optimization operation includes at least one of the following: adding index hints, adjusting the SQL execution order.
[0079] In this embodiment, the preset database code generation template is a general code framework pre-stored by the server that corresponds to different data processing modes (such as truncation_insert, incremental_insert, etc.), with the basic business execution logic of the mode built in, and only reserving space to adapt to specific business parameters.
[0080] The target database type refers to the database product category (such as MySQL, Oracle, etc.) specified in the business rule parameters. Different types correspond to different SQL syntax specifications. The syntax template is a code template that matches the syntax rules of a specific database type, ensuring that the generated code can be executed correctly in the target database. Reserved parameter bits are blank spaces in the syntax template set to fill in specific business rule parameters, such as source table names and filter conditions.
[0081] In a specific embodiment, when the server generates the first stored procedure data according to the business rule parameters, it first extracts and determines the processing mode from the business rule parameters. The processing mode clarifies the core method of data processing. For example, incremental insertion means that only data that meets the conditions is added.
[0082] Next, based on the determined processing mode, the server retrieves the corresponding preset database code generation template from the preset template library. This template already contains the general business logic for that processing mode. Based on the business rule parameters and the preset database code generation template, the server further generates the first stored procedure data.
[0083] Specifically, first identify the target database type specified in the business rule parameters, clarify the syntax specifications that the generated code needs to adapt to, and then call the corresponding syntax template pre-stored in the server according to the target database type to ensure that the code syntax meets the requirements of the target database.
[0084] Next, the business rule parameters are converted according to the syntax rules of the target database type to form target fill parameters with a suitable format. Then, the target fill parameters are filled into the reserved parameter positions in the syntax template one by one to generate the initial stored procedure code with complete business logic but without performance optimization.
[0085] Finally, optimize the initial stored procedure code by adding index hints, such as specifying an index for filter condition fields to speed up data retrieval; adjust the SQL execution order, such as filtering data first and then performing table joins, to reduce resource consumption and improve execution efficiency, ultimately obtaining a performance-optimized and executable first stored procedure.
[0086] As can be seen, by matching preset templates according to processing modes, adapting to target database syntax, and optimizing execution statements, it is ensured that the data of the first stored procedure can accurately carry business rules and meet the execution requirements of the target database, while avoiding syntax errors and performance defects in manually written code. At the same time, it greatly simplifies the code generation process and improves the efficiency, accuracy, and execution performance of the first stored procedure generation.
[0087] S103. The target stored procedure data is stored in the target database through the server; the scheduling task corresponding to the target stored procedure data is determined; the execution of the basic business code is triggered according to the execution rules corresponding to the scheduling task, and structured log data is generated through the log code during the execution process.
[0088] In this embodiment of the application, the target database refers to a database used to store target stored procedure data.
[0089] In a specific embodiment, after the server generates the target stored procedure data, it first stores the data in the target database. During the storage process, the integrity and executability of the target stored procedure data are ensured, so that it conforms to the syntax specifications and storage requirements of the target database.
[0090] Next, the server extracts the scheduling task parameters corresponding to the scheduled task, determines the scheduled task corresponding to the target stored procedure data, and determines the execution rules such as the task execution cycle, task start time, dependent processes, and dependent conditions. Then, the server triggers the execution of the basic business code in the target stored procedure data according to the execution rules corresponding to the scheduled task. During the execution of the basic business code, the embedded logging code runs synchronously, recording key information such as business date, business code, execution status, business start time, business end time, and time consumption according to the logging rule parameters. This information is then integrated according to a preset format to generate structured log data, completing the synchronous execution of basic business operations and log recording.
[0091] As can be seen, by storing the target stored procedure data in the target database and automatically determining the scheduling task, triggering execution and generating logs, the entire process from code implementation to business execution and log recording is automated. There is no need for manual intervention in storage, scheduling configuration and log collection, which avoids the inefficiency and error risk caused by manual operation, and also ensures the synchronization and accuracy of basic business execution and log recording.
[0092] Please see Figure 5 , Figure 5 This is a schematic diagram of a task scheduling and log generation process provided in an embodiment of this application. Optionally, the above steps: triggering the execution of the basic business code according to the execution rules corresponding to the scheduled task, and generating structured log data through the log code during the execution process, may specifically include the following steps:
[0093] A301. When the scheduled task meets the preset execution conditions, a stored procedure execution instruction is sent to the target database to trigger the execution of the basic business code in the target stored procedure data; the preset execution conditions include that the task start time of the scheduled task is the execution time of the task execution cycle, and the stored procedure data in the dependent process has been successfully executed;
[0094] A302. During the execution of the basic business code, the execution of the log code in the target stored procedure data is triggered to obtain log information; the log information includes: the execution status of the basic business code, business dimension information, business start time, business end time, and time consumed;
[0095] A303. Generate structured log data from the log information according to a preset log format; the structured log data includes the unique configuration ID.
[0096] In this embodiment, the preset scheduling engine is a dedicated scheduling component pre-deployed in the server, used to query scheduling tasks, determine execution conditions, and send execution instructions. It is the core module for managing the entire lifecycle of scheduling tasks.
[0097] The preset execution conditions are the preset criteria for triggering the execution of scheduled tasks. Both the dependency conditions and the successful execution of the dependency process must be met simultaneously.
[0098] The default log format is a structured format pre-defined by the server to organize log information under normal execution scenarios. It specifies the order and data type of log fields. If the basic business code executes normally, the default log format may only include basic log information, such as execution result, result description, business start time, business end time, and time consumed. If an exception occurs during the execution of the basic business code, the default log format may also include exception log information, such as exception execution result and exception result description.
[0099] In a specific embodiment, the server can execute the scheduling task corresponding to the target stored procedure data through a preset scheduling engine. Specifically, the server uses the preset scheduling engine to query the scheduling task parameters based on the unique configuration ID, and extracts information such as the task execution cycle, task start time, dependent processes, and dependent conditions to determine the corresponding scheduling task, ensuring that the scheduling task is accurately associated with the target stored procedure data.
[0100] The preset scheduling engine continuously monitors the execution conditions of scheduled tasks. When it detects that the task start time of a scheduled task has reached the preset execution time within the task execution cycle, the dependency conditions in the scheduled task are met, and the stored procedure data in the dependency process has been successfully executed by querying through the unique configuration ID, it is determined that the preset execution conditions are met. At this time, a stored procedure execution instruction is sent to the target database to trigger the basic business code in the target stored procedure data to start execution.
[0101] During the execution of the basic business code, the embedded logging code is triggered synchronously to collect and record in real time the execution status of the basic business code (such as success or failure), business dimension information (such as business date and business code), business start time, business end time, and time consumption, etc.
[0102] The server integrates the collected normal log information according to a preset log format, generating structured log data containing a unique configuration ID to ensure that the logs are traceable to the corresponding configuration and code. It should be noted that if an exception occurs during the execution of the basic business code, the logging code will automatically capture the exception details (such as the error node and the error cause) and generate exception log information, and then generate structured log data according to a preset log format.
[0103] It is evident that by using a pre-defined scheduling engine to automate the management of scheduled tasks, combined with clear execution conditions and differentiated log formats, it not only ensures that the basic business code is executed accurately as expected, but also ensures that the log data structure is consistent and carries key traceability identifiers in different execution scenarios.
[0104] Optionally, the method further includes the following steps:
[0105] B301. The client responds to the user's log retrieval operation and sends retrieval conditions to the server.
[0106] B302. The server filters the structured log data from the preset structured log database according to the search conditions, associates the configuration file and stored procedure corresponding to the structured log data, obtains the associated query results, and returns the associated query results to the client; the preset structured log database is used to store structured log data.
[0107] In this embodiment, the preset structured log database is a database pre-deployed on the server for centralized storage of generated structured log data. Its data storage format is compatible with the field structure of the structured log data, and it can support quick filtering of log data according to multi-dimensional search conditions, providing a data storage foundation for log retrieval and related queries.
[0108] In a specific embodiment, when a user needs to retrieve log data, the client responds to the log retrieval operation initiated by the user. Specifically, the user enters or selects retrieval conditions in the client's log retrieval interface, such as business date, business code, execution status, source table information, etc. The client encapsulates the retrieval conditions determined by the user and sends them to the server.
[0109] After receiving the search criteria, the server queries and filters the pre-defined structured log database based on these criteria, retrieving structured log data that meets the conditions. Since each structured log data carries a unique configuration ID, the server uses this unique configuration ID to retrieve the corresponding structured configuration file from the configuration database and the corresponding target stored procedure data from the code database. The filtered structured log data is then integrated with the associated configuration file and stored procedure data to form a related query result.
[0110] Finally, the server sends the associated query result back to the client, which displays the result through a visual interface. Users can directly view log details, corresponding configuration information, and stored procedure code in the interface without needing to switch between systems.
[0111] As can be seen, the process of initiating a search request by the client, executing filtering and related queries by the server, and returning the results enables one-click related queries of log data with configuration files and stored procedures, solving the problem that traditional log retrieval can only filter by file name and time and cannot link configuration and code.
[0112] Optionally, the search criteria include at least one business dimension filter item, each of which includes: business date, source table name, target table name, and business execution status; the above steps: the server filters the structured log data from the preset structured log database according to the search criteria, and associates the configuration files and stored procedures corresponding to the structured log data to obtain the associated query results, which may specifically include the following steps:
[0113] C301. Based on the search criteria, traverse the preset structured log database and filter out the structured log data that meets the search criteria; the structured log data includes the unique configuration ID;
[0114] C302. Obtain the structured configuration file and the target stored procedure corresponding to the unique configuration ID;
[0115] C303. Integrate the structured log data, the structured configuration file, and the target stored procedure according to the preset hierarchical structure to generate related query results.
[0116] In this embodiment, the business dimension filtering item is a specific condition item used to filter structured log data from a business perspective. Each filtering item corresponds to a key business attribute in the log record, which can accurately locate logs related to a specific business scenario.
[0117] The preset hierarchical structure is a predefined information organization format of the server, usually arranged in a logical hierarchy of log details, associated configurations, and associated code, to clearly and orderly display the integrated information.
[0118] In a specific embodiment, after receiving the search criteria sent by the client, the server receives the search criteria, which include at least one business dimension filter item. Each business dimension filter item includes: business date, source table name, target table name, and business execution status. Based on these filter items, the server traverses a preset structured log database, compares the corresponding business attributes of each structured log data in the database one by one, and filters out all structured log data that meet the criteria. Each structured log data carries a unique configuration ID.
[0119] Next, the server uses a unique configuration ID as the retrieval identifier to retrieve the corresponding structured configuration file from the configuration database and the corresponding target stored procedure from the code database, ensuring that it obtains configuration information and code data directly associated with the structured log data.
[0120] Finally, the server integrates the structured log data, the corresponding structured configuration files, and the target stored procedures according to the preset hierarchical structure, so that the log details are the top-level information and the configuration files and stored procedures are the lower-level related information, forming a logically coherent related query result. This process relies on a unique configuration ID to achieve accurate association of data at each stage.
[0121] As can be seen, the target log can be quickly located by filtering by business dimensions. Combined with the unique configuration ID, the log is automatically associated with the configuration and code. The results are then integrated according to the preset hierarchical structure. This not only solves the inefficiency of traditional logs that can only be searched by file name and time, but also avoids the cumbersome operation of users querying related data across systems, greatly improving the efficiency of log retrieval and problem location.
[0122] Please see Figure 6 , Figure 6 This is a schematic diagram of a scenario for a method to generate database code through visual configuration provided in an embodiment of this application. As shown in the figure, the scenario process presents a closed loop of the entire chain, from configuring parameters to generating code, to automatic scheduling and execution, and finally to log retrieval and tracing.
[0123] First, users can perform configuration parameter operations through the client-side visual interface of the database code generation system, complete the setting of business rule parameters, scheduling parameters, and log rule parameters, and generate a structured configuration file with a unique configuration ID.
[0124] Next, the server receives the structured configuration file, generates a stored procedure containing basic business code based on the business rule parameters therein, embeds the log code corresponding to the log rule parameters, and forms executable stored procedure data, which is the code generation stage.
[0125] Subsequently, the server's scheduling engine automatically triggers the execution of basic business code according to the scheduling task parameters and preset execution rules, i.e., automatic scheduling. During the execution process, the log code runs synchronously, generating structured log data with a unique configuration ID and storing it in the log database.
[0126] Finally, users can initiate log retrieval operations through the client. The server filters structured log data from the log database according to the retrieval criteria, associates it with the corresponding structured configuration files and stored procedure data, and returns the association results to the client.
[0127] In summary, by implementing the embodiments of this application, the client responds to the user's visual configuration operation to obtain the structured configuration file corresponding to the visual configuration operation; the structured configuration file is sent to the server; the structured configuration file includes: a unique configuration ID, business rule parameters, scheduling parameters, and log rule parameters; after receiving the structured configuration file, the server generates target stored procedure data based on the structured configuration file; the target stored procedure data includes: basic business code and log code; the basic business code and the log code are mutually associated based on the unique configuration ID; the server stores the target stored procedure data in the target database; the scheduling task corresponding to the target stored procedure data is determined; the execution of the basic business code is triggered according to the execution rules corresponding to the scheduling task, and structured log data is generated through the log code during the execution process. It is evident that by generating database code for data link management through visual configuration of business operations, scheduling tasks, and log functions, the maintainability of the system is improved.
[0128] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a visual configuration database code generation system provided in an embodiment of this application. The visual configuration database code generation system 700 includes a client and a server, and includes: a visual configuration unit 701, a stored procedure generation unit 702, and a stored procedure execution unit 703, wherein:
[0129] The visualization configuration unit 701 is used to respond to the user's visualization configuration operation through the client, obtain the structured configuration file corresponding to the visualization configuration operation, and send the structured configuration file to the server; the structured configuration file includes: unique configuration ID, business rule parameters, scheduling parameters, and log rule parameters;
[0130] The stored procedure generation unit 702 is used to receive the structured configuration file from the server and generate target stored procedure data based on the structured configuration file; the target stored procedure data includes: basic business code and log code; the basic business code and the log code are associated with each other based on the unique configuration ID;
[0131] The stored procedure execution unit 703 is used to store the target stored procedure data in the target database through the server; determine the scheduling task corresponding to the target stored procedure data; trigger the execution of the basic business code according to the execution rules corresponding to the scheduling task; and generate structured log data through the log code during the execution process.
[0132] Optionally, the client includes a visual interface; the visual interface includes: a business rule configuration box, a scheduling parameter configuration box, and a log rule configuration box;
[0133] In terms of obtaining the structured configuration file corresponding to the visual configuration operation by responding to the user's visual configuration operation through the client, the visual configuration unit 701 is further specifically used for:
[0134] In response to the user's operation on the business rule configuration box, the business rule parameters are determined; the business rule parameters include: source data table information, field combination, filtering conditions, target data table information, field mapping relationship, and data processing mode;
[0135] In response to the user's operation on the scheduling parameter configuration box, the scheduling parameters are determined; the scheduling parameters include: task execution cycle, task start time, task end time, dependent process, and dependent conditions;
[0136] In response to the user's operation on the log rule configuration box, the log rule parameters are determined; the log rule parameters include: business date, business code, and execution status.
[0137] Based on the business rule parameters, the scheduling parameters, and the log rule parameters, a structured configuration file including the unique configuration ID is generated.
[0138] Optionally, in generating the target stored procedure data according to the structured configuration file, the stored procedure generation unit 702 is further specifically used for:
[0139] The server generates first stored procedure data based on the business rule parameters; the first stored procedure data is used to characterize the execution code of the basic business; the basic business is the business related to the basic business code;
[0140] The log code is determined based on the log rule parameters, and the log code is embedded into the first stored procedure data to obtain the target stored procedure data.
[0141] Optionally, in generating the first stored procedure data according to the business rule parameters, the stored procedure generation unit 702 is further specifically used for:
[0142] Determine the processing mode in the business rule parameters;
[0143] A preset database code generation template is obtained according to the processing mode;
[0144] The first stored procedure data is determined based on the business rule parameters and the preset database code generation template;
[0145] The step of determining the first stored procedure data based on the business rule parameters and the preset database code generation template includes:
[0146] Identify the target database type specified in the business rule parameters;
[0147] Call the corresponding syntax template based on the target database type;
[0148] The business rule parameters are converted according to the syntax rules corresponding to the target database type to obtain the target fill parameters;
[0149] The target filling parameters are filled into the reserved parameter positions of the syntax template to obtain the initial stored procedure code;
[0150] The initial stored procedure code is optimized to obtain the first stored procedure data; the optimization operation includes at least one of the following: adding index hints and adjusting the SQL execution order.
[0151] Optionally, in triggering the execution of the basic business code according to the execution rules corresponding to the scheduling task, and generating structured log data through the log code during execution, the stored procedure execution unit 703 is further specifically used for:
[0152] When the scheduled task meets the preset execution conditions, a stored procedure execution instruction is sent to the target database to trigger the execution of the basic business code in the target stored procedure data; the preset execution conditions include that the task start time of the scheduled task is the execution time of the task execution cycle, and the stored procedure data in the dependent process has been successfully executed;
[0153] During the execution of the basic business code, the execution of the log code in the target stored procedure data is triggered to obtain log information; the log information includes: the execution status of the basic business code, business dimension information, business start time, business end time, and time consumed;
[0154] The log information is used to generate structured log data according to a preset log format; the structured log data includes the unique configuration ID.
[0155] Optionally, the visual configuration generation database code system 700 is further specifically used for:
[0156] The client responds to the user's log retrieval operation and sends retrieval criteria to the server;
[0157] The server filters the structured log data from a preset structured log database according to the search criteria, associates the configuration files and stored procedures corresponding to the structured log data, obtains the associated query results, and returns the associated query results to the client; the preset structured log database is used to store structured log data.
[0158] Optionally, the search criteria include at least one business dimension filter item, and each business dimension filter item includes: business date, source table name, target table name, and business execution status.
[0159] In the process of filtering structured log data from a preset structured log database according to the search criteria via the server, and associating the structured log data with the corresponding configuration files and stored procedures to obtain associated query results, the visual configuration generating database code system 700 is further specifically used for:
[0160] Based on the search criteria, the preset structured log database is traversed to filter out the structured log data that meets the search criteria; the structured log data includes the unique configuration ID;
[0161] Obtain the structured configuration file and the target stored procedure corresponding to the unique configuration ID;
[0162] The structured log data, the structured configuration file, and the target stored procedure are integrated according to a preset hierarchical structure to generate related query results.
[0163] The visual configuration database code generation system 700 described in this application can obtain a structured configuration file corresponding to a user's visual configuration operation via a client; send the structured configuration file to a server; the structured configuration file includes: a unique configuration ID, business rule parameters, scheduling parameters, and log rule parameters; after receiving the structured configuration file, the server generates target stored procedure data based on the structured configuration file; the target stored procedure data includes: basic business code and log code; the basic business code and the log code are associated with each other based on the unique configuration ID; the server stores the target stored procedure data in a target database; determines the scheduling task corresponding to the target stored procedure data; triggers the execution of the basic business code according to the execution rules corresponding to the scheduling task, and generates structured log data through the log code during the execution process. It is evident that by generating database code through visual configuration business operations, scheduling tasks, and log functions for data link management, the maintainability of the system is improved.
[0164] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include a processor, a memory, a communication interface, and one or more programs. The processor, memory, and communication interface can be interconnected via a bus. The one or more programs are stored in the memory and configured to be executed by the processor. In this embodiment, the programs include instructions for performing the following steps:
[0165] The client responds to the user's visual configuration operation and obtains the structured configuration file corresponding to the visual configuration operation; the structured configuration file is sent to the server; the structured configuration file includes: unique configuration ID, business rule parameters, scheduling parameters, and log rule parameters;
[0166] After receiving the structured configuration file from the server, the server generates target stored procedure data based on the structured configuration file. The target stored procedure data includes: basic business code and log code. The basic business code and the log code are associated with each other based on the unique configuration ID.
[0167] The target stored procedure data is stored in the target database through the server; the scheduling task corresponding to the target stored procedure data is determined; the execution of the basic business code is triggered according to the execution rules corresponding to the scheduling task, and structured log data is generated through the log code during the execution process.
[0168] The electronic device described in this application can obtain a structured configuration file corresponding to a user's visual configuration operation via a client; send the structured configuration file to a server; the structured configuration file includes: a unique configuration ID, business rule parameters, scheduling parameters, and log rule parameters; after receiving the structured configuration file, the server generates target stored procedure data based on the structured configuration file; the target stored procedure data includes: basic business code and log code; the basic business code and the log code are associated with each other based on the unique configuration ID; the server stores the target stored procedure data in a target database; determines the scheduling task corresponding to the target stored procedure data; triggers the execution of the basic business code according to the execution rules corresponding to the scheduling task, and generates structured log data through the log code during the execution process. It is evident that by generating database code for data link management through visual configuration of business operations, scheduling tasks, and log functions, the maintainability of the system is improved.
[0169] This application also provides a computer-readable storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any of the methods described in the above method embodiments, wherein the computer includes an electronic device.
[0170] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer may include an electronic device.
[0171] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
[0172] The steps of the methods or algorithms described in the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in RAM, flash memory, ROM, EPROM, electrically erasable programmable read-only memory (EEPROM), registers, hard disk, portable hard disk, read-only optical disk (CD-ROM), or any other form of storage medium well known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and storage medium can reside in an ASIC. Furthermore, the ASIC can reside in a terminal device or management device. Alternatively, the processor and storage medium can exist as discrete components in the terminal device or management device.
[0173] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in the embodiments of this application can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0174] The modules / units included in the various devices and products described in the above embodiments can be software modules / units, hardware modules / units, or a combination of both. For example, for devices and products applied to or integrated into a chip, all modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs that run on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits. For devices and products applied to or integrated into a chip module, all modules / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The implementation is achieved through a software program that runs on the processor integrated within the chip module. The remaining modules / units (if any) can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into terminal equipment, each of their modules / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components within the terminal equipment. Alternatively, at least some modules / units can be implemented through a software program that runs on the processor integrated within the terminal equipment, while the remaining modules / units (if any) can be implemented using hardware methods such as circuits.
[0175] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above descriptions are merely specific embodiments of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.
Claims
1. A method for generating database code through visual configuration, characterized in that, A method for generating database code through visual configuration, the system comprising a client and a server, includes the following: The client responds to the user's visual configuration operation and obtains the structured configuration file corresponding to the visual configuration operation; the structured configuration file is sent to the server; the structured configuration file includes: a unique configuration ID, business rule parameters, scheduling parameters, and log rule parameters; After receiving the structured configuration file from the server, the server generates target stored procedure data based on the structured configuration file. The target stored procedure data includes: basic business code and log code. The basic business code and the log code are associated with each other based on the unique configuration ID. The target stored procedure data is stored in the target database through the server; the scheduling task corresponding to the target stored procedure data is determined; the execution of the basic business code is triggered according to the execution rules corresponding to the scheduling task, and structured log data is generated through the log code during the execution process; wherein, the target database refers to the database used to store the target stored procedure data, and the integrity and executability of the target stored procedure data are ensured during the storage process, so that it conforms to the syntax specifications and storage requirements of the target database; The step of generating target stored procedure data based on the structured configuration file includes: The server generates first stored procedure data based on the business rule parameters; the first stored procedure data is used to characterize the execution code of the basic business; the basic business is the business related to the basic business code; The log code is determined based on the log rule parameters, and the log code is embedded into the first stored procedure data to obtain the target stored procedure data.
2. The method as described in claim 1, characterized in that, The client includes a visual interface; the visual interface includes: a business rule configuration box, a scheduling parameter configuration box, and a log rule configuration box; The step of responding to the user's visual configuration operation through the client to obtain the structured configuration file corresponding to the visual configuration operation includes: In response to the user's operation on the business rule configuration box, the business rule parameters are determined; the business rule parameters include: source data table information, field combination, filtering conditions, target data table information, field mapping relationship, and data processing mode; In response to the user's operation on the scheduling parameter configuration box, the scheduling parameters are determined; the scheduling parameters include: task execution cycle, task start time, task end time, dependent process, and dependent conditions; In response to the user's operation on the log rule configuration box, the log rule parameters are determined; the log rule parameters include: business date, business code, and execution status. Based on the business rule parameters, the scheduling parameters, and the log rule parameters, a structured configuration file including the unique configuration ID is generated.
3. The method as described in claim 1, characterized in that, The step of generating the first stored procedure data according to the business rule parameters includes: Determine the processing mode in the business rule parameters; A preset database code generation template is obtained according to the processing mode; The first stored procedure data is determined based on the business rule parameters and the preset database code generation template; The step of determining the first stored procedure data based on the business rule parameters and the preset database code generation template includes: Identify the target database type specified in the business rule parameters; Call the corresponding syntax template based on the target database type; The business rule parameters are converted according to the syntax rules corresponding to the target database type to obtain the target fill parameters; The target filling parameters are filled into the reserved parameter positions of the syntax template to obtain the initial stored procedure code; The initial stored procedure code is optimized to obtain the first stored procedure data; the optimization operation includes at least one of the following: adding index hints and adjusting the SQL execution order.
4. The method as described in claim 2, characterized in that, The step of triggering the execution of the basic business code according to the execution rules corresponding to the scheduled task, and generating structured log data through the log code during the execution process, includes: When the scheduled task meets the preset execution conditions, a stored procedure execution instruction is sent to the target database to trigger the execution of the basic business code in the target stored procedure data; the preset execution conditions include that the task start time of the scheduled task is the execution time of the task execution cycle, and the stored procedure data in the dependent process has been successfully executed; During the execution of the basic business code, the execution of the log code in the target stored procedure data is triggered to obtain log information; the log information includes: the execution status of the basic business code, business dimension information, business start time, business end time, and time consumed; The log information is used to generate structured log data according to a preset log format; the structured log data includes the unique configuration ID.
5. The method as described in claim 1, characterized in that, The method further includes: The client responds to the user's log retrieval operation and sends retrieval criteria to the server; The server filters the structured log data from a preset structured log database according to the search criteria, associates the configuration files and stored procedures corresponding to the structured log data, obtains the associated query results, and returns the associated query results to the client; the preset structured log database is used to store structured log data.
6. The method as described in claim 5, characterized in that, The search criteria include at least one business dimension filter item, and each business dimension filter item includes: business date, source table name, target table name, and business execution status. The step of filtering structured log data from a preset structured log database based on the search criteria by the server, and associating the structured log data with the corresponding configuration files and stored procedures to obtain associated query results includes: Based on the search criteria, the preset structured log database is traversed to filter out the structured log data that meets the search criteria; the structured log data includes the unique configuration ID; Obtain the structured configuration file and the target stored procedure corresponding to the unique configuration ID; The structured log data, the structured configuration file, and the target stored procedure are integrated according to a preset hierarchical structure to generate related query results.
7. A visual configuration-based database code generation system, used to execute the method as described in any one of claims 1-6, characterized in that, The visual configuration database code generation system includes a client and a server. The system further includes a visual configuration unit, a stored procedure generation unit, and a stored procedure execution unit, wherein: The visual configuration unit is used to respond to the user's visual configuration operation through the client, obtain the structured configuration file corresponding to the visual configuration operation, and send the structured configuration file to the server; the structured configuration file includes: unique configuration ID, business rule parameters, scheduling parameters, and log rule parameters; The stored procedure generation unit is used to receive the structured configuration file from the server and generate target stored procedure data based on the structured configuration file; the target stored procedure data includes: basic business code and log code; the basic business code and the log code are associated with each other based on the unique configuration ID; The stored procedure execution unit is used to store the target stored procedure data in the target database through the server; determine the scheduling task corresponding to the target stored procedure data; trigger the execution of the basic business code according to the execution rules corresponding to the scheduling task; and generate structured log data through the log code during the execution process.
8. An electronic device, characterized in that, include: Processor, memory, communication interface, and one or more programs; The one or more programs are stored in the memory and configured to be executed by the processor, the programs including instructions for performing the steps of the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1-6.