Data management device, data management method, and program

The data management device optimizes data extraction and deletion in RDB and NoSQL databases by using a dual search key system, addressing inefficiencies in identifying and removing data based on expiration dates, thereby enhancing processing speed and efficiency.

JP2025185521APending Publication Date: 2025-12-22TOPPAN HOLDINGS INC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024093814
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-06-10
Publication Date
2025-12-22

AI Technical Summary

Technical Problem

Existing data management systems, particularly in RDB and NoSQL databases, face inefficiencies in data extraction and deletion processes, especially when dealing with large volumes of data, leading to prolonged processing times and limitations in identifying and removing records based on expiration dates.

Method used

A data management device and method that associates data with a first search key, part of the expiration date, and a second search key, combining the remainder of the expiration date and a unique value, enabling efficient data identification and deletion by matching search keys with specified times, thereby optimizing data processing.

Benefits of technology

The solution allows for rapid and efficient identification and deletion of data, reducing processing time and improving data management efficiency in both RDB and NoSQL databases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025185521000001_ABST
    Figure 2025185521000001_ABST
Patent Text Reader

Abstract

To provide a data management device, a data management method, and a program which allow for efficiently specifying data being a processing object.SOLUTION: The data management device includes a registration unit and a search unit. The registration unit registers data having a time of validity with a database in association with a first search key being a part of the time of validity and a second search key being a value obtained by combining the rest of the time of validity and a unique value. The search unit specifies data associated with the first search key matching a time preceding a time indicated by at least a part of a designation search key indicating the time, and specifies data associated with the second search key corresponding to a time preceding a time indicated by the rest of the designation search key, out of the specified data.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to a data management device, a data management method, and a program. [Background technology]

[0002] There are cases where expired data is extracted and deleted from the large amount of data stored in a database. The main types of databases are RDB (relational database) and NoSQL (Not Only SQL).

[0003] In an RDB, data can be flexibly extracted from the database using Structured Query Language (SQL), but it is generally said that processing takes time as the number of data (records) increases. On the other hand, NoSQL is suitable for storing large amounts of data, but it does not offer as much flexibility as SQL in an RDB, and there are restrictions on how to extract target records from a table.

[0004] In DynamoDB (registered trademark), a NoSQL database, to create a table, it is necessary to specify the table name and a primary key that uniquely identifies each item in the table. A partition key consisting of one attribute can be used as the primary key. Alternatively, a partition key and a sort key can be used as the primary key. When using a partition key as the primary key, multiple records in a single table cannot have the same partition key; they must have different partition keys. When using a partition key and a sort key as the primary key, multiple records in a single table can have the same partition key, but they must have different sort keys.

[0005] Below we will explain how to extract records in NoSQL. For example, there are three methods in NoSQL: (1) By executing a command called Scan, the entire table is first obtained and then each record is read one by one. (2) Execute a command called GetItem to retrieve one record that exactly matches the primary key. (3) Execute a command called a query to retrieve multiple records that exactly match the primary key.

[0006] Patent Document 1 discloses a technique for registering records having expiration dates before a threshold expiration date in an archive file, and deleting the records registered in the archive file. [Prior art documents] [Patent documents]

[0007] [Patent Document 1] Patent No. 7106656 Summary of the Invention [Problem to be solved by the invention]

[0008] In an RDB, if a large amount of data (records) is registered, it takes time to extract the data using SQL.

[0009] In NoSQL, when a large amount of data (records) is registered, it takes time to retrieve the entire table by executing a scan, and it is inefficient to identify some of the records from the entire retrieved table.

[0010] In NoSQL, when GetItem is executed, only one record is extracted per execution of GetItem, so it is not possible to extract multiple records in one search.

[0011] In NoSQL, when a partition key is used as a primary key, multiple records in a single table must have different partition keys. When a query is executed that uses a partition key as a primary key, only one record is extracted per query execution. As a result, it is not possible to extract multiple records.

[0012] A data extraction method in the prior art will be described with reference to Figures 16 to 18. Figure 16 shows a first example of data registered in database 30 in the prior art. Database 30 includes a certificate management table 300a for managing digital certificate data.

[0013] The certificate management table 300a contains multiple records. Each record contains items IT200 to IT203 that are associated with each other. Item IT200 indicates a random value. The value of item IT200 is different for each record. Item IT201 indicates the expiration date. The expiration date is a combination of values ​​indicating the year, month, day, hour, minute, and second. Item IT202 indicates the ID assigned to the digital certificate data. Item IT203 indicates the digital certificate data. Item IT200 is registered as the primary key (partition key).

[0014] Fig. 17 shows an example of the procedure for processing to delete a record in an RDB. The data management device 3 having the database 30 shown in Fig. 16 receives a deletion request from the terminal device 4 and deletes the data to be deleted.

[0015] The terminal device 4 transmits a deletion request including a search key (specified search key) indicating "20231212" to the data management device 3. The specified search key indicates the year, month, and day. The data management device 3 receives the deletion request (step S200a) and identifies records whose first eight digits of the expiration date match "20231212" or a value indicating an expiration date earlier than "20231212" (step S205a).

[0016] After step S205a, the data management device 3 reads one of the identified records (step S210a), and deletes the record by specifying the primary key of the record (step S215a).

[0017] If the record read in step S210a is not the last record (NO in step S220a), the data management device 3 reads the next record in step S210a. If the record read in step S210a is the last record (YES in step S220a), the data management device 3 transmits a deletion completion notification to the terminal device 4 (step S225a).

[0018] 17, if a large number of records are registered in the certificate management table 300a, it takes time to identify the records in step S205a. Also, steps S210a, S215a, and S220a must be executed for all of the records identified in step S205a.

