A data storage method, device, apparatus and computer readable medium
By distinguishing between data with and without deadlines in the database, and determining and copying the necessary data without deadlines to the database, the problem of excessive invalid data in the database is solved, and hardware resources are optimized.
Patent Information
- Application Number
- CN202310720434.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-16
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-06-16
AI Technical Summary
Existing technologies contain a large amount of invalid data in databases, resulting in large database sizes and high hardware requirements. Current methods, which mainly delete data containing expiration dates, have failed to effectively reduce invalid data.
The original dataset is divided into data without a deadline and data with a deadline. It is determined whether the target data without a deadline referenced by the data with a deadline exists in the database. If the target data without a deadline that is not stored in the database exists in the original dataset, it is copied to the database to avoid data redundancy.
It reduces invalid data in the database, lowers hardware requirements, and improves data storage efficiency.
Smart Images

Figure CN116680273B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and more particularly, to a data storage method, device, equipment and computer readable medium. BACKGROUND
[0002] With the increasing development and popularity of computer technology, today's society has entered the era of big data from the information age. Various industries will generate a large amount of data, which is collected by different information systems. For example, the international civil aviation price system: in addition to calculating the ticket price of the non-flying flight, the international civil aviation price system also supports the refund and change of the ticketed flight. Therefore, not only the current effective price data is needed, but also the historical price data. However, too much data collected by the system will make the database very large. The larger the database is, the higher the requirements for the computer server memory, hard disk, network and other hardware specifications are.
[0003] In order to curb the continuous expansion of the database, the prior art mainly cleans up the data containing the expiration date in the database. If the data reaches the expiration date, the data is deleted from the database, so as to reduce the database. However, in addition to the data containing the expiration date in the database, there is also a large amount of data not containing the expiration date. Among them, the data not containing the expiration date can be referenced by the data containing the expiration date. Some data not containing the expiration date in the database is not referenced by the data containing the expiration date. The data not containing the expiration date which is not referenced by the data containing the expiration date is invalid data. Therefore, there are many invalid data in the database. SUMMARY
[0004] Therefore, the present application provides a data storage method, device, equipment and computer readable medium, which solves the problem of existing data storage method that there are many invalid data in the database.
[0005] To achieve the above purpose, the present scheme is as follows:
[0006] A data storage method comprises:
[0007] Obtaining an original data set, the original data set comprising data without expiration date and data with expiration date;
[0008] Storing the data with expiration date in the original data set to the database;
[0009] Judging whether the target data without expiration date referenced by each piece of data with expiration date exists in the database;
[0010] For the target data without expiration date not stored in the database, further judging whether it exists in the original data set.
[0011] If the target deadline-free data exists in the original data set, the target deadline-free data is copied from the original data set to the database.
[0012] A data storage apparatus comprises:
[0013] a data acquisition unit configured to acquire an original data set, the original data set comprising deadline-free data and deadline-containing data;
[0014] a data storage unit configured to store the deadline-containing data in the original data set to a database;
[0015] a first judging unit configured to judge whether target deadline-free data cited by each piece of the deadline-containing data exists in the database;
[0016] a second judging unit configured to further judge whether the target deadline-free data not stored in the database exists in the original data set;
[0017] a first copying unit configured to copy the target deadline-free data from the original data set to the database if the target deadline-free data exists in the original data set.
[0018] A data storage device comprises a memory and a processor;
[0019] the memory is configured to store a program;
[0020] the processor is configured to execute the program to realize each step of the foregoing data storage method.
[0021] A computer readable medium having stored thereon a computer program, the computer program being executed by a processor to realize each step of the foregoing data storage method.
[0022] From the above technical solution, the data storage method provided by the embodiment of the application considers that the original data includes data without a deadline and data with a deadline, therefore, after obtaining the original data set, the data in the original data set is divided into data without a deadline and data with a deadline. For the data with a deadline, the data with a deadline in the original data set is stored into the database, and for the data without a deadline, it is firstly judged whether the target data without a deadline referenced by each piece of data with a deadline exists in the database, for the target data without a deadline not stored in the database, it is further judged whether it exists in the original data set, if the target data without a deadline exists in the original data set, the target data without a deadline is copied from the original data set to the database. The two kinds of data are processed by the embodiment of the application, instead of directly storing the data in the original data set. For the data without a deadline, the embodiment of the application only copies the target data without a deadline referenced by the data with a deadline and existing in the original data set but not existing in the database to the database, without directly storing all the data without a deadline in the original data set into the database, avoiding data redundancy, reducing invalid data in the database, and further achieving the purpose of reducing the database. BRIEF DESCRIPTION OF DRAWINGS
[0023] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent by describing in detail the embodiments thereof with reference to the attached drawings in which:
[0024] Figure 1 A data storage method flow chart provided by the embodiment of the application;
[0025] Figure 2 A data storage device structure diagram provided by the embodiment of the application;
[0026] Figure 3 A data storage device hardware structure block diagram provided by the embodiment of the application. DETAILED DESCRIPTION
[0027] Embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings. While several embodiments of the disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be construed as being limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and fully convey the scope of the present disclosure to those skilled in the art. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes, and are not intended to limit the protection scope of the present disclosure.
[0028] As used herein, the term "includes" and its variants are open-ended, meaning that "includes but is not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment." The term "another embodiment" means "at least one additional embodiment." The term "some embodiments" means "at least some embodiments." Related terms have corresponding definitions.
[0029] It should be noted that the terms "first", "second", and the like in the present disclosure are used only to distinguish different devices, modules or units, and do not imply the order or interdependence of the functions performed by these devices, modules or units.
[0030] It should be noted that the terms "one", "multiple" in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that "one or more" should be understood unless otherwise explicitly indicated in the context.
[0031] The data storage method provided by the present application can be realized based on any terminal with data processing capability, which can be a mobile phone, a computer, a server, a cloud, etc.
[0032] First, combined with the accompanying drawings Figure 1 The data storage method provided by the present application is described as follows Figure 1 As shown in the figure, the method can include:
[0033] Step S10, obtaining an original data set.
[0034] Specifically, the original data set to be stored is obtained, wherein the original data set includes data without expiration date and data with expiration date.
[0035] Step S11, storing the data with expiration date in the original data set to the database.
[0036] Specifically, the field of the data with expiration date includes the expiration date of the data, and only the data after expiration is invalid data. The original data set is a newly obtained set of data to be stored, so the data with expiration date in the original data set is all unexpired data, so the data with expiration date in the original data set can be stored to the database. For example, in the international civil aviation price system, R1 data 1 and R1 data 2 can be obtained in the original data set, wherein R1 is a data type defined in the international price standard, and R1 type data is data with expiration date, so R1 data 1 and R1 data 2 can be stored to the database.
[0037] Step S12, judging whether the target data without expiration date referred to by each piece of data with expiration date exists in the database.
[0038] Specifically, considering that the data with expiration date can refer to the data without expiration date, different data with expiration date can refer to the same data without expiration date. Therefore, the target data without expiration date referred to by the data with expiration date in the original data set can have been stored in the database. If the target data without expiration date also exists in the original data set, directly storing the data without expiration date in the original data set into the database will cause the same data without expiration date to be stored repeatedly, which will increase the invalid data in the database. Therefore, it can be determined whether the target data without expiration date referred to by each piece of data with expiration date exists in the database. For example, taking the international civil aviation price system as an example, it is obtained that there are R1 data 1 and R3T999 data 1 in the original data set, wherein R1 and R3T999 are data types defined in the international price standard, the R1 type data is data with expiration date, and the R3T999 type data is data without expiration date. When the R1 data 1 refers to the R3T999 data 1, it can be determined whether the R3T999 data 1 is stored in the database.
[0039] For the target data without expiration date that is not stored in the database, the following step S13 is further performed; and for the target data without expiration date that is already stored in the database, it is not necessary to perform secondary storage.
[0040] Step S13, determining whether the target data without expiration date exists in the original data set.
[0041] Specifically, in addition to the data with expiration date, there is also data without expiration date in the original data set. Therefore, when the target data without expiration date referred to by the data with expiration date is not stored in the database, in order to complete the relationship between the data, it can also be determined whether the target data without expiration date exists in the original data set. For example, taking the international civil aviation price system as an example, it can be obtained that there are R1 data 1 and R3T999 data 1 in the original data set, wherein R1 and R3T999 are data types defined in the international price standard, the R1 type data is data with expiration date, and the R3T999 type data is data without expiration date. When the R1 data 1 refers to the R3T999 data 1, if the R3T999 data 1 is not stored in the database, it can be determined whether the R3T999 data 1 exists in the original data set.
[0042] If the target data without expiration date exists in the original data set, the following step S14 can be performed.
[0043] Step S14, copying the target data without expiration date from the original data set to the database.
[0044] Specifically, if the target non-expiry data exists in the original data set, in order to store the completeness of the data in the database, the target non-expiry data can be copied from the original data set to the database. At this time, both the expiry data and the target non-expiry data referenced by the expiry data are stored in the database, the completeness of the data can be ensured, for example, taking the international civil aviation price system as an example, R1 data 1 and R3T999 data 1 can be obtained in the original data set, wherein R1 and R3T999 are data types defined in the international price standard, the R1 type data is expiry data, and the R3T999 type data is non-expiry data, when the R1 data 1 references the R3T999 data 1, because the R3T999 data 1 exists in the original data set, the R3T999 data 1 can be copied to the database.
[0045] As can be seen from the above technical solutions, the data storage method provided by the embodiments of the present application considers that the original data includes non-expiry data and expiry data, therefore, after obtaining the original data set, the data in the original data set is divided into non-expiry data and expiry data. For the expiry data, the expiry data in the original data set is stored in the database, and for the non-expiry data, it is firstly judged whether the target non-expiry data referenced by each piece of expiry data exists in the database, for the target non-expiry data not stored in the database, it is further judged whether it exists in the original data set, if the target non-expiry data exists in the original data set, the target non-expiry data is copied from the original data set to the database. The two kinds of data are processed by the embodiments of the present application, instead of directly storing the data in the original data set. For the non-expiry data, the embodiments of the present application only copy the target non-expiry data referenced by the expiry data, which exists in the original data set but does not exist in the database, to the database, without directly storing all the non-expiry data in the original data set to the database, avoiding data redundancy, reducing invalid data in the database, and further achieving the purpose of reducing the database.
[0046] The flowchart in the above Figure 1 illustrates the functions and operations that can be implemented by the method according to the embodiments of the present disclosure. In this regard, each block in the flowchart can represent a module, a program segment, or a part of code, which includes one or more executable instructions for implementing the specified logic function. It should also be noted that in some alternative implementations, the functions noted in the blocks can be performed in a different order from that shown in the flowchart. Furthermore, one or more of the blocks can be repeated, or some blocks can be omitted, depending on the implementation. Figure 1The order in which the operations are described is not intended to be construed as a limitation, and any number of the described operations can be omitted or combined together in any order. For example, two operations denoted in succession can in fact be executed substantially concurrently, sometimes in the reverse order, depending upon the functionality involved. It will further be noted that each block of the flowchart illustrations, and combinations of blocks in the flowchart illustrations, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
[0047] Considering that some of the non-expiry date data in the original data set can not be referenced by the expiry date data in the original data set, the non-expiry date data is not stored into the database, but the non-expiry date data can be referenced by the expiry date data in the original data set acquired later, on the basis of the foregoing embodiment, the following step S15 can be further executed.
[0048] Step S15, copying the non-expiry date data in the original data set to the hard disk.
[0049] Specifically, the non-expiry date data in each acquired original data set can be stored by the hard disk, i.e., the non-expiry date data in the original data set is copied to the hard disk. For example, in the international civil aviation price system, R3T999 data 1 and R3T999 data 2 can be acquired in the original data set. The R3T999 is a data type defined in the international price standard, and the R3T999 type data is non-expiry date data, so the R3T999 data 1 and the R3T999 data 2 can be stored to the hard disk.
[0050] The embodiment of the present application introduces the process of copying the non-expiry date data in the original data set to the hard disk in step S15, and the process is as follows:
[0051] Step S151, judging whether each non-expiry date data in the original data set exists in the hard disk.
[0052] Specifically, in order to prevent data redundancy in the hard disk, whether each non-expiry date data in the original data set exists in the hard disk can be judged before the non-expiry date data is stored to the hard disk. For example, in the international civil aviation price system, R3T999 data 1 and R3T999 data 2 can be acquired in the original data set. The R3T999 is a data type defined in the international price standard, and the R3T999 type data is non-expiry date data, so whether the R3T999 data 1 and the R3T999 data 2 exist in the hard disk can be judged.
[0053] For the non-expiry date data not stored in the hard disk, the following step S152 is further executed; for the non-expiry date data already stored in the hard disk, storage is not needed.
[0054] S152, copying from the original data set to the hard disk.
[0055] Specifically, if the hard disk does not exist in the data without the deadline, the data without the deadline is stored in the hard disk, and there is no data redundancy. Therefore, for the data without the deadline which is not stored in the hard disk, it can be copied from the original data set to the hard disk. For example, in the international civil aviation price system, R3T999 data 1 and R3T999 data 2 can be obtained in the original data set. Among them, R3T999 is a data type defined in the international price standard, and R3T999 type data is data without deadline. If the hard disk exists R3T999 data 1, and does not exist R3T999 data 2, R3T999 data 2 is copied from the original data set to the hard disk.
[0056] The embodiment of the application copies the data without deadline in the original data set which does not exist in the hard disk from the original data set to the hard disk, which not only avoids the data redundancy in the hard disk, but also guarantees the completeness of the data without deadline in the hard disk.
[0057] After the step S13, the embodiment of the application judges whether the target data without deadline exists in the original data set, for the target data without deadline which is not stored in the original data set, the following step S16 can also be executed.
[0058] Step S16, judging whether the target data without deadline exists in the hard disk.
[0059] Specifically, the hard disk can be used to store the data without deadline, so when the database and the original data set do not exist in the target data without deadline, it can also be judged whether the target data without deadline exists in the hard disk.
[0060] If the target data without deadline exists in the hard disk, the following step S17 is executed; if the target data without deadline does not exist in the hard disk, the prompt information can be sent to the staff to prompt the staff that the data is missing.
[0061] Step S17, copying the target data without deadline from the hard disk to the database.
[0062] Specifically, when the database and the original data set do not exist in the target data without deadline, and the hard disk stores the target data without deadline, in order to complete the data in the database, the target data without deadline can be copied to the database.
[0063] After the target data without expiration date is not stored in the database and the original data set, it is judged whether the target data without expiration date is stored in the hard disk. When the target data without expiration date is stored in the hard disk, the data without expiration date in the hard disk is copied to the database, so that the completeness of the data in the database is further ensured.
[0064] Considering that the data will expire and the data will become invalid data after the data expires, the expired data can be cleaned up. For the data with expiration date, it is only needed to judge whether the date reaches the expiration date of the data with expiration date. If the expiration date is reached, it is determined that the data with expiration date has expired, and the expired data with expiration date can be deleted from the database. The cleaning of the data without expiration date is introduced in the embodiments of the present application, and the process can include:
[0065] In step S18, the data without expiration date in the database is screened.
[0066] Specifically, because the data without expiration date has no expiration date, it cannot be simply judged whether the data expires by judging whether the expiration date is reached, and needs to be processed separately from the data with expiration date. The data without expiration date in the database can be screened.
[0067] In step S19, it is judged whether the data with expiration date referencing each screened data without expiration date is expired.
[0068] Specifically, because the data without expiration date can be referenced by the data with expiration date, when the data with expiration date expires, the data with expiration date becomes invalid data, so the data without expiration date referenced by the data with expiration date also becomes invalid data. Therefore, after the data without expiration date in the database is screened, it is judged whether the data with expiration date referencing each screened data without expiration date is expired. Two cases can determine that the data with expiration date is expired. The first case is that there is data with expiration date referencing the data without expiration date in the database, and the expiration date of the data with expiration date is reached, so it is determined that the data with expiration date is expired. The second case is that there is no data with expiration date referencing the data without expiration date in the database, which proves that the data with expiration date is cleaned up because it is expired, so it is also determined that the data with expiration date is expired. For example, in the international civil aviation price system, R1 data 1 and R3T999 data 1 are stored in the database. R1 and R3T999 are data types defined in the international price standard. The R1 type data is data with expiration date, and the R3T999 type data is data without expiration date. The R1 data 1 references the R3T999 data 1. After the R3T999 data 1 is screened, it is judged whether the R1 data 1 is expired.
[0069] If it is expired, the following step S20 is performed.
[0070] Step S20, deleting the no-expiration-date data referenced by the expired expiration-date data from the database.
[0071] Specifically, if the expiration-date data has expired, the expired expiration-date data becomes invalid data, and the no-expiration-date data referenced by the invalid data is also invalid data. In order to reduce the database, the no-expiration-date data referenced by the expired expiration-date data can be deleted from the database.
[0072] The method for cleaning the no-expiration-date data in the database provided by the embodiments of the present application can determine whether each no-expiration-date data is expired by judging whether the expiration-date data referencing the no-expiration-date data is expired, so that the no-expiration-date data in the database can be cleaned, and the purpose of reducing the database can be achieved.
[0073] Before the step S12, the embodiments of the present application can further perform the following steps S21-S22.
[0074] Step S21, parsing the expiration-date data in the original data set to obtain the foreign key of each expiration-date data.
[0075] Specifically, each data can be parsed to obtain the primary key and the foreign key, and the reference relationship between the data can be determined by the primary key and the foreign key. The foreign key is the identifier of the data referenced by the data. In order to determine the no-expiration-date data referenced by the expiration-date data, the expiration-date data in the original data set can be parsed to obtain the foreign key of each expiration-date data. For example, the R2C data 1 in the international civil aviation price system is parsed, wherein R2C is a data type defined in the international price standard, and the R2C type data is expiration-date data. The parsed R2C data 1 can obtain the information as shown in Table 1:
[0076] Table 1
[0077]
[0078] Step S22, finding the no-expiration-date data with the same primary key as the foreign key of the expiration-date data as the target no-expiration-date data.
[0079] Specifically, because the primary key is the identification of data, and the foreign key is the identification of data referenced by data. So when the foreign key of data containing a deadline and the primary key of data without a deadline are the same, it can be determined that the data without a deadline is the target data without a deadline referenced by the data containing a deadline. Therefore, after the foreign key of the data containing a deadline is parsed, the data without a deadline whose primary key is the same as the foreign key of the data containing a deadline can be found as the target data without a deadline. For example, taking the international civil aviation price system as an example, the foreign key of R2C data 1 is shown in Table 1, R2C and R3C035 are data types defined in the international price standard, and the R2C type data can reference the R3C035 type data. It can be determined that the target data without a deadline referenced by the R2C data 1 is the R3C035 data 1, and the information of the R3C035 data 1 is shown in Table 2:
[0080] Table 2
[0081]
[0082] The method for determining the target data without a deadline provided by the embodiment of the application first parses the data containing a deadline in the original data set to obtain the foreign key of each data containing a deadline, and then finds the data without a deadline whose primary key is the same as the foreign key of the data containing a deadline as the target data without a deadline.
[0083] Considering that the data without a deadline can be referenced by data without a deadline, after the step S22 of finding the data without a deadline whose primary key is the same as the foreign key of the data containing a deadline as the target data without a deadline, the step S23 can be further executed.
[0084] In step S23, the data without a deadline whose primary key is the same as the foreign key of the target data without a deadline is also found as the target data without a deadline.
[0085] Specifically, after the target deadline-free data is determined, the target deadline-free data can also refer to other deadline-free data. In order to ensure data integrity, the deadline-free data referred to by the target deadline-free data can also be determined as the target deadline-free data referred to by the deadline-containing data, and thus, the deadline-free data having the same foreign key as the target deadline-free data is searched for and also regarded as the target deadline-free data. For example, taking the international civil aviation price system as an example, the foreign key of R3C035 data 1 is shown in Table 2, R3T983 and R3C035 are data types defined in the international price standard, and the R3T983 and R3C035 type data is deadline-free data, but the R3C035 type data can refer to the R3T983 type data. According to the foreign key of R3C035 data 1 shown in Table 2, it can be determined that the R3T983 data 1 having the same foreign key as the R3C035 data 1 is also the target deadline-free data, where the information of the R3T983 data 1 is shown in Table 3:
[0086] Table 3
[0087]
[0088] After the deadline-free data having the same primary key as the deadline-containing data is determined as the target deadline-free data, the deadline-free data having the same foreign key as the target deadline-free data is also searched for and regarded as the target deadline-free data in the embodiment of the application, further ensuring data integrity.
[0089] The names of the related information in the method embodiments of the present disclosure are only for illustrative purposes, and are not used to limit the scope of the information.
[0090] Although the operations are described in a specific order in the method embodiments of the present disclosure, this should not be understood as requiring the operations to be performed in the specific order or in a sequential order. In certain circumstances, multi-tasking and parallel processing can be advantageous.
[0091] It should be understood that each step described in the method embodiments of the present disclosure can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the execution of the steps shown. The scope of the present disclosure is not limited in this respect.
[0092] Computer program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0093] The data storage apparatus provided by the embodiments of the present application is described below, and the data storage apparatus described below can be referred to the data storage method described above.
[0094] Firstly, the data storage apparatus is introduced, as shown in Figure 2 The data storage apparatus can include: Figure 2
[0095] The data acquisition unit 100 is configured to acquire an original data set, wherein the original data set includes no-cut-off date data and cut-off date data;
[0096] The data storage unit 200 is configured to store the cut-off date data in the original data set into a database;
[0097] The first judging unit 300 is configured to judge whether the target no-cut-off date data referred by each piece of the cut-off date data exists in the database;
[0098] The second judging unit 400 is configured to further judge whether the target no-cut-off date data not stored in the database exists in the original data set;
[0099] The first copying unit 500 is configured to copy the target no-cut-off date data from the original data set to the database if the target no-cut-off date data exists in the original data set.
[0100] Optionally, the data storage apparatus can further include:
[0101] The second copying unit is configured to copy the no-cut-off date data in the original data set to a hard disk.
[0102] Optionally, the process of the second copying unit copying the data without deadline in the original data set to the hard disk can comprise:
[0103] judging whether each data without deadline in the original data set exists in the hard disk;
[0104] for the data without deadline not stored in the hard disk, further copying it from the original data set to the hard disk.
[0105] Optionally, the data storage device can further comprise:
[0106] a third judging unit, configured to, after the second judging unit judges whether the target data without deadline exists in the original data set, further judge whether the target data without deadline not stored in the original data set exists in the hard disk;
[0107] a third copying unit, configured to, if the target data without deadline exists in the hard disk, copy the target data without deadline from the hard disk to the database.
[0108] Optionally, the data storage device can further comprise:
[0109] a data screening unit, configured to screen the data without deadline in the database;
[0110] a fourth judging unit, configured to judge whether the data with deadline referencing each screened data without deadline is expired, and if so, delete the data without deadline referenced by the expired data with deadline from the database.
[0111] Optionally, each data comprises a foreign key and a primary key, the primary key is the identification of the data, and the foreign key is the identification of the data referenced by the data, and the data storage device can further comprise:
[0112] a data analyzing unit, configured to, before the first judging unit judges whether the target data without deadline referenced by each data with deadline exists in the database, analyze the data with deadline in the original data set to obtain the foreign key of each data with deadline;
[0113] a first data searching unit, configured to search for the data without deadline with the same primary key as the foreign key of the data with deadline as the target data without deadline.
[0114] Optionally, the data storage device can further comprise:
[0115] The second data search unit is used to search for no-deadline data whose primary key is the same as the foreign key of the data containing a deadline in the first data search unit and use it as the target no-deadline data, and then search for no-deadline data whose primary key is the same as the foreign key of the target no-deadline data and use it as the target no-deadline data.
[0116] The units involved in the embodiments described in this disclosure may be implemented by software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first judgment unit may also be described as a "data judgment unit."
[0117] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0118] The data storage device provided in the embodiments of the present application can be applied to data storage equipment. Figure 3 A hardware structure block diagram of the data storage device 600 is shown. The data storage device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The data storage device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0119] like Figure 3 As shown, the data storage device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 606 into a random access memory (RAM) 603. Various programs and data required for the operation of the data storage device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0120] Generally, the following devices can be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, and the like; storage devices 608 including, for example, a magnetic tape, a hard disk, and the like; and communication devices 609. The communication devices 609 can allow the data storage device 600 to communicate with other devices wirelessly or wired to exchange data. Although Figure 3 The data storage device 600 is shown with various devices, but it is understood that all of the shown devices are not required to be implemented or present. More or fewer devices can alternatively be implemented or present.
[0121] The embodiments of the present application also provide a computer readable medium, which carries one or more programs, when the one or more programs are executed by the data storage device, the data storage device is caused to: acquire an original data set, the original data set including no-cut-off date data and cut-off date data; store the cut-off date data in the original data set to a database; judge whether target no-cut-off date data referred by each piece of the cut-off date data exists in the database; for the target no-cut-off date data not stored in the database, further judge whether it exists in the original data set; if the target no-cut-off date data exists in the original data set, copy the target no-cut-off date data from the original data set to the database.
[0122] It should be noted that the computer readable medium described above in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination thereof. The computer readable storage medium may, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present disclosure, the computer readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or apparatus. The program code contained in the computer readable medium can be transmitted by any suitable medium, including but not limited to a wire, a cable, a RF (radio frequency) or the like, or any suitable combination thereof.
[0123] The computer readable medium described above can be contained in the data storage device described above; or can exist separately and not be assembled into the data storage device.
[0124] In particular, according to embodiments of the present disclosure, the processes described in the above data storage method embodiments can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program comprising program code for executing the above data storage method. In such embodiments, the computer program can be downloaded and installed from the network by the communication device 609 in the apparatus 601, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above functions defined in the data storage method of the embodiments of the present disclosure are executed. Figure 3
[0125] According to one or more embodiments of the present disclosure, example 1 provides a data storage method, comprising:
[0126] obtaining a raw data set comprising open-ended data and closed-ended data;
[0127] storing the closed-ended data in the raw data set to a database;
[0128] determining whether target open-ended data referenced by each piece of the closed-ended data exists in the database;
[0129] for the target open-ended data not stored in the database, further determining whether it exists in the raw data set;
[0130] if the target open-ended data exists in the raw data set, copying the target open-ended data from the raw data set to the database.
[0131] According to one or more embodiments of the present disclosure, example 2 provides the method of example 1, further comprising:
[0132] copying open-ended data in the raw data set to a hard disk.
[0133] According to one or more embodiments of the present disclosure, example 3 provides the method of example 2, copying open-ended data in the raw data set to a hard disk, comprising:
[0134] determining whether each piece of the open-ended data in the raw data set exists in the hard disk;
[0135] for the open-ended data not stored in the hard disk, further copying it from the raw data set to the hard disk.
[0136] According to one or more embodiments of the present disclosure, example 4 provides the method of example 1, after determining whether the target open-ended data exists in the raw data set, further comprising:
[0137] for the target open-ended data not stored in the raw data set, further determining whether it exists in the hard disk;
[0138] if the target open-ended data exists in the hard disk, copying the target open-ended data from the hard disk to the database.
[0139] According to one or more embodiments of the present disclosure, example 5 provides the method of example 1, further comprising:
[0140] screening open-ended data in the database;
[0141] determining whether the data without expiration date referenced by the data with expiration date is expired, and if so, deleting the data without expiration date referenced by the data with expiration date that is expired from the database.
[0142] According to one or more embodiments of the present disclosure, example 6 provides the method of any one of examples 1-5, each piece of data contains a foreign key and a primary key, the primary key is the identification of the data, and the foreign key is the identification of the data referenced by the data.
[0143] Before determining whether the target data without expiration date referenced by each piece of data with expiration date exists in the database, further comprising:
[0144] parsing the data with expiration date in the original data set to obtain the foreign key of each piece of data with expiration date;
[0145] finding the data without expiration date with the same primary key as the foreign key of the data with expiration date as the target data without expiration date.
[0146] According to one or more embodiments of the present disclosure, example 7 provides the method of example 6, after finding the data without expiration date with the same primary key as the foreign key of the data with expiration date as the target data without expiration date, further comprising:
[0147] finding the data without expiration date with the same primary key as the foreign key of the target data without expiration date as the target data without expiration date.
[0148] According to one or more embodiments of the present disclosure, example 8 provides a data storage device, comprising:
[0149] a data acquisition unit configured to acquire an original data set, the original data set comprising data without expiration date and data with expiration date;
[0150] a data storage unit configured to store the data with expiration date in the original data set to a database;
[0151] a first determination unit configured to determine whether the target data without expiration date referenced by each piece of data with expiration date exists in the database;
[0152] a second determination unit configured to further determine whether the target data without expiration date that is not stored in the database exists in the original data set;
[0153] a first copying unit configured to copy the target data without expiration date from the original data set to the database if the target data without expiration date exists in the original data set.
[0154] According to one or more embodiments of the present disclosure, example 9 provides a data storage device, comprising: a memory and a processor;
[0155] the memory, configured to store a program;
[0156] the processor, configured to execute the program, to implement each step of the data storage method according to any one of examples 1-7.
[0157] According to one or more embodiments of the present disclosure, example 10 provides a computer readable medium, having stored thereon a computer program, which when executed by a processor, implements each step of the data storage method according to any one of examples 1-7.
[0158] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
[0159] While several inventive embodiments have been described above, it should be understood that many modifications, substitutions and changes can be made by those skilled in the art to the particular implementations noted without departing from the scope of the present disclosure. Accordingly, the detailed description and drawings are to be regarded as illustrative and not restrictive.
[0160] The above description is merely illustrative of the application and the application should not be limited thereto as modifications of the application will occur to those skilled in the art upon consideration of the foregoing description, with the sole exception that the application should not be limited to the details of construction, design, or method of operation as described above. Accordingly, all changes coming within the meaning and equivalency range of the claims are intended to be embraced therein.
Claims
1. A data storage method, characterized by, The method comprises the following steps: acquiring an original data set, wherein the original data set comprises no deadline data and deadline data; storing the deadline data in the original data set into a database; judging whether target no deadline data referenced by each piece of deadline data exists in the database; for the target no deadline data not stored in the database, further judging whether the target no deadline data exists in the original data set; if the target no deadline data exists in the original data set, copying the target no deadline data from the original data set to the database; each piece of data comprises a foreign key and a primary key, wherein the primary key is the identification of the data, and the foreign key is the identification of the data referenced by the data; before judging whether the target no deadline data referenced by each piece of deadline data exists in the database, the method further comprises the following steps: analyzing the deadline data in the original data set to obtain the foreign key of each piece of deadline data; finding no deadline data with the same primary key as the foreign key of the deadline data as the target no deadline data.
2. The method of claim 1, wherein, The method further comprises the following steps: copying the no deadline data in the original data set to a hard disk.
3. The method of claim 2, wherein, The step of copying the no deadline data in the original data set to the hard disk comprises the following steps: judging whether each piece of no deadline data in the original data set exists in the hard disk; for the no deadline data not stored in the hard disk, further copying the no deadline data from the original data set to the hard disk.
4. The method of claim 1, wherein, after judging whether the target no deadline data exists in the original data set, the method further comprises the following steps: for the target no deadline data not stored in the original data set, further judging whether the target no deadline data exists in the hard disk; if the target no deadline data exists in the hard disk, copying the target no deadline data from the hard disk to the database.
5. The method of claim 1, wherein, The method further comprises the following steps: screening the no deadline data in the database; judging whether the deadline data referenced by each piece of screened no deadline data is expired, and if the deadline data is expired, deleting the no deadline data referenced by the expired deadline data from the database.
6. The method of claim 5, wherein, after the step of finding no deadline data with the same primary key as the foreign key of the deadline data as the target no deadline data, the method further comprises the following step: finding no deadline data with the same primary key as the foreign key of the target no deadline data as the target no deadline data.
7. A data storage device, characterized by The method comprises the following steps: a data acquisition unit is configured to acquire an original data set, wherein the original data set comprises no deadline data and deadline data; a data storage unit is configured to store the deadline data in the original data set into a database; a first judging unit is configured to judge whether target no deadline data referenced by each piece of deadline data exists in the database; a second judging unit is configured to, for the target no deadline data not stored in the database, further judge whether the target no deadline data exists in the original data set; a first copying unit, configured to copy the target deadline-free data from the original data set to the database if the target deadline-free data exists in the original data set; Each piece of data contains a foreign key and a primary key, the primary key is the identification of the data, and the foreign key is the identification of the data referenced by the data; The data storage device further comprises: a data analysis unit, configured to analyze the deadline-containing data in the original data set to obtain the foreign key of each deadline-containing data before the first judging unit judges whether the target deadline-free data referenced by each piece of deadline-containing data exists in the database; a first data searching unit, configured to search for deadline-free data with the same primary key as the foreign key of the deadline-containing data as the target deadline-free data.
8. A data storage device, characterized by comprise: a memory and a processor; The memory is used to store programs; The processor is used to execute the programs to realize the steps of the data storage method according to any one of claims 1-6.
9. A computer readable medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to realize the steps of the data storage method according to any one of claims 1-6. The computer program is executed by the processor to realize the steps of the data storage method according to any one of claims 1-6.
Citation Information
Patent Citations
Freight rate data storage method and related device
CN114691693A
Replication queue handling
US20180075118A1