Salary determination method, electronic device and computer program product

By generating compressed information of salary determination rules in both JVM heap and external storage, the problem of garbage collection pauses caused by JVM heap memory usage in existing technologies is solved, achieving efficient salary determination rule management and improving system stability and performance.

CN121169601APending Publication Date: 2025-12-19BEIKE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511304246.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-12
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

In existing technologies, as enterprise business scale grows, the complexity and size of payroll calculation rule packages increase, causing long pauses in the Java Virtual Machine (JVM) during garbage collection, affecting service stability. Furthermore, existing solutions such as adding hardware configurations or splitting rule packages have limitations and complexities.

Method used

The pay determination rules are stored in the JVM heap memory, and compressed information of the rules is stored in the JVM off-heap memory. The pay determination rules are generated from the compressed information, which reduces JVM memory usage, reduces garbage collection pressure, and optimizes memory access paths.

Benefits of technology

It achieves efficient management of payroll determination rules, reduces JVM memory usage, improves service stability and performance, reduces the negative impact of off-heap caching on services, and improves the speed of payroll determination and overall system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121169601A_ABST
    Figure CN121169601A_ABST
Patent Text Reader

Abstract

The invention provides a salary determination method, electronic equipment and a computer program product. The salary determination method comprises the steps of obtaining target employee information and a target salary determination rule identifier; under the condition that a target salary determination rule corresponding to the target salary determination rule identifier is not stored in a JVM in-heap memory, compressed information of the target salary determination rule is obtained from a JVM out-heap memory based on the target salary determination rule identifier, and the compressed information of multiple rules is stored in the JVM out-heap memory; decompressing the compressed information of the target salary determination rule to obtain the target salary determination rule; and determining the salary of the target employee according to the target employee information and the target salary determination rule.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to a method for determining compensation, electronic devices, readable storage media, and computer program products. Background Technology

[0002] As businesses expand, payroll calculation becomes a critical function within their services. Current technologies rely on loading complex rule packages to determine employee compensation. However, with increasing business scale, the complexity and size of these rule packages grow, leading to high memory consumption during payroll determination. This high memory consumption further causes prolonged pauses in the Java Virtual Machine (JVM) during garbage collection (GC), severely impacting service stability. Summary of the Invention

[0003] This disclosure provides a method for determining compensation, an electronic device, a readable storage medium, and a computer program product.

[0004] According to one aspect of this disclosure, a method for determining salary is provided, comprising: obtaining target employee information and a target salary determination rule identifier; if no target salary determination rule corresponding to the target salary determination rule identifier is stored in the JVM heap memory, obtaining compressed information of the target salary determination rule from the JVM off-heap memory based on the target salary determination rule identifier, wherein the JVM off-heap memory stores compressed information of multiple rules; decompressing the compressed information of the target salary determination rule to obtain the target salary determination rule; and determining the salary of the target employee according to the target employee information and the target salary determination rule.

[0005] According to one technical solution, when the target salary determination rules are not stored in the JVM heap memory, compressed information of the target salary determination rules is obtained from the JVM off-heap memory. Based on this compressed information, the target salary determination rules are then derived, ensuring the smooth execution of the salary determination task and achieving efficient salary determination rule management. Because the salary determination rules are not entirely stored in the JVM heap memory, nor directly in the JVM off-heap memory, but rather stored in compressed form in the JVM off-heap memory, JVM memory usage is reduced, alleviating the pressure on JVM garbage collection and improving service stability. Simultaneously, since some salary determination rules are stored in the JVM heap memory, it is not necessary to retrieve the target salary determination rules from the JVM off-heap memory every time. In specific situations, the target salary determination rules can be directly retrieved from the JVM heap memory, thereby reducing the negative impact of off-heap caching on service performance.

[0006] According to at least one embodiment of the salary determination method of this disclosure, the compressed information of the target salary determination rule includes one or more of the following: target precondition number, target action number, and target parameter number.

[0007] According to the technical solution of this embodiment, the compressed information of the target salary determination rule includes one or more of the precondition number, action number, and parameter number. This numbered compression method can significantly reduce space occupation, save JVM off-heap memory space, facilitate fast retrieval and decompression, help maintain the integrity and scalability of the target salary determination rule, and improve the storage efficiency and rule management flexibility of the target salary determination rule.

[0008] According to at least one embodiment of the salary determination method of this disclosure, the compressed information of the target salary determination rule is decompressed to obtain the target salary determination rule, including: obtaining target precondition information corresponding to the target precondition number from the rule storage medium according to the mapping relationship between precondition number and precondition information; obtaining target action information corresponding to the target action number from the rule storage medium according to the mapping relationship between action number and action information; obtaining target parameter information corresponding to the target parameter number from the rule storage medium according to the mapping relationship between parameter number and parameter information; and generating the target salary determination rule based on the target precondition information, the target action information, and the target parameter information.

[0009] According to the technical solution of this embodiment, target precondition information, target action information, and target parameter information are obtained from the rule storage medium based on the mapping relationship between numbers and information, and target salary determination rules are generated, thus realizing the automation and standardization of target salary determination rule decompression. Compared with the method of directly storing complete target salary determination rules, this method reduces data redundancy through number mapping, improves the decompression efficiency of target salary determination rules, and ensures the accuracy and consistency of target salary determination rules by utilizing the reliability and maintainability of the rule storage medium.

