Integral Processing Method, Device, Equipment and Computer Readable Storage Medium

By storing user identity identification in the in-memory database on the server side and updating the points table and total points table, the problem of points processing in the existing technology consumes a lot of computing power and increases system load, achieving more efficient points operation.

CN115344581BActive Publication Date: 2025-06-10SHENZHEN CHINAROAD NETWORK TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210991197.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-17
Publication Date
2025-06-10
Estimated Expiration
2042-08-17

AI Technical Summary

Technical Problem

The existing points processing method requires scanning the database table at a fixed time, resulting in a large amount of computing power spent on the server. Each point operation requires checking whether there are expired points, increasing the system load.

Method used

By storing user identity in the in-memory database on the server side, obtaining and updating the corresponding points table and total points table, only performing points operations when necessary, avoiding repeated checks on expired points.

Benefits of technology

It reduces the computing power consumption on the server side, reduces the system load, and improves the efficiency of points operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115344581B_ABST
    Figure CN115344581B_ABST
Patent Text Reader

Abstract

The present invention discloses an integral processing method, device, equipment and computer-readable storage medium. The method includes: obtaining an integral request and an identity identifier; if the identity identifier does not exist in the in-memory database, obtaining a first integral table, a first total integral table and the current date; updating the first integral table and the first total integral table according to the current date, determining a second integral table and a second total integral table, and storing the identity identifier into the in-memory database; performing an integral operation according to the second integral table and the second total integral table. According to the received integral request and identity identifier, the present invention determines whether the identity identifier exists in the in-memory database. If the identity identifier does not exist, the expired integral records are updated, and the integral table is updated and the identity identifier is stored. If the identity identifier exists, the integral operation can be directly performed according to the second integral table and the second total integral table without having to determine again whether there are expired integral records in the first integral table, thereby saving the computing power of the server side.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of integral processing, and particularly to an integral processing method, device, equipment and computer-readable storage medium. Background Art

[0002] Currently, the main method of integral processing is to use a timed task to scan the database table storing the integrals, compare the expiration time of the integral table stored in the database with the scanning time. If the expiration time is less than the scanning time, the integral is deleted or set to unavailable.

[0003] In actual application, the server side needs to start a timed task at a fixed time every day to scan the entire database table, which requires a powerful computing power of the server side. In addition, there are some inactive users. When starting a timed task to scan the entire database table, it is also necessary to check whether the integrals of inactive users expire on the same day, and every time an integral is consumed or obtained, it is necessary to check whether there are expired integrals, which undoubtedly wastes computing power and increases the load of the entire system.

[0004] The above content is only used to assist in understanding the technical solution of the present invention, and does not represent an admission that the above content is prior art. Summary of the Invention

[0005] The main object of the present invention is to provide an integral processing method, device, equipment and computer-readable storage medium, aiming to solve the technical problem that in the existing integral operation process, it is necessary to determine whether there are expired integrals every time an integral operation is performed, thus consuming a large amount of computing power of the system.

[0006] To achieve the above object, the present invention provides an integral processing method, which is applied to the server side. The integral processing method includes the following steps:

[0007] Obtain an integral request sent by a user terminal and the identity identifier corresponding to the user terminal;

[0008] Determine whether the identity identifier exists in the in-memory database;

[0009] If the identity identifier does not exist in the in-memory database, obtain the first integral table, the first total integral table corresponding to the identity identifier, and the current date;

[0010] Update the first integral table according to the current date to determine a second integral table, update the first total integral table according to the current date to determine a second total integral table, and store the identity identifier in the in-memory database;

[0011] Execute the integral operation corresponding to the integral request according to the second integral table and the second total integral table.

[0012] Further, the first integral table includes various first integral records, and the first integral record includes a first expiration date. The steps of updating the first integral table according to the current date, determining a second integral table, updating the first total integral table according to the current date, determining a second total integral table, and storing the identity identifier in the memory database include:

[0013] Determine first target integral records in the first integral record where the current date exceeds the first expiration date, and update the flag bits in the first target integral records in the first integral table to a first preset value to obtain a second integral table;

[0014] Accumulatively calculate the expired integral values corresponding to each first target integral record to obtain the total expired integral, determine the first total integral value corresponding to the first total integral table, and perform a subtraction operation on the first total integral value and the total expired integral to obtain a second total integral value;

[0015] Update the first total integral value in the first total integral table to the second total integral value to obtain a second total integral table.

[0016] Further, the second integral table includes various second integral records. The steps of performing the integral operation corresponding to the integral request according to the second integral table and the second total integral table include:

[0017] If the integral request is a request to obtain integral, obtain the integral value to be obtained corresponding to the request to obtain integral and the third expiration date corresponding to the request to obtain integral;

[0018] Determine valid integral records with flag bits as a second preset value in the second integral record, and determine whether there are second target integral records with the same second expiration date and the third expiration date in the valid integral records;

[0019] If there are the second target integral records, obtain the first integral value of the second target integral record, perform an addition operation on the first integral value and the integral value to be obtained to obtain a second integral value, and update the first integral value to the second integral value in the second integral table;

[0020] If there are no such second target integral records, use the third expiration date, the flag bit with the second preset value, and the integral value to be obtained as a third integral record;

[0021] Add the third integral record in the second integral table to update the second integral table, and update the second total integral table according to the integral value to be obtained.

