Prize receiving information cache processing method, device and equipment and storage medium
By converting annual, quarterly and monthly prize collection information into binary numbers and storing it in the form of a bytes array, the problem of excessive memory occupancy of traditional String type storage is solved, reducing system load and database burden, and improving query efficiency.
Patent Information
- Application Number
- CN202411101755.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-11-15
AI Technical Summary
Use traditional String types to store customer award records. Each record may take up more memory space, resulting in a sharp increase in system load during holidays or promotions, excessive database burden, and reduced query efficiency.
Convert annual, quarterly and monthly prize collection information into binary numbers, and store it in 1-2 bytes arrays with corresponding flags and user IDs to reduce memory usage, and verify the collection status on the client to improve query efficiency .
It greatly reduces the memory required for each customer to receive the award information, reduces the system load, improves database query efficiency, and ensures the accuracy of the award information.
Smart Images

Figure CN118966154A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data storage, and in particular to a method, device, equipment and storage medium for caching award information. Background Art
[0002] In modern banking, it is common practice for customers to participate in various promotions and rewards. These activities may include points redemption, holiday promotions, special offers, etc., and usually there are some restrictions, such as prizes can only be redeemed once a year. The implementation of such restrictions is aimed at allocating resources fairly and ensuring that every customer has the opportunity to participate and receive rewards.
[0003] Using the traditional String type to store customers' award-claiming records, each record may occupy a large amount of memory space. For example, "2023" requires 48 bytes, or 384 bits, which takes up a lot of memory. For systems that need to store a large amount of customer award-claiming information, this storage method consumes a lot of memory, which causes a large number of customers to try to log in to the system to redeem prizes at specific time points, such as holidays or promotions, resulting in a sharp increase in system load. At the same time, in order to verify whether the customer meets the annual redemption conditions, the system needs to frequently query the database, which not only increases the burden on the database, but also reduces query efficiency. Summary of the invention
[0004] The present application provides a prize claim information cache processing method, device, equipment and storage medium, which solves the problem of using the traditional String type to store the customer's prize claim records. Each record may occupy a large amount of memory space, resulting in a large number of customers trying to log in to the system to redeem prizes at specific time points, such as holidays or promotional activities, causing a sharp increase in system load. At the same time, in order to verify whether the customer meets the annual redemption conditions, the system needs to frequently query the database, which not only increases the burden on the database, but also reduces the query efficiency. Technical problem.
[0005] In view of this, the first aspect of the present application provides a method for caching award information, the method comprising:
[0006] Step S1, when the user executes the annual prize claiming, the first character consisting of the units digit and tens digit of the current year is converted into a first binary number;
[0007] Step S2: Store the first binary number in a byte array in association with the first mark of the annual prize and the second mark of the user.
[0008] Optionally, it also includes:
[0009] Step S3, when the user executes the quarterly prize redemption, the second character consisting of the units digit and tens digit of the current year is converted into a second binary number, and the current quarter is converted into a third binary number;
[0010] Step S4: After the second binary number is concatenated with the third binary number to obtain a fourth binary number, the fourth binary number is stored in a 2-byte array in association with the third mark of the quarterly prize and the second mark of the user.
[0011] Optionally, it also includes:
[0012] Step S5, when the user executes the monthly prize claim, the third character consisting of the units digit and tens digit of the current year is converted into a fifth binary number, and the current month is converted into a sixth binary number;
[0013] Step S6: After the fifth binary digit is concatenated with the sixth binary digit to obtain the seventh binary digit, the seventh binary digit is stored in association with the fourth mark of the monthly prize and the second mark of the user in the form of a 2-byte array.
[0014] Optionally, it also includes:
[0015] Before the user executes the annual prize collection, based on the first mark of the annual prize and the second mark of the user, checking whether there is a first binary number associated with the storage in the corresponding cache of the user;
[0016] If it exists, convert the first binary number into a fourth character, and check whether the fourth character is consistent with the first character consisting of the units digit and tens digit of the current year. If they are consistent, return a receipt prompt to the corresponding client of the user, otherwise execute the annual prize collection process;
[0017] If it does not exist, the annual prize collection process will be executed.
[0018] Optionally, it also includes:
[0019] Before the user executes the quarterly prize collection, based on the third mark of the quarterly prize and the second mark of the user, checking whether there is a fourth binary number associated and stored in the corresponding cache of the user;
[0020] If it exists, convert the fourth binary digit into a fifth character, and check whether the fifth character is consistent with the second character composed of the units and tens digits of the current year and the sixth character composed of the current quarter. If they are consistent, return a receipt prompt to the corresponding client of the user, otherwise execute the quarterly prize collection process;
[0021] If it does not exist, the quarterly prize collection process is executed.
[0022] Optionally, it also includes:
[0023] Before the user executes the monthly prize collection, based on the fourth mark of the monthly prize and the second mark of the user, checking whether there is a seventh binary number associated with the storage in the corresponding cache of the user;
[0024] If it exists, convert the seventh binary number into the seventh character, and check whether the seventh character is consistent with the third character composed of the units and tens digits of the current year and the eighth character composed of the current month. If they are consistent, return a receipt prompt to the corresponding client of the user, otherwise execute the monthly prize receipt process;
[0025] If it does not exist, the monthly prize collection process is executed.
[0026] Optionally, it also includes:
[0027] The associated stored data in the user's cache is cleared at a preset timing.
[0028] A second aspect of the present application provides a prize claim information cache processing device, the device comprising:
[0029] A first processing unit, configured to convert a first character consisting of a unit digit and a tens digit of the current year into a first binary number when the user executes the annual prize redemption;
[0030] The first storage unit is used to store the first binary number in a byte array in association with the first mark of the annual prize and the second mark of the user.
[0031] Optionally, it also includes:
[0032] A second processing unit is used to convert the second character consisting of the units digit and tens digit of the current year into a second binary number and the current quarter into a third binary number when the user executes the quarterly prize redemption;
[0033] The second storage unit is used to concatenate the second binary number with the third binary number to obtain a fourth binary number, and then store it in a 2-byte array in association with the third mark of the quarterly prize and the second mark of the user.
[0034] Optionally, it also includes:
[0035] A third processing unit is used to convert the third character consisting of the units digit and the tens digit of the current year into a fifth binary number and the current month into a sixth binary number when the user executes the monthly prize redemption;
[0036] The third storage unit is used to concatenate the fifth binary digit and the sixth binary digit to obtain the seventh binary digit, and then store it in a 2-byte array in association with the fourth mark of the monthly prize and the second mark of the user.
[0037] Optionally, it also includes:
[0038] A first verification unit is used to verify whether there is a first binary number associated with the user in a corresponding cache based on a first mark of the annual prize and a second mark of the user before the user executes the annual prize collection;
[0039] If it exists, convert the first binary number into a fourth character, and check whether the fourth character is consistent with the first character consisting of the units digit and tens digit of the current year. If they are consistent, return a receipt prompt to the corresponding client of the user, otherwise execute the annual prize collection process;
[0040] If it does not exist, the annual prize collection process will be executed.
[0041] Optionally, the method further includes a second verification unit, configured to:
[0042] Before the user executes the quarterly prize collection, based on the third mark of the quarterly prize and the second mark of the user, checking whether there is a fourth binary number associated and stored in the corresponding cache of the user;
[0043] If it exists, convert the fourth binary digit into a fifth character, and check whether the fifth character is consistent with the second character composed of the units and tens digits of the current year and the sixth character composed of the current quarter. If they are consistent, return a receipt prompt to the corresponding client of the user, otherwise execute the quarterly prize collection process;
[0044] If it does not exist, the quarterly prize collection process is executed.
[0045] Optionally, a third verification unit is further included, configured to:
[0046] Before the user executes the monthly prize collection, based on the fourth mark of the monthly prize and the second mark of the user, checking whether there is a seventh binary number associated with the storage in the corresponding cache of the user;
[0047] If it exists, convert the seventh binary number into the seventh character, and check whether the seventh character is consistent with the third character composed of the units and tens digits of the current year and the eighth character composed of the current month. If they are consistent, return a receipt prompt to the corresponding client of the user, otherwise execute the monthly prize receipt process;
[0048] If it does not exist, the monthly prize collection process is executed.
[0049] Optionally, it also includes:
[0050] The clearing unit is used to clear the associated stored data in the user's cache according to a preset timing.
[0051] A third aspect of the present application provides a prize claim information cache processing device, the device comprising a processor and a memory:
[0052] The memory is used to store program codes and transmit the program codes to the processor;
[0053] The processor is used to execute the steps of the method for caching award information as described in the first aspect according to the instructions in the program code.
[0054] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the method described in the first aspect above.
[0055] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0056] In the present application, a prize claim information caching processing method, device, equipment and storage medium are provided. After the user receives the annual prize, the characters corresponding to the units and tens digits of the current year are converted into binary numbers so that they can be saved using only one bytes array, greatly reducing the memory required to cache the prize claim information of each customer. At the same time, the binary numbers are associated with the prizes and user corresponding identifiers to ensure that the prize claim information is correct. This solves the problem of using the traditional String type to store the customer's prize claim records, where each record may occupy a large amount of memory space, resulting in a large number of customers trying to log in to the system to redeem prizes at specific time points, such as holidays or promotional activities, causing a sharp increase in system load. At the same time, in order to verify whether the customer meets the annual redemption conditions, the system needs to frequently query the database, which not only increases the burden on the database but also reduces the query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 A method flow chart of a method for caching award information in an embodiment of the present application;
[0058] Figure 2 This is a schematic diagram of the structure of the award information cache processing device in the embodiment of the present application;
[0059] Figure 3 It is a structural diagram of the award information cache processing device in the embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0061] The present application designs a prize claim information cache processing method, device, equipment and storage medium, which solves the problem of using the traditional String type to store the customer's prize claim records. Each record may take up a lot of memory space, resulting in a large number of customers trying to log in to the system to redeem prizes at specific time points, such as holidays or promotional activities, causing a sharp increase in system load. At the same time, in order to verify whether the customer meets the annual redemption conditions, the system needs to frequently query the database, which not only increases the burden on the database, but also reduces the query efficiency. Technical problems.
[0062] For easier understanding, see Figure 1 , Figure 1 Flow chart of the method for caching award information in the embodiment of the present application. Figure 1 As shown, specifically:
[0063] Step S1, when the user executes the annual prize claiming, the first character consisting of the units digit and tens digit of the current year is converted into a first binary number;
[0064] It should be noted that the units and tens digits of the current year are determined, and these two digits are combined into a two-digit character. Then, this character is converted into the corresponding binary number.
[0065] Example: If the current year is 2023, the ones and tens digits form the character "23". Converting to binary yields 00101101 (2 in binary is 0010, 3 in binary is 0011).
[0066] Step S2: Store the first binary number in a byte array in association with the first symbol of the annual prize and the second symbol of the user.
[0067] It should be noted that the binary number obtained in step S1 is stored as a byte array and is stored in association with a specific mark of the annual award (eg, a fixed bit pattern) and an identifier of the user (eg, user ID).
[0068] Example: 00101101 is stored in association with the annual award symbol A and the user ID userID_123.
[0069] Furthermore, it also includes:
[0070] Step S3, when the user executes the quarterly prize redemption, the second character consisting of the units digit and tens digit of the current year is converted into a second binary number, and the current quarter is converted into a third binary number;
[0071] It should be noted that when claiming quarterly prizes, the process of step S1 is repeated, and the current quarter (1-4) is converted into two binary digits.
[0072] Example: If it is the first quarter of 2023, the year part "23" converted to binary is 00101101, and the quarter digit 1 converted to binary is 0001.
[0073] Step S4: After the second binary digit and the third binary digit are concatenated to obtain a fourth binary digit, the fourth binary digit is stored in a 2-byte array in association with the third mark of the quarterly prize and the second mark of the user.
[0074] It should be noted that the binary numbers of the year and quarter obtained in step S3 are concatenated and stored as a two-byte array, and are stored in association with the logo of the quarterly prize and the user ID.
[0075] Example: 001011010001 is stored in association with the quarterly prize flag B and the user ID userID_123.
[0076] Furthermore, it also includes:
[0077] Step S5, when the user executes the monthly prize claim, the third character consisting of the units digit and tens digit of the current year is converted into a fifth binary number, and the current month is converted into a sixth binary number;
[0078] Step S6: After the fifth binary digit and the sixth binary digit are concatenated to obtain the seventh binary digit, the seventh binary digit is stored in a 2-byte array in association with the fourth mark of the monthly prize and the second mark of the user.
[0079] It should be noted that when claiming monthly prizes, the ones and tens digits of the year and the current month (1-12) are converted into binary numbers and then concatenated and stored.
[0080] Example: If it is March 2023, the year part "23" is converted to binary 00101101, and the month digit 3 is converted to binary 0011. The concatenation results in 001011010011.
[0081] Furthermore, it also includes:
[0082] Before the user executes the annual prize collection, based on the first mark of the annual prize and the second mark of the user, it is checked whether there is a first binary number associated with the storage in the corresponding cache of the user;
[0083] If it exists, convert the first binary digit into the fourth character, and check whether the fourth character is consistent with the first character composed of the units and tens digits of the current year. If they are consistent, return a receipt prompt to the user's corresponding client, otherwise execute the annual prize collection process;
[0084] If it does not exist, the annual prize collection process will be executed.
[0085] It should be noted that before the user attempts to claim the prize, the system will search the cache for the corresponding binary number based on the prize type flag and user ID, and compare it with the characters of the current date.
[0086] Example: If a user attempts to claim a yearly prize, the system looks for the binary number associated with userID_123 and flag A. If 00101101 is found, and this matches the binary conversion of the current year "23", the system notifies the user that it has been claimed.
[0087] Furthermore, it also includes:
[0088] Before the user executes the quarterly prize collection, based on the third mark of the quarterly prize and the second mark of the user, checking whether there is a fourth binary number associated with the storage in the corresponding cache of the user;
[0089] If it exists, convert the fourth binary digit into the fifth character, and check whether the fifth character is consistent with the second character composed of the units and tens digits of the current year and the sixth character composed of the current quarter. If they are consistent, return a receipt prompt to the user's corresponding client, otherwise execute the quarterly prize collection process;
[0090] If it does not exist, the quarterly prize collection process will be executed.
[0091] Furthermore, it also includes:
[0092] Before the user executes the monthly prize collection, based on the fourth mark of the monthly prize and the second mark of the user, checking whether the seventh binary number associated with the storage exists in the corresponding cache of the user;
[0093] If it exists, convert the seventh binary digit into the seventh character, and check whether the seventh character is consistent with the third character composed of the units and tens digits of the current year and the eighth character composed of the current month. If they are consistent, return a receipt prompt to the user's corresponding client, otherwise execute the monthly prize collection process;
[0094] If it does not exist, the monthly prize collection process will be executed.
[0095] Furthermore, it also includes:
[0096] Clear the associated stored data in the user's cache according to the preset time.
[0097] It should be noted that the system automatically clears all relevant binary numbers and associated flags in the user cache according to preset rules (for example, January 1 of each year).
[0098] Example: On January 1 of each year, the system automatically clears all annual, quarterly, and monthly prize claim records in the user cache.
[0099] See also Figure 2 , Figure 2 Schematic diagram of the structure of the award information cache processing device in the embodiment of the present application. Figure 2 As shown, specifically:
[0100] The first processing unit 201 is used to convert the first character consisting of the units digit and tens digit of the current year into a first binary number when the user executes the annual prize redemption;
[0101] It should be noted that the units and tens digits of the current year are determined, and these two digits are combined into a two-digit character. Then, this character is converted into the corresponding binary number.
[0102] Example: If the current year is 2023, the ones and tens digits form the character "23". Converting to binary yields 00101101 (2 in binary is 0010, 3 in binary is 0011).
[0103] The first storage unit 202 is used to store the first binary number in a byte array in association with the first mark of the annual prize and the second mark of the user.
[0104] It should be noted that the binary number obtained in step S1 is stored as a byte array and is stored in association with a specific mark of the annual award (eg, a fixed bit pattern) and an identifier of the user (eg, user ID).
[0105] Example: 00101101 is stored in association with the annual award symbol A and the user ID userID_123.
[0106] Furthermore, it also includes:
[0107] A second processing unit is used to convert the second character consisting of the units digit and tens digit of the current year into a second binary number and the current quarter into a third binary number when the user executes the quarterly prize redemption;
[0108] It should be noted that when claiming quarterly prizes, the process of step S1 is repeated, and the current quarter (1-4) is converted into two binary digits.
[0109] Example: If it is the first quarter of 2023, the year part "23" converted to binary is 00101101, and the quarter digit 1 converted to binary is 0001.
[0110] The second storage unit is used to concatenate the second binary digit and the third binary digit to obtain a fourth binary digit, and then store it in a 2-byte array in association with the third mark of the quarterly prize and the second mark of the user.
[0111] It should be noted that the binary numbers of the year and quarter obtained in step S3 are concatenated and stored as a two-byte array, and are stored in association with the logo of the quarterly prize and the user ID.
[0112] Example: 001011010001 is stored in association with the quarterly prize flag B and the user ID userID_123.
[0113] Furthermore, it also includes:
[0114] A third processing unit is used to convert the third character consisting of the units digit and the tens digit of the current year into a fifth binary number and the current month into a sixth binary number when the user executes the monthly prize redemption;
[0115] The third storage unit is used to concatenate the fifth binary digit and the sixth binary digit to obtain the seventh binary digit, and store it in association with the fourth mark of the monthly prize and the second mark of the user in the form of a 2-byte array.
[0116] It should be noted that when claiming monthly prizes, the ones and tens digits of the year and the current month (1-12) are converted into binary numbers and then concatenated and stored.
[0117] Example: If it is March 2023, the year part "23" is converted to binary 00101101, and the month digit 3 is converted to binary 0011. The concatenation results in 001011010011.
[0118] Furthermore, it also includes:
[0119] A first verification unit is used to verify whether there is a first binary number associated with the user in a corresponding cache based on the first mark of the annual prize and the second mark of the user before the user executes the annual prize collection;
[0120] If it exists, convert the first binary digit into the fourth character, and check whether the fourth character is consistent with the first character composed of the units and tens digits of the current year. If they are consistent, return a receipt prompt to the user's corresponding client, otherwise execute the annual prize collection process;
[0121] If it does not exist, the annual prize collection process will be executed.
[0122] It should be noted that before the user attempts to claim the prize, the system will search the cache for the corresponding binary number based on the prize type flag and user ID, and compare it with the characters of the current date.
[0123] Example: If a user attempts to claim a yearly prize, the system looks for the binary number associated with userID_123 and flag A. If 00101101 is found, and this matches the binary conversion of the current year "23", the system notifies the user that it has been claimed.
[0124] Furthermore, it also includes a second verification unit, which is used to:
[0125] Before the user executes the quarterly prize collection, based on the third mark of the quarterly prize and the second mark of the user, checking whether there is a fourth binary number associated with the storage in the corresponding cache of the user;
[0126] If it exists, convert the fourth binary digit into the fifth character, and check whether the fifth character is consistent with the second character composed of the units and tens digits of the current year and the sixth character composed of the current quarter. If they are consistent, return a receipt prompt to the user's corresponding client, otherwise execute the quarterly prize collection process;
[0127] If it does not exist, the quarterly prize collection process will be executed.
[0128] Furthermore, a third verification unit is included, which is used to:
[0129] Before the user executes the monthly prize collection, based on the fourth mark of the monthly prize and the second mark of the user, checking whether the seventh binary number associated with the storage exists in the corresponding cache of the user;
[0130] If it exists, convert the seventh binary digit into the seventh character, and check whether the seventh character is consistent with the third character composed of the units and tens digits of the current year and the eighth character composed of the current month. If they are consistent, return a receipt prompt to the user's corresponding client, otherwise execute the monthly prize collection process;
[0131] If it does not exist, the monthly prize collection process will be executed.
[0132] Furthermore, it also includes:
[0133] The clearing unit is used to clear the associated stored data in the user's cache according to a preset timing.
[0134] It should be noted that the system automatically clears all relevant binary numbers and associated flags in the user cache according to preset rules (for example, January 1 of each year).
[0135] Example: On January 1 of each year, the system automatically clears all annual, quarterly, and monthly prize claim records in the user cache.
[0136] The present application embodiment also provides another award information cache processing device, such as Figure 3 For the sake of convenience, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. The terminal can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (English full name: Personal Digital Assistant, English abbreviation: PDA), a sales terminal (English full name: Point of Sales, English abbreviation: POS), a car computer, etc., taking the terminal as a mobile phone as an example:
[0137] Figure 3 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal provided in an embodiment of the present application. Figure 3 The mobile phone includes: a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080, and a power supply 1090. Those skilled in the art can understand that Figure 3 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0138] Combine the following Figure 3 A detailed introduction to the various components of the mobile phone:
[0139] The RF circuit 1010 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 1080 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 1010 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (full name: Low Noise Amplifier, English abbreviation: LNA), a duplexer, etc. In addition, the RF circuit 1010 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communications can use any communication standard or protocol, including but not limited to Global System of Mobile communications (Global System of Mobile communication, English abbreviation: GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, English abbreviation: CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (Long Term Evolution, English abbreviation: LTE), e-mail, Short Messaging Service (SMS), etc.
[0140] The memory 1020 can be used to store software programs and modules. The processor 1080 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1020. The memory 1020 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1020 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0141] The input unit 1030 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 1031 or near the touch panel 1031 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 1031 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 1080, and can receive and execute commands sent by the processor 1080. In addition, the touch panel 1031 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 1031, the input unit 1030 may further include other input devices 1032. Specifically, the other input devices 1032 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
[0142] The display unit 1040 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 1040 may include a display panel 1041. Optionally, the display panel 1041 may be configured in the form of a liquid crystal display (full name in English: Liquid Crystal Display, English abbreviation: LCD), an organic light-emitting diode (full name in English: Organic Light-Emitting Diode, English abbreviation: OLED), etc. Further, the touch panel 1031 may cover the display panel 1041. When the touch panel 1031 detects a touch operation on or near it, it is transmitted to the processor 1080 to determine the type of touch event. Subsequently, the processor 1080 provides a corresponding visual output on the display panel 1041 according to the type of touch event. Although in Figure 3 In the embodiment, the touch panel 1031 and the display panel 1041 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 1031 and the display panel 1041 can be integrated to realize the input and output functions of the mobile phone.
[0143] The mobile phone may also include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 1041 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0144] The audio circuit 1060, the speaker 1061, and the microphone 1062 can provide an audio interface between the user and the mobile phone. The audio circuit 1060 can transmit the received audio data to the speaker 1061 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 1062 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1060 and converted into audio data, and then the audio data is output to the processor 1080 for processing, and then sent to another mobile phone through the RF circuit 1010, or the audio data is output to the memory 1020 for further processing.
[0145] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 1070. It provides users with wireless broadband Internet access. Figure 3 A WiFi module 1070 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.
[0146] The processor 1080 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 1020 and calling data stored in the memory 1020, it executes various functions of the mobile phone and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 1080 may include one or more processing units; preferably, the processor 1080 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1080.
[0147] The mobile phone also includes a power supply 1090 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 1080 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.
[0148] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0149] In the embodiment of the present application, the processor 1080 included in the terminal also has the following functions:
[0150] Step S1, when the user executes the annual prize claiming, the first character consisting of the units digit and tens digit of the current year is converted into a first binary number;
[0151] It should be noted that the units and tens digits of the current year are determined, and these two digits are combined into a two-digit character. Then, this character is converted into the corresponding binary number.
[0152] Example: If the current year is 2023, the ones and tens digits form the character "23". Converting to binary yields 00101101 (2 in binary is 0010, 3 in binary is 0011).
[0153] Step S2: Store the first binary number in a byte array in association with the first symbol of the annual prize and the second symbol of the user.
[0154] It should be noted that the binary number obtained in step S1 is stored as a byte array and is stored in association with a specific mark of the annual award (eg, a fixed bit pattern) and an identifier of the user (eg, user ID).
[0155] Example: 00101101 is stored in association with the annual award symbol A and the user ID userID_123.
[0156] Furthermore, it also includes:
[0157] Step S3, when the user executes the quarterly prize redemption, the second character consisting of the units digit and tens digit of the current year is converted into a second binary number, and the current quarter is converted into a third binary number;
[0158] It should be noted that when claiming quarterly prizes, the process of step S1 is repeated, and the current quarter (1-4) is converted into two binary digits.
[0159] Example: If it is the first quarter of 2023, the year part "23" converted to binary is 00101101, and the quarter digit 1 converted to binary is 0001.
[0160] Step S4: After the second binary digit and the third binary digit are concatenated to obtain a fourth binary digit, the fourth binary digit is stored in a 2-byte array in association with the third mark of the quarterly prize and the second mark of the user.
[0161] It should be noted that the binary numbers of the year and quarter obtained in step S3 are concatenated and stored as a two-byte array, and are stored in association with the logo of the quarterly prize and the user ID.
[0162] Example: 001011010001 is stored in association with the quarterly prize flag B and the user ID userID_123.
[0163] Furthermore, it also includes:
[0164] Step S5, when the user executes the monthly prize claim, the third character consisting of the units digit and tens digit of the current year is converted into a fifth binary number, and the current month is converted into a sixth binary number;
[0165] Step S6: After the fifth binary digit and the sixth binary digit are concatenated to obtain the seventh binary digit, the seventh binary digit is stored in a 2-byte array in association with the fourth mark of the monthly prize and the second mark of the user.
[0166] It should be noted that when claiming monthly prizes, the ones and tens digits of the year and the current month (1-12) are converted into binary numbers and then concatenated and stored.
[0167] Example: If it is March 2023, the year part "23" is converted to binary 00101101, and the month digit 3 is converted to binary 0011. The concatenation results in 001011010011.
[0168] Furthermore, it also includes:
[0169] Before the user executes the annual prize collection, based on the first mark of the annual prize and the second mark of the user, it is checked whether there is a first binary number associated with the storage in the corresponding cache of the user;
[0170] If it exists, convert the first binary digit into the fourth character, and check whether the fourth character is consistent with the first character composed of the units and tens digits of the current year. If they are consistent, return a receipt prompt to the user's corresponding client, otherwise execute the annual prize collection process;
[0171] If it does not exist, the annual prize collection process will be executed.
[0172] It should be noted that before the user attempts to claim the prize, the system will search the cache for the corresponding binary number based on the prize type flag and user ID, and compare it with the characters of the current date.
[0173] Example: If a user attempts to claim a yearly prize, the system looks for the binary number associated with userID_123 and flag A. If 00101101 is found, and this matches the binary conversion of the current year "23", the system notifies the user that it has been claimed.
[0174] Furthermore, it also includes:
[0175] Before the user executes the quarterly prize collection, based on the third mark of the quarterly prize and the second mark of the user, checking whether there is a fourth binary number associated with the storage in the corresponding cache of the user;
[0176] If it exists, convert the fourth binary digit into the fifth character, and check whether the fifth character is consistent with the second character composed of the units and tens digits of the current year and the sixth character composed of the current quarter. If they are consistent, return a receipt prompt to the user's corresponding client, otherwise execute the quarterly prize collection process;
[0177] If it does not exist, the quarterly prize collection process will be executed.
[0178] Furthermore, it also includes:
[0179] Before the user executes the monthly prize collection, based on the fourth mark of the monthly prize and the second mark of the user, checking whether the seventh binary number associated with the storage exists in the corresponding cache of the user;
[0180] If it exists, convert the seventh binary digit into the seventh character, and check whether the seventh character is consistent with the third character composed of the units and tens digits of the current year and the eighth character composed of the current month. If they are consistent, return a receipt prompt to the user's corresponding client, otherwise execute the monthly prize collection process;
[0181] If it does not exist, the monthly prize collection process will be executed.
[0182] Furthermore, it also includes:
[0183] Clear the associated stored data in the user's cache according to the preset time.
[0184] It should be noted that the system automatically clears all relevant binary numbers and associated flags in the user cache according to preset rules (for example, January 1 of each year).
[0185] Example: On January 1 of each year, the system automatically clears all annual, quarterly, and monthly prize claim records in the user cache.
[0186] The embodiment of the present application also provides a computer-readable storage medium for storing program code, wherein the program code is used to execute any one of the implementation methods of the award information cache processing method described in the aforementioned embodiments.
[0187] In the embodiments of the present application, a prize claim information caching processing method, device, equipment and storage medium are provided. After the user receives the annual prize, the characters corresponding to the units and tens digits of the current year are converted into binary numbers so that they can be saved using only one bytes array, greatly reducing the memory required to cache the prize claim information of each customer. At the same time, the binary numbers are associated with the prizes and user corresponding identifiers to ensure that the prize claim information is correct. This solves the problem of using the traditional String type to store the customer's prize claim records, where each record may occupy a large amount of memory space, resulting in a large number of customers trying to log in to the system to redeem prizes at specific time points, such as holidays or promotional activities, causing a sharp increase in system load. At the same time, in order to verify whether the customer meets the annual redemption conditions, the system needs to frequently query the database, which not only increases the burden on the database, but also reduces the query efficiency.
[0188] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0189] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0190] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0191] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0192] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0193] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0194] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (full name in English: Read-Only Memory, English abbreviation: ROM), random access memory (full name in English: Random Access Memory, English abbreviation: RAM), disk or optical disk and other media that can store program codes.
[0195] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for caching award information, It is characterized in that include: Step S1, when the user executes the annual prize claiming, the first character consisting of the units digit and tens digit of the current year is converted into a first binary number; Step S2: Store the first binary number in a byte array in association with the first mark of the annual prize and the second mark of the user.
2. The award information cache processing method according to claim 1, It is characterized in that Also includes: Step S3: when the user executes the quarterly prize claiming, the second character consisting of the units digit and tens digit of the current year is converted into a second binary number, and the current quarter is converted into a third binary number; Step S4: After the second binary number is concatenated with the third binary number to obtain a fourth binary number, the fourth binary number is stored in a 2-byte array in association with the third mark of the quarterly prize and the second mark of the user.
3. The award information cache processing method according to claim 1, It is characterized in that Also includes: Step S5, when the user executes the monthly prize claiming, the third character consisting of the units digit and tens digit of the current year is converted into a fifth binary number, and the current month is converted into a sixth binary number; Step S6: After the fifth binary digit is concatenated with the sixth binary digit to obtain the seventh binary digit, the seventh binary digit is stored in association with the fourth mark of the monthly prize and the second mark of the user in the form of a 2-byte array.
4. The award information cache processing method according to claim 1, It is characterized in that Also includes: Before the user executes the annual prize collection, based on the first mark of the annual prize and the second mark of the user, checking whether there is a first binary number associated with the storage in the corresponding cache of the user; If it exists, convert the first binary number into a fourth character, and check whether the fourth character is consistent with the first character consisting of the units digit and tens digit of the current year. If they are consistent, return a receipt prompt to the corresponding client of the user, otherwise execute the annual prize collection process; If it does not exist, the annual prize collection process will be executed.
5. The award information cache processing method according to claim 2, It is characterized in that Also includes: Before the user executes the quarterly prize collection, based on the third mark of the quarterly prize and the second mark of the user, checking whether there is a fourth binary number associated and stored in the corresponding cache of the user; If it exists, convert the fourth binary digit into a fifth character, and check whether the fifth character is consistent with the second character composed of the units and tens digits of the current year and the sixth character composed of the current quarter. If they are consistent, return a receipt prompt to the corresponding client of the user, otherwise execute the quarterly prize collection process; If it does not exist, the quarterly prize collection process is executed.
6. The award information cache processing method according to claim 3, It is characterized in that Also includes: Before the user executes the monthly prize collection, based on the fourth mark of the monthly prize and the second mark of the user, checking whether there is a seventh binary number associated with the storage in the corresponding cache of the user; If it exists, convert the seventh binary number into the seventh character, and check whether the seventh character is consistent with the third character composed of the units and tens digits of the current year and the eighth character composed of the current month. If they are consistent, return a receipt prompt to the corresponding client of the user, otherwise execute the monthly prize receipt process; If it does not exist, the monthly prize collection process is executed.
7. The award information cache processing method according to claim 1, It is characterized in that Also includes: The associated stored data in the user's cache is cleared at a preset timing.
8. A prize collection information cache processing device, It is characterized in that include: A first processing unit, configured to convert a first character consisting of a unit digit and a tens digit of the current year into a first binary number when the user executes the annual prize redemption; The first storage unit is used to store the first binary number in a byte array in association with the first mark of the annual prize and the second mark of the user.
9. A prize collection information cache processing device, It is characterized in that The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the award information cache processing method described in any one of claims 1-7 according to the instructions in the program code.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium is used to store program codes, and the program codes are used to execute the award information cache processing method according to any one of claims 1 to 7.
Citation Information
Cited By
Digital surveying and mapping method for landscape garden
CN120219545A
