Lightweight expression evaluation engine aviator-based holiday calculation method
The vacation calculation method based on the lightweight expression evaluation engine Aviator solves the problem of low efficiency of the existing vacation management system, realizes the electronic processing of the entire process of vacation application, approval and statistics, and improves administrative execution efficiency and user Satisfaction and adapting to rapidly changing business needs.
Patent Information
- Application Number
- CN202410831624.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-10-15
AI Technical Summary
The existing vacation management system lacks intelligent processing, resulting in low efficiency in the vacation application, approval, accounting calibration and statistical processes. It cannot meet the requirements for efficient work, and the process is fixed and cannot be expanded, making it impossible to configure vacation conditions according to management needs.
Adopting a holiday calculation method based on the lightweight expression evaluation engine Aviator, it achieves flexible configuration and rapid calculation of holiday rules by setting preset conditions, editing executable objects, determining holiday priorities, using custom functions and dynamic data processing , supports large integers and precision calculations, and adapts to adjustments and changes in business logic.
It realizes the electronic processing of the whole process of vacation application, approval and statistics, improves administrative execution efficiency, reduces manual operation processes, reduces human errors, improves management efficiency and user satisfaction, supports dynamic rule addition and modification, and adapts to rapidly changing business needs. .
Smart Images

Figure CN118780752A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of expression evaluation engine aviator analysis, and more specifically to a holiday calculation method based on a lightweight expression evaluation engine aviator. Background Art
[0002] In the current work of holiday coordination and management, the holiday application, approval, accounting calibration and statistical processes have not been intelligently processed. Personal holiday information is fragmented, the approval process lacks unified management, and holiday information changes, adjustments, and holiday cancellation accounting cannot be automatically calculated and traced according to variable rules, thus failing to meet the requirements of efficient work.
[0003] The traditional holiday management method is to submit the application manually through a single holiday application process. The application submitted by the applicant is defined as a single action. If the holiday is changed or cancelled due to special circumstances, the cancellation-application-approval process must be repeated first. The holiday statistics across the year need to be manually counted by administrative personnel, which consumes a long working time and has high labor costs.
[0004] At the same time, the process is fixed and cannot be expanded, and holiday conditions cannot be configured according to management needs. The lack of flexibility results in low work efficiency and insufficient user satisfaction, and also causes great difficulties for daily operation and maintenance. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a holiday calculation method based on a lightweight expression evaluation engine aviator, which performs repeated calculations on different variables and outputs the results while supporting large integers and precision calculations, so as to realize rapid modification of rules to adapt to adjustments and changes in business logic.
[0006] In order to solve the above technical problems, the technical solutions adopted by the present invention are as follows.
[0007] The holiday calculation method based on the lightweight expression evaluation engine aviator includes the following steps:
[0008] A. Set preset conditions;
[0009] B. Edit the preset conditions into executable objects;
[0010] C. Determine holiday priorities;
[0011] D. Holiday calculations are performed using the lightweight expression evaluation engine aviator;
[0012] E. Add custom functions to the function library to freely configure holiday rules;
[0013] F. Acquire and process dynamic data through the Aviator engine’s rule set;
[0014] G. Map input data to output results.
[0015] To further optimize the technical solution, in step A, the preset conditions are set by adding defined functions to the aviator's function library by means of preset expressions and operating environment parameters, and calling these functions when they are needed.
[0016] To further optimize the technical solution, in step B, the method for editing the preset conditions into executable objects is to configure the holiday rules. The configured holiday rules are composed of an expression object of the condition part and an expression object of the output part. When the result of the logical expression of the condition part is true, the expression of the output part will be executed, that is, the result of the executable object given under the condition will be output. Otherwise, when the result of the operation is false, the expression of the output part will not be executed.
[0017] To further optimize the technical solution, in step C, the vacation priority is sorted in a manner including user natural attributes-gender or attribute priority and user social attributes-working hours priority.
[0018] To further optimize the technical solution, the user's natural attribute - gender or attribute priority is based on the collected basic user information, and the application conditions of the vacation type are first judged according to the user's gender, and then a second judgment is made according to the user's marital status to generate specific vacations and days.
[0019] To further optimize the technical solution, the user social attribute - working hours priority is to determine the interval of vacation days that the user can enjoy based on the statistical length of service of the user, and then based on the vacation year that the user can choose, finally determine and generate the vacation days and remaining days that the user can choose.
[0020] To further optimize the technical solution, the calculation method in step D is to execute the holiday application conditions according to the established holiday rule priority, perform holiday determination calculations by utilizing the specific personnel information of the holiday type elements, generate a holiday calculation formula to determine the element parameters, input the holiday element parameters into each leave determination condition to calculate the valid holiday entry, comprehensively calculate the valid holiday days of the holiday type based on the number of leave days of the valid holiday entries of the holiday type, generate valid holiday application information, and finally transmit the valid holiday application information to the user terminal.
[0021] To further optimize the technical solution, in step E, the method for freely configuring holiday rules includes the following steps:
[0022] E1. Define the logic that needs custom configuration;
[0023] E2. Register custom functions;
[0024] E3. Call the custom function.
[0025] To further optimize the technical solution, in step F, the process of dynamic data processing includes the following steps:
[0026] F1. Define basic element information;
[0027] F2. Process the function;
[0028] F3. Process the function, add corresponding parameters and register the function to the aviator engine;
[0029] F4. Use this function in an expression.
[0030] To further optimize the technical solution, in step G, the method of mapping the input data to the output result is to execute it one by one in a pre-editing manner, return the edited result after editing the expression, and pass it into different envs to reuse the edited result.
[0031] Due to the adoption of the above technical scheme, the technical progress achieved by the present invention is as follows.
[0032] The present invention provides a holiday calculation method based on the lightweight expression evaluation engine aviator, which realizes the electronic processing of the entire process of application, approval and statistics through rule configuration and rapid approval calculation of holiday values, and constructs a new holiday management system based on current holiday rules. The system not only improves administrative execution efficiency, but also reduces cumbersome manual operation processes and reduces errors caused by human factors. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is the work flow chart of the present invention. DETAILED DESCRIPTION
[0034] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0035] The holiday calculation method based on the lightweight expression evaluation engine aviator includes the following steps:
[0036] A. Set preset conditions.
[0037] Aviator calls a function (for example, AviatorEvaluator.execute(String expression, Map<String,Object> env) sets the preset conditions, which is to add the defined functions to the aviator function library by presetting expressions and operating environment parameters, and call them when they are needed.
[0038] Preset conditions include: for example, automatically generating annual leave days based on length of service, automatically calculating holidays, setting the number of days that can be applied for expired holidays to zero, automatically calculating the number of days an employee can take leave, the number of days already taken leave, and the number of days that cannot exceed the number of days available for leave, etc.
[0039] B. Edit the preset conditions into executable objects.
[0040] The method to edit preset conditions into executable objects is to configure the holiday rules. The configured holiday rules consist of an expression object in the condition part and an expression object in the output part. When the result of the logical expression in the condition part is true, the expression in the output part will be executed, that is, the result of the executable object given under the condition will be output. Otherwise, when the result is false, the expression in the output part will not be executed.
[0041] For example, based on the vacation application submitted by the user, the number of days the employee can take leave is automatically calculated (and the number of days already taken leave is displayed simultaneously). If the number of days that can be applied for does not exceed the upper limit, the application is valid. While the number of days that can be applied for leave is displayed, further operations on the vacation application can be performed.
[0042] C. Determine vacation priorities.
[0043] The holiday rule priority determines the combination order and execution order of multiple rules. The execution order of applicable holidays is based on the established holiday rules.
[0044] The vacation priority is sorted in two ways: user's natural attribute - gender or attribute priority and user's social attribute - working hours priority.
[0045] The first sorting method, user natural attribute - gender or attribute priority is based on the collected basic user information. The conditions for applying for the holiday type are first judged according to the user's gender (male / female), and then the specific holidays and days are generated according to the user's marital status (unmarried / married). For example, maternity leave (women include breastfeeding leave, bonus leave, difficult childbirth leave, etc.; men only have paternity leave), gender differences in the conditions for applying for holiday selection produce obvious holiday differences. Another example is home leave. The holiday interval for the number of days of annual leave is determined according to the user's marital status (unmarried / married) and the selectable home visit object (parents / spouse). Then, according to the user's selectable vacation year (the cumulative year of unfinished vacation), the number of days of vacation that the user can select and the remaining days are finally judged and generated. For example, according to the specific execution rules configured for each vacation type, execute HolidayCalculator.calculateRule(HdHolidayRuleCalSimple cal,HdHolidayRule rule,Map<String,Object> params) function calculates the number of holidays.
[0046] The second sorting method, user social attributes - working hours priority is the user's length of service (for example, if the user has worked for more than one year but less than 10 years, the number of vacation days is 5 days; if the user has worked for more than 10 years but less than 20 years, the number of vacation days is 10 days, etc.) determines the number of vacation days that the user can apply for annual leave. The system first determines the interval of vacation days that the user can enjoy based on the statistical length of service of the user, and then based on the vacation year that the user can choose (the cumulative year of unfinished vacation that can be chosen), finally determines and generates the number of vacation days and remaining days that the user can choose. For example, if the cumulative working years are more than 10 years but less than 20 years as a condition for enjoying 10 days of annual leave, the conditional expression is:
[0047] SD_workDateMonth>=120&&
[0048] If SD_workDateMonth<240, and all leave conditions are met, the holiday is 10 days.
[0049] D. Holiday calculations are performed using the lightweight expression evaluation engine aviator.
[0050] Aviator supports calculation operators and executes the holiday application conditions according to the established holiday rule priority. It uses the specific personnel information of the holiday type elements to perform holiday determination calculations, generates a holiday calculation formula to determine the element parameters (such as: number of working months - [SD_workDateMonth]), inputs the holiday element parameters into each leave determination condition to calculate the valid holiday entries (such as: cumulative work for more than 10 years but less than 20 years - [SD_workDateMonth>=120&&SD_workDateMonth<240]), calculates the valid holiday days of the holiday type based on the number of leave days of the valid holiday entries of the holiday type, generates valid holiday application information, and finally transmits the valid holiday application information to the user terminal.
[0051] E. Add custom functions to the function library to freely configure holiday rules.
[0052] The method for freely configuring holiday rules includes the following steps:
[0053] E1. Define the logic that needs to be customized. For example, if a holiday type A needs to determine the number of days off for another type of holiday B in the previous year to determine whether to enjoy type A holiday in the current year, it is necessary to customize the function holidayUseNum(holidayType) for the number of days off.
[0054] E2. Register a custom function, for example, register the holidayUseNum function, register a Class B holiday number element function named HCI_holidayUseNum_B, AviatorEvaluator.addFunction(new HCI_holidayUseNum_B()).
[0055] E3. Call a custom function. For example, if a person took a Class B holiday for more than 30 days last year, he / she will not be entitled to a Class A holiday in the current year. The judgment expression for not enjoying a Class A holiday is defined as: holidayUseNum(Class B holiday)>30.
[0056] F. Acquire and process dynamic data through the Aviator engine's rule set.
[0057] The dynamic data processing process includes the following steps:
[0058] F1. Define basic information, such as user gender, working hours, etc.
[0059] F2. Define basic functions, such as the number of sick leave days in the previous year, the cumulative number of working months, etc.
[0060] F3. Process the function, add corresponding parameters and register the function to the aviator engine.
[0061] F4. Use this function in an expression.
[0062] G. Map input data to output results.
[0063] Execute one by one through pre-editing. After editing the expression, return the edited result, pass in different env to reuse the edited result, for example, build the execution env parameter set according to the basic element information of each person, and execute AviatorEvaluator.execute(String expression,Map<String,Object> env) function to obtain the data results.
[0064] Through the efficient output of the aviator expression engine, the five major construction goals of the holiday system have been initially achieved. The specific process is as follows: Figure 1 shown.
[0065] 1. Quick application: the system searches for eligible vacation conditions through the rule engine based on the vacation application initiated by the user, and automatically deducts the vacation records in combination with the calculation engine. After completing the vacation results, the system outputs the number of vacation days that can be applied for. The system can also query the previous vacation status and number of days of personal vacation, and the number of days remaining for personal vacation.
[0066] 2. Flat approval, clear hierarchy of approvers, process-based approval settings, including sending for review and approval in the case of consent, and returning to the initiator in the case of objections. Visual display of the progress of the entire approval process and handling opinions. At the end of the process, the electronic application form can be printed and filed.
[0067] 3. Closed-loop management: In addition to the general approval process, the complete return-to-work reporting and leave cancellation process supports the reporting of completed trips. If the user cancels leave due to special reasons, the system will automatically return the deducted holiday balance after completing the leave cancellation process approval.
[0068] 4. Statistics and analysis visualization: monthly / annual data statistics of various holidays (including business trips) are combined with visual graphics to display peak and trough trends, assist in analyzing the impact of monthly / annual holidays on annual work priorities, and support the public disclosure of duty status.
[0069] 5. Flexible handling of holiday rules. Customized configuration of holiday information such as configuration items and configuration codes, holiday configuration such as holiday name, holiday description, and holiday rules such as rule name, gender, number of days, conditions for enjoyment, and conditions for non-enjoyment, to achieve update iteration and scalability of holiday rules. Combined with personal user holiday information maintenance and statutory holiday management maintenance, the whole holiday process can be effectively controlled.
[0070] Based on the lightweight expression evaluation engine aviator technology, through rule configuration and rapid approval calculation of holiday values, the entire process of application, approval and statistics can be electronically processed, and a new holiday management system based on current holiday rules can be built. This system not only improves administrative execution efficiency, but also reduces cumbersome manual operation processes and reduces errors caused by human factors.
[0071] Rules and conditions for different holidays can be configured to improve administrative efficiency and reduce repetitive administrative workload and tedious and complex manual calculation processes. Dynamic rule addition and modification are supported to adapt to rapidly changing business needs.
[0072] At the same time, it effectively solves the problem of users viewing online rules, approval processes and remaining vacation status with one click, and multi-process support for vacation changes and adjustments caused by emergencies, avoiding excessive administrative communication and improving user satisfaction.
Claims
1. A holiday calculation method based on the lightweight expression evaluation engine aviator, characterized by: The following steps are involved: A. Set preset conditions; B. Edit the preset conditions into executable objects; C. Determine holiday priorities; D. Holiday calculations are performed using the lightweight expression evaluation engine aviator; E. Add custom functions to the function library to freely configure holiday rules; F. Acquire and process dynamic data through the Aviator engine’s rule set; G. Map input data to output results.
2. The vacation calculation method based on the lightweight expression evaluation engine aviator according to claim 1 is characterized in that: In step A, the setting of the preset conditions is to add the defined functions to the function library of aviator by means of preset expressions and operating environment parameters, and call these functions when they are needed.
3. The vacation calculation method based on the lightweight expression evaluation engine aviator according to claim 1, characterized in that: In step B, the method for editing the preset conditions into executable objects is to configure the holiday rules. The configured holiday rules are composed of an expression object of the condition part and an expression object of the output part. When the result of the logical expression of the condition part is true, the expression of the output part will be executed, that is, the result of the executable object given under the condition will be output. Otherwise, when the result of the operation is false, the expression of the output part will not be executed.
4. The vacation calculation method based on the lightweight expression evaluation engine aviator according to claim 1, characterized in that: In the step C, the order of vacation priorities includes user natural attributes-gender or attribute priority and user social attributes-working hours priority.
5. The vacation calculation method based on the lightweight expression evaluation engine aviator according to claim 4 is characterized in that: The user's natural attribute - gender or attribute priority is based on the collected basic user information. The applicable conditions of the vacation type are first judged according to the user's gender, and then a second judgment is made according to the user's marital status to generate specific vacations and days.
6. The vacation calculation method based on the lightweight expression evaluation engine aviator according to claim 4 is characterized in that: The user social attribute-working hours priority is to determine the interval of vacation days that the user can enjoy based on the statistical length of service of the user, and then based on the vacation year that the user can choose, finally determine and generate the vacation days and remaining days that the user can choose.
7. The vacation calculation method based on the lightweight expression evaluation engine aviator according to claim 1 is characterized in that: The calculation method in step D is to execute the holiday application conditions according to the established holiday rule priority, perform holiday determination calculations by utilizing the specific personnel information of the holiday type elements, generate a holiday calculation formula to determine the element parameters, input the holiday element parameters into each leave determination condition to calculate the valid holiday entry, comprehensively calculate the valid holiday days of the holiday type based on the number of leave days of the valid holiday entries of the holiday type, generate valid holiday application information, and finally transmit the valid holiday application information to the user terminal.
8. The vacation calculation method based on the lightweight expression evaluation engine aviator according to claim 1, characterized in that: In step E, the method for freely configuring holiday rules includes the following steps: E1. Define the logic that needs custom configuration; E2. Register custom functions; E3. Call the custom function.
9. The vacation calculation method based on the lightweight expression evaluation engine aviator according to claim 1, characterized in that: In step F, the process of dynamic data processing includes the following steps: F1. Define basic element information; F2. Process the function; F3. Process the function, add corresponding parameters and register the function to the aviator engine; F4. Use this function in an expression.
10. The vacation calculation method based on the lightweight expression evaluation engine aviator according to claim 1, characterized in that: In the step G, the method of mapping the input data to the output result is to execute it one by one in a pre-editing manner, return the edited result after editing the expression, and pass it into different env to reuse the edited result.