[0022] Further, the step of performing the integration operation corresponding to the integration request according to the second integration table and the second total integration table includes:

[0023] If the integration request is a consumption integration request, obtain the consumption integral value corresponding to the consumption integration request, and determine whether the second total integral value corresponding to the second total integration table is greater than or equal to the consumption integral value;

[0024] If the second total integral value is greater than or equal to the consumption integral value, determine the third target integral record with the earliest expiration date in the valid integral records according to the second expiration date;

[0025] Determine whether the third integral value in the third target integral record is greater than the consumption integral value;

[0026] If the third integral value is greater than the consumption integral value, perform a subtraction operation on the third integral value and the consumption integral value to obtain a fourth integral value, update the third integral value in the third target integral record to the fourth integral value in the second integration table, and update the second total integration table according to the consumption integral value.

[0027] Further, after the step of determining whether the third integral value in the third target integral record is greater than the consumption integral value, the following steps are also included:

[0028] If the third integral value is less than the consumption integral value, sequentially accumulate the fifth integral values in the second integral records according to the time sequence of the second expiration dates until the sum first exceeds the consumption integral value to obtain a sixth integral value;

[0029] Perform a subtraction operation on the sixth integral value and the consumption integral value to obtain a seventh integral value, and determine the fourth target integral records accumulated to the fourth target integral value;

[0030] According to the expiration dates in the fourth target integral records, determine the fifth target integral record with the latest expiration date in the fourth target integral records, and determine each sixth target integral record that is not the latest expired in the fourth target integral records;

[0031] Update the eighth integral value in the fifth target integral record to the seventh integral value in the second integration table, clear the ninth integral values in each sixth target integral record in the second integration table, and set the flag bits of each sixth target integral record to the first preset value;

[0032] Update the second total integration table according to the consumption integral value.

[0033] Further, the step of performing the integral operation corresponding to the integral request according to the second integral table includes:

[0034] If the integral request is an integral query request, send the second integral table and the second total integral table to the user terminal, where the user terminal displays the second integral table and the second total integral table.

[0035] Further, after the step of determining whether the identity identifier exists in the in-memory database, the following steps are also included:

[0036] If the identity identifier exists in the in-memory database, obtain the second integral table and the second total integral table corresponding to the identity identifier;

[0037] Perform the integral operation corresponding to the integral request according to the second integral table and the second total integral table.

[0038] In addition, to achieve the above object, the present invention also provides an integral processing device, the integral processing device includes:

[0039] A first acquisition module, configured to acquire an integral request sent by a user terminal and the identity identifier corresponding to the user terminal;

[0040] A determination module, configured to determine whether the identity identifier exists in the in-memory database;

[0041] A second acquisition module, configured to, if the identity identifier does not exist in the in-memory database, acquire the first integral table, the first total integral table corresponding to the identity identifier, and the current date;

[0042] A storage module, configured to update the first integral table according to the current date, determine the second integral table, update the first total integral table according to the current date, determine the second total integral table, and store the identity identifier in the in-memory database;

[0043] An execution module, configured to perform the integral operation corresponding to the integral request according to the second integral table and the second total integral table.

[0044] In addition, to achieve the above object, the present invention also provides an integral processing device, the integral processing device includes: a memory, a processor, and an integral processing program stored on the memory and executable on the processor, and when the integral processing program is executed by the processor, the steps of the foregoing integral processing method are implemented.

[0045] In addition, to achieve the above object, the present invention also provides a computer-readable storage medium, on which an integral processing program is stored, and when the integral processing program is executed by a processor, the steps of the foregoing integral processing method are implemented.

[0046] The present invention obtains an integral request sent by a user terminal and the identity identifier corresponding to the user terminal; determines whether the identity identifier exists in the in-memory database; if the identity identifier does not exist in the in-memory database, obtains a first integral table, a first total integral table corresponding to the identity identifier, and the current date; updates the first integral table according to the current date, determines a second integral table, updates the first total integral table according to the current date, determines a second total integral table, and stores the identity identifier in the in-memory database; performs an integral operation corresponding to the integral request according to the second integral table and the second total integral table. It can update the expired integral records, update the integral table, and store the identity identifier when the identity identifier does not exist in the in-memory database according to the integral request and the identity identifier. When the identity identifier already exists in the in-memory database, the integral operation can be directly performed according to the second integral table and the second total integral table without having to determine again whether there are expired integral records in the first integral table, thereby saving the computing power of the server side. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 is a schematic structural diagram of an integral processing device in a hardware operating environment related to the solution of an embodiment of the present invention;

[0048] Figure 2 is a schematic flowchart of a first embodiment of the integral processing method of the present invention;

[0049] Figure 3 is a schematic diagram of functional modules of an embodiment of an integral processing device of the present invention.

[0050] The implementation, functional features, and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0051] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0052] As Figure 1 shown, Figure 1 is a schematic structural diagram of an integral processing device in a hardware operating environment related to the solution of an embodiment of the present invention.

[0053] The integral processing device in the embodiments of the present invention can be a PC, or a mobile terminal device with a display function such as a smart phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a portable computer, etc.