[0019] Fig. 18 shows an example of the procedure for deleting a record in NoSQL. The data management device 3 having the database 30 shown in Fig. 16 receives a deletion request from the terminal device 4 and deletes the data to be deleted.

[0020] The terminal device 4 sends a delete request including a specified search key indicating "20231212" to the data management device 3. The specified search key indicates the year, month, and day. The data management device 3 receives the delete request (step S200b). The primary key of each record in the certificate management table 300a is a random value and is different from the specified search key. The data management device 3 cannot identify a record even if it executes a query that uses the specified search key as the primary key. Therefore, the data management device 3 executes a scan to identify all records in the certificate management table 300a (step S205b).

[0021] After step S205b, the data management device 3 reads one of the identified records (step S210b). The data management device 3 determines whether the first eight digits of the expiration date in the read record match "20231212" or a value indicating a date earlier than "20231212". If the first eight digits of the expiration date match "20231212" or a value indicating a date earlier than "20231212", the data management device 3 specifies the primary key of the read record and deletes the record (step S215b).

[0022] If the record read in step S210b is not the last record (NO in step S220b), the data management device 3 reads the next record in step S210b. If the record read in step S210b is the last record (YES in step S220b), the data management device 3 transmits a deletion completion notification to the terminal device 4 (step S225b).

[0023] 18, if a large number of records are registered in the certificate management table 300a, it takes time to acquire all the records in the certificate management table 300a in step S205b. Also, it takes time to make a determination based on the expiration date in step S215b.

[0024] 19 shows a second example of data registered in the conventional database 30. The database 30 includes a certificate management table 300b for managing digital certificate data.

[0025] The certificate management table 300b contains multiple records. Each record contains items IT210 to IT213 that are associated with each other. Item IT210 indicates the expiration date. Item IT211 indicates a random value. Item IT212 indicates the ID assigned to the digital certificate data. Item IT213 indicates the digital certificate data. Item IT210 and item IT211 are registered as primary keys. Item IT210 corresponds to the partition key, and item IT211 corresponds to the sort key.

[0026] The procedure for deleting a record from the certificate management table 300b in the RDB is the same as the procedure shown in Fig. 17. Therefore, the same problems as those in the procedure shown in Fig. 17 arise.

[0027] The NoSQL process for deleting records from the certificate management table 300b is the same as the process shown in FIG. 18. A partition key and a sort key are used as the primary key for each record in the certificate management table 300b. The partition key is the expiration date, and the sort key is a random value. However, the primary key, which is a combination of the expiration date and the random value, does not completely match the specified search key ("20231212"). The data management device 3 cannot identify records even if it executes a query that uses the specified search key as the primary key. Therefore, the data management device 3 must execute a scan to identify all records in the certificate management table 300a.

[0028] An object of the present invention is to provide a data management device, a data management method, and a program that can efficiently identify data to be processed. [Means for solving the problem]

[0029] The present invention is a data management device having a registration unit that registers data with an expiration date in a database by associating it with a first search key that is part of the expiration date and a second search key that is a value combining the remainder of the expiration date and a unique value, and a search unit that searches data registered in the database using a specified search key that indicates a time, identifying data associated with the first search key that matches a time before the time indicated by at least a part of the specified search key, and identifying, from the identified data, data associated with the second search key that corresponds to a time before the time indicated by the remainder of the specified search key.

[0030] The present invention is a data management method having: a registration step in which a registration unit registers data having an expiration date in a database by associating it with a first search key that is part of the expiration date and a second search key that is a value combining the remainder of the expiration date and a unique value; and a search step in which a search unit searches the data registered in the database using a specified search key that indicates a time, identifying data associated with the first search key that matches a time before the time indicated by at least a part of the specified search key, and identifying, from the identified data, data associated with the second search key that corresponds to a time before the time indicated by the remainder of the specified search key.

[0031] The present invention is a program that causes a computer to function as: a registration unit that registers data with an expiration date in a database by associating it with a first search key that is part of the expiration date and a second search key that is a value combining the remainder of the expiration date and a unique value; and a search unit that searches the data registered in the database using a specified search key that indicates a time, identifying data associated with the first search key that matches a time before the time indicated by at least a part of the specified search key, and identifying, from the identified data, data associated with the second search key that corresponds to a time before the time indicated by the remainder of the specified search key. [Effects of the Invention]

[0032] According to the present invention, the data management device, the data management method, and the program can efficiently identify data to be processed. [Brief explanation of the drawings]

[0033] [Figure 1] 1 is a block diagram showing a configuration of a data management device according to an embodiment of the present invention. [Figure 2] 2 is a block diagram showing a configuration of a data management unit included in the data management device according to the embodiment of the present invention. FIG. [Figure 3] 10 is a flowchart illustrating an example of processing executed by a data management device according to an embodiment of the present invention. [Figure 4] FIG. 2 is a diagram showing an example of data registered in a database of a data management device according to an embodiment of the present invention. [Figure 5] FIG. 4 is a sequence diagram illustrating an example of processing executed by a data management device according to an embodiment of the present invention. [Figure 6] FIG. 2 is a diagram showing an example of data registered in a database included in a data management device according to an embodiment of the present invention. [Figure 7] FIG. 4 is a sequence diagram illustrating an example of processing executed by a data management device according to an embodiment of the present invention. [Figure 8] FIG. 4 is a sequence diagram illustrating an example of processing executed by a data management device according to an embodiment of the present invention. [Figure 9] FIG. 2 is a diagram showing an example of data registered in a database included in a data management device according to an embodiment of the present invention. [Figure 10] FIG. 4 is a sequence diagram illustrating an example of processing executed by a data management device according to an embodiment of the present invention. [Figure 11] FIG. 2 is a diagram showing an example of data registered in a database of a data management device according to an embodiment of the present invention. [Figure 12] FIG. 4 is a sequence diagram illustrating an example of processing executed by a data management device according to an embodiment of the present invention. [Figure 13]FIG. 4 is a sequence diagram illustrating an example of processing executed by a data management device according to an embodiment of the present invention. [Figure 14] 10 is a diagram illustrating an example of the relationship between an expiration date, a specified search key, a first search key, and a second search key according to an embodiment of the present invention. FIG. [Figure 15] FIG. 10 is a block diagram showing a configuration of a data management device according to a modified example of an embodiment of the present invention. [Figure 16] FIG. 1 is a diagram showing an example of data registered in a database in the prior art. [Figure 17] FIG. 10 is a sequence diagram illustrating an example of processing executed by a data management device according to the prior art. [Figure 18] FIG. 10 is a sequence diagram illustrating an example of processing executed by a data management device according to the prior art. [Figure 19] FIG. 1 is a diagram showing an example of data registered in a database in the prior art. DETAILED DESCRIPTION OF THE INVENTION

