A compression algorithm for processing multiple time period restrictions

By designing a compression algorithm that deals with multiple time period restrictions, the problem that special user groups need to handle recharge services regularly is solved, and the effect of reducing the burden on users and staff and balancing the interests of users and merchants is achieved.

CN114337681BActive Publication Date: 2025-06-20TIANJIN ZHONGCHAO PAPER IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111604504.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-24
Publication Date
2025-06-20
Estimated Expiration
2041-12-24

AI Technical Summary

Technical Problem

Special user groups need to go to the processing center regularly to handle recharge services, which leads to inconvenience and excessive burden on staff.

Method used

A compression algorithm is designed to deal with multiple time period limitations, and the consumption limit and record management of the consumer terminal is realized by initializing the numerical domain, defining the consumption date and the subdomain of the available consumption times, and selecting factors.

Benefits of technology

This algorithm reduces the frequency of users need to visit the processing center regularly, reduces the workload of staff, and effectively limits and manages the number of users' consumption, balancing the interests of users and merchants.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114337681B_ABST
    Figure CN114337681B_ABST
Patent Text Reader

Abstract

The present invention provides a compression algorithm for processing multiple time period restrictions, comprising the following steps: S1, initializing the numerical range; S2, defining the consumption year, month, and day as sub-domain A, the remaining available consumption times per month as sub-domain B, the remaining available consumption times per day as sub-domain C, the maximum available consumption times per month as Max B, and the maximum available consumption times per day as Max A; S3, selecting factors b and c; S4, performing a negation operation on sub-domain A, defined as sub-domain A1; S5, performing compression calculation to obtain a numerical value X and storing the numerical value X; S6, decomposing the inverse operation of the numerical value X to obtain sub-domains A, B, and C; S7, the consumption end determines the consumption result according to the obtained sub-domains A, B, and C. The present invention can eliminate the need for additional recharge or re-initialization operations every month. Reducing this operation not only facilitates users by saving them the trouble of going to the card handling office at the acceptance center every month, but also reduces the crowd gathering at the acceptance center and the workload of the staff.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and particularly relates to a compression algorithm for processing multiple time period restrictions. Background Art

[0002] At present, relevant national departments have clearly put forward to promote the adaptation of Internet applications to the elderly, eliminate the "digital divide" for the elderly, and accelerate the "aging-friendly" reform, which can make the lives of the elderly simpler, more convenient and smarter. It is also a "sunset industry" that is conducive to boosting consumption and expanding domestic demand, a win-win situation;

[0003] Electronic tickets in the form of IC cards are suitable for financial consumption in the offline state and have low requirements for real-time networking of IC card financial payment terminals. Therefore, they are generally applicable to application scenarios such as buses, subways, light rails, park tickets, etc. At present, it has facilitated special user groups represented by the elderly and increased user stickiness. Many public application fields have introduced policies such as discounted tickets. However, in order to balance the interests of both parties involved, merchants providing such preferential products have also imposed certain restrictions on discounted tickets: for example, a limit requirement of 4 times per day and 100 times per month is proposed. However, users need to go to the handling center regularly to handle the recharge business. Considering the particularity of such groups, this patent application designs a compression algorithm for processing multiple time period restrictions. Summary of the Invention

[0004] In view of this, the present invention aims to propose a compression algorithm for processing multiple time period restrictions to solve the problem that special groups need to go to the handling center regularly to handle the recharge business.

[0005] To achieve the above object, the technical solution of the present invention is realized as follows:

[0006] A compression algorithm for processing multiple time period restrictions includes the following steps: S1. Initialize the numerical domain and make it monotonically decreasing according to the consumption rules;

[0007] S2. Define the consumption year, month, and day as sub-domain A, the remaining available consumption times per month as sub-domain B, the remaining available consumption times per day as sub-domain C, the maximum available consumption times per month as Max B, and the maximum available consumption times per day as Max A;

[0008] S3. Select factors b and c, where the values of factors b and c are both positive integers, the value of factor b is greater than Max B, and the value of factor c is greater than Max C;

[0009] S4. Perform a negation operation on sub-domain A in step S2 and define it as sub-domain A1;

[0010] S5. Perform compression calculation using the parameters obtained in steps S2, S3, and S4 to obtain the value X, and store the value X.

[0011] S6. Decompose the inverse operation of the value X to obtain sub-domains A, B, and C.

[0012] S7. The consumer end determines the consumption result based on the obtained sub-domains A, B, and C.

[0013] Furthermore, the compression calculation algorithm in step S5 is X = A1 * b * c + B * c + C.

[0014] Furthermore, in step S6, when decomposing the inverse operation of the value X, the specific method is as follows:

[0015] Take the remainder of the value X with respect to the factor c to obtain the sub-domain C.

[0016] Take the integer part of the value X with respect to the factor c to obtain the value Y.

[0017] Take the remainder of the value Y with respect to the factor b to obtain the sub-domain B.