[0054] As Figure 1 shown, the integral processing device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0055] Optionally, the integral processing device may further include a camera, an RF (Radio Frequency) circuit, sensors, an audio circuit, a WiFi module, and so on. Among them, the sensors include, for example, a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. Among them, the ambient light sensor can adjust the brightness of the display screen according to the brightness of the ambient light, and the proximity sensor can turn off the display screen and / or the backlight when the integral processing device is moved to the ear. As a kind of motion sensor, the gravity acceleration sensor can detect the magnitude of the acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used for applications that identify the posture of the integral processing device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as a pedometer, tapping), etc.; of course, the integral processing device can also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be elaborated here.

[0056] Those skilled in the art can understand that Figure 1 the terminal structure shown in does not constitute a limitation on the terminal, and may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements.

[0057] As shown Figure 1 in FIG., the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an integral processing program.

[0058] In Figure 1 the terminal shown in FIG., the network interface 1004 is mainly used to connect to the background server and perform data communication with the background server; the user interface 1003 is mainly used to connect to the client (user side) and perform data communication with the client; and the processor 1001 may be used to call the integral processing program stored in the memory 1005.

[0059] In this embodiment, the integral processing device includes: a memory 1005, a processor 1001, and an integral processing program stored on the memory 1005 and executable on the processor 1001. When the processor 1001 calls the integral processing program stored in the memory 1005, it executes the steps of the integral processing method in the following respective embodiments.

[0060] The present invention also provides an integral processing method, which is applied to the server side. Referring to Figure 2 , Figure 2 FIG. is a schematic flowchart of the first embodiment of the method of the present invention.

[0061] In this embodiment, the integral processing method includes the following steps:

[0062] Step S101, obtaining an integral request sent by a user terminal and the identity identifier corresponding to the user terminal;

[0063] It should be noted that the integral request sent by the user terminal may be triggered by the user clicking a button corresponding to a preset integral request on the user interface. The integral request includes a request for consuming integral, a request for obtaining integral, a request for querying integral, etc.

[0064] In this embodiment, when detecting an integral request sent by the user terminal, obtain the integral request sent by the user terminal and obtain the identity identifier corresponding to the user terminal. Each user terminal has its corresponding unique identity identifier.

[0065] Step S102, determining whether the identity identifier exists in the in-memory database;

[0066] It should be noted that the identity identifiers of user terminals are stored in the in-memory database, and all the identity identifiers stored in the in-memory database can be deleted according to a preset time. Specifically, it can be set to automatically delete all the identity identifiers of user terminals stored in the in-memory database at 23:59:59 every day.

[0067] In this embodiment, when an integral request sent by a user terminal is detected, it is queried whether the identity identifier of the user terminal is stored in the in-memory database. Herein, the identity identifier may be the ID (Identity document) of the user. Specifically, the identity identifier may be stored in a Redis (Remote Dictionary Server) non-relational in-memory database. The data in Redis can be set with a data clearing time. Once the data clearing time is reached, the user data of the day will be cleared. For example, the time for clearing all identity identifiers in the in-memory database can be set to 23:59:59 of the current day.

[0068] Step S103, if the identity identifier does not exist in the in-memory database, obtain the first integral table, the first total integral table corresponding to the identity identifier, and the current date.

[0069] In this embodiment, if the identity identifier of the user terminal does not exist in the in-memory database, obtain the first integral table corresponding to the user terminal within a preset time. Specifically, when a query integral request sent by the user terminal is detected, traverse all the identity identifiers stored in the in-memory database to determine whether the identity identifier of the user terminal exists. If not, obtain the first integral table, the first total integral table of the user through the user ID, and obtain the current date.

[0070] Step S104, update the first integral table according to the current date to determine the second integral table, update the first total integral table according to the current date to determine the second total integral table, and store the identity identifier in the in-memory database.

[0071] In this embodiment, the server side compares the obtained current date with the first expiration date of each first integral record in the first integral table, and sets the flag bit of the expired first integral record in the first integral table to a first preset value. Herein, the first preset value can be artificially set to 0, indicating that the record has expired, to obtain the second integral table. Then, according to the expired integral value of the expired first integral record in the first integral table and the total integral value in the first total integral table, the second total integral table can be obtained. Store the identity identifier corresponding to the user terminal in the in-memory database, indicating that the user has updated the expired integral in the first integral table within the preset time to obtain the second integral table. Each second integral record in the second integral table has not expired and is available, and can be used for the integral operation corresponding to the next integral request.

[0072] Step S105, perform the integral operation corresponding to the integral request according to the second integral table and the second total integral table.

[0073] In this embodiment, by obtaining the second integral table and the second total integral table, and then according to the integral request sent by the user terminal, perform the integral operation corresponding to the integral request, where the integral operation can be an integral consumption operation, an integral acquisition operation, and an integral query operation.

[0074] The integral processing method proposed in this embodiment determines whether the identity identifier exists in the in-memory database by obtaining the integral request sent by the user terminal and the identity identifier corresponding to the user terminal. Then, if the identity identifier does not exist in the in-memory database, obtain the first integral table, the first total integral table, and the current date corresponding to the identity identifier. Next, update the first integral table according to the current date to determine the second integral table, update the first total integral table according to the current date to determine the second total integral table, and store the identity identifier in the in-memory database. Finally, according to the second integral table and the second total integral table, perform the integral operation corresponding to the integral request. It can update the expired integral records when the identity identifier does not exist in the in-memory database according to the integral request and the identity identifier, update the integral table, and store the identity identifier. When the identity identifier already exists in the in-memory database, the integral operation can be directly performed according to the second integral table and the second total integral table without having to determine again whether there are expired integral records in the first integral table, thereby saving the computing power of the server side.