[0034] Hereinafter, an embodiment of the present invention will be described with reference to the drawings. Fig. 1 shows the configuration of a data management device 1 according to an embodiment of the present invention. The data management device 1 is a computer system such as a server, and includes a communication unit 10, a data management unit 11, and a database 12.

[0035] The communication unit 10 has a communication circuit and communicates with the terminal device 2. The communication performed by the communication unit 10 may be either wired communication or wireless communication. The data management unit 11 manages data registered in the database 12. The database 12 is stored in a storage medium within the data management device 1. The database 12 may be stored in a storage device separate from the data management device 1. The database 12 has a certificate management table 120. Data registered in the database 12 is associated with a first search key, which is part of the expiration date of the data, and a second search key, which is a value combining the remaining expiration date and a unique value.

[0036] 2 shows the configuration of the data management unit 11. The data management unit 11 includes a control unit 110, a registration unit 111, a search unit 112, and a deletion unit 113.

[0037] The control unit 110 controls the communication performed by the communication unit 10. The registration unit 111 registers data in the database 12. The search unit 112 searches the data registered in the database 12 based on a predetermined search key and identifies data to be deleted. The deletion unit 113 deletes the data to be deleted identified by the search unit 112.

[0038] In the embodiment of the present invention, a case will be described in which data that satisfies a condition regarding an expiration date is identified and the identified data is deleted. The identified data may be used for processing other than deletion. For example, the data management device 1 may transmit information indicating a list of the identified data to the terminal device 2, and the terminal device 2 may display the information on a display.

[0039] The data management unit 11 may be realized by a processor such as a CPU (Central Processing Unit) executing a program recorded on a computer-readable recording medium. The data management unit 11 may also be realized by hardware (circuitry) such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field-Programmable Gate Array). The data management unit 11 may also be realized by a combination of software and hardware.

[0040] The computer-readable recording medium may be a portable medium such as a flexible disk, a magneto-optical disk, a ROM, or a CD-ROM, or a storage unit such as a hard disk built into a computer system. The above-mentioned program may be a differential file (differential program). The function of the data management unit 11 may be realized by combining a program already recorded in the computer with the differential program.

[0041] 3 shows an example of processing executed by the data management device 1. The operation of the data management device 1 will be described with reference to FIG.

[0042] Before the process shown in FIG. 3 is executed, the registration unit 111 registers one or more pieces of data having an expiration date in the database 12. At this time, the registration unit 111 associates each piece of data with a first search key and a second search key and registers it in the database 12. The first search key is part of the expiration date. The second search key is a value that combines the remaining expiration date and a unique value. Each record in the certificate management table 120 includes the first search key, the second search key, and the registered data.

[0043] (Step S100) The terminal device 2 transmits a deletion request including a search key (specified search key) to the data management device 1. The specified search key is composed of a combination of values ​​indicating time. For example, the specified search key is "20231212," which is a combination of "2023" indicating the year, "12" indicating the month, and "12" indicating the day. The communication unit 10 receives the deletion request and outputs the received deletion request to the data management unit 11.

[0044] (Step S105) Search unit 112 performs a search using the specified search key included in the delete request, and identifies data associated with a first search key that matches a time before the time indicated by at least a portion of the specified search key.

[0045] (Step S110) Search unit 112 compares the length of the specified search key with the length of the first search key, and determines whether or not to perform a search using the second search key. If the length of the specified search key is the same as the length of the first search key, search unit 112 determines not to perform a search using the second search key. In this case, step S120, described below, is executed. If the length of the specified search key is different from the length of the first search key, search unit 112 determines to perform a search using the second search key. In this case, step S115, described below, is executed.

[0046] (Step S115) Search unit 112 performs a search using the second search key on the data identified in step S105. Search unit 112 identifies data associated with the second search key that corresponds to a time before the time indicated by the remaining part of the specified search key excluding the part used in the search in step S105.

[0047] (Step S120) The deletion unit 113 deletes the data identified in step S105 or step S115 from the database 12.

[0048] (Step S125) The control unit 110 outputs a deletion completion notification to the communication unit 10. The communication unit 10 transmits the deletion completion notification to the terminal device 2.

[0049] A specific example will be described below.

[0050] (First example) A first example will be described below. Fig. 4 shows an example of data registered in the database 12. The database 12 includes a certificate management table 120a and a certificate management table 120b.

[0051] The name of the certificate management table 120a is "20231212." This name is the first search key for the data registered in the certificate management table 120a.

[0052] Certificate management table 120a includes multiple records. The expiration date is a combination of values ​​indicating the year, month, day, hour, minute, and second. A portion of the expiration date of the data in each record is registered as a first search key, and the remainder of the expiration date and a unique value are registered as a second search key. Specifically, the beginning of the expiration date is registered as the first search key, and the end of the expiration date and the unique value are registered as the second search key.

