Rule engine-based human resource and social resource adjustment method and system
By using a rules engine-based approach to generate and manage structured salary adjustment rule documents, the problem of frequent code modifications due to policy changes caused by hard coding in existing systems is solved. This enables rapid response to policy changes and flexible salary adjustment management, meeting business needs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-08
- Publication Date
- 2026-04-03
AI Technical Summary
The existing human resources and social security salary adjustment system requires frequent code modifications when policies change due to hard coding, which consumes a lot of manpower and time. Moreover, business personnel cannot directly participate in rule adjustments, making it difficult to meet the business needs of frequent and flexible policy changes.
By adopting a rule engine-based approach, structured adjustment rule documents are generated, and rule object models are stored and parsed. Dynamic loading and version management are supported, and business personnel can directly adjust the rule documents without modifying the system code.
It enables rapid response to policy changes, shortens maintenance time, improves policy response speed, supports rule document version management, meets audit requirements, and reduces the impact on other business operations.
Smart Images

Figure CN121788088A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of human resources and social security data processing technology, and in particular relates to a human resources and social security salary adjustment method and system based on a rule engine. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] Salary adjustments in the field of human resources and social security (hereinafter referred to as "HRSS"), especially those involving adjustments to pensions for retirees and salaries and benefits for active employees, are highly policy-driven, far-reaching, and attract significant public attention. The core of this work lies in rigorously and accurately translating the promulgated policy provisions (which typically include various complex calculation rules such as fixed-amount adjustments, linked adjustments, and appropriate preferential treatment) into executable calculation logic and applying it to a massive number of insured individuals.
[0004] Currently, the technical solutions for information systems in the industry that implement this type of salary adjustment function can be mainly divided into two categories: The first type is the traditional hard-coded approach, which is the most common practice. This involves interpreting policy documents and directly writing the complex calculation conditions and actions into program code (such as a series of if-else statements, mathematical formulas, etc.). Since policies are adjusted almost annually, each adjustment means developers need to re-understand the policy, modify source code, conduct unit testing, system integration testing, and deploy to the production environment. The entire process is lengthy, requiring repeated communication and confirmation between business and technical departments. This method consumes significant manpower and time. The adjustment logic is deeply bound to the core system code, and business personnel rely entirely on developers to implement their business intentions, unable to directly participate in or verify the logic configuration. Any minor rule change requires technical team intervention, creating a technical bottleneck for business iteration. Policy rules are scattered across numerous code files, making it difficult to intuitively present the complete rule set corresponding to a particular version of the adjustment. There is a lack of clear and independent documentation for recording and auditing how historical rules have evolved and which rule a specific adjustment calculation is based on.
[0005] The second category is an improved solution based on simple parameterized configuration. In order to improve flexibility, some systems attempt to extract the thresholds in the policy into the database table for configuration. However, this method can only solve the change of "value" and cannot cope with the change of the rule logic structure itself. When the policy logic is structurally adjusted, the system still faces the same code-level modification requirements as the hard-coded solution. Therefore, the existing rigid and inflexible salary adjustment schemes cannot meet the business needs of frequent and flexible policy changes. Summary of the Invention
[0006] To address at least one of the technical problems mentioned above, this invention provides a human resources and social security salary adjustment method and system based on a rule engine, which can quickly respond to policy changes without modifying the system code.
[0007] To achieve the above objectives, the present invention adopts the following technical solution: The first aspect of the present invention provides a human resources and social security salary adjustment method based on a rule engine, comprising the following steps: In response to configuration or adjustment of rule conditions and action parameters, generate a structured fund adjustment rule document; Versioned storage stores the structured salary adjustment rule document; Matches and parses the specified version of the rule document according to the set conditions, verifies the syntactic correctness and logical integrity of the converted logical judgment object, and outputs the rule object model that the rule engine can execute. Receive the preprocessed personnel data object to be adjusted, traverse the executable rule object model, match personnel attributes with rule conditions according to rule priority, and execute the corresponding calculation actions for rules that meet the conditions in sequence to obtain the adjustment details; Summarize all salary adjustment details and generate the final salary adjustment result and a salary adjustment log including rule version and execution details.
[0008] Furthermore, the salary adjustment rule document contains at least one rule unit, and each rule unit includes a rule number, rule conditions, rule actions, rule priority, and self-loop control flags; wherein, the rule conditions are logical expressions that include personnel attribute fields, comparison operators, and condition thresholds.
[0009] Furthermore, the rule conditions are: a logical expression containing personnel attribute fields, comparison operators, and condition thresholds; The rule action is: defining the calculation operation to be performed when the rule condition is met, usually assigning a value to the target field or an accumulation expression; Rule priority is a numerical parameter used to determine the execution order when multiple rules are satisfied simultaneously; the higher the value, the higher the priority. The self-loop control flag is a Boolean parameter used to declare whether the rule is allowed to trigger itself again due to the result of its action after execution.
[0010] Furthermore, when the salary adjustment policy changes, a new version of the rule document is generated and stored in the rule storage database by updating the condition thresholds or action parameters in the structured salary adjustment rule document. Further, when parsing a specified version of the rule document, keywords, variables, operators, and literals in the document are identified, and the text rules are decomposed and mapped into conceptual objects within the engine, including rule objects, condition objects, action objects, and logical combination objects. The rule object includes rule number, rule priority, and self-loop control flag metadata; the condition object includes lvalues, operators, and rvalues; the action object includes target fields and calculated expressions; and the logical combination object is used to represent the "AND" and "OR" relationships between multiple condition objects.
[0011] Furthermore, the verification of the syntactic correctness and logical completeness of the converted logical judgment object includes: The lvalue in the condition object must be defined in the personnel data model, and the operator and rvalue types must match. At the same time, the calculation expression in the action object must be syntactically correct and the result type must match the target field type. If any of the conditions are not met, the validation will fail.
[0012] Furthermore, the step of traversing the executable rule object model and matching personnel attributes with rule conditions according to rule priority includes: Sort all rules in the rule object model in descending order according to their priority values; Traverse the rules in sorting order, and for each rule, determine whether the attributes of the current personnel data object satisfy all the logical relationships defined in the rule conditions; If the conditions are met, the rule action for that rule will be activated and executed, and the personnel salary adjustment result data will be updated. Continue until all rules have been traversed to obtain the total salary adjustment amount for the current data object of the person whose salary is to be adjusted.
[0013] A second aspect of the present invention provides a human resources and social security salary adjustment system based on a rule engine, comprising: The rule configuration module is used to generate structured adjustment rule documents in response to the configuration or adjustment of rule conditions and action parameters; The rules storage module is used to version-store the structured adjustment rules document; The rule parsing module is used to match and parse the specified version of the rule document according to the set conditions, verify the syntactic correctness and logical integrity of the converted logical judgment object, and output the rule object model that the rule engine can execute. The rule execution module is used to receive the preprocessed data object of the personnel to be adjusted, traverse the executable rule object model, match the personnel attributes with the rule conditions according to the rule priority, and execute the corresponding calculation actions of the rules that meet the conditions in sequence to obtain the adjustment details. The results generation module is used to summarize all adjustment details, generate the final adjustment results and adjustment logs including rule versions and execution details.
[0014] A third aspect of the present invention provides a computer-readable storage medium.
[0015] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the rule engine-based human resources and social security salary adjustment method described above.
[0016] A fourth aspect of the present invention provides a computer device.
[0017] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps in the rule engine-based human resources and social security salary adjustment method described above.
[0018] Compared with the prior art, the beneficial effects of the present invention are: This invention, through the combination of a rule engine and structured rule documents, completely solves the defects caused by hard coding in existing human resources and social security salary adjustment systems, providing an efficient, flexible, and accurate solution for salary adjustment work in the human resources and social security field. It has significant practicality and innovation, specifically manifested in: When policies change, only the rule documents need to be adjusted, without modifying the code, reducing maintenance time from several days to several hours; business personnel can directly participate in rule adjustments without relying on developers, significantly improving the speed of responding to policy changes; the rule engine supports dynamic loading, eliminating the need to restart the system and avoiding the impact of capital adjustment rule upgrades on other businesses; the rule documents support version management, allowing users to view capital adjustment rules and results for any time period, meeting audit requirements.
[0019] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0020] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0021] Figure 1 This is a flowchart of the human resources and social security salary adjustment method based on a rule engine provided in an embodiment of the present invention; Figure 2 This is a block diagram of a human resources and social security salary adjustment system based on a rule engine, provided in an embodiment of the present invention. Detailed Implementation
[0022] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0023] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0024] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0025] Example 1 like Figure 1 As shown, this embodiment provides a human resources and social security salary adjustment method based on a rule engine, including the following steps: Step 1: In response to configuring or adjusting rule conditions and action parameters, generate a structured capital adjustment rule document; In this embodiment, the input configuration conditions include condition fields directly determined by the policy, comparison operators, condition thresholds, action types, and action parameters, etc. Automatically assemble and generate a complete, engine-readable structured document of adjustment rules according to predefined domain-specific languages (DRLs) or other syntactic structures; The salary adjustment rule document contains at least one rule unit, and each rule unit includes a rule number, rule conditions, rule actions, rule priority, and self-loop control flags; The rule conditions are: a logical expression containing personnel attribute fields, comparison operators, and condition thresholds; The rule action is: defining the calculation operation to be performed when the rule condition is met, usually assigning a value to the target field or an accumulation expression; Rule priority is a numerical parameter used to determine the execution order when multiple rules are satisfied simultaneously; the higher the value, the higher the priority. The self-loop control flag is a Boolean parameter used to declare whether the rule is allowed to trigger itself again due to the result of its action after execution.
[0027] The rule conditions are used for logical judgment, and their logical entities are personnel attributes. The judgment basis is the comparison relationship between the attribute value and the preset threshold. The rule actions are used to define the calculation operation on the salary adjustment result when the condition is met. The rule priority is used to determine the execution order when multiple rules are activated at the same time. The self-loop control flag is used to declare whether the result produced by this rule action allows this rule to be triggered again.
[0028] For example, A complete rule unit can be represented as: Rule number: RULE_001; Rule condition: Insurance status == Retirement; Rule action: Regular benefits amount increased by 27.3 yuan; Rule priority: 90; Self-loop control flag: false; The rule states that when an individual's insurance status is "retired," 27.3 yuan will be added to their regular benefit amount. This rule has a priority of 90, meaning it will be executed earlier than rules with a priority of less than 90, and it will not be triggered again due to changes in the amount after execution.
[0029] Step 2: Version-based storage of the structured adjustment rules document; The rule storage module stores rule documents with different applicable subjects and different effective times in a versioned manner; for example, it records information such as effective time, version number, operator, and operation time, forming a complete traceable chain.
[0030] Step 3: Match and parse the specified version of the rule document according to the set conditions, verify the syntactic correctness and logical integrity of the converted logical judgment object, and output the rule object model that the rule engine can execute; In this embodiment, the structured rule document matching according to the set conditions can be set according to the actual situation, such as the region and the current time, and the latest version number of the rule document can be retrieved to trigger the parsing process. In this embodiment, text rules are decomposed and mapped into identifiable and verifiable logical judgment objects. Specifically, through lexical and syntactic analysis, keywords (such as rule, salience, when, and then), variables, operators, and literals in the document are identified, and text rules are decomposed and mapped into conceptual objects within the engine, including: Rule object: contains metadata such as rule number, rule priority, and self-loop control flag; Condition objects consist of lvalues (personal attributes), operators, and rvalues (condition thresholds); Action object: Consists of target field and evaluation expression; Logical combination object: used to represent the "AND" or "OR" relationship between multiple conditional objects.
[0031] For example: For the text rule "rule RULE_001 salience 90 when 参保状态==退休 and 年龄≥75岁 then 定期待遇金额增加27.3元", after parsing, it generates: Rule object: rule number = "RULE_001", priority = 90; Conditional object: conditional object one (left value = "参保状态", operator = "==", right value = "退休") and conditional object two (left value = "年龄", operator = "≥", right value = "75岁"); Action object: target field = "定期待遇金额", calculation expression = "当前值 + 27.3元"; Logical combination object: relationship = "AND" (conditional object one, conditional object two).
[0032] In this embodiment, the syntax correctness and logical integrity of the converted logical judgment object are verified, specifically including: the left value (such as "年龄") in the conditional object must be defined in the personnel data model, and the operator (such as "≥") and the right value type (such as number) match. At the same time, the calculation expression (such as "27.3") in the action object is syntactically correct and the result type matches the target field (such as "定期待遇金额") type. If any condition is not met, the verification fails and an error report is generated; Step 4: Receive the preprocessed salary-adjustment personnel data object, traverse the executable rule object model, match the personnel attributes with the rule conditions according to the rule priority, and execute the corresponding calculation actions for the rules that meet the conditions to obtain the salary-adjustment details; In this embodiment, before preprocessing the salary-adjustment personnel data object, all salary-adjustment personnel information is queried from the core database of the human resources and social security department according to specific query conditions and information preprocessing is performed to obtain the preprocessed personnel data; Querying all salary-adjustment personnel information from the core database of the human resources and social security department according to specific query conditions includes fields such as name, social security number, contribution years, date of birth, and insurance status.
[0033] Information preprocessing, for example, calculates the "年龄" field based on the date of birth.
[0034] In this embodiment, to obtain the preprocessed single-personnel information and match the rule conditions in descending order of rule priority, the following steps are specifically included: 1) Sort all the loaded rule objects in descending order according to their priority values; 2) Iterate through the sorted list of rules in order. For each rule, match its condition part with the current personnel data object and check whether the personnel attributes meet all the logical relationships defined in the condition. 3) If all the conditions of a rule are met, the rule is activated, the engine executes its action part, and updates the personnel's result data object; 4) Continue the above process until all rules in the list have been processed, and obtain the total salary adjustment amount for the person. Taking Zhang San (name: Zhang San, social security number: XXX, contribution period: 21 years, age: 75, insurance status: retired) as an example: First, match the general adjustment rule with priority 100, and if the condition of "insurance status = retirement" is met, execute the action of "increasing regular benefits by 43 yuan"; Next, the elderly bias rule (age ≥ 80 years old) with priority 90 is matched. Since the condition of 75 years old < 80 years old is not met, this rule is skipped. Then, it matches the middle-aged and elderly subsidy rule with priority 80 (75 years old ≤ age < 80 years old). If the condition is met, the action of "increasing the regular benefit by 25 yuan" will be executed. Finally, the payment period subsidy rule with priority 50 is matched (payment period > 15 years, subsidy of 0.6 yuan for each additional year of payment, less than one year is calculated as one year). If the condition is met, the action of "regular benefit increase (21-15) × 0.6 = 3.6 yuan" will be executed.
[0035] After all the rules are executed, Zhang San's total increase in benefits is 43 + 25 + 3.6 = 71.6 yuan.
[0036] Step 5: Summarize all adjustment details and generate the final adjustment results and adjustment log including rule version and execution details; In this embodiment, each adjustment detail generated during the execution of the above rules is recorded in a structured manner according to its corresponding rule item, calculated amount, and calculation basis, and the final adjustment result is generated by accumulating these records. Simultaneously, the system records the rule version, execution time, and matching and execution status of each rule used in this adjustment, forming a complete adjustment log.
[0037] Specifically, the salary adjustment details are generated into structured data in the format of "adjustment item - amount - calculation basis" (e.g., "general adjustment fixed amount adjustment - 43 yuan - policy document" "contribution years subsidy - 3.6 yuan - (21-15) × 0.6"), and the total pension amount after adjustment is calculated (original pension 2700 yuan + adjustment amount 71.6 yuan = 2771.6 yuan). At the same time, the system automatically generates a salary adjustment serial number, associates the social security number of the personnel, rule version number, execution time and other information, and writes it into the salary adjustment log table. After the salary adjustment stage is completed, the salary adjustment results are summarized, and a report is generated and exported according to the Excel template specified by the human resources and social security department. Business personnel view and analyze the report. If any abnormality is found (e.g., a person does not match the old-age subsidy they should receive), the rule matching process can be traced through the log to locate the cause of the problem (e.g., the rule condition "age ≥ 75 years old" is mistakenly written as "age > 75 years old"). Then, the business personnel correct the condition and re-release the rule document. The system can choose to re-execute the salary adjustment calculation for all personnel or only for abnormal personnel to ensure that the results are accurate.
[0038] Example 2 like Figure 2 As shown, this embodiment provides a human resources and social security salary adjustment system based on a rule engine, comprising six parts: a rule configuration module, a rule storage module, a rule parsing module, a data acquisition module, a rule execution module, and a result generation module; The system comprises the following modules: a rule configuration module, which provides an interface for business personnel to configure or adjust rule conditions and action parameters, and generates a structured salary adjustment rule document; a rule storage module, connected to the rule configuration module, which version-stores the structured salary adjustment rule document and related metadata; a rule parsing module, connected to the rule storage module, which loads and parses a specified version of the rule document, performs legality verification, and outputs a rule object model executable by the rule engine; a data acquisition module, which obtains and preprocesses information about personnel to be adjusted from the data source, and outputs personnel data objects; a rule execution module, connected to both the rule parsing module and the data acquisition module, which matches the personnel data objects with the rule object model and executes the corresponding actions of the activated rules; and a result generation module, connected to the rule execution module, which summarizes the salary adjustment details and generates the final salary adjustment result and salary adjustment log.
[0039] Specifically, in the rule configuration module, a complete, engine-readable structured adjustment rule document is automatically assembled and generated according to predefined domain-specific language (DRL) or other syntax structures. The salary adjustment rule document contains at least one rule unit, and each rule unit includes a rule number, rule conditions, rule actions, rule priority, and self-loop control flags; The rule conditions are: a logical expression containing personnel attribute fields, comparison operators, and condition thresholds; The rule action is: defining the calculation operation to be performed when the rule condition is met, usually assigning a value to the target field or an accumulation expression; Rule priority is a numerical parameter used to determine the execution order when multiple rules are satisfied simultaneously; the higher the value, the higher the priority. The self-loop control flag is a Boolean parameter used to declare whether the rule is allowed to trigger itself again due to the result of its action after execution.
[0040] The rule conditions are used for logical judgment, and their logical entities are personnel attributes. The judgment basis is the comparison relationship between the attribute value and the preset threshold. The rule actions are used to define the calculation operation on the salary adjustment result when the condition is met. The rule priority is used to determine the execution order when multiple rules are activated at the same time. The self-loop control flag is used to declare whether the result produced by this rule action allows this rule to be triggered again.
[0041] In the rule parsing module, the specified version of the rule document is matched and parsed according to the set conditions. The syntactic correctness and logical integrity of the converted logical judgment object are verified, and the rule object model that the rule engine can execute is output. In this embodiment, the structured rule document matching according to the set conditions can be set according to the actual situation, such as the region and the current time, and the latest version number of the rule document can be retrieved to trigger the parsing process. In this embodiment, text rules are decomposed and mapped into identifiable and verifiable logical judgment objects. Specifically, through lexical and syntactic analysis, keywords (such as rule, when, then), variables, operators, and literals in the document are identified, and text rules are decomposed and mapped into conceptual objects within the engine, such as... "Condition object" (containing lvalues, operators, and rvalues), such as "Age ≥ 75"; "Action object" (containing target field and calculated expression), such as "Regular benefits increased by 27.3 yuan"; In this embodiment, the converted logical judgment object is verified for syntactic correctness and logical integrity. Specifically, the condition object's left value (such as "age") must be defined in the personnel data model, and the operator (such as "≥") and the right value type (such as number) must match. At the same time, the calculation expression in the action object (such as "27.3") must be syntactically correct and the result type must match the target field (such as "periodic benefit amount"). If any condition is not met, the verification fails and an error report is generated. In the rule execution module, the preprocessed data object of the personnel to be adjusted is received, the executable rule object model is traversed, the personnel attributes are matched with the rule conditions according to the rule priority, and the corresponding calculation actions are executed sequentially for the rules that meet the conditions to obtain the adjustment details. In this embodiment, the preprocessed single piece of personnel information is obtained, and the rule conditions are matched sequentially according to the rule priority from high to low. The specific steps include the following: 1) Sort all loaded rule objects in descending order according to their priority values; 2) Iterate through the sorted list of rules in order. For each rule, match its condition part with the current personnel data object and check whether the personnel attributes meet all the logical relationships defined in the condition. 3) If all the conditions of a rule are met, the rule is activated, the engine executes its action part, and updates the personnel's result data object; 4) Continue the above process until all rules in the list have been processed, and obtain the total salary adjustment amount for the person.
[0042] It should be noted that the specific implementation of the human resources and social security salary adjustment system based on the rule engine in this embodiment of the invention is similar to the specific implementation of the human resources and social security salary adjustment method based on the rule engine in this embodiment of the invention. For details, please refer to the description in the method section. In order to reduce redundancy, it will not be repeated here.
[0043] Example 3 This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the rule engine-based human resources and social security salary adjustment method described above.
[0044] Example 4 This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the rule engine-based human resources and social security salary adjustment method described above.
[0045] Example 5 This embodiment provides a program product, which is a computer program product, including a computer program. When the computer program is executed by a processor, it implements the steps in the rule engine-based human resources and social security salary adjustment method described above.
[0046] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0047] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0048] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0049] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0050] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0051] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A human resources and social security salary adjustment method based on a rule engine, characterized in that, Includes the following steps: In response to configuration or adjustment of rule conditions and action parameters, generate a structured fund adjustment rule document; Versioned storage stores the structured salary adjustment rule document; Matches and parses the specified version of the rule document according to the set conditions, verifies the syntactic correctness and logical integrity of the converted logical judgment object, and outputs the rule object model that the rule engine can execute. Receive the preprocessed personnel data object to be adjusted, traverse the executable rule object model, match personnel attributes with rule conditions according to rule priority, and execute the corresponding calculation actions for rules that meet the conditions in sequence to obtain the adjustment details; Summarize all salary adjustment details and generate the final salary adjustment result and a salary adjustment log including rule version and execution details.
2. The human resources and social security salary adjustment method based on a rule engine as described in claim 1, characterized in that, The salary adjustment rule document contains at least one rule unit. Each rule unit includes a rule number, rule conditions, rule actions, rule priority, and self-loop control flags. The rule conditions are logical expressions that include personnel attribute fields, comparison operators, and condition thresholds.
3. The human resources and social security salary adjustment method based on a rule engine as described in claim 2, characterized in that, in, The rule conditions are: a logical expression containing personnel attribute fields, comparison operators, and condition thresholds; The rule action is: defining the calculation operation to be performed when the rule condition is met, usually assigning a value to the target field or an accumulation expression; Rule priority is a numerical parameter used to determine the execution order when multiple rules are satisfied simultaneously; the higher the value, the higher the priority. The self-loop control flag is a Boolean parameter used to declare whether the rule is allowed to trigger itself again due to the result of its action after execution.
4. The human resources and social security salary adjustment method based on a rule engine as described in claim 1, characterized in that, When the salary adjustment policy changes, a new version of the rule document is generated and stored in the rule storage database by updating the condition thresholds or action parameters in the structured salary adjustment rule document.
5. The human resources and social security salary adjustment method based on a rule engine as described in claim 1, characterized in that, When parsing a specified version of a rule document, the engine identifies keywords, variables, operators, and literals in the document, decomposes the text rules, and maps them into conceptual objects within the engine, including rule objects, condition objects, action objects, and logical combination objects. Among them, rule objects include rule number, rule priority, and self-loop control flag metadata; condition objects include lvalues, operators, and rvalues; action objects include target fields and calculated expressions; and logical combination objects are used to represent the "AND" and "OR" relationships between multiple condition objects.
6. The human resources and social security salary adjustment method based on a rule engine as described in claim 1, characterized in that, The verification of the syntactic correctness and logical integrity of the converted logical judgment object includes: The lvalue in the condition object must be defined in the personnel data model, and the operator and rvalue types must match. At the same time, the calculation expression in the action object must be syntactically correct and the result type must match the target field type. If any of the conditions are not met, the validation will fail.
7. The human resources and social security salary adjustment method based on a rule engine as described in claim 1, characterized in that, The step of traversing the executable rule object model and matching personnel attributes with rule conditions according to rule priority includes: Sort all rules in the rule object model in descending order according to their priority values; Traverse the rules in sorting order, and for each rule, determine whether the attributes of the current personnel data object satisfy all the logical relationships defined in the rule conditions; If the conditions are met, the rule action for that rule will be activated and executed, and the personnel salary adjustment result data will be updated. Continue until all rules have been traversed to obtain the total salary adjustment amount for the current data object of the person whose salary is to be adjusted.
8. A human resources and social security salary adjustment system based on a rule engine, characterized in that, include: The rule configuration module is used to generate structured adjustment rule documents in response to the configuration or adjustment of rule conditions and action parameters; The rules storage module is used to version-store the structured adjustment rules document; The rule parsing module is used to match and parse the specified version of the rule document according to the set conditions, verify the syntactic correctness and logical integrity of the converted logical judgment object, and output the rule object model that the rule engine can execute. The rule execution module is used to receive the preprocessed data object of the personnel to be adjusted, traverse the executable rule object model, match the personnel attributes with the rule conditions according to the rule priority, and execute the corresponding calculation actions of the rules that meet the conditions in sequence to obtain the adjustment details. The results generation module is used to summarize all adjustment details, generate the final adjustment results and adjustment logs including rule versions and execution details.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the human resources and social security salary adjustment method based on a rule engine as described in any one of claims 1-7.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the human resources and social security salary adjustment method based on a rule engine as described in any one of claims 1-7.