[0075] Based on the first embodiment, a second embodiment of the integral processing method of the present invention is proposed. In this embodiment, step S104 includes:

[0076] Step S201, determine the first target integral records in the first integral records whose current date exceeds the first expiration date, and update the flag bit in the first target integral records in the first integral table to the first preset value to obtain the second integral table;

[0077] Step S203, accumulate the expired integral values corresponding to each first target integral record to obtain the total expired integral, determine the first total integral value corresponding to the first total integral table, and perform a subtraction operation on the first total integral value and the total expired integral to obtain the second total integral value;

[0078] Step S204, update the first total integral value in the first total integral table to the second total integral value to obtain the second total integral table.

[0079] It should be noted that the first integral table includes each first integral record, and the first integral record includes the first expiration date.

[0080] It should be noted that the preset value can be manually set to 0.

[0081] In this embodiment, the first expiration date of each first integral record in the first integral table is queried and compared with the current date to determine whether the current date exceeds the first expiration date, and the first target integral records in the first integral records where the current date exceeds the first expiration date are determined. The flag bit of the above first integral record is updated to a first preset value to obtain a second integral table. Here, the first flag bit indicates whether the first integral record has expired. When the flag bit is the first preset value, it means that the first integral record has expired. For example, when the flag bit is 0, it means that the first integral record has expired or the integral value of the first integral record is 0. When the flag bit is 1, it means that the first integral record has not expired.

[0082] Next, the expired integral values corresponding to each first target integral record are accumulated to obtain the total expired integral, and the first total integral value corresponding to the first total integral table is determined. The first total integral value is subtracted from the total expired integral to obtain the second total integral value. The first total integral value in the first total integral table is updated to the second total integral value to obtain a second total integral table.

[0083] For example, the expired integral values corresponding to each first target integral record are 7, 8, 9, and 10 respectively, the total expired integral is 34, and the first total integral value is 60. The first total integral value is subtracted from the total expired integral to obtain the second total integral value of 26. The first total integral value of 60 in the first total integral table is updated to the second total integral value of 26 to obtain a second total integral table.

[0084] The integral processing method proposed in this embodiment determines the first target integral records in the first integral records where the current date exceeds the first expiration date, and updates the flag bit in the first target integral records in the first integral table to the first preset value to obtain a second integral table. Then, the expired integral values corresponding to each first target integral record are accumulated to obtain the total expired integral, and the first total integral value corresponding to the first total integral table is determined. The first total integral value is subtracted from the total expired integral to obtain the second total integral value. Finally, the first total integral value in the first total integral table is updated to the second total integral value to obtain a second total integral table, which can update the flag bit of the first target integral records in the first integral table, exclude the expired integral records, and then accurately obtain the second integral table and the second total integral table after excluding the expired integrals.

[0085] Based on the first embodiment, a third embodiment of the integral processing method of the present invention is proposed. In this embodiment, step S105 includes:

[0086] Step 301, if the integral request is an integral acquisition request, obtain the acquired integral value corresponding to the integral acquisition request and the third expiration date corresponding to the integral acquisition request;

[0087] Step 302, determine the valid integral records in the second integral record with the flag bit being the second preset value, and determine whether there is a second target integral record in the valid integral records with the second expiration date being the same as the third expiration date;

[0088] Step 303, if there is the second target integral record, obtain the first integral value of the second target integral record, perform an addition operation on the first integral value and the acquired integral value to obtain a second integral value, and update the first integral value to the second integral value in the second integral table;

[0089] Step 304, if there is no such second target integral record, use the third expiration date, the flag bit with the second preset value, and the acquired integral value as the third integral record;

[0090] Step 305, add the third integral record in the second integral table to update the second integral table, and update the second total integral table according to the acquired integral value.

[0091] In this embodiment, if the integral request is an integral acquisition request, determine the acquired integral value corresponding thereto according to the integral acquisition request, and the third expiration date corresponding to the integral acquisition request

[0092] Then, determine the valid integral records in the second integral record with the flag bit being the second preset value, where the second preset value is a numerically preset value, specifically, it can be set to 1, indicating that the second integral record is valid, and then determine whether there is a second target integral record in the valid integral records with the second expiration date being the same as the third expiration date.

[0093] If there is a second target integral record, obtain the first integral value of the second target integral record, perform an addition operation on the first integral value and the acquired integral value to obtain a second integral value, and update the first integral value to the second integral value in the second integral table. For example, if the first integral value of the second target integral record is 10 and the acquired integral value is 20, then the second integral value is 30.

[0094] If there is no second target integral record, use the third expiration date, the flag bit of the second preset value, and the obtained integral value as the third integral record, add the third integral record to the second integral table to update the second integral table, and update the second total integral table according to the obtained integral value. Specifically, add the obtained integral value to the total integral value of the second total integral table to obtain a new total integral value, and store the new total integral value in the second total integral table.

