A data storage destruction method and device, electronic equipment and storage medium
By detecting the type and validity of the destruction trigger command, the destruction process is executed. The system storage resources are cleared first, and then the hard disk data is cleared using the dd command. This solves the problems of storage media not being reusable and insufficient adaptability in the existing technology, and achieves better adaptability and flexibility.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU EBOYLAMP ELECTRONICS CO LTD
- Filing Date
- 2023-06-05
- Publication Date
- 2026-07-24
Smart Images

Figure CN116825166B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and more specifically, to a method, apparatus, electronic device, and storage medium for destroying stored data. Background Technology
[0002] Currently, in the field of disk array storage technology, data destruction is an important data cleanup method in special scenarios to ensure the security of stored data, helping users effectively prevent data leakage. Existing data destruction technologies typically employ two different methods: one is to completely erase user data stored on the storage device using software erasure tools; the other is to physically damage the circuitry of the data storage medium or directly destroy the storage medium, thereby preventing data from being accessed again. Software destruction is more convenient to operate and can adapt to various scenarios and different levels of destruction requirements; once all data is overwritten and erased, it is unrecoverable. Physical destruction fundamentally destroys the data carrier, making the storage medium unrecoverable after destruction.
[0003] While physical data destruction technologies offer a more thorough and direct way to destroy storage media, they inevitably render the media unusable, thus lacking reusability and increasing the cost of replacing storage media. Software destruction, on the other hand, has lower implementation costs and allows for repeated erasure of storage media; however, its versatility across different storage systems makes it unsuitable for various data destruction scenarios. Therefore, the adaptability and usability of existing data destruction methods are not ideal. Summary of the Invention
[0004] To address the aforementioned issues, embodiments of this application provide a method, apparatus, electronic device, and storage medium for destroying stored data.
[0005] In a first aspect, embodiments of this application provide a method for destroying stored data, the method comprising:
[0006] When a destruction trigger command is detected, the command category of the destruction trigger command is determined, and the validity of the destruction trigger command is verified according to the command category;
[0007] For a valid destruction trigger command, execute the destruction process;
[0008] In the destruction process, system storage resources built on the hard disk are cleared, and after all system storage resources are cleared, the hard disk data is cleared. The hard disk data clearing operation is completed based on the dd command.
[0009] Preferably, when a destruction trigger command is detected, determining the command type of the destruction trigger command includes:
[0010] When a destruction trigger command is detected, the command category corresponding to the destruction trigger command is determined according to the object that generated the destruction trigger command. The command category includes remote operation commands and key commands.
[0011] Preferably, verifying the validity of the destruction trigger instruction based on the instruction category includes:
[0012] For the remote operation command, the RESTful interface is called to verify the status of the destruction trigger command.
[0013] For the key press command, the state confirmation and verification of the destruction trigger command is performed based on the debounce circuit and the judgment circuit.
[0014] Preferably, the step of calling the RESTful interface to verify the status of the destruction trigger command includes:
[0015] Call the RESTful interface to determine the user information input for the generated object;
[0016] When the user information matches the preset user information, the destruction trigger command is verified as valid;
[0017] When the user information does not match the preset user information, the destruction trigger instruction is verified as invalid.
[0018] Preferably, the status verification of the destruction trigger command based on the debouncing circuit and the judgment circuit includes:
[0019] After eliminating signal jitter in the electrical signal corresponding to the destruction trigger command based on the debouncing circuit, the duration of the electrical signal is determined based on the judgment circuit.
[0020] When the duration exceeds the preset duration, the destruction trigger command is verified as valid;
[0021] When the duration is not greater than the preset duration, the destruction trigger instruction is verified as invalid.
[0022] Preferably, for a valid destruction trigger instruction, the destruction process includes:
[0023] For valid remote operation commands, the data destruction interface is directly invoked to execute the destruction process;
[0024] For a valid key press command, the SAS extender-based state management service process selects and changes the status of the destruction flag in the flag database, and when the system daemon polls and finds that the flag status is in the execution state, it calls the data destruction interface to execute the destruction process.
[0025] Preferably, after all system storage resources are cleared, the hard disk data is cleared. The hard disk data clearing operation is performed based on the dd command, including:
[0026] After all system storage resources have been cleared, obtain the data destruction selection information corresponding to the hard disk data;
[0027] When the data destruction selection information indicates that only metadata is to be cleared, the metadata of the system storage resource in the hard disk is determined based on the data type corresponding to the system storage resource, and the metadata is cleared based on the dd command.
[0028] When the data destruction selection information indicates a full disk wipe, the data on the SSD is wiped using the blkdiscard command, and the data on the HDD is wiped using the dd command.
[0029] Secondly, embodiments of this application provide a data destruction device, the device comprising:
[0030] The detection module is used to determine the instruction category of the destruction trigger instruction when a destruction trigger instruction is detected, and to verify the validity of the destruction trigger instruction based on the instruction category.
[0031] The selection module is used to execute the destruction process for valid destruction trigger commands;
[0032] The clearing module is used to clear system storage resources built on the hard disk during the destruction process, and to clear hard disk data after all system storage resources have been cleared. The hard disk data clearing operation is completed based on the dd command.
[0033] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method provided as in the first aspect or any possible implementation of the first aspect.
[0034] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method provided as in the first aspect or any possible implementation thereof.
[0035] The beneficial effects of this invention are as follows: 1. The destruction process uses a method of first deleting storage resources and then clearing hard disk data, and the hard disk data is cleared based on the dd command, which is compatible with hard disks with different interfaces such as SAS, SATA and NVME, and has better adaptability and usability.
[0036] 2. Data destruction can be triggered using both remote and button operation methods, and the degree of data erasure on the hard drive can be selected according to actual needs, expanding the flexibility of data destruction operations in different scenarios. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 A flowchart illustrating a method for destroying stored data provided in an embodiment of this application;
[0039] Figure 2 This is a schematic diagram of the structure of a data destruction device provided in an embodiment of this application;
[0040] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0041] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0042] In the following description, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. The following description provides multiple embodiments of this application, which can be substituted or combined with each other. Therefore, this application can also be considered to include all possible combinations of the same and / or different embodiments described. Thus, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then this application should also be considered to include embodiments containing one or more other possible combinations of A, B, C, and D, even if such embodiments are not explicitly described in the following text.
[0043] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made to the function and arrangement of the described elements without departing from the scope of this application. Various processes or components may be appropriately omitted, substituted, or added to the examples. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.
[0044] See Figure 1 , Figure 1 This is a flowchart illustrating a method for destroying stored data provided in an embodiment of this application. In this embodiment, the method includes:
[0045] S101. When a destruction trigger instruction is detected, the instruction category of the destruction trigger instruction is determined, and the validity of the destruction trigger instruction is verified according to the instruction category.
[0046] The executing entity of this application may be the processor or controller corresponding to the storage device.
[0047] In one embodiment of this application, regardless of the method used by the user to perform a destruction operation, a corresponding destruction trigger instruction will be generated. Upon detecting the destruction trigger instruction, the processor assumes that the user has performed a data-clearing operation. First, it needs to determine the instruction type of the destruction trigger instruction to ascertain how it was generated. Then, it needs to verify the destruction trigger instruction to determine its validity. Only if the destruction trigger instruction is deemed valid will the subsequent data destruction process proceed.
[0048] In one possible implementation, determining the instruction type of the destruction trigger instruction when a destruction trigger instruction is detected includes:
[0049] When a destruction trigger command is detected, the command category corresponding to the destruction trigger command is determined according to the object that generated the destruction trigger command. The command category includes remote operation commands and key commands.
[0050] In one embodiment of this application, there can be two types of instructions: one is a remote operation instruction executed by a remote computer, and the other is a key instruction formed by physically pressing the data clear button. The specific verification process for different types of instructions is different. Specifically, the generating object corresponding to different types of instructions is different. The generating object of the remote operation instruction is the remote computer connected to the storage device, and the generating object of the key instruction is the data clear button on the storage device. Therefore, the type of instruction that triggers the destruction can be determined based on the different generating objects.
[0051] In one possible implementation, verifying the validity of the destruction trigger instruction based on the instruction category includes:
[0052] For the remote operation command, the RESTful interface is called to verify the status of the destruction trigger command.
[0053] For the key press command, the state confirmation and verification of the destruction trigger command is performed based on the debounce circuit and the judgment circuit.
[0054] In one embodiment of this application, for remote operation commands, a remote computer connects to the storage device to be destroyed via a network. The remote computer logs into the storage device's software management interface through a browser, selects the data destruction function, and clicks "trigger execution" on the interface, sending the destruction command (i.e., the destruction trigger command) to the storage device. The processor calls a RESTful interface to verify the command's status. RESTful is suitable for scenarios where mobile internet vendors use it as a business interface to enable third-party OTT services to call mobile network resources, with action types including adding, modifying, and deleting the called resources. For button commands, since pressing a physical button on the device chassis triggers the operation, to prevent accidental touches or malfunctions caused by electronic noise, a debouncing circuit and a judgment circuit are used to identify the continuity and stability of the destruction trigger command, thereby performing status verification.
[0055] In one possible implementation, the step of calling the RESTful interface to perform status verification of the destruction trigger command includes:
[0056] Call the RESTful interface to determine the user information input for the generated object;
[0057] When the user information matches the preset user information, the destruction trigger command is verified as valid;
[0058] When the user information does not match the preset user information, the destruction trigger instruction is verified as invalid.
[0059] In one embodiment of this application, for remote operation, user authentication checks are required. Specifically, it is necessary to check whether the user information (e.g., user account password) for remote computing is entered correctly. Only when the entered user information matches the preset user information corresponding to the remote computer stored in the server can the destruction trigger instruction be verified as valid; otherwise, it is an invalid instruction and the data clearing process will not be performed.
[0060] In one possible implementation, the status verification of the destruction trigger command based on the debouncing circuit and the judgment circuit includes:
[0061] After eliminating signal jitter in the electrical signal corresponding to the destruction trigger command based on the debouncing circuit, the duration of the electrical signal is determined based on the judgment circuit.
[0062] When the duration exceeds the preset duration, the destruction trigger command is verified as valid;
[0063] When the duration is not greater than the preset duration, the destruction trigger instruction is verified as invalid.
[0064] In one embodiment of this application, a button generally needs to be pressed for more than 3 seconds to be considered triggered. Therefore, the state confirmation verification process will be explained using 3 seconds as an example. During state confirmation, the debounce circuit removes signal jitter caused by operation or circuitry. The judgment circuit will determine whether the button is actually pressed and meets the requirement of being pressed for more than 3 seconds based on the continuous detection time of the electrical signal. Only destruction trigger commands with a duration exceeding the preset duration will be verified as valid.
[0065] S102. For a valid destruction trigger instruction, execute the destruction process.
[0066] In one embodiment of this application, the processor executes the destruction process to clear the stored data in the storage device only after the destruction trigger instruction is verified as valid. Destroy trigger instructions that are verified as invalid will not execute the destruction process.
[0067] In one possible implementation, step S102 includes:
[0068] For valid remote operation commands, the data destruction interface is directly invoked to execute the destruction process;
[0069] For a valid key press command, the SAS extender-based state management service process selects and changes the status of the destruction flag in the flag database, and when the system daemon polls and finds that the flag status is in the execution state, it calls the data destruction interface to execute the destruction process.
[0070] In one embodiment of this application, after the remote operation command has completed the validity verification, the destruction process can be executed directly by calling the data destruction interface. However, for key commands, certain processing is required before the destruction process can be executed.
[0071] Specifically, the storage device is equipped with a SAS extender. Key presses trigger hardware interrupts to the SAS extender. The GPIO interrupt service within the SAS extender handles these interrupts, waking up the signal processing process. After notifying the signal processing process, it determines it's a write interrupt flag transaction and can directly call the function interface to write the key state to the destruction flag in the flag database. The destruction flag is the DESTROY flag selected from a data unit of the associated characteristic unit; changing the flag state can involve setting the destruction flag from 0 to 1. Next, the system daemon polls for the destruction signal. The daemon uses the SAS commands initiated by the host for device management to send a query request to the virtual target device, preparing to read the key state flag, specifically the destruction flag. If the flag state is found to be 1, indicating an execution state, the data destruction interface is called to initiate the destruction process. Simultaneously, the daemon also sends a request to clear the key state via SAS commands from the host. Upon receiving this request, the virtual target device also clears the flag in the flag database through the state management service process, enabling subsequent processing. The virtual target device is a simulated target device that enables data interaction between the system initiator and the extended chip, and allows communication with the state management service.
[0072] S103. In the destruction process, the system storage resources built on the hard disk are cleared, and after all the system storage resources are cleared, the hard disk data is cleared. The hard disk data clearing operation is completed based on the dd command.
[0073] In one embodiment of this application, the destruction process prioritizes deleting storage resources created on the hard disks by storage software, followed by clearing hard disk data using system management commands. Storage resources include key resources such as storage pools, logical volumes, and file systems, which are the core manifestations of disk array management of storage space. After the destruction phase begins, the configuration information of these storage resources in the system needs to be cleared to prevent information residue from affecting the reuse of the storage device after data destruction. After the deletion of storage resources is completed, data is then cleared from all hard disks on the storage device to complete the complete destruction of stored data. The `dd` command is a command on Unix and Unix-like systems, primarily used for converting and copying files.
[0074] In one possible implementation, after all system storage resources are cleared, the hard disk data is cleared. The hard disk data clearing operation is performed based on the dd command and includes:
[0075] After all system storage resources have been cleared, obtain the data destruction selection information corresponding to the hard disk data;
[0076] When the data destruction selection information indicates that only metadata is to be cleared, the metadata of the system storage resource in the hard disk is determined based on the data type corresponding to the system storage resource, and the metadata is cleared based on the dd command.
[0077] When the data destruction selection information indicates a full disk wipe, the data on the SSD is wiped using the blkdiscard command, and the data on the HDD is wiped using the dd command.
[0078] In one embodiment of this application, users can choose different levels of data destruction based on their assessment of their own data security. If only the hard drive metadata is erased, the destruction process can be completed more quickly, meeting the user's need for rapid reuse of the storage device in a low-risk environment. If a full disk overwrite is selected, the destruction process will take longer, but it can meet the user's need for complete destruction of all stored data in a high-risk environment. Specifically, based on the user's selection, data destruction selection information corresponding to the hard drive data will be generated. The processor can then determine whether the user wants to destroy only the metadata or perform full disk data destruction based on this information.
[0079] Metadata cleanup is performed using the Linux system data read / write tool `dd`. Based on the data type of the storage resource, the metadata area on the hard drive is located, and the `dd` command overwrites these metadata areas with zeros. Hard drive data cleanup uses the `blkdiscard` command to write zeros to SSDs and the `dd` command to write zeros to HDDs. The commands for hard drive data cleanup can be used on any hard drive recognized by the system, regardless of the hard drive interface. Therefore, the above data destruction methods are compatible with hard drives with SAS, SATA, and NVMe interfaces.
[0080] The following will be combined with the appendix Figure 2 This application provides a detailed description of the data destruction device for stored data provided in the embodiments. It should be noted that the appendix... Figure 2 The data destruction device shown is used to execute the present application. Figure 1 The methods shown in the embodiments are for illustrative purposes only, illustrating the parts relevant to the embodiments of this application. For specific technical details not disclosed, please refer to this application. Figure 1 The example shown.
[0081] Please see Figure 2 , Figure 2 This is a schematic diagram of a data destruction device provided in an embodiment of this application. Figure 2 As shown, the device includes:
[0082] The detection module 201 is used to determine the instruction category of the destruction trigger instruction when a destruction trigger instruction is detected, and to verify the validity of the destruction trigger instruction based on the instruction category;
[0083] Selection module 202 is used to execute the destruction process for a valid destruction trigger command;
[0084] The clearing module 203 is used to clear the system storage resources built on the hard disk during the destruction process, and to clear the hard disk data after all the system storage resources have been cleared. The clearing operation of the hard disk data is completed based on the dd command.
[0085] In one possible implementation, the detection module 201 includes:
[0086] The detection unit is used to determine the instruction category corresponding to the destruction trigger instruction based on the object that generated the destruction trigger instruction when a destruction trigger instruction is detected. The instruction category includes remote operation instructions and key instructions.
[0087] In one possible implementation, the detection module 201 further includes:
[0088] The first verification unit is used to call a RESTful interface to verify the status of the destruction trigger instruction in response to the remote operation instruction.
[0089] The second verification unit is used to perform status confirmation verification of the destruction trigger command based on the debounce circuit and the judgment circuit for the key command.
[0090] In one possible implementation, the first verification unit is used to:
[0091] Call the RESTful interface to determine the user information input for the generated object;
[0092] When the user information matches the preset user information, the destruction trigger command is verified as valid;
[0093] When the user information does not match the preset user information, the destruction trigger instruction is verified as invalid.
[0094] In one possible implementation, the second verification unit is used for:
[0095] After eliminating signal jitter in the electrical signal corresponding to the destruction trigger command based on the debouncing circuit, the duration of the electrical signal is determined based on the judgment circuit.
[0096] When the duration exceeds the preset duration, the destruction trigger command is verified as valid;
[0097] When the duration is not greater than the preset duration, the destruction trigger instruction is verified as invalid.
[0098] In one possible implementation, the selection module 202 includes:
[0099] The first judgment unit is used to directly call the data destruction interface to execute the destruction process for a valid remote operation command;
[0100] The second judgment unit is used to select and change the status of the destruction flag in the flag database based on the status management service process of the SAS extender for a valid key command, and to call the data destruction interface to execute the destruction process when the system daemon polls and finds that the flag status is in the execution state.
[0101] In one possible implementation, the clearing module 203 includes:
[0102] The acquisition unit is used to acquire data destruction selection information corresponding to the hard disk data after all the system storage resources have been cleared;
[0103] The first clearing unit is used to determine the metadata of the system storage resource on the hard disk based on the data type corresponding to the system storage resource when the data destruction selection information indicates that only metadata is to be cleared, and to clear the metadata based on the dd command.
[0104] The second clearing unit is used to clear hard disk data of type SSD based on the blkdiscard command and clear hard disk data of type HDD based on the dd command when the data destruction selection information indicates full disk clearing.
[0105] Those skilled in the art will clearly understand that the technical solutions of the embodiments of this application can be implemented by means of software and / or hardware. In this specification, "unit" and "module" refer to software and / or hardware that can independently complete or cooperate with other components to complete a specific function, wherein the hardware may be, for example, a field-programmable gate array (FPGA), an integrated circuit (IC), etc.
[0106] Each processing unit and / or module in the embodiments of this application can be implemented by an analog circuit that implements the functions described in the embodiments of this application, or by software that executes the functions described in the embodiments of this application.
[0107] See Figure 3 It shows a schematic diagram of the structure of an electronic device according to an embodiment of this application, which can be used to implement... Figure 1 The method in the illustrated embodiment. (As shown) Figure 3As shown, the electronic device 300 may include: at least one central processing unit 301, at least one network interface 304, user interface 303, memory 305, and at least one communication bus 302.
[0108] The communication bus 302 is used to enable communication between these components.
[0109] The user interface 303 may include a display screen and a camera. Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0110] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0111] The central processing unit 301 may include one or more processing cores. The central processing unit 301 connects to various parts within the electronic device 300 using various interfaces and lines. It executes various functions of the terminal 300 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 305, and by calling data stored in the memory 305. Optionally, the central processing unit 301 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The central processing unit 301 may integrate one or more of the following: a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip without being integrated into the central processing unit 301.
[0112] The memory 305 may include random access memory (RAM) or read-only memory. Optionally, the memory 305 may include a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 305 may also be at least one storage device located remotely from the aforementioned central processing unit 301. Figure 3 As shown, the memory 305, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and program instructions.
[0113] exist Figure 3 In the illustrated electronic device 300, the user interface 303 is mainly used to provide an input interface for the user and to acquire user input data; while the central processing unit 301 can be used to call the stored data in the memory 305 to destroy the application program, and specifically perform the following operations:
[0114] When a destruction trigger command is detected, the command category of the destruction trigger command is determined, and the validity of the destruction trigger command is verified according to the command category;
[0115] For a valid destruction trigger command, execute the destruction process;
[0116] In the destruction process, system storage resources built on the hard disk are cleared, and after all system storage resources are cleared, the hard disk data is cleared. The hard disk data clearing operation is completed based on the dd command.
[0117] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method. The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, DVDs, CD-ROMs, microdrives, as well as magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.
[0118] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0119] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0120] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0121] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0122] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0123] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0124] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0125] The foregoing description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Those skilled in the art will readily conceive of embodiments of this disclosure upon considering the specification and practicing the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described herein. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.
Claims
1. A method for destroying stored data, characterized in that, The method includes: When a destruction trigger command is detected, the command category of the destruction trigger command is determined, and the validity of the destruction trigger command is verified according to the command category; For a valid destruction trigger command, execute the destruction process; In the destruction process, system storage resources built on the hard disk are cleared, and after all system storage resources are cleared, the hard disk data is cleared. The hard disk data clearing operation is completed based on the dd command. The instruction category for determining the destruction trigger instruction includes: When a destruction trigger command is detected, the command category corresponding to the destruction trigger command is determined according to the object that generated the destruction trigger command. The command category includes remote operation commands and key commands. The step of verifying the validity of the destruction trigger instruction according to the instruction category includes: For the remote operation command, the RESTful interface is called to verify the status of the destruction trigger command. For the key press command, the state confirmation and verification of the destroy trigger command is performed based on the debounce circuit and the judgment circuit. For a valid destruction trigger command, the destruction process is executed, including: For valid remote operation commands, the data destruction interface is directly invoked to execute the destruction process; For a valid key press command, the SAS extender-based state management service process selects and changes the status of the destruction flag in the flag database, and when the system daemon polls and finds that the flag status is in the execution state, it calls the data destruction interface to execute the destruction process. After all system storage resources are cleared, the hard disk data is cleared. The hard disk data clearing operation is performed based on the dd command, including: After all system storage resources have been cleared, obtain the data destruction selection information corresponding to the hard disk data; When the data destruction selection information indicates that only metadata is to be cleared, the metadata of the system storage resource in the hard disk is determined based on the data type corresponding to the system storage resource, and the metadata is cleared based on the dd command. When the data destruction selection information indicates a full disk wipe, the data on the SSD is wiped using the blkdiscard command, and the data on the HDD is wiped using the dd command.
2. The method according to claim 1, characterized in that, The step of calling the RESTful interface to verify the status of the destruction trigger command includes: Call the RESTful interface to determine the user information input for the generated object; When the user information matches the preset user information, the destruction trigger command is verified as valid; When the user information does not match the preset user information, the destruction trigger instruction is verified as invalid.
3. The method according to claim 1, characterized in that, The status verification of the destruction trigger command based on the debouncing circuit and the judgment circuit includes: After eliminating signal jitter in the electrical signal corresponding to the destruction trigger command based on the debouncing circuit, the duration of the electrical signal is determined based on the judgment circuit. When the duration exceeds the preset duration, the destruction trigger command is verified as valid; When the duration is not greater than the preset duration, the destruction trigger instruction is verified as invalid.
4. A data destruction device, characterized in that, The device includes: The detection module is used to determine the instruction category of the destruction trigger instruction when a destruction trigger instruction is detected, and to verify the validity of the destruction trigger instruction based on the instruction category. The selection module is used to execute the destruction process for valid destruction trigger commands; The clearing module is used to clear the system storage resources built on the hard disk during the destruction process, and to clear the hard disk data after all the system storage resources have been cleared. The hard disk data clearing operation is completed based on the dd command. The detection module also includes: The detection unit is used to determine the instruction category corresponding to the destruction trigger instruction based on the object that generated the destruction trigger instruction when a destruction trigger instruction is detected. The instruction category includes remote operation instructions and key instructions. The detection module also includes: The first verification unit is used to call a RESTful interface to verify the status of the destruction trigger instruction in response to the remote operation instruction. The second verification unit is used to perform status confirmation verification of the destruction trigger instruction based on the debounce circuit and the judgment circuit for the key instruction. The selection module further includes: The first judgment unit is used to directly call the data destruction interface to execute the destruction process for a valid remote operation command; The second judgment unit is used to select and change the status of the destruction flag in the flag database based on the status management service process of the SAS extender for a valid key command, and call the data destruction interface to execute the destruction process when the system daemon polls and finds that the flag status is in the execution state. The clearing module further includes: The acquisition unit is used to acquire data destruction selection information corresponding to the hard disk data after all the system storage resources have been cleared; The first clearing unit is used to determine the metadata of the system storage resource on the hard disk based on the data type corresponding to the system storage resource when the data destruction selection information indicates that only metadata is to be cleared, and to clear the metadata based on the dd command. The second clearing unit is used to clear hard disk data of type SSD based on the blkdiscard command and clear hard disk data of type HDD based on the dd command when the data destruction selection information indicates full disk clearing.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1-3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-3.