[0010] According to at least one embodiment of the present disclosure, a method for determining the salary of a target employee is provided, which determines the salary of a target employee based on the target employee information and the target salary determination rule. The method includes: extracting target parameter values ​​from the target employee information based on the target parameter information; and, if the target parameter values ​​satisfy the target precondition information, performing a first action in the target action information to obtain the salary of the target employee.

[0011] According to the technical solution of this embodiment, the salary of the target employee is automatically determined by accurate target parameter values, clear condition judgment and action execution logic, which reduces the need for manual intervention and improves the accuracy of the salary determination result of the target employee.

[0012] According to at least one embodiment of the salary determination method of this disclosure, after obtaining target employee information and target salary determination rule identifier, the method further includes: if the target salary determination rule corresponding to the target salary determination rule identifier is stored in the JVM heap memory, determining the salary of the target employee based on the target employee information and the target salary determination rule stored in the JVM heap memory.

[0013] According to the technical solution of this embodiment, by directly using the target salary determination rule to determine employee salaries when the target salary determination rule is already stored in the JVM heap memory, the steps of obtaining and decompressing the target salary determination rule from the JVM off-heap memory are reduced, thereby reducing system computational overhead, optimizing the access path of the target salary determination rule, and improving the salary determination speed. It is especially suitable for high-frequency rule scenarios and improves the overall performance of the system.

[0014] The salary determination method according to at least one embodiment of the present disclosure, after obtaining the target salary determination rule, further includes: storing the target salary determination rule in the JVM heap memory.

[0015] According to the technical solution of this embodiment, by storing the decompressed target salary determination rules in the JVM heap memory, an in-heap caching mechanism for target salary determination rules is implemented. This eliminates the need to repeatedly retrieve and decompress the target salary determination rules from off-heap memory during subsequent salary determination processes using the same rules, improving the reuse efficiency of target salary determination rules and reducing the frequency of off-heap memory access, thereby improving system speed and resource utilization. It is understandable that since some salary determination rules occupy a relatively large amount of memory, frequent reading and decompression from off-heap memory can impact the performance of electronic devices, and the reading time is also relatively long. Therefore, storing the target salary determination rules in the JVM heap memory facilitates subsequent reuse.

[0016] The salary determination method according to at least one embodiment of the present disclosure further includes: determining the number of times the salary determination rule stored in the JVM heap memory is used within a set time period and / or the time difference between the most recent use time of the salary determination rule stored in the JVM heap memory and the current time; and deleting the salary determination rule stored in the JVM heap memory based on the number of uses and / or the time difference.

[0017] According to the technical solution of this embodiment, by tracking the number of times the salary determination rules are used in the JVM heap memory and / or the time difference between the most recent use time and the current time, and deleting the salary determination rules stored in the JVM heap memory based on the number of uses and / or the time difference, dynamic cleanup of the JVM heap memory is achieved. This helps to release the space occupied by infrequently used salary determination rules in the JVM heap memory, thereby improving the utilization rate of the JVM heap memory and reducing the risk of memory overflow.

[0018] According to at least one embodiment of the present disclosure, a method for determining compensation includes deleting compensation determination rules stored in the JVM heap memory based on the number of uses and / or the time difference, including deleting compensation determination rules whose number of uses is less than a usage threshold from the JVM heap memory.

[0019] According to the technical solution of this embodiment, by deleting the salary determination rules that are used infrequently in the JVM heap memory, the cleanup strategy of the JVM heap memory is refined. This can effectively prevent the high-frequency salary determination rules in the JVM heap memory from being accidentally deleted, ensuring that the high-frequency salary determination rules can continue to be accessed quickly through the JVM heap memory. At the same time, the resource allocation of the JVM heap memory is optimized, improving the stability and performance of the system.

[0020] According to at least one embodiment of the present disclosure, a method for determining compensation includes deleting compensation determination rules stored in the JVM heap memory based on the number of uses and / or the time difference, including deleting compensation determination rules whose time difference is greater than or equal to a time difference threshold from the JVM heap memory.

[0021] According to the technical solution of this embodiment, by deleting long-term unused salary determination rules in the JVM heap memory, a time-based JVM heap memory cleanup strategy is implemented. This ensures that the salary determination rules stored in the JVM heap memory are relevant to the current business needs, reduces the occupation of invalid rules, and improves the management efficiency of JVM heap memory.

[0022] According to at least one embodiment of the present disclosure, a method for determining compensation includes deleting compensation determination rules stored in the JVM heap memory based on the number of uses and / or the time difference, comprising: performing a weighted summation of the number of uses and the time difference to obtain a sum value; and deleting compensation determination rules whose sum value is greater than or equal to a sum value threshold from the JVM heap memory.

[0023] According to the technical solution of this embodiment, by weighted summation of usage frequency and time difference, and deleting salary determination rules from JVM heap memory based on the sum, a more intelligent JVM heap memory cleanup strategy is achieved by comprehensively considering multiple dimensions. Compared with single-dimensional cleanup methods, this weighted method can more accurately identify and delete low-value salary determination rules stored in JVM heap memory, thereby optimizing the resource allocation of JVM heap memory and balancing the availability of salary determination rules and system performance.