[0095] The integral processing method proposed in this embodiment, if the integral request is an integral acquisition request, obtains the obtained integral value corresponding to the integral acquisition request and the third expiration date corresponding to the integral acquisition request, then determines the valid integral records in the second integral record with the flag bit being the second preset value, and determines whether there is a second target integral record with the same second expiration date and the third expiration date in the valid integral records. Then, if there is the second target integral record, obtains the first integral value of the second target integral record, performs an addition operation on the first integral value and the obtained integral value to obtain a second integral value, and updates the first integral value to the second integral value in the second integral table. Then, if there is no second target integral record, uses the third expiration date, the flag bit of the second preset value, and the obtained integral value as the third integral record, then adds the third integral record to the second integral table to update the second integral table, and updates the second total integral table according to the obtained integral value, and can accurately obtain the second integral table and the second integral table after performing the integral acquisition operation when the integral request is an integral acquisition request.

[0096] Based on the third embodiment, a fourth embodiment of the integral processing method of the present invention is proposed. In this embodiment, step S105 includes:

[0097] Step S401, if the integral request is a point consumption request, obtain the consumed integral value corresponding to the point consumption request, and determine whether the second total integral value corresponding to the second total integral table is greater than or equal to the consumed integral value;

[0098] Step S402, if the second total integral value is greater than or equal to the consumed integral value, determine the third target integral record with the earliest expiration in the valid integral records according to the second expiration date;

[0099] Step S403, determine whether the third integral value in the third target integral record is greater than the consumed integral value;

[0100] Step S404, if the value of the third integral is greater than the value of the consumed integral, perform a subtraction operation on the value of the third integral and the value of the consumed integral to obtain a fourth integral value, and update the value of the third integral in the third target integral record in the second integral table to the fourth integral value.

[0101] It should be noted that when the value of the consumed integral is greater than the sum of the integral values in all the second integral records, that is, the user's integral is not enough to consume the integral, it is fed back to the user that the consumption integral operation corresponding to the consumed integral cannot be performed.

[0102] In this embodiment, when the integral request is a consumed integral request, obtain the value of the consumed integral corresponding to the consumed integral request, and determine whether the value of the second total integral in the second total integral table is greater than or equal to the value of the consumed integral. If the value of the second total integral in the second total integral table is greater than or equal to the value of the consumed integral, then continue to determine the third target integral record with the earliest expiration date in the valid integral records according to the second expiration date. For example, there is a valid integral record A, where the expiration date of the valid integral record A is July 17th, a valid integral record B, where the expiration date of the valid integral record B is July 18th, and a valid integral record C, where the expiration date of the valid integral record C is July 19th. Then the third target record is the valid record A.

[0103] Next, determine whether the value of the third integral in the third target integral record is greater than the value of the consumed integral. If the value of the third integral is greater than the value of the consumed integral, perform a subtraction operation on the value of the third integral and the value of the consumed integral to obtain a fourth integral value. For example, if the value of the third integral is 20 and the value of the consumed integral is 10, then the value of the third integral is greater than the value of the consumed integral. Subtract the value of the consumed integral from the value of the third integral, and then the value of the fourth integral is 10. Next, update the value of the third integral in the third target integral record in the second integral table to the fourth integral value, and update the value of the second total integral in the second total integral table according to the value of the consumed integral.

[0104] The integral processing method proposed in this embodiment, if the integral request is a consumption integral request, obtains the consumption integral value corresponding to the consumption integral request, determines whether the second total integral value corresponding to the second total integral table is greater than or equal to the consumption integral value, and then if the second total integral value is greater than or equal to the consumption integral value, determines the third target integral record with the earliest expiration date in the valid integral records according to the second expiration date, and then determines whether the third integral value in the third target integral record is greater than the consumption integral value. Then, if the third integral value is greater than the consumption integral value, subtracts the consumption integral value from the third integral value to obtain a fourth integral value, updates the third integral value in the third target integral record to the fourth integral value in the second integral table, and updates the second total integral table according to the consumption integral value, so that when the integral request is a consumption integral request, the second integral table and the second total integral table after performing the consumption integral operation can be accurately obtained.

[0105] Based on the fourth embodiment, a fifth embodiment of the integral processing method of the present invention is proposed. In this embodiment, after step S403, it includes:

[0106] Step 501, if the third integral value is less than the consumption integral value, sequentially accumulate the fifth integral values in the second integral records according to the time sequence of the second expiration dates in each second integral record until it first exceeds the consumption integral value to obtain a sixth integral value;

[0107] Step 502, subtract the consumption integral value from the sixth integral value to obtain a seventh integral value;

[0108] Step 503, determine each fourth target integral record whose fourth target integral value is accumulated;

[0109] Step 504, determine the fifth target integral record with the last expiration date in the fourth target integral records according to the expiration date in the fourth target integral records, and determine each sixth target integral record that is not the last expired in the fourth target integral records;

[0110] Step 505, update the eighth integral value of the fifth target integral record to the seventh integral value in the second integral table, clear the ninth integral values of each sixth target integral record in the second integral table, set the flag bit of each sixth target integral record to the first preset value, and update the second total integral table according to the consumption integral value.