[0018] Take the integer part of the value Y with respect to the factor b to obtain the sub-domain A1.

[0019] Perform a negation operation on the sub-domain A1 to obtain the sub-domain A.

[0020] Furthermore, step S7 specifically includes the following steps:

[0021] S71. The consumer end determines whether the sub-domain A is the current year, month, and day; if it is the current year, month, and day, jump to step S73; if it is not the current year, month, and day, perform step S72.

[0022] S72. Set the sub-domain A2 as the current year, month, and day, the sub-domain B2 = Max B, and the sub-domain C2 = Max C.

[0023] S73. Determine whether the sub-domain B is greater than 0 and the sub-domain C is greater than 0; if the conditions are met, proceed to the next step; if the conditions are not met, jump to step S75.

[0024] S74. Perform a subtraction operation on the sub-domains B2 and C2 by 1, and consumption is allowed.

[0025] S75. Meet the consumption limit conditions, and consumption is rejected.

[0026] Compared with the prior art, the compression algorithm for processing multiple time period restrictions described in the present invention has the following beneficial effects:

[0027] (1) The compression algorithm for processing multiple time period restrictions described in the present invention is a monotonically decreasing operation, which does not require additional recharge or re-initialization operations every month. Reducing this operation not only facilitates users by eliminating the need to go to the card handling office at the acceptance center every month, but also reduces the gathering of people at the acceptance center and the workload of the staff.

[0028] (2) The compression algorithm for processing multiple time period restrictions described in the present invention enables the consumption terminal to perform consumption processing according to rules, which can limit the daily and monthly consumption times of users, balance the interests between users and merchants, and can better cultivate users' travel habits and expand the user consumption group.

[0029] (3) The compression algorithm for processing multiple time period restrictions described in the present invention can be applied to various application scenarios such as buses, subways, parks, canteens, movie tickets, membership tickets, etc., and has great promotion value. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0031] Figure 1 is a transaction flow chart of applying a compression algorithm for processing multiple time period restrictions according to an embodiment of the present invention;

[0032] Figure 2 is a small program interface diagram of the year-month-day compression and decompression converter according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0033] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.

[0034] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "transverse", "up", "down", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first", "second", etc. can explicitly or implicitly include one or more of such features. In the description of the present invention, unless otherwise specified, the meaning of "a plurality" is two or more.

[0035] In the description of the present invention, it should be noted that unless otherwise clearly specified and limited, the terms "installation", "connection", and "coupling" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the communication inside two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.

[0036] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0037] A compression algorithm for processing multiple time period restrictions includes the following steps: S1. Initialize the numerical domain to make it monotonically decreasing according to the consumption rule;

[0038] S2. Define the consumption year, month, and day as sub-domain A, the remaining available consumption times per month as sub-domain B, the remaining available consumption times per day as sub-domain C, the maximum available consumption times per month as Max B, and the maximum available consumption times per day as Max A;

[0039] S3. Select factors b and c. The values of both factor b and factor c are positive integers. The value of factor b is greater than Max B, and the value of factor c is greater than Max C;

[0040] S4. Perform a negation operation on sub-domain A in step S2 and define it as sub-domain A1; since the value of the consumption year, month, and day increases monotonically according to the natural law, through the negation operation, its value is monotonically decreasing, and the values of the remaining available consumption times per month and the remaining available consumption times per day are both monotonically decreasing. The combination of the three monotonically decreasing sub-domain values ensures the monotonically decreasing characteristic of the consumption terminal;

[0041] S5. Perform compression calculation using the parameters obtained in steps S2, S3, and S4 to obtain a value X, and store the value X;

[0042] S6. Decompose the inverse operation of the value X to obtain sub-domain A, sub-domain B, and sub-domain C;

[0043] S7. The consumption terminal determines the consumption result according to the obtained sub-domain A, sub-domain B, and sub-domain C.

[0044] The compression calculation algorithm in step S5 is X = A1 * b * c + B * c + C.

[0045] In step S6, when decomposing the inverse operation of the value X, the specific method is as follows:

[0046] The factor c performs a remainder operation on the value X to obtain sub-domain C;

[0047] Factor c performs an integer operation on the numerical value X to obtain the numerical value Y;

[0048] Factor b performs a remainder operation on the numerical value Y to obtain the sub-domain B;

[0049] Factor b performs an integer operation on the numerical value Y to obtain the sub-domain A1;

[0050] The sub-domain A1 is inverted to obtain the sub-domain A.

[0051] Step S7 specifically includes the following steps:

[0052] S71. The consumer end determines whether the sub-domain A is the current year, month, and day; if it is the current year, month, and day, it jumps to step S73; if it is not the current year, month, and day, it proceeds to step S72;

[0053] S72. Set the sub-domain A2 as the current year, month, and day, the sub-domain B2 = Max B, and the sub-domain C2 = Max C;