[0024] According to at least one embodiment of the salary determination method of this disclosure, before determining the number of times the salary determination rule stored in the JVM heap memory is used within a set time period and / or the time difference between the most recent use time of the salary determination rule stored in the JVM heap memory and the current time, the method further includes: determining that the remaining capacity of the JVM heap memory is less than a remaining capacity threshold.

[0025] According to the technical solution of this embodiment, by determining whether the remaining capacity of the JVM heap memory is less than a remaining capacity threshold before cleaning up the JVM heap memory, it is ensured that the JVM heap memory cleanup operation can be triggered when necessary, avoiding unnecessary deletion of payroll determination rules. This triggering mechanism based on remaining memory capacity improves the targeting and efficiency of memory management, prevents performance degradation when memory is scarce, and enhances the stability and reliability of the system.

[0026] According to another aspect of this disclosure, an electronic device is provided, comprising: a memory storing a computer program; and a processor executing the computer program stored in the memory, such that the processor performs a salary determination method according to any embodiment of this disclosure.

[0027] According to another aspect of this disclosure, a readable storage medium is provided, wherein a computer program is stored therein, which, when executed by a processor, is used to implement the salary determination method of any embodiment of this disclosure.

[0028] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements a salary determination method according to any embodiment of this disclosure. Attached Figure Description

[0029] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0030] Figure 1This is a schematic flowchart of a salary determination method according to one embodiment of the present disclosure.

[0031] Figure 2 This is a schematic diagram of the decompression process according to one embodiment of the present disclosure.

[0032] Figure 3 This is a schematic diagram illustrating the process of determining target employee compensation according to one embodiment of the present disclosure.

[0033] Figure 4 This is a schematic flowchart of a salary determination method according to another embodiment of the present disclosure.

[0034] Figure 5 This is a flowchart illustrating a method for determining compensation according to yet another embodiment of the present disclosure.

[0035] Figure 6 This is a schematic diagram of the deletion rule process according to one embodiment of the present disclosure.

[0036] Figure 7 This is a schematic diagram of the deletion rule process according to another embodiment of this disclosure.

[0037] Figure 8 This is a schematic diagram of the deletion rule process according to another embodiment of this disclosure.

[0038] Figure 9 This is a flowchart illustrating a method for determining compensation according to another embodiment of the present disclosure.

[0039] Figure 10 This is a schematic structural block diagram of a salary determination device according to one embodiment of the present disclosure.

[0040] Figure 11 This is a schematic block diagram of an electronic device according to one embodiment of the present disclosure. Detailed Implementation

[0041] The present disclosure will now be described in further detail with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.

[0042] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0043] The applicant's measurements revealed that rule package objects could consume up to 10GB of memory, while the entire service could reach 14GB under extreme conditions. Such high memory consumption causes prolonged pauses during Java Virtual Machine garbage collection, severely impacting service stability. While increasing CPU and memory configuration can improve single-machine performance and alleviate memory pressure, this is a temporary solution with limitations on machine hardware configuration, failing to address the root cause of memory consumption issues and increasing hardware costs. Storing rule packages in external caches like Redis can reduce JVM heap memory usage, but the large size of the rule packages necessitates network transmission for rule retrieval, limiting Redis throughput and network latency, thus impacting rule loading efficiency and service response speed. Although splitting rule packages based on business logic can reduce the complexity and memory consumption of individual rule packages, this process requires deep involvement from the business side, and the unclear definition of splitting boundaries makes splitting difficult.

[0044] To address this, this disclosure proposes the following technical solution: In this solution, a portion of the salary determination rules can be stored in the JVM heap memory, while compressed information of multiple rules is stored in the JVM off-heap memory. Therefore, when employee salaries need to be determined, if the target salary determination rules are not stored in the JVM heap memory, the compressed information of the target salary determination rules can be obtained from the JVM off-heap memory, and the target salary determination rules can be derived based on this compressed information, thus ensuring the smooth execution of salary determination. Since the salary determination rules are not all stored in the JVM heap memory, nor directly in the JVM off-heap memory, but rather stored in the form of compressed information in the JVM off-heap memory, JVM memory usage is reduced, the pressure on JVM garbage collection is alleviated, and service stability is improved. Simultaneously, since a portion of the salary determination rules are stored in the JVM heap memory, it is not necessary to obtain the target salary determination rules from the JVM off-heap memory every time. In specific situations, the salary determination rules stored in the JVM heap memory can be used directly, thereby reducing the negative impact of off-heap caching on service performance.

[0045] To facilitate description and make the technical solutions of this disclosure easier to understand, the terminology of this disclosure will be explained before describing the technical solutions of this disclosure.

[0046] The Java Virtual Machine (JVM) is an abstraction of a computer that simulates various computer functions on an actual computer.

[0047] JVM heap memory is memory managed uniformly by the JVM.

[0048] JVM off-heap memory is memory managed uniformly by the operating system. JVM off-heap memory is not managed by the JVM.

[0049] The salary determination method disclosed herein can be used by electronic devices to automatically determine the salary of a target employee after obtaining the target employee's information and the target salary determination rule identifier. In this disclosure, electronic devices include, but are not limited to, mobile phones, tablets, laptops, personal computers, wearable devices, and ATMs.

[0050] Figure 1 A schematic diagram illustrating the overall flow of a salary determination method according to one embodiment of this disclosure is shown. Figure 1 The method M100 shown includes steps S110 to S140. This method can be executed by electronic devices such as mobile phones and tablets.

