Automatic data deletion method, storage medium, electronic equipment and program product

By constructing an array of database data tables and cyclically accumulating them, the deletion time node is determined, which solves the problem of low intelligence in data deletion in the database, achieves high efficiency and accuracy of automatic deletion, and prioritizes deletion of historical data.

CN118626480APending Publication Date: 2024-09-10BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410739345.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

The existing technology is less intelligent when deleting data in the database. Users need to judge the deletion period and quantity by themselves, and cannot estimate the specific number of deletions, resulting in low management efficiency.

Method used

By constructing an array of data tables, sorting them in ascending or descending order by time, cyclically accumulating the number of data items in adjacent time periods, determining the deletion time node, automatically deleting data that meets the conditions, and providing customized deletion methods.

Benefits of technology

It achieves a high degree of intelligence in automatically deleting data in terms of time and quantity requirements. It prioritizes deleting historical data without affecting the viewing of new data, simplifying user operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626480A
    Figure CN118626480A
Patent Text Reader

Abstract

The invention relates to the technical field of data security, and particularly provides an automatic data deletion method, a storage medium, electronic equipment and a program product, the method can comprise the following steps: obtaining arrays corresponding to all data tables in a database, the array comprises the table name of each data table in a plurality of data tables and the time of each piece of data in each data table; sequentially accumulating the number of data in adjacent time periods in the array to a specified number, and determining to delete a time node; and deleting all data in the data table meeting the deletion time node requirement. Some embodiments of the application can realize automatic deletion of the data, and meet the customization demand of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data security technology, and in particular to a method, storage medium, electronic device and program product for automatic data deletion. Background Art

[0002] A database is a warehouse for storing data. Although its storage space is large, the database does not store data randomly. It needs to follow certain rules when storing data to ensure the efficiency of data query.

[0003] Since the storage capacity of the database is limited, it is necessary to delete the data in the database regularly. At present, when deleting data in the database, users can generally select the time period to be cleaned and directly delete the data in the time period. However, the amount of data in the database is large, and users need to judge the deletion period by themselves, and they cannot know the amount of deletion, which is low in intelligence.

[0004] Therefore, how to provide a technical solution for a method of automatic data deletion with a high degree of intelligence has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] The purpose of some embodiments of the present application is to provide a method, storage medium, electronic device and program product for automatic data deletion. Through the technical solutions of the embodiments of the present application, automatic data deletion can be achieved in terms of time and quantity requirements, providing users with a customized deletion method with a high degree of intelligence.

[0006] In a first aspect, some embodiments of the present application provide a method for automatic data deletion, comprising: obtaining an array corresponding to all data tables in a database, wherein the array includes the table name of each data table in multiple data tables and the time of each data item in each data table; after successively adding the number of data items in adjacent time periods in the array to a specified number, determining a deletion time node; and deleting all data in the data tables that meet the deletion time node requirements.

[0007] Some embodiments of the present application determine the deletion time node corresponding to a specified number of data that needs to be deleted through an array corresponding to a data table in a database, and then delete the data corresponding to the deletion time node. This can achieve automatic deletion of data based on time and quantity requirements, provide users with a customized deletion method, and has a high degree of intelligence.

[0008] In some embodiments, obtaining an array corresponding to all data tables in a database includes: storing the results of traversing all data tables in the database in the array; updating the array by sorting the multiple data tables in ascending order of time; deleting all data in the data tables that meet the deletion time node requirement includes: deleting all data before the deletion time node.

[0009] Some embodiments of the present application delete data before a deletion time node by traversing data tables in a database and sorting them in ascending order of time. Historical data can be deleted first without affecting the viewing of new data.

[0010] In some embodiments, obtaining an array corresponding to all data tables in a database includes: updating the array by sorting the multiple data tables in descending order of time; deleting all data in the data tables that meet the deletion time node requirement includes: deleting all data after the deletion time node.