[0053] Each record includes items IT100 to IT102 that are associated with each other. Item IT100 indicates a combination of the remaining expiration date, excluding the portion registered as the first search key, and a unique value. The remaining expiration date is placed at the beginning of item IT100, followed by the unique value. The unique value differs between records. Item IT101 indicates the ID assigned to the electronic certificate data. Item IT102 indicates the electronic certificate data. Item IT100 is registered as the primary key (partition key) and is used as the second search key.

[0054] For example, in the case of digital certificate data with an expiration date of "20231212121532," part of the expiration date ("20231212") is the first search key, which matches the name in the certificate management table 120a. The combination of the remaining expiration date ("121532") and the unique value ("10901") is the second search key, which is registered as the primary key (partition key).

[0055] The unique value is, for example, a random value, or may be a sequential number.

[0056] The configuration of the certificate management table 120b is the same as the configuration of the certificate management table 120a. The name of the certificate management table 120b is "20231213".

[0057] 5 shows an example of processing executed by the data management device 1 in the first example. The operation of the data management device 1 will be described with reference to FIG.

[0058] (Step S100a) The communication unit 10 receives the deletion request transmitted by the terminal device 2, and outputs the received deletion request to the data management unit 11. The specified search key included in the deletion request is "20231212".

[0059] (Step S105a) The search unit 112 identifies a table associated with a first search key that matches a time before the time indicated by the specified search key. The first search key is the name of each table. The name of certificate management table 120a ("20231212") matches the specified search key. Therefore, the search unit 112 identifies certificate management table 120a as the table to be deleted. The name of certificate management table 120b ("20231213") does not match the specified search key, so certificate management table 120b is not the table to be deleted.

[0060] If a table containing data with an expiration date corresponding to a time earlier than "20231212" is registered in the database 12, the search unit 112 identifies that table as a table to be deleted. For example, the search unit 112 identifies a table with the name "20231211" as a table to be deleted.

[0061] The length of the specified search key is the same as the length of the first search key, so search unit 112 determines not to perform a search using the second search key.

[0062] (Step S120a) The deletion unit 113 deletes the entire certificate management table 120a identified in step S105a from the database 12.

[0063] (Step S125a) The control unit 110 outputs a deletion completion notification to the communication unit 10. The communication unit 10 transmits the deletion completion notification to the terminal device 2.

[0064] In the first example, the search unit 112 identifies a table to be deleted that has a name that matches the specified search key. After identifying the table to be deleted, the search unit 112 does not need to refer to the records of the table. Therefore, the search unit 112 can efficiently identify the data to be deleted.

[0065] (Second example) A second example will be described below. Fig. 6 shows an example of data registered in the database 12. The database 12 includes a certificate management table 120c.

[0066] The name of the certificate management table 120c is "202312." This name is the first search key for the data registered in the certificate management table 120c.

[0067] Certificate management table 120c includes multiple records. A portion of the expiration date of the data in each record is registered as a first search key, and the remainder of the expiration date and a unique value are registered as a second search key. Specifically, the beginning of the expiration date is registered as the first search key, and the end of the expiration date and the unique value are registered as the second search key.

[0068] Each record includes items IT103 to IT105 that are associated with each other. Item IT103 indicates a combination of the remaining expiration date excluding the portion registered as the first search key and a unique value. Item IT104 indicates an ID assigned to the digital certificate data. Item IT105 indicates the digital certificate data. Item IT103 is registered as a primary key (partition key) and is used as a second search key.

[0069] For example, in the case of digital certificate data with an expiration date of "20231212121532," part of the expiration date ("202312") is the first search key, which matches the name in the certificate management table 120c. The combination of the remaining expiration date ("12121532") and the unique value ("10901") is the second search key, which is registered as the primary key (partition key).

[0070] 7 shows an example of processing executed by the data management device 1 in the second example. The operation of the data management device 1 will be described with reference to FIG.

[0071] (Step S100b) The communication unit 10 receives the deletion request transmitted by the terminal device 2, and outputs the received deletion request to the data management unit 11. The specified search key included in the deletion request is "202312".

[0072] (Step S105b) The search unit 112 identifies a table associated with a first search key that matches a time before the time indicated by the specified search key. The first search key is the name of each table. The name of certificate management table 120c ("202312") matches the specified search key. Therefore, the search unit 112 identifies certificate management table 120c as the table to be deleted.

[0073] If a table containing data with an expiration date corresponding to a time earlier than "202312" is registered in the database 12, the search unit 112 identifies that table as the table to be deleted. For example, the search unit 112 identifies a table with the name "202311" as the table to be deleted.

[0074] The length of the specified search key is the same as the length of the first search key, so search unit 112 determines not to perform a search using the second search key.

[0075] (Step S120b) The deletion unit 113 deletes the entire certificate management table 120c identified in step S105b from the database 12.

[0076] (Step S125b) The control unit 110 outputs a deletion completion notification to the communication unit 10. The communication unit 10 transmits the deletion completion notification to the terminal device 2.

[0077] In the second example, the search unit 112 identifies a table to be deleted that has a name that matches the specified search key. After identifying the table to be deleted, the search unit 112 does not need to refer to the records of the table. Therefore, the search unit 112 can efficiently identify the data to be deleted.

[0078] (Third example) A third example will be described below. In the third example, a certificate management table 120c shown in FIG.

[0079] 8 shows an example of processing executed by the data management device 1 in the third example. The operation of the data management device 1 will be described with reference to FIG.

[0080] (Step S100c) The communication unit 10 receives the deletion request transmitted by the terminal device 2, and outputs the received deletion request to the data management unit 11. The specified search key included in the deletion request is "20231212".