[0051] In step S110, target employee information and target salary determination rule identifier are obtained.

[0052] For example, target employee information may include one or more of the following: employee identity information, salary structure information, attendance information, and performance information. Identity information may include one or more of the following: employee ID, name, department, position, employment type (full-time, part-time, outsourced, intern, etc.), and date of employment. Salary structure information may include one or more of the following: basic salary, position-based salary, seniority-based salary, overtime pay, and allowances. Attendance information may include one or more of the following: number of days worked, number of days off, number of days absent without leave, and records of lateness or early departure. Performance information may include one or more of the following: sales revenue, sales volume, and amount received.

[0053] It is understood that before using the technical solutions disclosed in the embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained. For example, in response to receiving a user's active request, a prompt message can be sent to the user to clearly inform the user that the requested operation will require the acquisition and use of the user's personal information. This allows the user to choose whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media that perform the operations of the technical solutions of this disclosure, based on the prompt message. As an optional but non-limiting implementation, the way to send a prompt message to the user in response to receiving a user's active request can be, for example, a pop-up window, in which the prompt message can be presented in text form. Furthermore, the pop-up window can also include a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0054] It is understood that the above notification and user authorization acquisition process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure. The data involved in the technical solution of this disclosure (including but not limited to the data itself, the acquisition or use of data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0055] The target salary determination rule identifier can be the name or number of the target salary determination rule. The target salary determination rule is the salary determination rule used to determine the salary of the target employee. Different employees may have different salary determination rules, thus allowing for pre-determining the salary determination rules for different employees. Therefore, during the process of determining the salary of the target employee, the target salary determination rule identifier for that employee can be directly determined.

[0056] In step S120, if the target salary determination rule corresponding to the target salary determination rule identifier is not stored in the JVM heap memory, the compressed information of the target salary determination rule is obtained from the JVM off-heap memory based on the target salary determination rule identifier. The JVM off-heap memory stores compressed information of multiple rules.

[0057] For example, the rule storage medium may include one or more of a database, file system, and distributed storage system. The rule storage medium may be a storage medium independent of electronic devices. The rule storage medium may store multiple rules, i.e., uncompressed rules containing detailed information (including but not limited to salary determination rules). Each rule may include precondition information, action information, and parameter information. Precondition information is used to determine whether a parameter meets the condition. Precondition information may include the parameter name, operator, and value. For example, if the parameter name in the precondition information is A, the operator is greater than, and the value is 1, then it indicates that it is necessary to determine whether the value of parameter A is greater than 1. Action information is used to define the action to be performed when the parameter meets the condition, such as adding a certain amount, subtracting a certain amount, or keeping it unchanged. Parameter information is used to define detailed information about the parameters participating in the condition judgment. When the service starts, multiple rules can be read from the rule storage medium, and each rule can be compressed to obtain the compressed information of each rule. The compressed information of each rule is then stored in the off-heap memory of the JVM. In this way, the compressed information of the rule can be directly obtained from the off-heap memory of the JVM based on the rule identifier.

[0058] In one example, the rule compression process includes: extracting precondition information, action information, and parameter information from multiple rules; deduplicating the extracted precondition information, action information, and parameter information; numbering the deduplicated precondition information, action information, and parameter information; and generating a mapping relationship between the numbers and the information to represent the precondition numbers, action numbers, and parameter numbers for each rule, using this mapping relationship as the compressed information for the corresponding rule. It is understandable that because different precondition information, action information, and parameter information have different numbers—meaning that the precondition information can be uniquely identified by the precondition number, the action information by the action number, and the parameter information by the parameter number—the mapping relationship between the precondition numbers, action numbers, and parameter numbers can uniquely identify the rule. Therefore, using this mapping relationship as the compressed information for the rule facilitates accurate rule retrieval later. Meanwhile, since compressed information is more concise and occupies less space compared to rules containing detailed information, storing compressed information in JVM off-heap memory can save JVM off-heap memory space and improve read speed.

[0059] In other examples, the rules can also be compressed using compression software in related technologies, which is not limited here.

[0060] In step S130, the compressed information of the target salary determination rule is decompressed to obtain the target salary determination rule.

[0061] The target salary determination rule can be understood as an uncompressed rule containing detailed information. The compressed information of the target salary determination rule is the compressed target salary determination rule.

[0062] For example, if the compressed information is obtained by replacing detailed information with numbers, the compressed information can be decompressed by restoring the numbers to detailed information; if the compressed information is obtained by compression software, the compressed information can be decompressed by compression software.

[0063] In step S140, the salary of the target employee is determined based on the target employee information and the target salary determination rules.

[0064] The target employee information may include the target parameter values ​​required for the execution of the target salary determination rules. Therefore, the salary of the target employee can be determined based on the target employee information and the target salary determination rules.

[0065] The salary determination method of this disclosure, when the target salary determination rule is not stored in the JVM heap memory, obtains compressed information of the target salary determination rule from the JVM off-heap memory, and derives the target salary determination rule based on this compressed information, thereby ensuring the smooth progress of the salary determination task and achieving efficient salary determination rule management. Since the salary determination rule is not entirely stored in the JVM heap memory, nor directly in the JVM off-heap memory, but is stored in the form of compressed information in the JVM off-heap memory, JVM memory usage is reduced, the pressure on JVM garbage collection is alleviated, and service stability is improved. Simultaneously, since some salary determination rules are stored in the JVM heap memory, it is not necessary to obtain the target salary determination rule from the JVM off-heap memory every time; in specific situations, the target salary determination rule can be directly obtained from the JVM heap memory, thereby reducing the negative impact of off-heap caching on service performance.