[0054] S73. Determine whether the sub-domain B is greater than 0 and the sub-domain C is greater than 0; if the condition is met, proceed to the next step; if the condition is not met, jump to step S75;

[0055] S74. Perform a subtraction operation on the sub-domains B2 and C2, and consumption is allowed;

[0056] S75. The consumption limit condition is met, and consumption is rejected;

[0057] In the case where S75 allows consumption, compress and adjust the sub-domains A2, B2, and C2, calculate the new numerical value X, and write it into the encrypted end IC card.

[0058] As Figure 1 shown, the overall transaction process of applying this compression algorithm is as follows:

[0059] K1. In the machine management system, according to the compression algorithm, information fields such as factor b, factor c, Max B, and Max C are wirelessly downloaded to the in-vehicle card machine;

[0060] K2. The passenger presents a certificate and applies for a special consumption card from the customer service center;

[0061] K3. The customer service center starts to make a card and writes X, which is compressed from the three information fields of the consumption year, month, and day A, the remaining available consumption times B per month, and the remaining available consumption times C per day, into the IC card according to the compression algorithm;

[0062] K4. The customer service center completes the paper card;

[0063] K5. The passenger completes getting the card;

[0064] K6. When passengers take a ride, they use a special consumption card to swipe and consume on the card reader.

[0065] K7. The card reader reads the X value in the IC card, calculates the values of sub - domain A, sub - domain B, and sub - domain C through the inverse operation of the compression algorithm, and verifies whether IC card consumption is allowed according to the rules.

[0066] K8. After successful verification, it prompts the passenger that the consumption is successful; if the verification fails, it prompts the passenger to insert coins.

[0067] As shown in the following table, taking some values as examples, select b = 16, c = 32, the value is 4 bytes, a total of 8 half - bytes, 32 bits.

[0068]

[0069] YYC: Monthly limit times, 60, maximum 255.

[0070] DDC: Daily limit times, 4, maximum 15.

[0071] YY: Lower 2 - bit year, hexadecimal number.

[0072] MM: Month, hexadecimal number.

[0073] DD: Day, hexadecimal number.

[0074] INV_YMD: = 0xFFFF-(DD + 32*((MM + 16*(YY))))

[0075] Among them, DD + 32*((MM + 16*(YY))) = YY*16*32 + MM*32 + DD,

[0076] <= 99*16*32 + 12*32 + 31 = 51103 = C79F;

[0077] After the above program design, the interface (small program for year - month - day compression and decompression converter) as shown in Figure 2 is formed.

[0078] The above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.

Claims

1. A compression algorithm for handling multiple time - period restrictions, characterized in that , including the following steps: S1. Initialize the numerical domain and make it monotonically decreasing according to the consumption rules; S2. Define the consumption year, month, and day as sub-domain A, the remaining available consumption times per month as sub-domain B, the remaining available consumption times per day as sub-domain C, the maximum available consumption times per month as Max B, and the maximum available consumption times per day as Max A; S3. Select factors b and c. The values of both factor b and factor c are positive integers. The value of factor b is greater than Max B, and the value of factor c is greater than Max C; S4. Perform a negation operation on sub-domain A in step S2 and define it as sub-domain A1; S5. Perform a compression calculation using the parameters obtained in steps S2, S3, and S4 to obtain the value X, and store the value X; The compression calculation algorithm in step S5 is X = A1 * b * c + B * c + C; S6. Decompose the inverse operation of the value X to obtain sub-domain A, sub-domain B, and sub-domain C; In step S6, the method for decomposing the inverse operation of the value X is as follows: Perform a modulo operation on the value X with factor c to obtain sub-domain C; Perform an integer division operation on the value X with factor c to obtain the value Y; Perform a modulo operation on the value Y with factor b to obtain sub-domain B; Perform an integer division operation on the value Y with factor b to obtain sub-domain A1; Perform a negation operation on sub-domain A1 to obtain sub-domain A; S7. The consumer end determines the consumption result based on the obtained sub-domain A, sub-domain B, and sub-domain C; Step S7 specifically includes the following steps: S71. The consumer end determines whether sub-domain A is the current year, month, and day; if it is the current year, month, and day, then jump to step S73; if it is not the current year, month, and day, then perform step S72; S72. Set sub-domain A2 as the current year, month, and day, sub-domain B2 = Max B, and sub-domain C2 = Max C; S73. Determine whether sub-domain B is greater than 0 and sub-domain C is greater than 0; if the conditions are met, then proceed to the next step; if the conditions are not met, then jump to step S75; S74. Perform a subtraction operation on sub-domain B2 and sub-domain C2 by 1, and consumption is allowed; S75. The consumption limit condition is met, and consumption is rejected.

Citation Information

Patent Citations

  • Processing device without Toom-Cook and modular multiplication acquisition method based on processing device

    CN112230886A

  • Real-time parameterized digital pulse compression method and system based on DSP

    CN113238213A