[0081] (Step S105c) The length of the specified search key ("20231212") is longer than the name of the table ("202312"), which is the first search key. In this case, search unit 112 extracts from the specified search key the portion ("202312") that includes the beginning of the specified search key and has the same length as the first search key. Search unit 112 identifies a table associated with the first search key that matches a time before the time indicated by the extracted portion. The first search key is the name of each table. The name ("202312") of certificate management table 120c matches the portion ("202312") extracted from the specified search key. Therefore, search unit 112 identifies certificate management table 120c. It has not yet been determined whether the entire certificate management table 120c is to be deleted.

[0082] The length of the specified search key is different from the length of the first search key, so search unit 112 determines to perform a search using the second search key.

[0083] (Step S105d) The search unit 112 sorts all records in the certificate management table 120c identified in step S105c in ascending order using the second search key. The second search key is a combination of the remaining expiration date (excluding the portion registered as the first search key) and a unique value, and is registered as a primary key (partition key). The search unit 112 sorts all records in the certificate management table 120c in ascending order of the value of item IT103. The search unit 112 saves the sorted certificate management table 120c.

[0084] (Step S115a) The search unit 112 reads one record from the sorted certificate management table 120c in ascending order of the value of the item IT103.

[0085] (Step S115b) Search unit 112 determines whether the first two digits of the second search key of the record read in step S115a are equal to or less than the remaining portion ("12") of the specified search key excluding the portion ("202312") extracted in step S105c. If the first two digits of the second search key of the record read in step S115a are equal to or less than the remaining portion ("12") of the specified search key, search unit 112 identifies the record read in step S115a as a record to be deleted.

[0086] The records in certificate management table 120c are sorted by the second search key. Certificate management table 120c includes three records whose second search keys have the first two digits "12" and two records whose second search keys have the first two digits "13". Search unit 112 identifies the three records whose second search keys have the first two digits "12" as records to be deleted. The two records whose second search keys have the first two digits "13" are not to be deleted.

[0087] If the table identified in step S105c includes a record whose first two digits of the second search key are smaller than the remaining portion of the specified search key ("12"), the search unit 112 identifies that record as the record to be deleted. For example, the search unit 112 identifies a record whose first two digits of the second search key are "11" as the record to be deleted. As described above, the search unit 112 identifies data associated with the second search key that corresponds to a time before the time indicated by the remaining portion ("12") of the specified search key excluding the portion used in the search in step S105c ("202312").

[0088] (Step S120c) The deletion unit 113 specifies the primary key (partition key) of the record read in step S115a and deletes the record from the database 12.

[0089] (Step S115c) After the record is deleted, the search unit 112 determines whether the record read in step S115a is the last record of the records sorted in step S105d. If the record read in step S115a is not the last record of the records sorted in step S105d, the search unit 112 reads the next record in step S115a. If the record read in step S115a is the last record of the records sorted in step S105d, the search using the second search key and record deletion end, and step S125c, described below, is executed.

[0090] If the search unit 112 determines in step S115b that the first two digits of the second search key of the record read in step S115a are greater than the remaining portion of the specified search key ("12"), the search using the second search key and the deletion of the record are terminated, and step S125c, described below, is executed.

[0091] In certificate management table 120c, records are read sequentially from the top. After three records whose second search key has the first two digits "12" are deleted, a record whose second search key has the first two digits "13" is read. Because the first two digits of the second search key ("13") are greater than the remaining portion of the specified search key ("12"), searches and record deletions using the second search key end. The last record in certificate management table 120c is not read.

[0092] If a table including data having an expiration date that corresponds to a time earlier than the portion of the specified search key extracted in step S105c ("202312") is registered in database 12, search unit 112 identifies that table as the table to be deleted. For example, search unit 112 identifies a table with the name "202311" as the table to be deleted. Deletion unit 113 deletes that table.

[0093] (Step S125c) The control unit 110 outputs a deletion completion notification to the communication unit 10. The communication unit 10 transmits the deletion completion notification to the terminal device 2.

[0094] In the third example, after all records in a table having a name that matches part of the specified search key are sorted by the second search key, the search unit 112 identifies, as records to be deleted, records associated with the second search key that correspond to a time before the time indicated by the remainder of the specified search key. After all records to be deleted have been deleted, the search unit 112 does not need to refer to the records. This allows the search unit 112 to efficiently identify data to be deleted.

[0095] (Example 4) A fourth example will be described. The fourth example is mainly applied to NoSQL. Fig. 9 shows an example of data registered in the database 12. The database 12 includes a certificate management table 120d.

[0096] Certificate management table 120d includes multiple records. A portion of the expiration date of the data in each record is registered as a first search key, and the remainder of the expiration date and a unique value are registered as a second search key. Specifically, the beginning of the expiration date is registered as the first search key, and the end of the expiration date and the unique value are registered as the second search key.

[0097] Each record includes items IT106 to IT109 that are associated with each other. Item IT106 indicates part of the expiration date. Item IT107 indicates a combination of the remainder of the expiration date excluding the part registered as item IT106 and a unique value. Item IT108 indicates an ID assigned to the electronic certificate data. Item IT109 indicates the electronic certificate data. Item IT106 and item IT107 are registered as primary keys. Item IT106 is registered as a partition key included in the primary key, and is used as a first search key. Item IT107 is registered as a sort key included in the primary key, and is used as a second search key.

[0098] For example, in the case of digital certificate data with an expiration date of "20231212121532," part of the expiration date ("20231212") is the first search key and is registered as the primary key (partition key). The combination of the remaining expiration date ("121532") and the unique value ("10901") is the second search key and is registered as the primary key (sort key).

[0099] 10 shows an example of processing executed by the data management device 1 in the fourth example. The operation of the data management device 1 will be described with reference to FIG.

[0100] (Step S100d) The communication unit 10 receives the deletion request transmitted by the terminal device 2, and outputs the received deletion request to the data management unit 11. The specified search key included in the deletion request is "20231212".