[0066] In some embodiments of this disclosure, the compressed information of the target compensation determination rule includes one or more of the following: target prerequisite number, target action number, and target parameter number.

[0067] For example, the compressed information of the target salary determination rule may include any one, any two, or all of the target prerequisite number, target action number, and target parameter number.

[0068] The salary determination method described above includes one or more of the following in the compressed information of the target salary determination rule: a precondition number, an action number, and a parameter number. This numbered compression method can significantly reduce space usage, save JVM off-heap memory space, facilitate fast retrieval and decompression, help maintain the integrity and scalability of the target salary determination rule, and improve the storage efficiency and rule management flexibility of the target salary determination rule.

[0069] Regarding step S130, in some embodiments of this disclosure, it may include, for example... Figure 2 Steps S131 to S134 are shown.

[0070] In step S131, the target precondition information corresponding to the target precondition number is obtained from the rule storage medium according to the mapping relationship between the precondition number and the precondition information.

[0071] In step S132, the target action information corresponding to the target action number is obtained from the rule storage medium according to the mapping relationship between action number and action information.

[0072] In step S133, the target parameter information corresponding to the target parameter number is obtained from the rule storage medium according to the mapping relationship between the parameter number and the parameter information.

[0073] In step S134, a target salary determination rule is generated based on the target precondition information, target action information, and target parameter information.

[0074] For example, the target salary determination rule can be obtained by filling the target precondition information, target action information and target parameter information into the rule template.

[0075] The salary determination method described above obtains target precondition information, target action information, and target parameter information from the rule storage medium based on a mapping relationship between numbers and information, and generates target salary determination rules, thereby automating and standardizing the decompression of target salary determination rules. Compared to directly storing complete target salary determination rules, this method reduces data redundancy through number mapping, improves the decompression efficiency of target salary determination rules, and ensures the accuracy and consistency of target salary determination rules by utilizing the reliability and maintainability of the rule storage medium.

[0076] Regarding step S140, in some embodiments of this disclosure, it may include, for example... Figure 3 Steps S141 and S142 are shown.

[0077] In step S141, target parameter values ​​are extracted from target employee information based on target parameter information.

[0078] For example, the target parameter information includes the name of the target parameter, the target employee information includes the target parameter value, and the target parameter value can be extracted from the target employee information based on the name of the target parameter.

[0079] In step S142, if the target parameter value satisfies the target precondition information, the first action in the target action information is executed to obtain the target employee's salary.

[0080] If the target parameter value does not meet the target prerequisite information, the second action in the target action information can be executed. The first action and the second action are different actions.

[0081] The salary determination method described above automatically determines the salary of target employees through accurate target parameter values, clear condition judgments, and action execution logic, reducing the need for manual intervention and improving the accuracy of the salary determination results.

[0082] In some embodiments of this disclosure, after step S110, the following steps may also be included: Figure 4 The step S150 shown.

[0083] In step S150, if the target salary determination rule corresponding to the target salary determination rule identifier is stored in the JVM heap memory, the salary of the target employee is determined according to the target employee information and the target salary determination rule stored in the JVM heap memory.

[0084] Specifically, the content related to determining the salary of the target employee in step S150 can be referred to the description of step S140, and will not be repeated here for the sake of brevity.

[0085] The salary determination method described above directly uses the target salary determination rule to determine employee salaries when the target salary determination rule is already stored in the JVM heap memory. This reduces the steps of obtaining and decompressing the target salary determination rule from the JVM off-heap memory, thereby reducing system computational overhead, optimizing the access path of the target salary determination rule, and improving the salary determination speed. It is especially suitable for high-frequency rule scenarios and improves the overall performance of the system.

[0086] In some embodiments of this disclosure, after step S130, the following may also be included: Figure 5 The step S160 shown.

[0087] In step S160, the target salary determination rule is stored in the JVM heap memory.

[0088] The salary determination method described above implements a heap caching mechanism for target salary determination rules by storing the decompressed target salary determination rules in the JVM heap memory. This eliminates the need to repeatedly retrieve and decompress the target salary determination rules from off-heap memory during subsequent salary determination processes using the same rules, improving the reuse efficiency of target salary determination rules and reducing the frequency of off-heap memory access, thereby improving system speed and resource utilization. It is understandable that since some salary determination rules occupy a relatively large amount of memory, frequent reading and decompression from off-heap memory can impact the performance of electronic devices, and the reading time is also relatively long. Therefore, storing the target salary determination rules in the JVM heap memory facilitates subsequent reuse. Furthermore, it should be noted that since salary determination services are typically deployed in clusters, and during the salary determination process, only a portion of the salary determination rules are usually executed on a particular electronic device within a certain period, all salary determination rules will not be stored in the JVM heap memory simultaneously, thus avoiding any performance impact caused by storing all salary determination rules in the JVM heap memory at the same time.

[0089] In some embodiments of this disclosure, the salary determination method may further include, for example: Figure 6 Steps S170 and S180 are shown.