[0011] Some embodiments of the present application can delete the data after the deletion time node by sorting the data table in the database in descending time order, so as to give priority to deleting the historical data without affecting the viewing of new data.

[0012] In some embodiments, before obtaining the arrays corresponding to all data tables in the database, the method further includes: obtaining the specified number of data to be deleted in response to a user's operation instruction; and confirming that the number of data in the database is greater than the specified number.

[0013] Some embodiments of the present application determine the specified number to be deleted through the user's operation instructions and confirm the number of data in the database to facilitate effective deletion of data.

[0014] In some embodiments, the method further includes: clearing the database when the amount of data in the database is less than or equal to the specified amount.

[0015] Some embodiments of the present application clear the database when it is confirmed that the amount of data in the database does not meet the specified amount, and the implementation method is simple and efficient.

[0016] In some embodiments, the step of sequentially accumulating the number of data items in the array in adjacent time periods to a specified number includes: looping the following operations until the accumulated result is greater than or equal to the specified number: adding the number of data items in the i-th time period and the i+1-th time period to obtain an accumulated result; confirming that the accumulated result is less than the specified number, and setting i=i+1.

[0017] Some embodiments of the present application can ensure the accuracy of data deletion by cyclically accumulating the number of items in adjacent time periods until a specified number is reached.

[0018] In some embodiments, the step of sequentially accumulating the number of data items in adjacent time periods in the array to a specified number includes: looping the following operations until the accumulated result is greater than or equal to the specified number: adding the number of data items in the i-th time period and the i+1-th time period to obtain an accumulated result; when confirming that the accumulated result is less than the specified number, taking the difference between the specified number and the accumulated result as the remaining number; judging whether the number in the i+2-th time period is greater than the remaining number, and if so, updating the accumulated result by the number in the i+2-th time period, otherwise setting i=i+1.

[0019] Some embodiments of the present application can ensure the accuracy of data deletion by cyclically accumulating and judging the number of items in adjacent time periods until a specified number is reached.

[0020] In a second aspect, some embodiments of the present application provide a device for automatic data deletion, comprising: an acquisition module, configured to acquire an array corresponding to all data tables in a database, wherein the array includes the table name of each data table in multiple data tables and the time of each data in each data table; a determination module, configured to determine a deletion time node after successively accumulating the number of data items in the array in adjacent time periods to a specified number; and a deletion module, configured to delete all data in the data table that meets the deletion time node requirements.

[0021] In a third aspect, some embodiments of the present application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the method described in any embodiment of the first aspect.

[0022] In a fourth aspect, some embodiments of the present application provide an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor can implement a method as described in any embodiment of the first aspect when executing the program.

[0023] In a fifth aspect, some embodiments of the present application provide a computer program product, wherein the computer program product comprises a computer program, wherein the computer program, when executed by a processor, can implement the method described in any embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of some embodiments of the present application, the drawings required for use in some embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0025] Figure 1 A system diagram for automatic data deletion provided for some embodiments of the present application;

[0026] Figure 2 One of the flow charts of the method for automatic data deletion provided in some embodiments of the present application;

[0027] Figure 3 A second flow chart of a method for automatic data deletion provided in some embodiments of the present application;

[0028] Figure 4 A block diagram of a device for automatically deleting data provided in some embodiments of the present application;

[0029] Figure 5 A schematic diagram of an electronic device is provided for some embodiments of the present application. DETAILED DESCRIPTION

[0030] The technical solutions in some embodiments of the present application will be described below in conjunction with the drawings in some embodiments of the present application.

[0031] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0032] With the continuous development of Internet technology, a large amount of data is generated. That is, the Internet world is a data world. In the Internet scenario, there are many sources of data, such as travel records, consumption records, web browsing, sending messages, etc. In addition to text-type data, images, music, and sounds are all data. However, as time goes by, the data stored in the database will become larger and larger, and the storage pressure will continue to increase, so database cleaning plays an important role.

