A rule generation method based on Vue
By using a Vue-based rule generation method, the problem of mental burden and lack of flexibility for ordinary users when using Cron rule generators is solved. It enables intuitive management and efficient configuration of scheduled tasks, supports custom rule editing and real-time preview, and improves configuration efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INSPUR SOFTWARE CO LTD
- Filing Date
- 2026-01-20
- Publication Date
- 2026-05-26
AI Technical Summary
In existing technologies, ordinary non-technical personnel face problems such as heavy mental burden and poor flexibility when using Cron rule generators, making it difficult to meet actual usage needs.
This rule generator is developed using Vue and Element components. It leverages Vue's reactive system and Composition API to allow users to customize rule parameters through a graphical interface. It supports custom rule editing and validation, provides real-time preview and user guidance, and achieves highly cohesive and loosely coupled component-based development.
By transforming complex Cron rule syntax into intuitive operations, ordinary users can manage scheduled tasks securely and efficiently, enabling an agile operation model directly driven by business needs and improving configuration efficiency and accuracy.
Smart Images

Figure CN122086394A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of thread pool resource scheduling technology, and in particular to a rule generation method based on Vue. Background Technology
[0002] In the field of computer task scheduling today, Cron rule generation plays a crucial role. It's a process of creating time-scheduling expressions that conform to standard syntax, using automated tools or interactive interfaces, with the aim of precisely controlling the execution cycle of computer tasks. Essentially, this process transforms everyday timed needs, such as "every day at 3 AM," into a specific string format that machines can parse, such as "0 3 * * *".
[0003] While Cron's syntax and rule implementation is relatively mature, variations exist across different applications. Crontab generators, as auxiliary tools, merely address rule calculation in a simple way. With the advent of the cloud era, new solutions have emerged, such as more specialized Kubernetes CronJob and serverless scheduled tasks, offering different approaches to task scheduling.
[0004] However, current rule generators for general non-technical users still incur significant hidden costs. The most critical issue is the cognitive burden on users. General non-technical users are often unfamiliar with Cron rule syntax, but existing components either directly expose technical details like "* / 5," leaving non-technical personnel confused, or they hide these rules too deeply, resulting in a lack of flexibility in configuration and difficulty in meeting actual usage needs. Therefore, exploring more intelligent and flexible scalable thread pool management methods has become one of the important research directions.
[0005] Based on the above, this invention proposes a rule generation method based on Vue. Summary of the Invention
[0006] To overcome the shortcomings of existing technologies, this invention provides a simple and efficient rule generation method based on Vue.
[0007] This invention is achieved through the following technical solution: A Vue-based rule generation method includes the following steps: Step S1: Develop a rule generator using Vue and Element components; In step S1, props and emits are used to define the data transmission and event sending of the rule generator in order to improve the maintainability and testability of the component. Organize business logic based on Vue's Composition API to enhance code reusability and structural clarity; Use Vue's reactive system for data management to ensure real-time updates and synchronization of component states; When developing the rule generator, we follow the principle of component-based development to achieve high cohesion and low coupling, making it easy to reuse in different projects.
[0008] Step S2: Generate fixed rules and quick-expansion rules through the rule generator, provide custom rule editing, and support any type of rule configuration; In step S2, the rule generator, based on preset time types including seconds, minutes, hours, days, months, weeks, and years, and combined with multiple configuration modes including range, interval, specified, and unlimited, allows users to customize and select configuration rule parameters through a graphical interface, and intelligently generate standard rule expressions.
[0009] In step S2, the rule generator supports users to quickly expand custom rule templates to meet personalized scheduling needs; Supports mutual exclusion logic for day and week fields to avoid conflicts in rule expressions; Provides expression validation functionality to ensure that the generated rule expressions are valid and legal. It supports both manual input and interface configuration, and maintains two-way synchronization.
[0010] Step S3: Parse the generated rule expression, update the view, and populate the form input boxes.
[0011] In step S3, a rule expression is generated by combining the expressions generated from each part of the configuration. The current rule expression is displayed through the input box, and commonly used preset expressions are provided through the drop-down menu on the right for filling in the rules. It supports custom shortcut settings and also allows professional technicians to quickly customize and append rules.
[0012] Based on Vue's core data-driven concept, in step S3, a declarative approach is used to bind the data model and view. When the underlying data model changes, the view is automatically updated to reflect the underlying changes.
[0013] In step S3, conditional rendering is used to dynamically display different configuration panels, providing a real-time preview function, allowing users to view the generated rule expressions and the next execution time during the configuration process; and it has a good user guidance and error prompt mechanism.
[0014] A Vue-based rule generation device includes a memory and a processor; the memory is used to store a computer program, and the processor is used to execute the computer program to implement the above-described method steps.
[0015] A readable storage medium storing a computer program that, when executed by a processor, implements the above-described method steps.
[0016] The beneficial effects of this invention are: the rule generation method based on Vue transforms the originally complex Cron rule syntax into an intuitive operation, allowing ordinary non-technical personnel to manage scheduled tasks safely and efficiently without mastering the Cron rule syntax, and truly realizes an agile operation mode in which business needs directly drive technical execution. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Appendix Figure 1 This is a schematic diagram of the rule generation method based on Vue according to the present invention. Detailed Implementation
[0019] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions in the embodiments of this invention will be clearly and completely described below in conjunction with the embodiments of this invention. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.
[0020] This Vue-based rule generation method includes the following steps: Step S1: Develop a rule generator using Vue and Element components; In step S1, props and emits are used to define the data transmission and event sending of the rule generator in order to improve the maintainability and testability of the component. Organize business logic based on Vue's Composition API to enhance code reusability and structural clarity; Use Vue's reactive system for data management to ensure real-time updates and synchronization of component states; When developing the rule generator, we follow the principle of component-based development to achieve high cohesion and low coupling, making it easy to reuse in different projects.
[0021] Step S2: Generate fixed rules and quick-expand rules through the rule generator, providing rich custom rule editing and supporting any type of rule configuration; In step S2, the rule generator, based on preset time types including seconds, minutes, hours, days, months, weeks, and years, and combined with multiple configuration modes including range, interval, specified, and unlimited, allows users to customize and select configuration rule parameters through a graphical interface, and intelligently generates standard rule expressions to meet most scheduled task scenarios. Completely parse and process special symbols in the rules, such as * (any time), ? (unspecified), L (last day), # (day of the week), - (range), and / (interval).
[0022] In step S2, the rule generator supports users to quickly expand custom rule templates to flexibly meet personalized scheduling needs. Supports mutual exclusion logic for day and week fields to avoid conflicts in regular expressions (e.g., an error is displayed when both day and week are specified). Provides expression validation functionality to ensure that the generated rule expressions are valid and legal. It supports both manual input and interface configuration, and maintains two-way synchronization.
[0023] Step S3: Parse the generated rule expression, update the view, and populate the form input boxes.
[0024] In step S3, a rule expression is generated by combining the expressions generated from each part of the configuration. The current rule expression is displayed through the input box, and commonly used preset expressions are provided through the drop-down menu on the right for filling in the rules. It supports custom shortcut settings and also allows professional technicians to quickly customize and append rules.
[0025] Based on Vue's core data-driven concept, in step S3, a declarative approach is used to bind the data model and view. When the underlying data model changes, the view is automatically updated to reflect the underlying changes.
[0026] In step S3, different configuration panels are dynamically displayed using conditional rendering (e.g., switching by "minute", "hour", "daily", "weekly", "monthly", etc.), providing a real-time preview function, allowing users to view the generated rule expressions and the next execution time during the configuration process; and the interface is user-friendly with a good user guidance and error prompt mechanism.
[0027] This rule generator is ideal for integration into management systems that require configuring scheduled tasks, such as backend management platforms, automated scheduling systems, and operation and maintenance tools. Through a graphical interface, users can easily configure scheduled tasks without needing to understand the complex syntax of rule expressions, while advanced users can still flexibly control the expression content through manual input. Example
[0028] The rule generator implements intelligent scheduled backup management in the data backup system configuration scheme. Specific implementation methods include: 1) Integrate a visual configuration component into the backup management interface, supporting the setting of the "full backup every Sunday at 2 AM" rule by selecting points, and automatically generating the standard expression "0 0 2 ? * 1"; 2) Built-in backup strategy template library, including preset schemes such as full / incremental backup, peak avoidance period, and abnormal retry; 3) A dual-center task distribution mechanism is adopted, with the primary and backup centers automatically executing tasks at off-peak times (primary center 2:00 / backup center 4:00). 4) Monitor task execution status in real time, and automatically retry according to the rule "0 0 / 15 2-3 ? * 1" when failure occurs. Actual deployment tests show that this solution reduces backup task configuration time from 45 minutes to 3 minutes, achieves 100% configuration accuracy, and improves resource utilization by 40%.
[0029] The Vue-based rule generation device includes a memory and a processor; the memory is used to store a computer program, and the processor is used to execute the computer program to implement the above-described method steps.
[0030] The readable storage medium stores a computer program that, when executed by a processor, implements the above-described method steps.
[0031] This Vue-based rule generation method transforms the originally complex Cron rule syntax into an intuitive operation, allowing ordinary non-technical personnel to manage scheduled tasks safely and efficiently without mastering Cron rule syntax. It truly realizes an agile operation model where business needs directly drive technical execution.
[0032] The embodiments described above are merely one specific implementation of the present invention. Ordinary changes and substitutions made by those skilled in the art within the scope of the technical solution of the present invention should be included within the protection scope of the present invention.
Claims
1. A Vue-based rule generation method, characterized by: The method comprises the following steps: Step S1, developing a rule generator using Vue combined with Element components; Step S2, generating fixed rules and fast expansion rules through the rule generator, providing custom rule editing, supporting any type and any type of rule configuration; Step S3, parsing the generated rule expression, updating the view, and filling in the form input box.
2. The Vue-based rule generation method of claim 1, wherein: In step S1, props and emits are used to define data transmission and event sending of the rule generator, to improve maintainability and testability of the component; Based on the Composition API of Vue, the business logic is organized to enhance the reusability and structural clarity of the code; Utilize the reactive system of Vue for data management to ensure real-time updating and synchronization of component state; When developing the rule generator, follow the component development principle to achieve high cohesion and low coupling, making it easy to reuse in different projects.
3. The Vue-based rule generation method of claim 1, wherein: In step S2, the rule generator generates standard rule expressions by customizing configuration rule parameters through a graphical interface according to pre-set time types, including seconds, minutes, hours, days, months, weeks, and years, combined with multiple configuration modes, including range, interval, specified, and unlimited.
4. The Vue-based rule generation method of claim 3, wherein: In step S2, the rule generator supports users to quickly extend custom rule templates to meet individual scheduling needs; Supports mutual exclusion logic for day and week fields to avoid rule expression conflicts; Provide expression verification function to ensure that the generated rule expression is legal and effective; Support both manual input and interface configuration, and maintain bidirectional synchronization.
5. The Vue-based rule generation method of claim 1, wherein: In step S3, the rule expression is generated according to the expression combination generated by each part configuration; Display the current rule expression through the input box, provide common preset expressions through the right drop-down menu, and support custom shortcut settings while supporting professional technicians to quickly customize additional rules.
6. The Vue-based rule generation method of claim 5, wherein: In step S3, use a declarative way to bind data models and views, and automatically update the view when the underlying data model changes to reflect the underlying changes.
7. The Vue-based rule generation method of claim 6, wherein: In step S3, use conditional rendering to dynamically display different configuration panels, provide real-time preview function, support users to view the generated rule expression and the next execution time during configuration process; and have good user guidance and error prompt mechanism. 8.A Vue-based rule generation device, characterized by comprising: A computer program product comprising a memory and a processor, wherein the memory is configured to store a computer program, and the processor is configured to execute the computer program to implement the method of any one of claims 1 to 7.
9. A readable storage medium characterized by: The readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.