[0090] In step S170, the number of times the salary determination rule stored in the JVM heap memory is used within a set time period and / or the time difference between the most recent use time of the salary determination rule stored in the JVM heap memory and the current time is determined.

[0091] The time period can be set according to needs, such as one day, three days, one week, or other time periods. The most recently used time is the last time it was used. The current time can be the system timestamp obtained when the payroll determination method was executed.

[0092] If there are multiple salary determination rules stored in the JVM heap memory, then the number of times each salary determination rule is used and / or the time difference is determined for each of the multiple salary determination rules, so as to facilitate the subsequent cleanup of the multiple salary determination rules stored in the JVM heap memory.

[0093] In step S180, the salary determination rules stored in the JVM heap memory are deleted based on the number of uses and / or time difference.

[0094] For example, if only the number of times the salary determination rule stored in the JVM heap memory is used within a set time period is obtained, the salary determination rule stored in the JVM heap memory can be deleted based solely on the number of uses; if only the time difference between the most recent use time and the current time of the salary determination rule stored in the JVM heap memory is obtained, the salary determination rule stored in the JVM heap memory can be deleted based solely on the time difference; if both the number of times the salary determination rule stored in the JVM heap memory is used within a set time period and the time difference between the most recent use time and the current time of the salary determination rule stored in the JVM heap memory are obtained, the salary determination rule stored in the JVM heap memory can be deleted based on both the number of uses and the time difference.

[0095] Salary determination rules that are removed from JVM heap memory can be stored back into JVM heap memory the next time they need to be used for employee salary determination.

[0096] The salary determination method described above achieves dynamic cleanup of JVM heap memory by tracking the number of times salary determination rules are used in JVM heap memory and / or the time difference between the most recent use time and the current time, and deleting salary determination rules stored in JVM heap memory based on the number of uses and / or the time difference. This helps to release the space occupied by infrequently used salary determination rules in JVM heap memory, thereby improving the utilization rate of JVM heap memory and reducing the risk of memory overflow.

[0097] Regarding step S180, as one possible implementation, it may include: deleting pay determination rules that have been used less than a usage threshold from the JVM heap memory.

[0098] The salary determination method described above refines the cleanup strategy for JVM heap memory by deleting salary determination rules that are used infrequently in JVM heap memory. This effectively prevents frequently used salary determination rules from being mistakenly deleted from JVM heap memory, ensuring that frequently used salary determination rules can continue to be accessed quickly through JVM heap memory. At the same time, it optimizes the resource allocation of JVM heap memory and improves the stability and performance of the system.

[0099] Regarding step S180, as another possible implementation, it may include: deleting pay determination rules whose time difference is greater than or equal to a time difference threshold from the JVM heap memory.

[0100] The salary determination method described above implements a time-based JVM heap memory cleanup strategy by deleting long-term unused salary determination rules from the JVM heap memory. This ensures that the salary determination rules stored in the JVM heap memory are relevant to the current business needs, reduces the occupation of invalid rules, and improves the management efficiency of the JVM heap memory.

[0101] Regarding step S180, as another possible implementation, it may include, for example... Figure 7 Steps S181 and S182 are shown.

[0102] In step S181, the number of uses and the time difference are weighted and summed to obtain the sum value.

[0103] For example, the sum = number of uses × first weight + time difference × second weight. The first and second weights can be set according to requirements.

[0104] In step S182, the pay determination rules with sum values ​​greater than or equal to the sum value threshold are removed from the JVM heap memory.

[0105] The salary determination method described above, by weighted summing of usage frequency and time differences and deleting salary determination rules from JVM heap memory based on the sum, comprehensively considers multiple dimensions, achieving a more intelligent JVM heap memory cleanup strategy. Compared to single-dimensional cleanup methods, this weighted method can more accurately identify and delete low-value salary determination rules stored in JVM heap memory, thereby optimizing JVM heap memory resource allocation and balancing the availability of salary determination rules with system performance.

[0106] In some embodiments of this disclosure, prior to step S170, the following may also be included: Figure 8 The step S190 is shown.

[0107] In step S190, it is determined that the remaining capacity of the JVM heap memory is less than the remaining capacity threshold.

[0108] The remaining capacity threshold can be set according to needs, such as 10%, 20%, or any other arbitrary value.

[0109] For example, if the remaining capacity of the JVM heap memory is greater than or equal to the remaining capacity threshold, steps S170 and S180 may not be performed.

[0110] The salary determination method described above ensures that JVM heap memory cleanup operations are triggered when necessary by determining whether the remaining capacity of the JVM heap memory is less than a remaining capacity threshold before cleanup, thus avoiding unnecessary deletion of salary determination rules. This triggering mechanism based on remaining memory capacity improves the targeting and efficiency of memory management, prevents performance degradation when memory is scarce, and enhances system stability and reliability.

[0111] Furthermore, as another possible implementation, step S190 can be omitted before step S170. Instead, it can be determined that the time difference between the last deletion of the salary determination rules stored in the JVM heap memory reaches a set period. In this way, the deletion of salary determination rules stored in the JVM heap memory can be triggered periodically according to the set period, thereby saving JVM heap memory and avoiding long pauses in garbage collection. In this implementation, if the time difference between the last deletion of the salary determination rules stored in the JVM heap memory does not reach the set period, steps S170 and S180 can be omitted.