[0033] In the prior art, when managing a database, an administrator can usually select a data cleanup time range and perform data cleanup on relevant information; build an automatic data cleanup process, and detect whether automatic data cleanup is required to implement a database combination cleanup process. However, this method can only delete data in a certain time period when cleaning the database, and cannot estimate the specific number of deletions. In addition, the administrator needs to determine which time period to delete, and cannot intelligently select the data content to be deleted in the future.

[0034] In view of this, some embodiments of the present application provide a method for automatic data deletion, which can construct a corresponding array for the data in the database, and then perform a cyclic accumulation operation on the number of data in the array until a specified number is reached to determine the deletion time node, and then delete the data that meets the deletion time node. Some embodiments of the present application only need to determine the specified number to be deleted to automatically delete the corresponding related data, and give priority to deleting historical data without affecting the viewing of new data, and have a high degree of intelligence.

[0035] The following is combined with Figure 1 The overall composition structure of the system for automatic data deletion provided by some embodiments of the present application is exemplified.

[0036] like Figure 1 As shown, some embodiments of the present application provide a system for automatic data deletion, which may include: a terminal 100 and a data server 200. The terminal 100 may obtain a specified number of data to be deleted in response to an operation instruction of a user (or administrator). After obtaining the specified number, the data server 200 may perform a cyclic accumulation operation on the array formed by the data in the database to determine the specified number of data and determine the deletion time node. Finally, delete all data associated with the deletion time node. That is, in the present application, the deletion of data in the data server 200 can be achieved only by specifying the number, which is easy to operate and implement.

[0037] In some embodiments of the present application, the terminal 100 may be a mobile terminal or a non-portable computer terminal, which is not specifically limited in the embodiments of the present application.

[0038] In other embodiments of the present application, if the terminal 100 can have the function of constructing an array of the connected database of the data server 200, determining the deletion time node after cyclic accumulation to a specified number, and then deleting the data, the data server 200 may not be set. Specifically, it can be selected according to the actual situation, and the embodiment of the present application is not specifically limited here.

[0039] The following is combined with Figure 2The implementation process of automatic data deletion performed by the data server 200 provided in some embodiments of the present application is exemplified.

[0040] Please see attached Figure 2 , Figure 2 A flow chart of a method for automatic data deletion provided for some embodiments of the present application, the method for automatic data deletion may include: S210, obtaining an array corresponding to all data tables in a database, wherein the array includes the table name of each data table in multiple data tables and the time of each data in each data table. S220, after successively accumulating the number of data items in the array in adjacent time periods to a specified number, determining a deletion time node. S230, deleting all data in the data table that meets the deletion time node requirement.

[0041] For example, in some embodiments of the present application, the data server 200 can store the time when the data is generated and the corresponding data in the array arr in the data table in the database. The arr is accumulated by the specified number of data to be deleted, the deletion time node is located, and finally all data that meets the deletion time node is deleted. The method for automatic data deletion provided in some embodiments of the present application can be applied to the firewall historical data deletion or other types of database usage scenarios, and the embodiments of the present application are not specifically limited here.

[0042] The above implementation process is described below by way of example.

[0043] In some embodiments of the present application, before executing S210, the method for automatic data deletion may further include: obtaining the specified number of data to be deleted in response to a user's operation instruction; and confirming that the number of data in the database is greater than the specified number.

[0044] For example, in some embodiments of the present application, the user can input the number of data to be deleted, i.e., the specified number, at the terminal 100. Then, the number of data in all data tables in the database is obtained. When the number of data in all data tables in the database is greater than the specified number, the subsequent data server 200 can automatically delete the corresponding data according to the specified number.

[0045] In some embodiments of the present application, the method for automatic data deletion may further include: when the amount of data in the database is less than or equal to the specified amount, clearing the database.

[0046] For example, in some embodiments of the present application, when the amount of data in all data tables in the database is less than or equal to a specified amount, the entire database is cleared, and the data deletion process ends.