[0101] (Step S105e) The search unit 112 executes a query that specifies the specified search key ("20231212"), and identifies one or more records that are associated with a partition key that matches the specified search key as records to be deleted.

[0102] Certificate management table 120d includes three records whose partition key, which is the first search key, is "20231212" and two records whose partition key is "20231213." The search unit 112 identifies the three records whose partition key is "20231212" as records to be deleted. The two records whose partition key is "20231213" are not to be deleted.

[0103] (Step S115d) The search unit 112 reads one of the records identified in step S105e.

[0104] (Step S120d) The deletion unit 113 specifies the primary key (partition key and sort key) of the record read in step S115d and deletes the record from the database 12.

[0105] (Step S115e) After the record is deleted, the search unit 112 determines whether the record read in step S115d is the last record of the records identified in step S105e. If the record read in step S115d is not the last record of the records identified in step S105e, the search unit 112 reads the next record in step S115d. If the record read in step S115d is the last record of the records identified in step S105e, the record deletion ends, and the following step S125d is executed.

[0106] (Step S125d) The control unit 110 outputs a deletion completion notification to the communication unit 10. The communication unit 10 transmits the deletion completion notification to the terminal device 2.

[0107] In the fourth example, the search unit 112 identifies, as the record to be deleted, a record associated with a first search key that matches the specified search key. The search unit 112 does not need to refer to a record associated with a first search key that does not match the specified search key. This allows the search unit 112 to efficiently identify the data to be deleted.

[0108] (Fifth Example) A fifth example will be described. The fifth example is mainly applied to NoSQL. Fig. 11 shows an example of data registered in the database 12. The database 12 includes a certificate management table 120e.

[0109] Certificate management table 120e includes multiple records. A portion of the expiration date of the data in each record is registered as a first search key, and the remainder of the expiration date and a unique value are registered as a second search key. Specifically, the beginning of the expiration date is registered as the first search key, and the end of the expiration date and the unique value are registered as the second search key.

[0110] Each record includes items IT110 to IT113 that are associated with each other. Item IT110 indicates part of the expiration date. Item IT111 indicates a combination of the remaining expiration date excluding the part registered as item IT110 and a unique value. Item IT1112 indicates an ID assigned to the electronic certificate data. Item IT113 indicates the electronic certificate data. Item IT110 and item IT111 are registered as primary keys. Item IT110 is registered as a partition key included in the primary key, and is used as the first search key. Item IT111 is registered as a sort key included in the primary key, and is used as the second search key.

[0111] For example, in the case of digital certificate data with an expiration date of "20231212121532," part of the expiration date ("202312") is the first search key and is registered as the primary key (partition key). The combination of the remainder of the expiration date ("12121532") and the unique value ("10901") is the second search key and is registered as the primary key (sort key).

[0112] 12 shows an example of processing executed by the data management device 1 in the fifth example. The operation of the data management device 1 will be described with reference to FIG.

[0113] (Step S100e) The communication unit 10 receives the deletion request transmitted by the terminal device 2, and outputs the received deletion request to the data management unit 11. The specified search key included in the deletion request is "202312".

[0114] (Step S105f) The search unit 112 executes a query that specifies the specified search key ("202312"), and identifies one or more records associated with a partition key that matches the specified search key as records to be deleted.

[0115] The certificate management table 120e includes five records whose partition key, which is the first search key, is "202312." The search unit 112 identifies the five records whose partition key is "202312" as records to be deleted.

[0116] (Step S115f) The search unit 112 reads one of the records identified in step S105f.

[0117] (Step S120f) The deletion unit 113 specifies the primary key (partition key and sort key) of the record read in step S115f and deletes the record from the database 12.

[0118] (Step S115g) After the record is deleted, the search unit 112 determines whether the record read in step S115f is the last record of the records identified in step S105f. If the record read in step S115f is not the last record of the records identified in step S105f, the search unit 112 reads the next record in step S115f. If the record read in step S115f is the last record of the records identified in step S105f, the record deletion ends, and the following step S125e is executed.

[0119] (Step S125e) The control unit 110 outputs a deletion completion notification to the communication unit 10. The communication unit 10 transmits the deletion completion notification to the terminal device 2.

[0120] In the fifth example, the search unit 112 identifies, as the record to be deleted, a record associated with a first search key that matches the specified search key. The search unit 112 does not need to refer to a record associated with a first search key that does not match the specified search key. This allows the search unit 112 to efficiently identify the data to be deleted.

[0121] (Example 6) A sixth example will be described. The sixth example is mainly applied to NoSQL. In the sixth example, a certificate management table 120e shown in FIG.

[0122] 13 shows an example of processing executed by the data management device 1 in the sixth example. The operation of the data management device 1 will be described with reference to FIG.

[0123] (Step S100f) The communication unit 10 receives the deletion request transmitted by the terminal device 2, and outputs the received deletion request to the data management unit 11. The specified search key included in the deletion request is "20231212".

[0124] (Step S105g) The length of the specified search key ("20231212") is longer than the first search key, item IT110 ("202312"). In this case, the search unit 112 extracts from the specified search key the portion ("202312") that includes the beginning of the specified search key and has the same length as the first search key. The search unit 112 executes a query that specifies the extracted portion ("202312"), and identifies one or more records associated with a partition key that matches that portion as records to be deleted.

[0125] Certificate management table 120e includes five records whose partition key, which is the first search key, is "202312." Search unit 112 identifies the five records whose partition key is "202312." It has not yet been determined whether all of the extracted records are to be deleted.

[0126] (Step S105h) The search unit 112 sorts the records identified in step S105g in ascending order using the second search key. The second search key is a combination of the remaining expiration date excluding the portion registered as the first search key and a unique value, and is registered as a primary key (sort key). The search unit 112 sorts the records identified in step S105g in ascending order of the value of item IT111. The search unit 112 saves the sorted records.