[0112] It should be noted that the specific values ​​mentioned above are only for illustrating the implementation of this disclosure in detail, and should not be construed as limiting the disclosure. In other examples, implementation methods, or embodiments, other values ​​may be selected based on this disclosure, and no specific limitations are made here.

[0113] Please combine Figure 9 In one example, the salary determination method may include the following steps S201 to S210. The content related to steps S201 to S210 can be referred to the description of the above implementation method. For the sake of brevity, it will not be repeated here.

[0114] In step S201, target employee information and target salary determination rule identifier are obtained.

[0115] In step S202, it is determined whether the target salary determination rule corresponding to the target salary determination rule identifier is stored in the JVM heap memory. If so, proceed to step S203; otherwise, proceed to step S204.

[0116] In step S203, if the target salary determination rule corresponding to the target salary determination rule identifier is stored in the JVM heap memory, the salary of the target employee is determined according to the target employee information and the target salary determination rule stored in the JVM heap memory.

[0117] In step S204, if the target salary determination rule corresponding to the target salary determination rule identifier is not stored in the JVM heap memory, the compressed information of the target salary determination rule is obtained from the JVM off-heap memory based on the target salary determination rule identifier.

[0118] In step S205, the compressed information of the target salary determination rule is decompressed to obtain the target salary determination rule.

[0119] In step S206, the target salary determination rule is stored in the JVM heap memory.

[0120] In step S207, the salary of the target employee is determined based on the target employee information and the target salary determination rules.

[0121] In step S208, the number of times the salary determination rule stored in the JVM heap memory is used within a set time period and the time difference between the most recent use time of the salary determination rule stored in the JVM heap memory and the current time are determined.

[0122] In step S209, the number of uses and the time difference are weighted and summed to obtain the sum value.

[0123] In step S210, the pay determination rules with sum values ​​greater than or equal to the sum value threshold are removed from the JVM heap memory.

[0124] Based on any of the above embodiments, this disclosure also provides a salary determination device.

[0125] Figure 10 This is a schematic block diagram of the structure of a salary determination device according to one embodiment of the present disclosure.

[0126] like Figure 10As shown, the salary determination device includes: a first acquisition module 110, used to acquire target employee information and a target salary determination rule identifier; a second acquisition module 120, used to acquire compressed information of the target salary determination rule from off-JVM memory based on the target salary determination rule identifier when the target salary determination rule corresponding to the target salary determination rule identifier is not stored in the JVM heap memory, wherein the off-JVM heap memory stores compressed information of multiple rules; a decompression module 130, used to decompress the compressed information of the target salary determination rule to obtain the target salary determination rule; and a first determination module 140, used to determine the salary of the target employee according to the target employee information and the target salary determination rule.

[0127] The aforementioned salary determination device can be in the form of computer software, and each module of the aforementioned salary determination device can be implemented through computer software modules.

[0128] In some embodiments of this disclosure, the compressed information of the target compensation determination rule includes one or more of the following: target prerequisite number, target action number, and target parameter number.

[0129] In some embodiments of this disclosure, the decompression module 130 is used to: obtain target precondition information corresponding to the target precondition number from the rule storage medium according to the mapping relationship between the precondition number and the precondition information; obtain target action information corresponding to the target action number from the rule storage medium according to the mapping relationship between the action number and the action information; obtain target parameter information corresponding to the target parameter number from the rule storage medium according to the mapping relationship between the parameter number and the parameter information; and generate a target salary determination rule based on the target precondition information, the target action information, and the target parameter information.

[0130] In some embodiments of this disclosure, the first determining module 140 is used to: extract target parameter values ​​from target employee information based on target parameter information; and, if the target parameter values ​​satisfy the target precondition information, execute the first action in the target action information to obtain the target employee's salary.

[0131] In some embodiments of this disclosure, the salary determination device further includes: a second determination module, used to determine the salary of the target employee based on the target employee information and the target salary determination rule stored in the JVM heap memory, when the target salary determination rule corresponding to the target salary determination rule identifier is stored in the JVM heap memory.

[0132] In some embodiments of this disclosure, the pay determination apparatus further includes a storage module for storing the target pay determination rules in JVM heap memory.

[0133] In some embodiments of this disclosure, the pay determination device further includes: a third determination module, configured to determine the number of times the pay determination rule stored in the JVM heap memory is used within a set time period and / or the time difference between the most recent use time of the pay determination rule stored in the JVM heap memory and the current time; and a deletion module, configured to delete the pay determination rule stored in the JVM heap memory based on the number of uses and / or the time difference.

[0134] In some embodiments of this disclosure, the third determining module is used to: remove pay determination rules that have been used less than a usage threshold from the JVM heap memory.

[0135] In some embodiments of this disclosure, the third determining module is used to: remove pay determination rules whose time difference is greater than or equal to a time difference threshold from the JVM heap memory.

[0136] In some embodiments of this disclosure, the third determining module is used to: perform a weighted summation of the number of uses and the time difference to obtain a sum value; and delete the salary determination rules whose sum value is greater than or equal to the sum value threshold from the JVM heap memory.

[0137] In some embodiments of this disclosure, the pay determination device further includes: a fourth determination module, used to determine that the remaining capacity of the JVM heap memory is less than a remaining capacity threshold.

