Data management method and device, electronic device and storage medium
After the hard disk is formatted, the database records associated with the hard disk are obtained and deleted and unrelated them from the hard disk, the problem of slow database records being cancelled after the hard disk is formatted is solved, and data processing efficiency and user experience are improved.
Patent Information
- Application Number
- CN202510113116.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-23
AI Technical Summary
After the hard disk is formatted, how to effectively unlink the corresponding database record before formatting and the hard disk, and solve the problem of slow and affecting the user experience in the prior art.
By obtaining the first hard disk identification information associated with the target hard disk, the target hard disk is formatted, and the database record corresponding to the first hard disk identification information is deleted in the target database. Then, the second hard disk identification information that is inconsistent with the first hard disk identification information is determined, and it is associated to the target hard disk, and the first hard disk identification information is deleted.
It quickly unlinks database records and hard disks after hard disk formatting, improves data processing efficiency and data query accuracy, reduces resource consumption and improves user experience.
Smart Images

Figure CN120029547A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a data management method, device, electronic device and storage medium. Background Art
[0002] With the development of technology, more and more data is generated, and these data are usually stored in a certain storage medium according to demand. In the field of video surveillance, the collected video data and image data are generally stored in a mechanical hard disk, and then the attributes of the video / image are recorded in the database, and the database is generally stored on a solid-state hard disk; when the video / image attribute information is recorded in the database, the identification information of which hard disk the video / image data is stored in is also recorded in the database accordingly. In the subsequent query of video / image records from the database, it is necessary to filter out the hard disk that no longer exists. At the same time, when the hard disk is formatted, it is also necessary to clear the database records related to the hard disk from the database.
[0003] In the related art, the hard disk identification recorded in the database is unique and unchanging on the device. Usually, the hard disk identification recorded in the database is recorded in the database as a unique and unchanging value such as the hard disk serial number. When the entire device has a large number of hard disks and a large amount of image data is stored in the hard disk, the entire database may be very large in this case; if the hard disk is formatted at this time, the database records related to the hard disk need to be cleared from the database. Since the database records are very large and the database capacity is also very large, it will be very slow to clear the database records related to the hard disk in this case. If formatting the hard disk and clearing the data in the database are a synchronous operation process, it is necessary to clear the database associated with the hard disk currently being formatted before formatting the hard disk. In this case, the process may be very long. In the fastest case, the database can be cleared in a few minutes, and in the slowest case, it may take several hours to clear the database. If clearing the data in the database and formatting the hard disk are an asynchronous and concurrent process, the hard disk may be formatted very quickly, and new pictures / video data can be written to the hard disk, and new records can be added to the database at the same time. However, since the process of clearing the database records associated with the hard disk currently being formatted is very slow, the old database records may be queried for a long time after the hard disk is formatted, but the data content corresponding to the record in the actual hard disk no longer exists, which will bring a very bad experience to customers.
[0004] Currently, in the related art, there is no effective solution to the problem of how to disassociate the corresponding pre-formatting database records from the hard disk after the hard disk is formatted. Summary of the invention
[0005] The embodiments of the present application provide a data management method, device, electronic device and storage medium to at least solve the problem in the related art of how to disassociate the corresponding pre-formatting database records from the hard disk after the hard disk is formatted.
[0006] In a first aspect, an embodiment of the present application provides a data management method.
[0007] In some embodiments, the data management method includes:
[0008] Acquire first hard disk identification information associated with a target hard disk, and format the target hard disk;
[0009] Determine a target database corresponding to the target hard disk, and delete a database record in the target database corresponding to the first hard disk identification information;
[0010] Determine second hard disk identification information that is inconsistent with the first hard disk identification information, associate the second hard disk identification information with the target hard disk, and delete the first hard disk identification information.
[0011] In some embodiments, determining second hard disk identification information inconsistent with the first hard disk identification information, associating the second hard disk identification information with the target hard disk, and deleting the first hard disk identification information includes:
[0012] Determine second hard disk identification information that is inconsistent with the first hard disk identification information, establish mapping relationship information between the second hard disk identification information and the hard disk serial number of the target hard disk, and delete the mapping relationship information between the first hard disk identification information and the hard disk serial number of the target hard disk.
[0013] In some embodiments, determining the second hard disk identification information inconsistent with the first hard disk identification information, establishing the mapping relationship information between the second hard disk identification information and the hard disk serial number of the target hard disk, and deleting the mapping relationship information between the first hard disk identification information and the hard disk serial number of the target hard disk includes:
[0014] In the case where the first hard disk identification information is a first integer value, determining the second hard disk identification information is a second integer value according to a preset identification information establishment rule;
[0015] A mapping relationship information between the second integer value and the hard disk serial number of the target hard disk is established, and a mapping relationship information between the first integer value and the hard disk serial number of the target hard disk is deleted.
[0016] In some embodiments, determining the second hard disk identification information inconsistent with the first hard disk identification information, establishing the mapping relationship information between the second hard disk identification information and the hard disk serial number of the target hard disk, and deleting the mapping relationship information between the first hard disk identification information and the hard disk serial number of the target hard disk includes:
[0017] In the case where the first hard disk identification information is a first hash integer value corresponding to the first universal unique identifier, obtaining a second hash integer value corresponding to the second universal unique identifier, and determining that the second hard disk identification information is the second hash integer value;
[0018] A mapping relationship information between the second hash integer value and the hard disk serial number of the target hard disk is established, and a mapping relationship information between the first hash integer value and the hard disk serial number of the target hard disk is deleted.
[0019] In some embodiments, after determining the second hard disk identification information inconsistent with the first hard disk identification information, associating the second hard disk identification information with the target hard disk, and deleting the first hard disk identification information, the method further includes:
[0020] Acquire target data to be stored, and determine a database record to be stored according to the target data to be stored and the second hard disk identification information;
[0021] The database records to be stored are stored in the target database.
[0022] In some embodiments, the acquiring the target data to be stored and determining the database record to be stored according to the target data to be stored and the second hard disk identification information includes:
[0023] Acquire the target data to be stored, and determine the target data name information, target data channel information and target data time information corresponding to the target data to be stored;
[0024] Determine the database record to be stored according to the target data name information, the target data channel information, the target data time information and the second hard disk identification information;
[0025] The database records to be stored are stored in the target database.
[0026] In some embodiments, after storing the to-be-stored database record in the target database, the method further includes:
[0027] receiving target data query condition information from a client, wherein the target data query condition information includes the second hard disk identification information;
[0028] According to the target data query condition information, the target query data in the target database is acquired.
[0029] In a second aspect, an embodiment of the present application provides a data management device.
[0030] In some embodiments, the device includes a hard disk formatting module, a record deletion module, and an identification association module:
[0031] The hard disk formatting module is used to obtain first hard disk identification information associated with a target hard disk and format the target hard disk;
[0032] The record deletion module is used to determine the target database corresponding to the target hard disk, and delete the database record corresponding to the first hard disk identification information in the target database;
[0033] The identification association module is used to determine second hard disk identification information that is inconsistent with the first hard disk identification information, associate the second hard disk identification information with the target hard disk, and delete the first hard disk identification information.
[0034] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data management method as described in the first aspect above is implemented.
[0035] In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the data management method as described in the first aspect above is implemented.
[0036] Compared with the related art, the data management method, device, electronic device and storage medium provided in the embodiments of the present application obtain first hard disk identification information associated with the target hard disk, format the target hard disk according to the first hard disk identification information, determine the target database corresponding to the target hard disk, delete the data corresponding to the first hard disk identification information in the target database, determine second hard disk identification information inconsistent with the first hard disk identification information, associate the second hard disk identification information to the target hard disk, and delete the first hard disk identification information, thereby solving the problem of how to disassociate the corresponding pre-formatting database records from the hard disk after the hard disk is formatted, thereby improving the accuracy of the association information between the hard disk and the database records.
[0037] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0039] Figure 1 is a hardware structure block diagram of a terminal according to a data management method of an embodiment of the present application;
[0040] Figure 2 is a flow chart of a data management method according to an embodiment of the present application;
[0041] Figure 3 is a flow chart of a data management method according to a preferred embodiment of the present application;
[0042] Figure 4 It is a structural block diagram of a data management device according to an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in the present application, some changes such as design, manufacturing or production based on the technical contents disclosed in the present application are only conventional technical means, and should not be understood as insufficient contents disclosed in the present application.
[0044] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0045] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third" and the like involved in the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects.
[0046] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. Taking running on a terminal as an example, Figure 1 FIG. 1 is a hardware structure diagram of a terminal of a data management method according to an embodiment of the present invention. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0047] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data management method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0048] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0049] This embodiment provides a data management method. Figure 2 is a flow chart of a data management method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0050] Step S201, obtaining first hard disk identification information associated with a target hard disk, and formatting the target hard disk.
[0051] In an embodiment of the present application, the target hard disk is a hard disk that needs to be formatted, and the first hard disk identification information currently associated with the target hard disk is obtained. The first hard disk identification information is associated with the target hard disk, and there may be a mapping relationship between the first hard disk identification information and the target hard disk. For example, there are three hard disks on the current device, namely hard disk A, hard disk B, and hard disk C; and the hard disk identification information of hard disk A is 1, the hard disk identification information of hard disk B is 2, and the hard disk identification information of hard disk C is 3. When hard disk A is determined to be the target hard disk, the first hard disk identification information is also determined to be 1 at the same time. The embodiment of the present application also includes formatting the target hard disk to clear the data in the target hard disk and release the storage space of the target hard disk.
[0052] Step S202: determine the target database corresponding to the target hard disk, and delete the database record corresponding to the first hard disk identification information in the target database.
[0053] Usually, in the data storage stage, after the data content is stored in the hard disk, the corresponding data attributes are combined into database records and stored in the database. Therefore, in the data clearing stage, the corresponding target database can be determined according to the formatted target hard disk, and the database record to be cleared corresponding to the first hard disk identification information can be queried and deleted. In this way, when the target hard disk is formatted, the corresponding database record can be cleared in time.
[0054] Step S203, determining second hard disk identification information that is inconsistent with the first hard disk identification information, associating the second hard disk identification information with the target hard disk, and deleting the first hard disk identification information.
[0055] The second hard disk identification information is determined according to the first hard disk identification information, wherein the second hard disk identification information cannot be the same as the first hard disk identification information. The second hard disk identification information is associated with the target hard disk, and a mapping relationship between the second hard disk identification information and the target hard disk can be established, and the first hard disk identification information is deleted after the mapping relationship is established.
[0056] Through the above steps, the embodiment of the present application determines the target hard disk to be formatted, obtains the first hard disk identification information associated with the target hard disk, and formats the target hard disk. After determining the target database corresponding to the target hard disk, the database record corresponding to the first hard disk identification information in the target database is deleted, so that when the target hard disk is formatted, the database record corresponding to the first hard disk identification information is also cleared, saving resources. Further, the second hard disk identification information inconsistent with the first hard disk identification information is determined, the second hard disk identification information is associated with the target hard disk, and the first hard disk identification information is deleted. Since the second hard disk identification information is different from the first hard disk identification information, even if the process of clearing the database record is longer than formatting the hard disk, when the data is continued to be stored in the target hard disk during the process, the corresponding database record will be recorded with the second hard disk identification information, so there will be no confusion. On the other hand, when performing data query in the process, if the query is based on the first hard disk identification information, since the first hard disk identification information has been deleted, the query cannot be performed; and if the query is based on the second hard disk identification information, it means that the queried data content is stored after the target hard disk is formatted, so the query result is accurate, improving the user experience. It can be seen that the embodiment of the present application solves the problem of how to disassociate the corresponding pre-formatting database records from the hard disk after the hard disk is formatted. It can store and query data in the hard disk while clearing the database records, thereby improving data processing efficiency and data query accuracy, saving resources, and improving user experience.
[0057] In some embodiments, step S203 includes:
[0058] Step S2031, determine the second hard disk identification information that is inconsistent with the first hard disk identification information, establish the mapping relationship information between the second hard disk identification information and the hard disk serial number of the target hard disk, and delete the mapping relationship information between the first hard disk identification information and the hard disk serial number of the target hard disk.
[0059] The hard disk serial number is a unique identifier assigned by the hard disk manufacturer during the production process. It is used to distinguish different hard disks. It is unique and cannot be modified by the user. Therefore, the hard disk identification information can be associated with the hard disk serial number of the target hard disk. Specifically, mapping relationship information between the two can be established, so that the corresponding target hard disk can be found through the hard disk identification information based on the mapping relationship information between the two. It is worth noting that each hard disk can only be associated with one hard disk identification information at the same time. Therefore, after establishing the mapping relationship information between the second hard disk identification information and the hard disk serial number of the target hard disk, the mapping relationship information between the first hard disk identification information and the hard disk serial number of the target hard disk needs to be deleted.
[0060] Through the above steps, the embodiment of the present application determines the hard disk identification information that the current target hard disk needs to correspond to by establishing the mapping relationship information between the second hard disk identification information and the hard disk serial number of the target hard disk, and deleting the mapping relationship information between the first hard disk identification information and the hard disk serial number of the target hard disk, so that after the target hard disk is formatted, a new unique hard disk identification information is associated, which is highly feasible.
[0061] In some embodiments, step S2031 includes:
[0062] Step S2131, when the first hard disk identification information is a first integer value, according to a preset identification information establishment rule, determine that the second hard disk identification information is a second integer value.
[0063] When the first hard disk identification information is a first integer value, the second hard disk identification information is determined to be a second integer value according to a preset identification information establishment rule. For example, when the device has only one hard disk, the preset identification information establishment rule may be to add one to the first integer value to determine it as the second hard disk identification information.
[0064] Step S2231, establishing mapping relationship information between the second integer value and the hard disk serial number of the target hard disk, and deleting the mapping relationship information between the first integer value and the hard disk serial number of the target hard disk.
[0065] Establish the mapping relationship information between the second integer value and the hard disk serial number of the target hard disk, and delete the mapping relationship information between the first integer value and the hard disk serial number of the target hard disk, that is, update the hard disk identification information in real time, so that the target hard disk always has only one corresponding hard disk identification information. In addition, when there are multiple hard disks, the hard disk identification information can be continuously accumulated. Continuing with the above example, if there are 3 hard disks on the current device, namely hard disk A, hard disk B, and hard disk C; and the hard disk identification information of hard disk A is 1, the hard disk identification information of hard disk B is 2, and the hard disk identification information of hard disk C is 3, after reformatting hard disk A, the hard disk identification information of hard disk A becomes 4, formatting hard disk A again, the hard disk identification information of hard disk A becomes 5, formatting hard disk C, the hard disk identification information of hard disk C becomes 6, and the hard disk identification information corresponding to the hard disk will continue to be accumulated, and the hard disk identification information used before will no longer be used.
[0066] Through the above steps, the embodiment of the present application uses a continuously accumulated unique integer value as the real-time update hard disk identification information, which is highly feasible and efficient.
[0067] In some embodiments, step S2031 includes:
[0068] Step S2331, when the first hard disk identification information is the first hash integer value corresponding to the first universal unique identifier, obtain the second hash integer value corresponding to the second universal unique identifier, and determine that the second hard disk identification information is the second hash integer value.
[0069] The hard disk identification information can be established in a similar way to the above integer value accumulation method, or by generating a universally unique identifier (UUID) character each time it is formatted, and then calculating a hash integer value through the UUID character. Each universally unique identifier corresponds to a hash integer value to ensure that the hard disk identification information generated each time is inconsistent with the historical one.
[0070] Step S2431, establishing mapping relationship information between the second hash integer value and the hard disk serial number of the target hard disk, and deleting the mapping relationship information between the first hash integer value and the hard disk serial number of the target hard disk.
[0071] Through the above steps, the hash integer value calculated by the UUID character in the embodiment of the present application is used as the hard disk identification information, which ensures uniqueness, accuracy and feasibility.
[0072] In some embodiments, step S203 further includes:
[0073] Step S204, obtaining the target data to be stored, and determining the database record to be stored according to the target data to be stored and the identification information of the second hard disk.
[0074] Since the second hard disk identification information is inconsistent with the first hard disk identification information, after associating the second hard disk identification information with the target hard disk and deleting the first hard disk identification information, the data storage operation can be implemented to read data into the target hard disk. First, confirm which hard disk to store the data in, and then obtain the hard disk identification information based on the hard disk serial number. Taking the target hard disk as an example, its currently corresponding hard disk identification information is the second hard disk identification information. Then obtain the target data to be stored, associate the target data to be stored with the second hard disk identification information, and determine the database record to be stored based on the target data to be stored and the second hard disk identification information.
[0075] Step S205, storing the database records to be stored in the target database.
[0076] Through the above steps, after the target hard disk is formatted, when new data needs to be written to the formatted hard disk, the embodiment of the present application will write the database record of the new data into the target database; and the hard disk identification information used for the new record written into the target database is the second hard disk identification information newly generated after formatting, thereby avoiding the problem of having to wait for the database to be cleared before writing new data, thereby improving efficiency and real-time performance.
[0077] In some embodiments, step S204 includes:
[0078] Step S2041, obtaining the target data to be stored, and determining the target data name information, target data channel information and target data time information corresponding to the target data to be stored.
[0079] Determine the target data name information, target data channel information and target data time information of the current data to be stored. Taking the video / image data in the field of video surveillance as an example, it can be to obtain the video / image file name, video / image channel number, and video / image start / end time.
[0080] Step S2042, determining the database record to be stored according to the target data name information, the target data channel information, the target data time information and the second hard disk identification information.
[0081] In an embodiment of the present application, the target data name information, the target data channel information, the target data time information and the second hard disk identification information may be combined into a database record to be stored.
[0082] Step S2043, storing the database records to be stored in the target database.
[0083] Through the above steps, the embodiment of the present application specifically combines the target data name information, target data channel information, target data time information and second hard disk identification information into a database record to be stored, and stores it in the target database, which is highly feasible and realizes the accurate association between the database record and the target hard disk.
[0084] In some embodiments, step S2043 further includes:
[0085] Step S2044: receiving target data query condition information from the client, where the target data query condition information includes the second hard disk identification information.
[0086] The embodiment of the present application may also include a data query operation, receiving target data query condition information from the client, the target data query condition information including the second hard disk identification information. Taking the query of video / image data in the field of video surveillance as an example, when querying, first confirm which hard disks are on the current device, and when confirming that the data to be searched is on the target hard disk, obtain the second hard disk identification information according to the serial number of the target hard disk.
[0087] Step S2045, acquiring target query data in the target database according to the target data query condition information.
[0088] Following the above example, the target data query condition information may include the video / image channel number, the video / image start / end time and the second hard disk identification information, based on which data records can be queried from the database.
[0089] Through the above steps, since database records related to the first hard disk identification information will be saved in the database records during the period after the hard disk is formatted and before the database is cleared, but the data query condition information includes the second hard disk identification information, the database records that do not conform to the second hard disk identification information can be automatically filtered out when querying the database, thereby improving the accuracy of data query.
[0090] The embodiments of the present application are described and illustrated below through preferred embodiments.
[0091] Figure 3 Flowchart of the data management method according to the preferred embodiment of the present application. Figure 3 As shown, the data management method includes the following steps:
[0092] Step S301, obtaining a first integer value corresponding to a target hard disk, and formatting the target hard disk according to the first integer value;
[0093] Step S302, determining a target database corresponding to the target hard disk, and deleting a database record corresponding to the target hard disk in the target database according to the first integer value;
[0094] Step S303, determining that the second integer value is the first integer value plus one, establishing mapping relationship information between the second integer value and the hard disk serial number of the target hard disk, and deleting the mapping relationship information between the first integer value and the hard disk serial number of the target hard disk;
[0095] Step S304, obtaining the target data to be stored, and determining the database record to be stored according to the target data to be stored and the second integer value;
[0096] Step S305, storing the database records to be stored in the target database.
[0097] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0098] This embodiment also provides a data management device, which is used to implement the above embodiments and preferred implementations, and will not be repeated here. As used below, the terms "module", "unit", "subunit", etc. can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0099] Figure 4 is a structural block diagram of a data management device according to an embodiment of the present application, such as Figure 4 As shown, the device includes a hard disk formatting module 10, a record deletion module 20 and an identification association module 30:
[0100] The hard disk formatting module 10 is used to obtain the first hard disk identification information associated with the target hard disk and format the target hard disk;
[0101] A record deletion module 20, used to determine a target database corresponding to a target hard disk, and delete a database record corresponding to the first hard disk identification information in the target database;
[0102] The identification association module 30 is used to determine the second hard disk identification information that is inconsistent with the first hard disk identification information, associate the second hard disk identification information with the target hard disk, and delete the first hard disk identification information.
[0103] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0104] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0105] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0106] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0107] Acquire first hard disk identification information associated with a target hard disk, and format the target hard disk;
[0108] Determine a target database corresponding to the target hard disk, and delete a database record in the target database corresponding to the first hard disk identification information;
[0109] Determine second hard disk identification information that is inconsistent with the first hard disk identification information, associate the second hard disk identification information with the target hard disk, and delete the first hard disk identification information.
[0110] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0111] In addition, in combination with the data management method in the above embodiments, the present application embodiment can provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the data management methods in the above embodiments is implemented.
[0112] Those skilled in the art should understand that the technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0113] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0114] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A data management method, characterized in that: The following steps are involved: Acquire first hard disk identification information associated with a target hard disk, and format the target hard disk; Determine a target database corresponding to the target hard disk, and delete a database record in the target database corresponding to the first hard disk identification information; Determine second hard disk identification information that is inconsistent with the first hard disk identification information, associate the second hard disk identification information with the target hard disk, and delete the first hard disk identification information.
2. The data management method according to claim 1, characterized in that: The determining of second hard disk identification information inconsistent with the first hard disk identification information, associating the second hard disk identification information with the target hard disk, and deleting the first hard disk identification information includes: Determine second hard disk identification information that is inconsistent with the first hard disk identification information, establish mapping relationship information between the second hard disk identification information and the hard disk serial number of the target hard disk, and delete the mapping relationship information between the first hard disk identification information and the hard disk serial number of the target hard disk.
3. The data management method according to claim 2, characterized in that: The determining of the second hard disk identification information inconsistent with the first hard disk identification information, establishing the mapping relationship information between the second hard disk identification information and the hard disk serial number of the target hard disk, and deleting the mapping relationship information between the first hard disk identification information and the hard disk serial number of the target hard disk includes: In the case where the first hard disk identification information is a first integer value, determining the second hard disk identification information is a second integer value according to a preset identification information establishment rule; A mapping relationship information between the second integer value and the hard disk serial number of the target hard disk is established, and a mapping relationship information between the first integer value and the hard disk serial number of the target hard disk is deleted.
4. The data management method according to claim 2, characterized in that: The determining of the second hard disk identification information inconsistent with the first hard disk identification information, establishing the mapping relationship information between the second hard disk identification information and the hard disk serial number of the target hard disk, and deleting the mapping relationship information between the first hard disk identification information and the hard disk serial number of the target hard disk includes: In the case where the first hard disk identification information is a first hash integer value corresponding to the first universal unique identifier, obtaining a second hash integer value corresponding to the second universal unique identifier, and determining that the second hard disk identification information is the second hash integer value; A mapping relationship information between the second hash integer value and the hard disk serial number of the target hard disk is established, and a mapping relationship information between the first hash integer value and the hard disk serial number of the target hard disk is deleted.
5. The data management method according to any one of claims 1 to 4, characterized in that: After determining the second hard disk identification information inconsistent with the first hard disk identification information, associating the second hard disk identification information with the target hard disk, and deleting the first hard disk identification information, the following steps are included: Acquire target data to be stored, and determine a database record to be stored according to the target data to be stored and the second hard disk identification information; The database records to be stored are stored in the target database.
6. The data management method according to claim 5, characterized in that: The acquiring of the target data to be stored and determining the database record to be stored according to the target data to be stored and the second hard disk identification information comprises: Acquire the target data to be stored, and determine the target data name information, target data channel information and target data time information corresponding to the target data to be stored; Determine the database record to be stored according to the target data name information, the target data channel information, the target data time information and the second hard disk identification information; The database records to be stored are stored in the target database.
7. The data management method according to claim 6, characterized in that: After storing the database record to be stored in the target database, the method further includes: receiving target data query condition information from a client, wherein the target data query condition information includes the second hard disk identification information; According to the target data query condition information, the target query data in the target database is acquired.
8. A data management device, characterized in that: Including hard disk formatting module, record deletion module and identification association module: The hard disk formatting module is used to obtain first hard disk identification information associated with a target hard disk and format the target hard disk; The record deletion module is used to determine the target database corresponding to the target hard disk, and delete the database record corresponding to the first hard disk identification information in the target database; The identification association module is used to determine second hard disk identification information that is inconsistent with the first hard disk identification information, associate the second hard disk identification information with the target hard disk, and delete the first hard disk identification information.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the data management method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the data management method according to any one of claims 1 to 7 when running.