[0127] (Step S115h) The search unit 112 reads one of the sorted records in ascending order of the value of the item IT111.

[0128] (Step S115i) Search unit 112 determines whether the first two digits of the second search key of the record read in step S115h are equal to or less than the remaining portion ("12") of the specified search key excluding the portion ("202312") extracted in step S105h. If the first two digits of the second search key of the record read in step S115h are equal to or less than the remaining portion ("12") of the specified search key, search unit 112 identifies the record read in step S115h as a record to be deleted.

[0129] The records in certificate management table 120e are sorted by the second search key. Certificate management table 120e includes three records whose second search keys have the first two digits "12" and two records whose second search keys have the first two digits "13". Search unit 112 identifies the three records whose second search keys have the first two digits "12" as records to be deleted. The two records whose second search keys have the first two digits "13" are not to be deleted.

[0130] If the records identified in step S105g include a record whose first two digits of the second search key are smaller than the remaining portion of the specified search key ("12"), the search unit 112 identifies that record as the record to be deleted. For example, the search unit 112 identifies a record whose first two digits of the second search key are "11" as the record to be deleted. As described above, the search unit 112 identifies data associated with the second search key that corresponds to a time before the time indicated by the remaining portion ("12") of the specified search key excluding the portion used in the search in step S105g ("202312").

[0131] (Step S120g) The deletion unit 113 specifies the primary key (partition key and sort key) of the record read in step S115h and deletes the record from the database 12.

[0132] (Step S115j) After the record is deleted, the search unit 112 determines whether the record read in step S115h is the last record of the records sorted in step S105h. If the record read in step S115h is not the last record of the records sorted in step S105h, the search unit 112 reads the next record in step S115h. If the record read in step S115h is the last record of the records sorted in step S105h, the search using the second search key and record deletion end, and step S125f, described below, is executed.

[0133] If the search unit 112 determines in step S115i that the first two digits of the second search key of the record read in step S115h are greater than the remaining portion of the specified search key ("12"), the search using the second search key and the deletion of the record are terminated, and step S125f, described below, is executed.

[0134] In certificate management table 120e, records are read in order from the top. After three records whose second search key has the first two digits "12" are deleted, a record whose second search key has the first two digits "13" is read. Because the first two digits of the second search key ("13") are greater than the remaining portion of the specified search key ("12"), searches using the second search key and record deletions end. The last record in certificate management table 120e is not read.

[0135] If a record including data having an expiration date that corresponds to a time earlier than the portion of the specified search key extracted in step S105g ("202312") is registered in certificate management table 120e, search unit 112 identifies that record as the record to be deleted. For example, search unit 112 identifies a record whose first search key is "202311" as the record to be deleted. Deletion unit 113 deletes that record.

[0136] (Step S125f) The control unit 110 outputs a deletion completion notification to the communication unit 10. The communication unit 10 transmits the deletion completion notification to the terminal device 2.

[0137] In the sixth example, after records associated with a first search key that matches part of the specified search key are sorted by the second search key, the search unit 112 identifies, as records to be deleted, records associated with the second search key that correspond to a time before the time indicated by the remainder of the specified search key. After all records to be deleted have been deleted, the search unit 112 does not need to refer to the records. This allows the search unit 112 to efficiently identify data to be deleted.

[0138] The following describes combinations of a first search key and a second search key. As shown in the first, second, and third examples above, the first search key may be the name of a table, and the second search key may be a partition key. In this case, NoSQL is mainly used. The partition key is also called a hash key. When the first search key is the name of a table, the second search key may be a primary key used in an RDB.

[0139] As shown in the fourth, fifth, and sixth examples above, the first search key may be a partition key, and the second search key may be a sort key. In this case, NoSQL is mainly used. The sort key is also called a range key. The first search key and the second search key may be primary keys used in an RDB.

[0140] The relationship between the expiration date, the specified search key, the first search key, and the second search key will be explained below. Figure 14 shows an example of these relationships.

[0141] Six examples are shown in Figure 14. In the first example shown in Figure 14, the expiration date is a combination of "year" and "month", the first search key is "year", and the second search key is "month". In the second example shown in Figure 14, the expiration date is a combination of "year", "month", and "day", the first search key is a combination of "year" and "month", and the second search key is "day". In the third example shown in Figure 14, the expiration date is a combination of "year", "month", "day", and "hour", the first search key is a combination of "year", "month", and "day", and the second search key is "hour".

[0142] In a fourth example shown in FIG. 14, the expiration date is a combination of "year," "month," "day," "hour," and "minute," the first search key is a combination of "year," "month," "day," and "hour," and the second search key is "minute." In a fifth example shown in FIG. 14, the expiration date is a combination of "year," "month," "day," "hour," "minute," and "second," the first search key is a combination of "year," "month," "day," "hour," and "minute," and the second search key is "second." In a sixth example shown in FIG. 14, the expiration date is a combination of "year," "month," "day," "hour," "minute," "second," and "millisecond," the first search key is a combination of "year," "month," "day," "hour," "minute," and "second," and the second search key is "millisecond."

[0143] (Variation) 15 shows the configuration of a data management device 1a according to a modified embodiment of the present invention. The following describes the parts that are different from those shown in FIG. 1, and omits the description of the parts that are the same as those shown in FIG. 1. The data management device 1a has a communication unit 10, a data management unit 11, a database 12, and a directory 13.

[0144] The directory 13 is stored on a storage medium within the data management device 1. The directory 13 may be stored in a storage device separate from the data management device 1. The directory 13 includes a certificate file 130a, a certificate file 130b, and a certificate file 130c. Each certificate file includes electronic certificate data. An ID is assigned to each certificate file, and each ID is associated with a record in the certificate management table 120 in the database 12. Each record in the certificate management table 120 does not need to include electronic certificate data.