[0138] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0139] The subject executing the salary determination method in the specific embodiments of this disclosure can be an electronic device such as a mobile phone or computer.

[0140] Therefore, based on any of the above embodiments, this disclosure also provides an electronic device that can execute the salary determination method of any of the embodiments described above.

[0141] Figure 11 This is a schematic block diagram of an electronic device 1000 according to one embodiment of the present disclosure.

[0142] The hardware structure of electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses and bridges, depending on the specific application and overall design constraints of the hardware. Bus 1100 connects various circuits including one or more processors 1200, memory 1300, and / or hardware modules. Bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc. Bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one connection line is used in this figure, but this does not indicate that there is only one bus or one type of bus.

[0143] For ease of explanation, certain steps of the above method are described in relation to modules. It should be understood that the corresponding module performing one or more steps of the above method may be one or more hardware modules specifically configured to perform the corresponding step, or implemented by a processor configured to perform the corresponding step, or stored in a computer-readable medium for implementation by a processor, or implemented by some combination thereof.

[0144] This disclosure also provides a readable storage medium storing a computer program that, when executed by a processor, is used to implement the methods described above. A "readable storage medium" can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples of a readable storage medium include: an electrical connection with one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM), etc.

[0145] This disclosure also provides a computer program product, the methods of which can be implemented wholly or partially through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented wholly or partially as a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed, all or part of the processes or functions of this disclosure are performed.

[0146] Computer programs or instructions can be stored in a readable storage medium or transferred from one readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The readable storage medium can be any available medium capable of access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; an optical medium, such as a digital video optical disc; or a semiconductor medium, such as a solid-state drive. The computer-readable storage medium can be a volatile or non-volatile storage medium, or it can include both volatile and non-volatile types of storage media.

[0147] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, electronic devices, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure 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, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0148] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, electronic devices, and computer program products according to this disclosure. 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 device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0149] 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.

[0150] 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.

[0151] In the description of this specification, the references to terms such as "one embodiment / mode," "some embodiments / modes," "example," "specific example," or "some examples," etc., refer to specific features, structures, or characteristics described in connection with that embodiment / mode or example, which are included in at least one embodiment / mode or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment / mode or example. Moreover, the specific features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments / modes or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments / modes or examples described in this specification, as well as the features of different embodiments / modes or examples.

[0152] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.

Claims

1. A method for determining salary, characterized in that, include: Obtain target employee information and target salary determination rule identifiers; If the target salary determination rule corresponding to the target salary determination rule identifier is not stored in the JVM heap memory, the compressed information of the target salary determination rule is obtained from the JVM off-heap memory based on the target salary determination rule identifier, wherein the compressed information of multiple rules is stored in the JVM off-heap memory. The compressed information of the target salary determination rule is decompressed to obtain the target salary determination rule; and The salary of the target employee is determined based on the target employee information and the target salary determination rules.

2. The salary determination method according to claim 1, characterized in that, The compressed information of the target salary determination rule includes one or more of the following: target prerequisite number, target action number, and target parameter number.

3. The salary determination method according to claim 2, characterized in that, The compressed information of the target salary determination rule is decompressed to obtain the target salary determination rule, which includes: Based on the mapping relationship between the precondition number and the precondition information, the target precondition information corresponding to the target precondition number is obtained from the rule storage medium. Based on the mapping relationship between action number and action information, the target action information corresponding to the target action number is obtained from the rule storage medium; Based on the mapping relationship between parameter numbers and parameter information, the target parameter information corresponding to the target parameter number is obtained from the rule storage medium; and The target salary determination rule is generated based on the target prerequisite information, the target action information, and the target parameter information.

4. The salary determination method according to claim 3, characterized in that, Based on the target employee information and the target salary determination rules, the salary of the target employee is determined, including: Extract target parameter values ​​from the target employee information based on the target parameter information; and If the target parameter value satisfies the target prerequisite information, the first action in the target action information is executed to obtain the target employee's salary.

5. The method for determining salary according to claim 1, characterized in that, After obtaining target employee information and target salary determination rule identifiers, the following is also included: If the target salary determination rule corresponding to the target salary determination rule identifier is stored in the JVM heap memory, the salary of the target employee is determined according to the target employee information and the target salary determination rule stored in the JVM heap memory.

6. The salary determination method according to claim 1, characterized in that, After obtaining the target salary determination rules, the following is also included: The target salary determination rules are stored in the JVM heap memory.

7. The method for determining salary according to any one of claims 1 to 6, characterized in that, Also includes: Determine the number of times the salary determination rule stored in the JVM heap memory is used within a set time period and / or the time difference between the most recent use time of the salary determination rule stored in the JVM heap memory and the current time. as well as Based on the number of uses and / or the time difference, the salary determination rules stored in the JVM heap memory are deleted.

8. The method for determining salary according to claim 7, characterized in that, Based on the number of uses and / or the time difference, the salary determination rules stored in the JVM heap memory are deleted, including: The pay determination rule for usage counts less than the usage count threshold is removed from the JVM heap memory.

9. An electronic device, characterized in that, include: Memory, the memory storing computer programs; as well as A processor that executes a computer program stored in the memory, causing the processor to perform the salary determination method according to any one of claims 1 to 8.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the salary determination method according to any one of claims 1 to 8.