[0111] In this embodiment, if the third integral value is less than the consumed integral value, then according to the chronological order of the second expiration dates in each second integral record, the fifth integral values in the second integral records are successively accumulated until it first exceeds the consumed integral value to obtain the sixth integral value. For example, the consumed integral value is 30, and there are second integral record A, second integral record B, second integral record C, and second integral record D. Among them, the second expiration date of the second integral record A is July 11th, and the fifth integral value is 8; the second expiration date of the second integral record B is July 12th, and the fifth integral value is 10; the second expiration date of the second integral record C is July 13th, and the fifth integral value is 13; the second expiration date of the second integral record D is July 14th, and the fifth integral value is 17. Then, the fifth integral values of the second integral record A, the second integral record B, and the second integral record C are successively accumulated, and the sum is 31, which is greater than the consumed integral value for the first time, so the sixth integral value is 31.

[0112] Then, a subtraction operation is performed on the sixth integral value and the consumed integral value to obtain the seventh integral value. For example, the sixth integral value is 31 and the consumed integral value is 30, so the seventh integral value is 1. Determine each fourth target integral record whose accumulated value reaches the fourth target integral value, such as the second integral record A, the second integral record B, and the second integral record C.

[0113] According to the expiration dates in the fourth target integral records, determine the fifth target integral record with the last expiration date in the fourth target integral records, and determine each sixth target integral record that is not the last expired in the fourth target integral records. For example, the second integral record C is the fifth target integral record, and the second integral record A and the second integral record B are the sixth target integral records.

[0114] In the second integral table, update the eighth integral value of the fifth target integral record to the seventh integral value, clear the ninth integral values of each sixth target integral record in the second integral table, and set the flag bit of each sixth target integral record to the first preset value. For example, take the second integral record C with the fifth integral value of 13 as the fifth target integral record and change 13 to the seventh integral value 1. Take the second integral record A with the fifth integral value of 8 and the second integral record B with the fifth integral value of 10 as the sixth target integral records, clear 8 and 10 to 0, and set the flag bit of each sixth target integral record to the first preset value, where the first preset value represents that this integral record is unavailable. Finally, update the second total integral value in the second total integral table according to the consumed integral value.

[0115] The integral processing method proposed in this embodiment is as follows: if the third integral value is less than the consumed integral value, then according to the chronological order of the second expiration dates in each second integral record, the fifth integral values in the second integral records are successively accumulated until it first exceeds the consumed integral value to obtain the sixth integral value. Then, a subtraction operation is performed on the sixth integral value and the consumed integral value to obtain the seventh integral value. Next, the fourth target integral records whose accumulated values reach the fourth target integral value are determined. Then, according to the expiration dates in the fourth target integral records, the fifth target integral record with the last expiration date is determined in the fourth target integral records, and each sixth target integral record that is not the last to expire is determined in the fourth target integral records. Then, in the second integral table, the eighth integral value of the fifth target integral record is updated to the seventh integral value, the ninth integral values of each sixth target integral record are cleared in the second integral table, and the flag bits of each sixth target integral record are set to the first preset value. And the second total integral table is updated according to the consumed integral value, so that when the integral request is a consumed integral request, the second integral table and the second total integral table after performing the consumed integral operation can be accurately obtained.

[0116] Based on the above embodiments, a sixth embodiment of the integral processing method of the present invention is proposed. In this embodiment, step S105 further includes:

[0117] Step S601, if the integral request is a query integral request, then send the second integral table and the second total integral table to the user terminal, where the user terminal displays the second integral table and the second total integral table.

[0118] In this embodiment, when the integral request is a query integral request, the integral operation corresponding to the query integral request is executed. The server sends the second integral table and the second total integral table to the user terminal, and the user terminal displays the second integral table and the second total integral table through a preset user interface for the user to query their valid integral.

[0119] The integral processing method proposed in this embodiment is as follows: if the integral request is a query integral request, then send the second integral table and the second total integral table to the user terminal, where the user terminal displays the second integral table and the second total integral table. It can send the second integral table and the second total integral table to the user terminal according to the query integral request, enabling the user to query the valid integral, thereby improving the user experience.

[0120] Based on the sixth embodiment, a seventh embodiment of the integral processing method of the present invention is proposed. In this embodiment, after step S102, it further includes:

[0121] Step 701, if the identity identifier exists in the in-memory database, obtain the second score table corresponding to the identity identifier and the second total score table;

[0122] Step 702, perform the score operation corresponding to the score request according to the second score table and the second total score table.

[0123] In this embodiment, if the identity identifier exists in the in-memory database, directly obtain the second score table corresponding to the identity identifier and the second total score table. Specifically, if the identity identifier exists in the in-memory database, the second score table and the second total score table have been updated within the preset storage duration. Finally, perform the score operation corresponding to the score request according to the second score table and the second total score table. Among them, for performing the score operation corresponding to the score request, refer to the above various embodiments and will not be elaborated here.

[0124] The score processing method proposed in this embodiment, by if the identity identifier exists in the in-memory database, obtain the second score table corresponding to the identity identifier and the second total score table, and then perform the score operation corresponding to the score request according to the second score table and the second total score table, can, according to the score request sent by the user terminal and the identity identifier, if the identity identifier corresponding to the user terminal exists in the in-memory database, directly obtain the second score table and the second total score table corresponding to the user terminal, without determining whether there are expired scores in the first score table corresponding to the user, thereby saving the computing power of the server side.

[0125] The present invention also provides a score processing device, refer to Figure 3 , the score processing device includes:

[0126] The first acquisition module 10 is used to acquire the score request sent by the user terminal and the identity identifier corresponding to the user terminal;