[0145] In the above example, the data to be managed for expiration dates is digital certificate data, but the data to be managed for expiration dates may also be key data, a whitelist, or some kind of setting information, etc. For example, the database 12 may have a table containing records in which key IDs and key values ​​are registered.

[0146] As described above, the registration unit 111 associates data having an expiration date with a first search key and a second search key and registers the data in the database 12. The first search key is part of the expiration date. The second search key is a value that combines the remaining expiration date and a unique value. The search unit 112 searches the data registered in the database 12 using a specified search key that indicates a time. The search unit 112 identifies data associated with a first search key that matches a time before the time indicated by at least a portion of the specified search key. Furthermore, the search unit 112 identifies, from the identified data, data associated with a second search key that corresponds to a time before the time indicated by the remainder of the specified search key. This allows the data management device 1 to efficiently identify the data to be processed.

[0147] The first search key includes the beginning of the expiration date. The remainder of the expiration date, excluding the beginning, is placed at the beginning of the second search key, and the unique value is placed after the remainder of the expiration date. The search unit 112 identifies data associated with the first search key that matches a time before the time indicated by at least the beginning of the specified search key.

[0148] When the length of the first search key is the same as the length of the specified search key, the data management device 1 can identify the data to be processed in a search that uses the first search key, as shown in Figures 5, 7, 10, and 12. Therefore, the data management device 1 does not need to perform a process for determining whether or not to delete a record for each record, and can efficiently identify the data to be processed.

[0149] If the name of the table in which data is registered in database 12 is the same as the first search key, data management device 1 can identify the data to be processed by referring to the name of the table. Therefore, data management device 1 does not need to refer to each record included in the table, and can efficiently identify the data to be processed.

[0150] As described above, search unit 112 sorts, by the second search key, data associated with the first search key that matches the time indicated by part of the specified search key (step S105d in FIG. 8 and step S105h in FIG. 13), and then identifies data associated with the second search key that corresponds to a time before the time indicated by the remainder of the specified search key (step S115b in FIG. 8 and step S115i in FIG. 13).

[0151] Search unit 112 performs a process of determining whether the data is associated with a second search key that corresponds to a time before the time indicated by the remainder of the specified search key, in accordance with the order of the data sorted by the second search key (step S115b in FIG. 8 and step S115i in FIG. 13). If the second search key associated with the data is for a time after the time indicated by the remainder of the specified search key (NO in step S115b in FIG. 8 and NO in step S115i in FIG. 13), search unit 112 ends this determination process.

[0152] Even if the data identified in a search using the first search key includes data that is not to be processed, the search unit 112 can end the search at the point when data that is to be processed is identified in a search using the second search key. Therefore, the data management device 1 does not need to perform a determination process on data that is not to be processed, and can efficiently identify data that is to be processed.

[0153] The above has described in detail an embodiment of the present invention with reference to the drawings, but the specific configuration is not limited to the above embodiment, and design changes and the like are also included within the scope that does not deviate from the gist of the present invention. [Explanation of symbols]

[0154] 1, 1a data management device, 10 communication unit, 11 data management unit, 12 database, 13 directory, 110 control unit, 111 registration unit, 112 search unit, 113 deletion unit

Claims

1. a registration unit that registers data having an expiration date in a database in association with a first search key that is a part of the expiration date and a second search key that is a value combining the remainder of the expiration date and a unique value; a search unit that searches data registered in the database using a specified search key that indicates a time, the search unit identifying data associated with the first search key that matches a time before the time indicated by at least a portion of the specified search key, and identifying, from the identified data, data associated with the second search key that corresponds to a time before the time indicated by the remainder of the specified search key; A data management device having:

2. the first search key includes a leading portion of the expiration date; the remainder of the expiration date excluding the beginning of the expiration date is placed at the beginning of the second search key, and the unique value is placed after the remainder of the expiration date, The search unit identifies data associated with the first search key that matches a time before the time indicated by at least the leading portion of the specified search key. The data management device according to claim 1 .

3. The length of the first search key is the same as the length of the specified search key.

3. The data management device according to claim 1.

4. The name of the table in which the data is registered in the database is the same as the first search key.

3. The data management device according to claim 1.

5. The search unit sorts, by the second search key, data associated with the first search key that matches the time indicated by a portion of the specified search key, and then identifies data associated with the second search key that corresponds to a time before the time indicated by the remainder of the specified search key.

3. The data management device according to claim 1.

6. The search unit executes a process of determining whether data is associated with the second search key corresponding to a time before the time indicated by the remainder of the specified search key in accordance with the order of the data sorted by the second search key, and terminates the process if the second search key associated with the data is for a time after the time indicated by the remainder of the specified search key. The data management device according to claim 5 .

7. a registration step in which a registration unit registers data having an expiration date in a database in association with a first search key that is a part of the expiration date and a second search key that is a value combining the remainder of the expiration date and a unique value; a search step in which a search unit searches data registered in the database using a specified search key indicating a time, the search step identifying data associated with the first search key that matches a time before the time indicated by at least a portion of the specified search key, and identifying, from the identified data, data associated with the second search key that corresponds to a time before the time indicated by the remainder of the specified search key; A data management method comprising:

8. a registration unit that registers data having an expiration date in a database in association with a first search key that is a part of the expiration date and a second search key that is a value combining the remainder of the expiration date and a unique value; a search unit that searches data registered in the database using a specified search key that indicates a time, the search unit identifying data associated with the first search key that matches a time before the time indicated by at least a portion of the specified search key, and identifying, from the identified data, data associated with the second search key that corresponds to a time before the time indicated by the remainder of the specified search key; A program that allows a computer to function as a

Citation Information

Patent Citations

  • Database device, program, and data processing method

    JP7106656B2