[0047] In some embodiments of the present application, S210 may include: storing the result of traversing all data tables in the database into the array; updating the array by sorting the multiple data tables in ascending order of time. S230 may include: deleting all the data before the deletion time node.

[0048] For example, in some embodiments of the present application, all data tables in the database are traversed, and the table name and the time of the first data in the table are stored in the array arr. Afterwards, the array arr is sorted in ascending order of time to obtain the sorted array arr. When deleting, the data before the deletion time node is deleted first.

[0049] In some other embodiments of the present application, S210 may include: updating the array by sorting the multiple data tables in descending order of time. S230 may include: deleting all the data after the deletion time node.

[0050] For example, in some other embodiments of the present application, the data in the array arr may be sorted in descending order of time to obtain the sorted array arr. When deleting, data after the deletion time node is deleted first.

[0051] In some embodiments of the present application, S220 may include: looping the following operations until the cumulative result is greater than or equal to the specified number: adding the number of data items in the i-th time period and the i+1-th time period to obtain the cumulative result; confirming that the cumulative result is less than the specified number, and setting i=i+1.

[0052] For example, in some embodiments of the present application, taking an array obtained by sorting in ascending order of time as an example, the position reaching the specified number is determined by cyclically accumulating the array arr. For example, the specified number is 100. The following is an explanation using three time periods as an example. For example, there are 30 data in the time period from 2024-01-01 to 2024-02-01, 60 data in the time period from 2024-02-01 to 2024-03-01, and 20 data in the time period from 2024-03-01 to 2024-04-01. Initialize i=1 when accumulating. At this time, you can first determine whether the amount of data in the first time period 2024-01-01 to 2024-02-01 is greater than 100. If not, add the 3 items in the first time period to the 60 items in the second time period (i.e., 2024-02-01 to 2024-03-01). The accumulated result is 90 items. Since 90 items are less than 100 items, they need to be added to the third time period (i.e., 2024-03-01 to 2024-04-01) again, and the accumulated result is 110 items. At this time, the requirement of 100 items has been exceeded, so the accumulation can be stopped. After that, the first 10 data items are located in the third time period, and the deletion time node can be located.

[0053] In other embodiments of the present application, S220 may include: looping the following operations until the cumulative result is greater than or equal to the specified number: adding the number of data items in the i-th time period and the i+1-th time period to obtain the cumulative result; when confirming that the cumulative result is less than the specified number, taking the difference between the specified number and the cumulative result as the remaining number; judging whether the number in the i+2-th time period is greater than the remaining number, and if so, updating the cumulative result by the number in the i+2-th time period, otherwise setting i=i+1.

[0054] For example, in some other embodiments of the present application, the difference between the cumulative result and the specified number can also be judged in the process of cyclic accumulation to confirm whether the amount of data in the next time period can meet the need to reach the specified number, so as to determine the data to be deleted. For example, the above three time periods are still used as an example for explanation. The cumulative result of the amount of data in the first time period and the second time period is 90, and the difference between the specified number and the cumulative result is 10 (as a specific example of the remaining number). It is judged whether the number in the third time period is greater than 10, and if so, it is confirmed that the final deletion time node of the data to be deleted is in the third time period, otherwise it is judged whether the amount of data in the next time period can reach the specified number after continuing to accumulate. As can be seen from the above, the 20 data in the third time period are greater than 10, and the remaining number of data can be selected from the third time period at this time, and the final deletion time node is obtained.

[0055] It is understandable that the above is a method for deleting quantities when the array is sorted in ascending time order. In another embodiment, when the array is sorted in descending time order, the last time period in the array can be the first time period, and the second to last time period can be the second time period, and the confirmation of the deletion time node and the deletion of the data can be achieved by analogy in the reverse direction. In actual applications, the method of locating and deleting the time node can be selected according to actual conditions, and the embodiments of the present application are not limited to this.

[0056] The following is combined with Figure 3 The specific process of automatic data deletion provided by some embodiments of the present application is exemplified.