[0127] The determination module 20 is used to determine whether the identity identifier exists in the in-memory database;

[0128] The second acquisition module 30 is used to, if the identity identifier does not exist in the in-memory database, acquire the first score table, the first total score table corresponding to the identity identifier, and the current date;

[0129] The storage module 40 is used to update the first score table according to the current date, determine the second score table, update the first total score table according to the current date, determine the second total score table, and store the identity identifier in the in-memory database;

[0130] The execution module 50 is used to perform the score operation corresponding to the score request according to the second score table and the second total score table.

[0131] Further, the storage module 40 is further configured to:

[0132] Determine a first target integral record in the first integral record where the current date exceeds the first expiration date, and update the flag bit in the first integral table to a first preset value for the first target integral record, so as to obtain a second integral table;

[0133] Accumulatively calculate the expired integral values corresponding to each first target integral record to obtain the total expired integral, determine the first total integral value corresponding to the first total integral table, and perform a subtraction operation on the first total integral value and the total expired integral to obtain a second total integral value;

[0134] Update the first total integral value to the second total integral value in the first total integral table to obtain a second total integral table.

[0135] Further, the execution module 50 is further configured to:

[0136] If the integral request is an integral acquisition request, obtain the acquired integral value corresponding to the integral acquisition request and the third expiration date corresponding to the integral acquisition request;

[0137] Determine a valid integral record with a flag bit of a second preset value in the second integral record, and determine whether there is a second target integral record in the valid integral record where the second expiration date is the same as the third expiration date;

[0138] If there is the second target integral record, obtain the first integral value of the second target integral record, perform an addition operation on the first integral value and the acquired integral value to obtain a second integral value, and update the first integral value to the second integral value in the second integral table;

[0139] If there is no such second target integral record, use the third expiration date, the flag bit of the second preset value, and the acquired integral value as a third integral record;

[0140] Add the third integral record to the second integral table to update the second integral table, and update the second total integral table according to the acquired integral value.

[0141] Further, the execution module 50 is further configured to:

[0142] If the integral request is an integral consumption request, obtain the consumed integral value corresponding to the integral consumption request, and determine whether the second total integral value corresponding to the second total integral table is greater than or equal to the consumed integral value;

[0143] If the second total integral value is greater than or equal to the consumed integral value, determine the third target integral record with the earliest expiration date in the valid integral record according to the second expiration date;

[0144] Determine whether the third integral value in the third target integral record is greater than the consumed integral value;

[0145] If the third integral value is greater than the consumed integral value, perform a subtraction operation on the third integral value and the consumed integral value to obtain a fourth integral value, update the third integral value in the third target integral record to the fourth integral value in the second integral table, and update the second total integral table according to the consumed integral value.

[0146] Furthermore, the execution module 50 is further configured to:

[0147] If the third integral value is less than the consumed integral value, sequentially accumulate the fifth integral values in the second integral records according to the chronological order of the second expiration dates until the sum first exceeds the consumed integral value to obtain a sixth integral value;

[0148] Perform a subtraction operation on the sixth integral value and the consumed integral value to obtain a seventh integral value, and determine the respective fourth target integral records accumulated to the fourth target integral value;

[0149] According to the expiration dates in the fourth target integral records, determine the fifth target integral record with the latest expiration date in the fourth target integral records, and determine the respective sixth target integral records that are not the last to expire in the fourth target integral records;

[0150] Update the eighth integral value in the fifth target integral record to the seventh integral value in the second integral table, clear the ninth integral values in the respective sixth target integral records in the second integral table, set the flag bits of the respective sixth target integral records to the first preset value, and update the second total integral table according to the consumed integral value.

[0151] Furthermore, the execution module 50 is further configured to:

[0152] If the integral request is a query integral request, send the second integral table and the second total integral table to the user terminal, where the user terminal displays the second integral table and the second total integral table.

[0153] Furthermore, the determination module 20 is further configured to:

[0154] If the identity identifier exists in the memory database, obtain the second integral table and the second total integral table corresponding to the identity identifier;

[0155] Perform the integration operation corresponding to the integration request according to the second integration table and the second total integration table.

[0156] The methods executed by the above program units can refer to the respective embodiments of the integration processing method of the present invention, and will not be elaborated here.

[0157] In addition, an embodiment of the present invention further provides an integration processing device, which includes: a memory, a processor, and an integration processing program stored on the memory and executable on the processor. When the integration processing program is executed by the processor, the steps of the above-mentioned integration processing method are implemented.

[0158] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which an integration processing program is stored. When the integration processing program is executed by a processor, the steps of the above-mentioned integration processing method are implemented.

[0159] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or system including that element.

