Method for controlling state of hard disk and electronic device
By dynamically linking user status and hard drive status, the security problem caused by the reliance on manual operation for self-encrypted hard drives is solved, achieving automatic locking and convenient unlocking, thus improving hard drive security.
Patent Information
- Application Number
- CN202511449944.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-10-11
AI Technical Summary
The locking and unlocking of self-encrypted hard drives relies on manual operation by the user, which means that unauthorized users may access encrypted data through system vulnerabilities or unauthorized access paths, posing a risk of data leakage and resulting in low hard drive security.
By responding to user unlocking operations, the system identifies the user and hard drive, updates the management list, and monitors the user's status in real time. When the user is online, it sends an online message to maintain the unlocked status, and cancels the message to lock the hard drive when the user is offline, thus dynamically linking the user's status with the hard drive's status.
It enables automatic hard drive locking when the user is offline, ensuring data security, while preventing repeated unlocking when the user is online, improving ease of use and enhancing hard drive security.
Smart Images

Figure CN120930191B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and more particularly to a method and electronic device for controlling the status of a hard disk. Background Technology
[0002] With increasingly stringent data security requirements, self-encrypting hard drives are becoming more widely used. In related technologies, locking and unlocking self-encrypting hard drives relies on manual user operation or physical power disconnection. After authentication, the user must manually send an unlock command to activate read and write permissions for the self-encrypting hard drive. After completing the operation, the user must manually send a lock command or physically power off the self-encrypting hard drive to lock it. If the user does not actively perform a locking operation, the self-encrypting hard drive will remain unlocked.
[0003] During the above process, unauthorized users may access encrypted data through system vulnerabilities or unauthorized access paths, posing a risk of data leakage and resulting in low hard drive security. Summary of the Invention
[0004] This application provides a method and electronic device for controlling the status of a hard disk, in order to at least solve the problem of low security of hard disks in related technologies.
[0005] This application provides a method for controlling the status of a hard disk, including:
[0006] In response to the user's unlocking operation on the hard drive, determine the user's corresponding user ID, hard drive ID, and hard drive management process;
[0007] Update the management list in the hard disk management process based on the user ID and hard disk ID. The management list includes at least one user ID and the hard disk ID corresponding to the user ID.
[0008] For any user identifier in the management list, the user status corresponding to the user identifier is detected and processed in real time to obtain the current status of the user identifier.
[0009] When the current status is online, an online message is sent to the hard drive corresponding to the hard drive identifier based on the user identifier, so that the hard drive status is updated to the unlocked status;
[0010] If the current status is offline, cancel sending online messages so that the hard drive status is updated to locked.
[0011] This application also provides a device for controlling the status of a hard disk, including:
[0012] The determination module is used to respond to the user's unlocking operation on the hard drive by determining the user's corresponding user ID, hard drive ID, and hard drive management process;
[0013] The update module is used to update the management list in the hard disk management process based on the user identifier and the hard disk identifier. The management list includes at least one user identifier and the hard disk identifier corresponding to the user identifier.
[0014] The detection module is used to detect and process the user status corresponding to any user identifier in the management list in real time, and obtain the current status of the user identifier.
[0015] The detection module is also used to send an online message to the hard drive corresponding to the hard drive identifier based on the hard drive identifier corresponding to the user identifier when the current status is online, so as to update the hard drive status to the unlocked status.
[0016] The detection module is also used to cancel sending online messages when the current state is offline, so that the hard drive status is updated to locked.
[0017] This application provides a method for controlling the status of a hard disk, including:
[0018] In response to the unlock message sent by the hard disk management process, the unlock message is parsed and processed to obtain the user identifier, and the hard disk status is updated to the unlocked status;
[0019] Create a counter corresponding to the user identifier and perform real-time detection and processing of online messages corresponding to the user identifier;
[0020] If an online message corresponding to the user identifier is obtained within the preset period, the counter is cleared according to the online message, and the hard drive is kept in the unlocked state.
[0021] If no online message corresponding to the user identifier is detected within the preset period, the statistical value in the counter is incremented once until the statistical value reaches the preset threshold, and then the hard disk status is updated to locked.
[0022] This application also provides a device for controlling the status of a hard disk, including:
[0023] The update module is used to respond to the unlock message sent by the hard disk management process, parse and process the unlock message, obtain the user identifier, and update the hard disk status to the unlocked status.
[0024] The module is used to create counters corresponding to user identifiers and to perform real-time detection and processing of online messages corresponding to user identifiers.
[0025] The control module is used to clear the counter and keep the hard disk in the unlocked state if an online message corresponding to the user identifier is obtained within a preset period.
[0026] The control module is used to perform an accumulation process on the statistical value in the counter if no online message corresponding to the user identifier is detected within a preset period, until the statistical value reaches a preset threshold, and then update the hard disk status to a locked state.
[0027] This application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the control method for any of the above-described hard disk states.
[0028] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described methods for controlling the state of a hard disk.
[0029] This application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any of the above-described methods for controlling the state of a hard disk.
[0030] This application responds to user unlocking operations on the hard drive, identifies and associates the user identifier and hard drive identifier in the management list of the hard drive management process, and monitors the current status of each user identifier in the list in real time. When the user is online, an online message is sent to the corresponding hard drive to maintain its unlocked state; when the user is offline, the online message is canceled to lock the hard drive. This dynamic linkage between user and hard drive status ensures automatic hard drive locking when the user is offline to guarantee data security, while avoiding repeated unlocking when the user is online, improving ease of use. It effectively solves the security vulnerabilities and operational inconveniences of traditional static authorization or fixed timeout management, thus improving hard drive security. Attached Figure Description
[0031] To more clearly illustrate 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.
[0032] Figure 1 A schematic diagram of a hard disk status control system provided in an embodiment of this application;
[0033] Figure 2 A flowchart illustrating a method for controlling hard disk status provided in an embodiment of this application;
[0034] Figure 3 A flowchart illustrating another method for controlling hard disk status provided in an embodiment of this application;
[0035] Figure 4A flowchart illustrating another method for controlling hard disk status provided in an embodiment of this application;
[0036] Figure 5 A flowchart illustrating another method for controlling the state of a hard disk provided in an embodiment of this application;
[0037] Figure 6 This is a schematic diagram of a hard disk status control device provided in an embodiment of this application;
[0038] Figure 7 A schematic diagram of another hard disk status control device provided in an embodiment of this application;
[0039] Figure 8 A schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation
[0040] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0041] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0042] With increasingly stringent data security requirements, self-encrypting hard drives are becoming more widely used. In related technologies, locking and unlocking self-encrypting hard drives relies on manual user operation or physical power disconnection. After authentication, the user must manually send an unlock command to activate read and write permissions for the self-encrypting hard drive. After completing the operation, the user must manually send a lock command or physically power off the self-encrypting hard drive to lock it. If the user does not actively perform a locking operation, the self-encrypting hard drive will remain unlocked.
[0043] During the above process, unauthorized users may access encrypted data through system vulnerabilities or unauthorized access paths, posing a risk of data leakage and resulting in low hard drive security.
[0044] To address the aforementioned technical problems, this application provides a method for controlling hard drive status. In response to a user's unlocking operation on the hard drive, the method determines and associates the user identifier and hard drive identifier in a management list of the hard drive management process. By real-time monitoring of the current status of each user identifier in the list, an online message is sent to the corresponding hard drive when the user is online to maintain its unlocked state; when the user is offline, the online message is canceled to lock the hard drive. This dynamic linkage between user status and hard drive status ensures automatic hard drive locking when the user is offline to guarantee data security, while avoiding repeated unlocking when the user is online, improving ease of use. This effectively solves the security vulnerabilities and operational inconveniences of traditional static authorization or fixed timeout management, thus improving hard drive security.
[0045] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0046] Below, we will provide examples of specific application environment architectures or specific hardware architectures that the execution of hard disk status control methods depends on.
[0047] Figure 1 This is a schematic diagram of a hard disk status control system provided in an embodiment of this application. Please refer to... Figure 1 , Figure 1 This can include a hard drive status control system. The hard drive status control system can include a hard drive manager and multiple hard drives.
[0048] The disk manager can serve as the system control center. It can respond to user unlocking operations on hard drives, establish and maintain an association list of user and hard drive identifiers, monitor the online / offline status of users in the list in real time, and send online messages to the corresponding hard drive based on the user's status to keep the hard drive unlocked or stop sending online messages to trigger the hard drive's lock. This enables dynamic linkage and control between user status and hard drive security status, and coordinates the execution of security policies across multiple hard drives.
[0049] The hard drive can be a self-encrypting hard drive with independent security control capabilities.
[0050] The hard drive can store its own unique hard drive identifier and supports bidirectional communication with the hard drive manager through preset protocols, such as the Trusted Computing Group Opal Storage Specification (TCG OPAL) protocol and custom security protocols. It can receive online messages sent by the manager and provide feedback on the reception status.
[0051] When an online message is continuously received from the manager, the hard drive is kept or updated to be in an unlocked state, allowing authorized users to access the data; when no online message is received within a timeout period, the local locking mechanism is automatically triggered, switching to a locked state, denying any unauthorized access, and ensuring data security.
[0052] Figure 2 This is a flowchart illustrating a method for controlling hard disk status according to an embodiment of this application. The execution entity in this embodiment can be a hard disk manager. Please refer to... Figure 2 The method includes:
[0053] S201. In response to the user's unlocking operation on the hard drive, determine the user's corresponding user ID, hard drive ID, and hard drive management process.
[0054] Unlocking can be a verification action performed by a user to obtain access to the hard drive.
[0055] Unlocking operations may include entering a password, verifying biometric information such as fingerprints / faces, or inserting a key device, etc., and are not limited here.
[0056] User identifiers can be used to uniquely identify a user.
[0057] User identifiers can be system accounts, device-bound unique identifiers, etc., and are not limited here.
[0058] Hard drive identifiers are information used to uniquely identify hard drives.
[0059] The hard drive identifier can be the hard drive's physical number, logical address, etc., and is not limited here.
[0060] The hard disk management process can be a background service or program running in the system.
[0061] The hard disk management process can be used to execute the security control logic of the hard disk.
[0062] In response to a user's unlocking operation on the hard drive, the system can call the user session interface to obtain the user's user identifier, read the hard drive's hard drive identifier, and determine the corresponding hard drive management process among multiple background service processes.
[0063] Optionally, in response to a user's unlocking operation on the hard drive, the user's corresponding user ID, hard drive ID, and hard drive management process can be determined as follows: A user interface is displayed, which includes multiple hard drive access components; in response to the user's selection of a target hard drive access component, the unlocking component corresponding to the target hard drive access component is displayed; in response to the user's input of an unlocking component, the user's input verification code is obtained, and the verification code is verified to obtain a verification result; if the verification result is successful, the user's corresponding user ID and the hard drive ID of the target hard drive access component are determined; it is determined whether a hard drive management process exists; if so, the hard drive management process is obtained; otherwise, a hard drive management process is created.
[0064] The user interface can be a visual interactive interface provided by the system to the user, which serves as the entry point for displaying hard drive-related operations.
[0065] A hard drive access component can be an interactive component in the user interface corresponding to a single hard drive. Each component is associated with a specific hard drive, and when a user selects a component, it means that they want to operate on the associated hard drive.
[0066] The target hard drive access component can be a specific interactive component selected by the user from multiple hard drive access components, corresponding to the hard drive that needs to be unlocked.
[0067] The unlocking component can be the authentication interaction component corresponding to the target hard drive access component, used to collect user verification information to ensure that only authorized users can unlock the hard drive.
[0068] The verification code can be information entered by the user to authenticate their identity by unlocking the component.
[0069] The system checks if a disk management process already exists in the background. If the disk management process is already running, it directly acquires that disk management process. If the disk management process is not running, it immediately creates a new disk management process.
[0070] Optionally, in response to a user's unlocking operation on the hard drive, after determining the user's corresponding user identifier, hard drive identifier, and hard drive management process, the method further includes sending an unlock message, which can be sent in the following manner: generating an unlock message based on the user identifier; and sending the unlock message to the hard drive corresponding to the hard drive identifier through the hard drive management process.
[0071] The unlock message can be a standardized data command generated based on a preset communication protocol.
[0072] The unlock message can be used to indicate that the user has successfully unlocked the hard drive.
[0073] S202. Update the management list in the hard disk management process based on the user ID and hard disk ID.
[0074] The management list includes at least one user ID and the hard drive ID corresponding to the user ID.
[0075] The management list can be a dynamic data table maintained by the disk management process.
[0076] Update messages can be generated based on user identifiers and hard disk identifiers, and sent to hardware management via message queues. The hard disk management process can then update its management list based on these update messages.
[0077] S203. For any user identifier in the management list, perform real-time detection and processing on the user status corresponding to the user identifier to obtain the current status corresponding to the user identifier.
[0078] Real-time monitoring can be used to detect the user's status.
[0079] The current status can include online status and offline status.
[0080] The online status indicates that the user is currently logged in online.
[0081] The offline status indicates that the user is offline.
[0082] The hard disk management process can traverse each user ID in the management list and determine the current status of the user ID in real time by interacting with the operating system session management interface, monitoring the activity status of user terminal input devices, or detecting the link status of remote connections, in the form of periodic polling.
[0083] Optionally, the user status corresponding to the user identifier can be detected and processed in real time to obtain the current status corresponding to the user identifier by: obtaining a preset interval duration; sending a preset instruction to the session management service within the preset interval duration; receiving the response information corresponding to the preset instruction; and parsing the response information to obtain the current status corresponding to the user identifier.
[0084] Among them, the preset command is used to obtain the session state corresponding to the user identifier.
[0085] The response information may include the session state corresponding to the user identifier.
[0086] S204. When the current status is online, send an online message to the hard drive corresponding to the hard drive identifier based on the user identifier, so that the hard drive status is updated to unlocked.
[0087] Online messages can be standardized data commands generated based on a preset protocol.
[0088] Online messages can include information such as user online status, user ID, and hard drive ID.
[0089] Online messages can be used to signal to the hard drive that the authorized user is still online, triggering the hard drive to remain unlocked.
[0090] When the current status is online, the hard drive management process can first find the hard drive identifier associated with the user identifier through the management list, generate an online message containing the user identifier, hard drive identifier and online status flag according to the preset communication protocol, and send the message to the hard drive corresponding to the hard drive identifier through a secure communication link. After receiving the online message, the hard drive recognizes that the authorized user is still online, thereby maintaining its own hard drive status as unlocked.
[0091] S205. When the current state is offline, cancel sending online messages so that the hard disk state is updated to locked state.
[0092] Offline status can indicate a state where the user is unable to maintain effective interaction with the system and has lost access permissions.
[0093] When the current state is offline, the hard disk management process can stop sending online messages to the hard disk corresponding to the hard disk ID associated with the user ID, thereby triggering the hard disk's local security mechanism. Since the hard disk does not continuously receive online messages, it can be determined that the authorized user has lost access rights and automatically update its own hard disk status from unlocked to locked.
[0094] In this way, security risks are automatically blocked as soon as the user goes offline.
[0095] Optionally, when the current status is offline, delete the user identifier and the hard disk identifier corresponding to the user identifier from the management list.
[0096] This embodiment provides a method for controlling hard drive status. In response to a user's unlocking operation on the hard drive, it determines the user's identifier, the hard drive identifier, and the hard drive management process. Based on the user and hard drive identifiers, it updates the management list in the hard drive management process. The management list includes at least one user identifier and its corresponding hard drive identifier. For any user identifier in the management list, it performs real-time detection of the user's status to obtain the current status. When the current status is online, it sends an online message to the hard drive corresponding to the user's identifier, updating the hard drive's status to unlocked. When the current status is offline, it cancels sending the online message, updating the hard drive's status to locked. This dynamic linkage between user and hard drive status ensures automatic hard drive locking when the user is offline to guarantee data security, while avoiding repeated unlocking when the user is online, improving ease of use. It effectively solves the security vulnerabilities and operational inconveniences of traditional static authorization or fixed timeout management, thus improving hard drive security.
[0097] Below, in conjunction with Figure 3 This section explains the specific process of sending an online message to the hard drive corresponding to the user identifier when the current status is online.
[0098] Figure 3 This is a flowchart illustrating another method for controlling hard disk status provided in an embodiment of this application. Based on the above embodiments, see [link to relevant documentation]. Figure 3 The method includes:
[0099] S301. When the current status is online, generate online information.
[0100] Online information can be a structured data set with multiple key fields, such as user identifier, corresponding hard drive identifier, timestamp, and checksum.
[0101] When the current status is online, initial information can be generated according to preset rules, and the field format and completeness of the initial information can be verified. After the verification is passed, the initial information is determined to be online information.
[0102] S302. Establish a communication link between the hard drives corresponding to the hard drive identifiers.
[0103] The communication link is based on a preset communication protocol.
[0104] A communication link can be established between hard drives corresponding to hard drive identifiers according to a predefined communication protocol.
[0105] S303. Generate online messages according to the preset communication protocol and online information.
[0106] Online information is structured and encapsulated using a preset communication protocol to generate online messages.
[0107] Optionally, an online message can be generated according to a preset communication protocol and online information in the following manner: a preset message is generated according to the preset communication protocol; information extraction processing is performed on the online information to obtain multiple information items, including user identifier, current status flag and timestamp; the multiple information items are filled into multiple fields of the preset message according to the preset communication protocol to generate an online message.
[0108] For example, fill in the user identifier "user123" in the user identifier field, fill in the current status flag "0x01" in the status field ("0x01" can indicate that the user is online), and fill in the timestamp "20250923153000" in the timestamp field.
[0109] S304. Send an online message to the hard drive corresponding to the hard drive identifier via the communication link.
[0110] The hard drive address corresponding to the hard drive identifier can be determined, and an online message can be sent to the hard drive corresponding to the hard drive identifier through the communication link based on the hard drive address.
[0111] The implementation details of each step in this application embodiment can be found in the description of the corresponding steps or operations in the above method embodiments; repeated content will not be repeated.
[0112] This embodiment provides a method for controlling the status of a hard drive. When the current status is online, online information is generated; a communication link is established between the hard drive and the hard drive corresponding to the hard drive identifier, based on a preset communication protocol; an online message is generated according to the preset communication protocol and the online information; and the online message is sent to the hard drive corresponding to the hard drive identifier through the communication link. In this way, by generating online information, establishing a protocol-based communication link, and generating and sending standardized online messages, accurate and secure authorization transmission and reliable device compatibility are achieved, while maintaining the hard drive's unlocked state when the user is online to avoid repeated operations. This balances data security and ease of use, improving hard drive security.
[0113] Below, in conjunction with Figure 4 This section explains the specific process of controlling the hard drive status on the hard drive side.
[0114] Figure 4 This is a flowchart illustrating another method for controlling the state of a hard disk provided in an embodiment of this application. The executing entity in this embodiment can be a hard disk. Based on the above embodiments, see [link to relevant documentation]. Figure 4 The method includes:
[0115] S401. In response to the unlock message sent by the hard disk management process, the unlock message is parsed and processed to obtain the user identifier, and the hard disk status is updated to the unlocked state.
[0116] Parsing and processing can be the operation of the hard disk to disassemble, verify and extract information from the received unlock message according to a preset communication protocol.
[0117] The hard drive status refers to the hard drive status of the hard drive operation area corresponding to the user identifier.
[0118] When the hard drive receives the unlock message sent by the hard drive management process, it can start the local message processing module to parse and process the unlock message according to the preset communication protocol, extract the user identifier in the message, and after confirming that the message is valid, the hard drive status management module can update its own security access status from the locked state to the unlocked state, remove the hardware-level encryption restriction, and allow users to read and write data on the hard drive.
[0119] S402. Create a counter corresponding to the user identifier and perform real-time detection and processing of online messages corresponding to the user identifier.
[0120] A counter can be used to record the time interval since the last received online message.
[0121] Real-time monitoring and processing can involve checking in real time whether an online message corresponding to the current user identifier has been received.
[0122] A counter corresponding to a user identifier can be created, and an initial value can be set for the counter's statistical value. The hard disk starts a real-time detection mechanism to perform real-time detection and processing of online messages corresponding to the user identifier.
[0123] S403. If an online message corresponding to the user identifier is obtained within a preset period, the counter is cleared according to the online message, and the hard disk is kept in the unlocked state.
[0124] The unlocked state can be a secure state in which the hard drive allows authorized users to access the data.
[0125] The reset operation can be an operation that resets the statistical value of the counter corresponding to the user identifier to the initial value.
[0126] If an online message corresponding to the user identifier is obtained within the preset period, the online message can be parsed, and the counter can be cleared according to the parsing result, while keeping the hard drive in the unlocked state.
[0127] S404. If no online message corresponding to the user identifier is detected within the preset period, the statistical value in the counter is incremented once until the statistical value reaches the preset threshold, and the hard disk status is updated to locked.
[0128] The preset threshold can be a pre-set value or can be pre-configured by the user through hard drive management commands; there is no limitation here.
[0129] Accumulation processing can be used to accumulate the statistical value of the counter.
[0130] For example, performing an accumulation process increases the statistical value from 1 to 2.
[0131] If no online message corresponding to the user identifier is detected within the preset period, the statistical value in the counter can be incremented once to determine whether the processed statistical value has reached the preset threshold. When the statistical value reaches the preset threshold, the hard disk status is updated to locked.
[0132] Optionally, after updating the hard drive status to a locked state, the method also includes deleting the counter corresponding to the user identifier.
[0133] The counter only exists when the hard drive is unlocked.
[0134] The implementation details of each step in this application embodiment can be found in the description of the corresponding steps or operations in the above method embodiments; repeated content will not be repeated.
[0135] This embodiment provides a hard drive status control method. In response to an unlock message sent by the hard drive management process, the method parses and processes the unlock message to obtain a user identifier, updates the hard drive status to unlock, creates a counter corresponding to the user identifier, and performs real-time detection and processing of online messages corresponding to the user identifier. If an online message corresponding to the user identifier is detected within a preset period, the counter is reset to zero, and the hard drive status remains unlocked. If no online message corresponding to the user identifier is detected within the preset period, the statistical value in the counter is incremented until the statistical value reaches a preset threshold, at which point the hard drive status is updated to locked. In this way, by parsing unlock commands on the hard drive side, dynamically monitoring online messages, and managing the status in a tiered manner based on a counter, dynamic security protection under precise authorization is achieved. This avoids the risk of authorization failure and misjudgment, balances data security and ease of use in multi-user scenarios, and improves hard drive security.
[0136] Below, in conjunction with Figure 5 The specific process of resetting the counter based on the online message is explained.
[0137] Figure 5 This is a flowchart illustrating another method for controlling hard disk status provided in an embodiment of this application. Based on the above embodiments, see [link to relevant documentation]. Figure 5 The method includes:
[0138] S501. Parse and process the online message to obtain the current status flag and timestamp.
[0139] The message can be parsed and processed according to the preset communication protocol to obtain the current status flag and timestamp.
[0140] S502. Based on the current time and the preset valid duration, obtain the valid time period.
[0141] The effective period can be a time standard for determining whether an online message still has authorization validity.
[0142] It can obtain the preset valid duration and the current real-time time of the system, and calculate the valid time period based on the current time and the preset valid duration.
[0143] S503. Determine whether the timestamp is within the valid time period.
[0144] If so, then execute S504;
[0145] If not, then execute S505.
[0146] If the message is within the valid time period, it indicates that the message is a valid authorization signal; if it is outside the valid time period, it indicates that the message has expired and is not valid for authorization.
[0147] S504. Clear the counter according to the current status flag.
[0148] If the timestamp is within a valid time period, the online message is determined to be a valid message, and the statistical value in the counter is reset to the initial value according to the current status flag in the online message.
[0149] S505. Accumulate the statistical value in the counter. When the statistical value reaches the preset threshold, update the hard disk status to locked.
[0150] The system can add a preset value to the initial statistical value to obtain the current statistical value; determine whether the current statistical value is equal to the preset threshold; if yes, update the hard drive status to locked; if no, keep the hard drive status unlocked, set the current statistical value to the initial statistical value, and perform real-time detection and processing of online messages corresponding to the user identifier in the next preset period.
[0151] The implementation details of each step in this application embodiment can be found in the description of the corresponding steps or operations in the above method embodiments; repeated content will not be repeated.
[0152] This embodiment provides a method for controlling the status of a hard disk. It parses online messages to obtain a current status marker and a timestamp; determines a valid time period based on the current time and a preset valid duration; checks if the timestamp is within the valid time period; if so, it resets a counter based on the current status marker; otherwise, it increments the counter's statistical value, updating the hard disk status to a locked state when the statistical value reaches a preset threshold. By performing timeliness checks on online messages and processing them according to different scenarios based on the check results, it can both prevent the security risk of reusing expired messages and avoid misjudgments and misoperations, balancing hard disk data security with the convenience of legitimate users, thus improving hard disk security.
[0153] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0154] Figure 6 This is a schematic diagram of a hard disk status control device provided in an embodiment of this application. Please refer to... Figure 6 The hard disk status control device 600 includes a determination module 601, an update module 602, and a detection module 603.
[0155] The determination module 601 is used to determine the user's corresponding user identifier, hard disk identifier, and hard disk management process in response to the user's unlocking operation on the hard disk;
[0156] The update module 602 is used to update the management list in the hard disk management process according to the user identifier and the hard disk identifier. The management list includes at least one user identifier and the hard disk identifier corresponding to the user identifier.
[0157] The detection module 603 is used to perform real-time detection and processing of the user status corresponding to any user identifier in the management list, and to obtain the current status corresponding to the user identifier.
[0158] The detection module 603 is also used to send an online message to the hard drive corresponding to the hard drive identifier based on the hard drive identifier corresponding to the user identifier when the current status is online, so as to update the hard drive status to the unlocked status.
[0159] The detection module 603 is also used to cancel sending online messages when the current state is offline, so that the hard disk status is updated to locked state.
[0160] In one possible implementation, the detection module 603 is specifically used for:
[0161] When the current status is online, generate online information;
[0162] Establish a communication link between the hard drives corresponding to the hard drive identifiers. The communication link is based on a preset communication protocol.
[0163] Generate online messages based on preset communication protocols and online information;
[0164] Send online messages to the hard drive corresponding to the hard drive identifier via the communication link.
[0165] In one possible implementation, the detection module 603 is specifically used for:
[0166] Generate a preset message according to the preset communication protocol;
[0167] The online information is extracted and processed to obtain multiple information items, including user identifier, current status marker and timestamp;
[0168] Multiple information items are filled into multiple fields of a preset message according to a preset communication protocol to generate an online message.
[0169] In one possible implementation, the determining module 601 is specifically used for:
[0170] Displays the user interface, which includes multiple hard drive access components;
[0171] In response to the user's selection of the target hard drive access component, the corresponding unlock component is displayed;
[0172] In response to the user's input operation on the unlock component, obtain the verification code entered by the user, perform verification processing on the verification code, and obtain the verification result;
[0173] If the verification result is successful, determine the user identifier corresponding to the user and the hard disk identifier of the target hard disk access component;
[0174] Determine if a disk management process exists. If yes, retrieve the disk management process; otherwise, create the disk management process.
[0175] In one possible implementation, the detection module 603 is specifically used for:
[0176] Get the preset interval duration;
[0177] Within a preset interval, a preset instruction is sent to the session management service. The preset instruction is used to obtain the session status corresponding to the user identifier.
[0178] Receive response information corresponding to preset commands;
[0179] The response information is parsed and processed to obtain the current state corresponding to the user identifier.
[0180] In one possible implementation, the device further includes a transmitting module 604, which is configured to:
[0181] Generate an unlock message based on the user identifier;
[0182] The disk management process sends an unlock message to the disk corresponding to the disk identifier.
[0183] Figure 7 This is a schematic diagram of another hard disk status control device provided in an embodiment of this application. Please refer to... Figure 7 The hard disk status control device 700 includes an update module 701, a creation module 702, and a control module 703.
[0184] The update module 701 is used to respond to the unlock message sent by the hard disk management process, parse and process the unlock message to obtain the user identifier, and update the hard disk status to the unlocked status.
[0185] Module 702 is used to create a counter corresponding to the user identifier and to perform real-time detection and processing of online messages corresponding to the user identifier.
[0186] The control module 703 is used to clear the counter according to the online message corresponding to the user identifier if an online message is obtained within a preset period, and keep the hard disk in the unlocked state.
[0187] The control module 703 is used to perform an accumulation process on the statistical value in the counter if no online message corresponding to the user identifier is detected within a preset period, until the statistical value reaches a preset threshold, and then update the hard disk status to a locked state.
[0188] In one possible implementation, the control module 703 is specifically used for:
[0189] The online message is parsed and processed to obtain the current status flag and timestamp;
[0190] The valid time period is obtained based on the current time and the preset valid duration;
[0191] Determine if the timestamp is within a valid time period;
[0192] If so, the counter is cleared according to the current state flag.
[0193] In one possible implementation, the control module 703 is further configured to:
[0194] If the timestamp is not within the valid time period, obtain the initial statistical value of the counter;
[0195] Add a preset value to the initial statistical value to obtain the current statistical value;
[0196] Determine whether the current statistical value is equal to a preset threshold;
[0197] If so, update the hard drive status to locked.
[0198] If not, keep the hard drive in the unlocked state, set the current statistical value to the initial statistical value, and perform real-time detection and processing of online messages corresponding to the user identifier in the next preset period.
[0199] In one possible implementation, the control module 703 is specifically used for:
[0200] If no online message corresponding to the user identifier is detected within the preset period, obtain the initial statistical value of the counter;
[0201] Add a preset value to the initial statistical value to obtain the current statistical value;
[0202] Determine whether the current statistical value is equal to a preset threshold;
[0203] If so, update the hard drive status to locked.
[0204] If not, keep the hard drive in the unlocked state, set the current statistical value to the initial statistical value, and perform real-time detection and processing of online messages corresponding to the user identifier in the next preset period.
[0205] In one possible implementation, the hard disk status is the hard disk status of the hard disk operation area corresponding to the user identifier.
[0206] In one possible implementation, the control module 703 is further configured to:
[0207] Delete the counter corresponding to the user ID.
[0208] Figure 8 A schematic diagram of the structure of the electronic device provided in this application. Figure 8 As shown, the electronic device 80 provided in this embodiment includes at least one processor 801 and a memory 802. Optionally, the electronic device 80 further includes a communication component 803. The processor 801, memory 802, and communication component 803 are connected via a bus.
[0209] In a specific implementation, at least one processor 801 executes computer execution instructions stored in memory 802, causing at least one processor 801 to execute the above-described embodiment of the hard disk state control method.
[0210] The specific implementation process of processor 801 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0211] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0212] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0213] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0214] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the hard disk state control method when running.
[0215] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0216] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described embodiments of the hard disk state control method.
[0217] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described embodiments of the hard disk state control method.
[0218] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0219] The above provides a detailed description of a hard disk status control method provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for controlling the status of a hard disk, characterized in that, include: In response to a user's unlocking operation on the hard drive, the user identifier and hard drive identifier corresponding to the user, as well as the hard drive management process used to execute hard drive security control logic, are determined. Based on the user identifier and the hard disk identifier, update the management list in the hard disk management process. The management list is used to dynamically associate and maintain the correspondence between at least one user identifier and the hard disk identifier corresponding to the user identifier. For any user identifier in the management list, the hard disk management process performs real-time detection and processing on the user status corresponding to the user identifier to obtain the current status corresponding to the user identifier. When the current state is online, an online message is sent to the hard drive corresponding to the hard drive identifier corresponding to the user identifier, so that the hard drive maintains the unlocked state based on the received online message; The online message is a keep-alive message generated based on a preset communication protocol and used to maintain the hard drive's unlocked state; When the current state is offline, the online message is canceled so that the hard drive does not receive the online message, and the hard drive state is updated to locked.
2. The method according to claim 1, characterized in that, When the current state is online, an online message is sent to the hard drive corresponding to the hard drive identifier based on the user identifier, including: When the current state is online, online information is generated; Establish a communication link between the hard drives corresponding to the hard drive identifier, the communication link being based on a preset communication protocol; Generate an online message based on the preset communication protocol and the online information; Online messages are sent to the hard drive corresponding to the hard drive identifier via the communication link.
3. The method according to claim 2, characterized in that, Based on the preset communication protocol and the online information, an online message is generated, including: Generate a preset message according to the preset communication protocol; The online information is processed to extract multiple information items, including user identifier, current status marker and timestamp; The multiple information items are filled into multiple fields of the preset message according to the preset communication protocol to generate an online message.
4. The method according to any one of claims 1-3, characterized in that, In response to a user's unlocking operation on the hard drive, the system determines the user's identifier, the hard drive identifier, and the hard drive management process, including: The user interface is displayed, and the user interface includes multiple hard disk access components. In response to the user's selection of the target hard drive access component, the unlock component corresponding to the target hard drive access component is displayed; In response to the user's input operation on the unlocking component, the system obtains the verification code entered by the user, verifies the verification code, and obtains the verification result. If the verification result is successful, determine the user identifier corresponding to the user and the hard disk identifier of the target hard disk access component; Determine if a disk management process exists; if yes, obtain the disk management process; otherwise, create the disk management process. The method further includes, after determining the user identifier, hard drive identifier, and hard drive management process corresponding to the user in response to the user's unlocking operation on the hard drive, the method also includes: Generate an unlock message based on the user identifier; The unlock message is sent to the hard drive corresponding to the hard drive identifier through the hard drive management process.
5. The method according to any one of claims 1-3, characterized in that, The user status corresponding to the user identifier is detected and processed in real time to obtain the current status corresponding to the user identifier, including: Get the preset interval duration; Within a preset interval, a preset instruction is sent to the session management service, the preset instruction being used to obtain the session state corresponding to the user identifier; Receive the response information corresponding to the preset instruction; The response information is parsed to obtain the current state corresponding to the user identifier.
6. A method for controlling the status of a hard disk, characterized in that, include: In response to the unlock message sent by the hard disk management process, the unlock message is parsed and processed to obtain the user identifier, and the hard disk status is updated to the unlocked status; The hard drive management process is used to execute the hard drive's security control logic; The hard disk management process updates the management list in the hard disk management process based on the update message generated by the user identifier and the hard disk identifier; the management list is used to dynamically associate and maintain the correspondence between at least one user identifier and the hard disk identifier corresponding to the user identifier; A counter corresponding to the user identifier is created, and the hard disk management process performs real-time detection and processing of online messages corresponding to the user identifier. If an online message corresponding to the user identifier is obtained within a preset period, the counter is cleared according to the online message, and the hard drive is kept in an unlocked state; the online message is a keep-alive message generated based on a preset communication protocol to maintain the hard drive in an unlocked state. If no online message corresponding to the user identifier is detected within a preset period, the statistical value in the counter is incremented once until the statistical value reaches a preset threshold, and then the hard disk status is updated to a locked state.
7. The method according to claim 6, characterized in that, According to the online message, the counter is cleared, including: The online message is parsed to obtain the current status flag and timestamp; The valid time period is obtained based on the current time and the preset valid duration; Determine whether the timestamp is within the valid time period; If so, the counter is cleared according to the current state flag.
8. The method according to claim 6, characterized in that, If no online message corresponding to the user identifier is detected within a preset period, the statistical value in the counter is incremented once until the statistical value reaches a preset threshold, and the hard disk status is updated to a locked state, including: If no online message corresponding to the user identifier is detected within the preset period, the initial statistical value of the counter is obtained; The initial statistical value is increased by a preset value to obtain the current statistical value; Determine whether the current statistical value is equal to a preset threshold; If so, update the hard drive status to locked. If not, keep the hard drive in the unlocked state, set the current statistical value to the initial statistical value, and perform real-time detection and processing on the online messages corresponding to the user identifier in the next preset period.
9. The method according to any one of claims 6-8, characterized in that, The hard disk status is the hard disk status of the hard disk operation area corresponding to the user identifier; after updating the hard disk status to a locked state, the method further includes: Delete the counter corresponding to the user identifier.
10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the method for controlling the state of a hard disk as described in any one of claims 1 to 5 or 6 to 9 when executing the computer program.
Citation Information
Patent Citations
Offline automatic service locking method, apparatus and system
CN104348804A
Instant messaging client state updating method and device
CN113905005A
Processing method for analyzing communication state of real network system
CN115987769A