[0057] Please see attached Figure 3 , Figure 3 A flow chart of a method for automatic data deletion provided for some embodiments of the present application.

[0058] The above process is explained below as an example.

[0059] S301, in response to a user's operation instruction, obtaining a specified amount of data to be deleted.

[0060] S302, determine whether the amount of data in the database is greater than the specified amount, if so, execute S304, otherwise execute S303.

[0061] S303, clear the database.

[0062] S304, traverse all data tables in the database and sort them in ascending time order to obtain a corresponding array, and initialize i=1.

[0063] S305, adding the number of data items in the array in the i-th time period and the i+1-th time period to obtain a cumulative result.

[0064] S306, determine whether the accumulated result is less than the specified number, if so, set i=i+1 and return to S305; otherwise, execute S307.

[0065] S307, determine the deletion time node.

[0066] S308, deleting all data before the deletion time node.

[0067] It should be noted that S301 to S308 are a specific implementation of the present application, and the internal implementation process can refer to the method embodiment provided above, and the detailed description is appropriately omitted here to avoid repetition. It should be understood that the embodiments of the present application are not limited thereto.

[0068] Through some of the above embodiments of the present application, it can be seen that the present application can automatically calculate the deletion time period according to the specified number input by the user. The user operation is simple and the old data is deleted first without affecting the new data.

[0069] Please refer to Figure 4 , Figure 4 The following is a block diagram of the composition of the device for automatic data deletion provided by some embodiments of the present application. It should be understood that the device for automatic data deletion corresponds to the above method embodiment and can execute each step involved in the above method embodiment. The specific functions of the device for automatic data deletion can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here.

[0070] Figure 4 The device for automatically deleting data includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the device for automatically deleting data, and the device for automatically deleting data includes: an acquisition module 410, configured to acquire an array corresponding to all data tables in a database, wherein the array includes the table name of each data table in multiple data tables and the time of each data in each data table; a determination module 420, configured to determine a deletion time node after successively accumulating the number of data items in the array in adjacent time periods to a specified number; a deletion module 430, configured to delete all data in the data table that meets the deletion time node requirement.

[0071] In some embodiments of the present application, the acquisition module 410 is configured to store the results of traversing all data tables in the database into the array; update the array by sorting the multiple data tables in ascending time order; and the deletion module 430 is configured to delete all the data before the deletion time node.

[0072] In some embodiments of the present application, the acquisition module 410 is configured to update the array by sorting the multiple data tables in descending order of time; the deletion module 430 is configured to delete all the data after the deletion time node.

[0073] In some embodiments of the present application, before obtaining module 410, the device for automatically deleting data also includes: a judgment module (not shown in the figure), which is configured to obtain the specified number of data to be deleted in response to the user's operation instructions; and confirm that the number of data in the database is greater than the specified number.

[0074] In some embodiments of the present application, the judgment module (not shown in the figure) is configured to clear the database when the amount of data in the database is less than or equal to the specified amount.

[0075] In some embodiments of the present application, the determination module 420 is configured to perform the following operations in a loop until the cumulative result is greater than or equal to the specified number: add the number of data items in the i-th time period and the i+1-th time period to obtain the cumulative result; confirm that the cumulative result is less than the specified number, and set i=i+1.

[0076] In some embodiments of the present application, the determination module 420 is configured to perform the following operations in a loop until the cumulative result is greater than or equal to the specified number: add the number of data items in the i-th time period and the i+1-th time period to obtain the cumulative result; when it is confirmed that the cumulative result is less than the specified number, take the difference between the specified number and the cumulative result as the remaining number; determine whether the number in the i+2-th time period is greater than the remaining number, and if so, update the cumulative result by the number in the i+2-th time period, otherwise set i=i+1.

[0077] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method, and will not be described in detail here.

[0078] Some embodiments of the present application further provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the operations of the method corresponding to any of the above methods provided in the above embodiments.