[0160] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0161] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium as described above (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in the respective embodiments of the present invention.

[0162] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. An integral processing method, characterized in that, applied to the server side, the integral processing method includes the following steps: Obtain an integral request sent by a user terminal and the identity identifier corresponding to the user terminal; Determine whether the identity identifier exists in the in-memory database; If the identity identifier does not exist in the in-memory database, obtain a first integral table, a first total integral table corresponding to the identity identifier, and the current date. The first integral table includes each first integral record, and the first integral record includes a first expiration date; Determine a first target integral record in the first integral record where the current date exceeds the first expiration date, and update the flag bit in the first integral record to a first preset value in the first integral table to obtain a second integral table; Accumulatively calculate the expired integral values corresponding to each first target integral record to obtain the total expired integral, determine the first total integral value corresponding to the first total integral table, and perform a subtraction operation on the first total integral value and the total expired integral to obtain a second total integral value; Update the first total integral value to the second total integral value in the first total integral table to obtain a second total integral table, and store the identity identifier in the in-memory database; Execute the integral operation corresponding to the integral request according to the second integral table and the second total integral table; If the identity identifier exists in the in-memory database, obtain the second integral table and the second total integral table corresponding to the identity identifier; Execute the integral operation corresponding to the integral request according to the second integral table and the second total integral table.

2. The integral processing method according to claim 1, characterized in that, the second integral table includes each second integral record, and the step of executing the integral operation corresponding to the integral request according to the second integral table and the second total integral table includes: If the integral request is an integral acquisition request, obtain the acquired integral value corresponding to the integral acquisition request and the third expiration date corresponding to the integral acquisition request; Determine valid integral records in the second integral record where the flag bit is a second preset value, and determine whether there is a second target integral record in the valid integral record where the second expiration date is the same as the third expiration date; If there is the second target integral record, obtain the first integral value of the second target integral record, perform an addition operation on the first integral value and the acquired integral value to obtain a second integral value, and update the first integral value to the second integral value in the second integral table; If the second target integral record does not exist, use the third expiration date, the flag bit of the second preset value, and the acquired integral value as a third integral record; Add the third integral record in the second integral table to update the second integral table, and update the second total integral table according to the acquired integral value.

3. The integral processing method according to claim 1, characterized in that, the step of executing the integral operation corresponding to the integral request according to the second integral table and the second total integral table includes: If the integral request is a consumption integral request, obtain the consumption integral value corresponding to the consumption integral request, and determine whether the second total integral value corresponding to the second total integral table is greater than or equal to the consumption integral value; If the second total integral value is greater than or equal to the consumption integral value, determine the third target integral record with the earliest expiration date in the valid integral records according to the second expiration date; Determine whether the third integral value in the third target integral record is greater than the consumption integral value; If the third integral value is greater than the consumption integral value, perform a subtraction operation on the third integral value and the consumption integral value to obtain a fourth integral value, update the third integral value in the third target integral record to the fourth integral value in the second integral table, and update the second total integral table according to the consumption integral value.

4. The integral processing method according to claim 3, characterized in that, after the step of determining whether the third integral value in the third target integral record is greater than the consumption integral value, further includes: If the third integral value is less than the consumption integral value, accumulate the fifth integral values in the second integral records in the order of the second expiration dates in each second integral record until it first exceeds the consumption integral value to obtain a sixth integral value; Perform a subtraction operation on the sixth integral value and the consumption integral value to obtain a seventh integral value, and determine each fourth target integral record that accumulates to the fourth target integral value; According to the expiration dates in the fourth target integral records, determine the fifth target integral record with the last expiration date in the fourth target integral records, and determine each sixth target integral record that is not the last expiration date in the fourth target integral records; Update the eighth integral value in the fifth target integral record to the seventh integral value in the second integral table, clear the ninth integral values in each sixth target integral record in the second integral table, set the flag bits of each sixth target integral record to the first preset value, and update the second total integral table according to the consumption integral value.

5. The integral processing method according to claim 1, characterized in that, The step of performing the integral operation corresponding to the integral request according to the second integral table and the second total integral table includes: If the integral request is a query integral request, send the second integral table and the second total integral table to the user terminal, where the user terminal displays the second integral table and the second total integral table.

6. An integral processing device, characterized in that, The integral processing device includes: A first acquisition module, configured to acquire an integral request sent by a user terminal and the identity identifier corresponding to the user terminal; A determination module, configured to determine whether the identity identifier exists in the memory database; A second acquisition module, configured to, if the identity identifier does not exist in the in-memory database, acquire a first integral table, a first total integral table corresponding to the identity identifier, and the current date, where the first integral table includes various first integral records, and the first integral record includes a first expiration date; or, if the identity identifier exists in the in-memory database, acquire a second integral table and a second total integral table corresponding to the identity identifier; A storage module, configured to determine first target integral records in the first integral records where the current date exceeds the first expiration date, update a flag bit in the first target integral records in the first integral table to a first preset value to obtain a second integral table, accumulate the expired integral values corresponding to the respective first target integral records to obtain a total expired integral, determine a first total integral value corresponding to the first total integral table, perform a subtraction operation on the first total integral value and the total expired integral to obtain a second total integral value, update the first total integral value in the first total integral table to the second total integral value to obtain a second total integral table, and store the identity identifier in the in-memory database; An execution module, configured to perform an integral operation corresponding to the integral request according to the second integral table and the second total integral table, or perform an integral operation corresponding to the integral request according to the second integral table and the second total integral table.

7. An integral processing device, characterized in that, the integral processing device includes: a memory, a processor, and an integral processing program stored on the memory and executable on the processor, and when the integral processing program is executed by the processor, the steps of the integral processing method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium, characterized in that, an integral processing program is stored on the computer-readable storage medium, and when the integral processing program is executed by a processor, the steps of the integral processing method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Point management method, blockchain node equipment, and client

    CN108830632A

  • Point data recording system and method, storage medium and terminal

    CN112541780A