[0079] Some embodiments of the present application further provide a computer program product, which includes a computer program, wherein when the computer program is executed by a processor, it can implement the operations corresponding to any of the above methods provided in the above embodiments.

[0080] like Figure 5 As shown, some embodiments of the present application provide an electronic device 500, which includes: a memory 510, a processor 520, and a computer program stored in the memory 510 and executable on the processor 520, wherein the processor 520 can implement a method as described in any of the above embodiments when reading the program from the memory 510 through a bus 530 and executing the program.

[0081] Processor 520 can process digital signals and can include various computing structures, such as complex instruction set computer structure, reduced instruction set computer structure, or a structure that implements a combination of multiple instruction sets. In some examples, processor 520 can be a microprocessor.

[0082] The memory 510 may be used to store instructions executed by the processor 520 or data related to the execution of instructions. These instructions and / or data may include codes for implementing some or all functions of one or more modules described in the embodiments of the present application. The processor 520 of the disclosed embodiment may be used to execute instructions in the memory 510 to implement the method shown above. The memory 510 includes a dynamic random access memory, a static random access memory, a flash memory, an optical memory, or other memory known to those skilled in the art.

[0083] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0084] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0085] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A method for automatic data deletion, characterized in that: include: Obtain an array corresponding to all data tables in the database, wherein the array includes the table name of each data table in the multiple data tables and the time of each data in each data table; After the number of data items in the array that are in adjacent time periods is accumulated in sequence to a specified number, a deletion time node is determined; Delete all data in the data table that meets the deletion time node requirement.

2. The method according to claim 1, characterized in that The step of obtaining arrays corresponding to all data tables in the database includes: The result of traversing all data tables in the database is stored in the array; Updating the array by sorting the multiple data tables in ascending order of time; Deleting all data in the data table that meets the deletion time node requirement includes: Delete all the data before the deletion time node.

3. The method according to claim 1, characterized in that The step of obtaining arrays corresponding to all data tables in the database includes: Updating the array by sorting the multiple data tables in descending order of time; Deleting all data in the data table that meets the deletion time node requirement includes: Delete all the data after the deletion time node.

4. The method according to any one of claims 1 to 3, characterized in that Before acquiring the arrays corresponding to all the data tables in the database, the method further includes: In response to an operation instruction of a user, obtaining the specified amount of data to be deleted; It is confirmed that the amount of data in the database is greater than the specified amount.

5. The method according to any one of claims 1 to 3, characterized in that The method further comprises: When the amount of data in the database is less than or equal to the specified amount, the database is cleared.

6. The method according to any one of claims 1 to 3, characterized in that The step of sequentially accumulating the number of data items in the array within adjacent time periods to a specified number includes: The following operations are performed in a loop until the accumulated result is greater than or equal to the specified number: Add the number of data items in the i-th time period and the i+1-th time period to obtain the cumulative result; Confirm that the accumulated result is less than the specified number, and set i=i+1.

7. The method according to any one of claims 1 to 3, characterized in that The step of sequentially accumulating the number of data items in the array within adjacent time periods to a specified number includes: The following operations are performed in a loop until the accumulated result is greater than or equal to the specified number: Add the number of data items in the i-th time period and the i+1-th time period to obtain the cumulative result; When it is confirmed that the accumulated result is less than the specified number, the difference between the specified number and the accumulated result is taken as the remaining number; Determine whether the quantity in the i+2th time period is greater than the remaining quantity. If so, update the accumulated result by the quantity in the i+2th time period. Otherwise, set i=i+1.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program executes the method according to any one of claims 1 to 7 when executed by a processor.

9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the computer program executes the method according to any one of claims 1 to 7 when being run by the processor.

10. A computer program product, characterized in that The computer program product comprises a computer program, wherein the computer program executes the method according to any one of claims 1 to 7 when executed by a processor.

Citation Information

Patent Citations

  • Message ordering method and system as well as method for displaying messages in SNS (social networking service)

    CN103294709A

  • Method and system for automatically deleting expired data

    CN105045535A