Method, device, computer device and storage medium for automated deployment
By monitoring the physical events of USB devices, verifying their legitimacy, and building a parallel pipeline system for streaming processing, the problems of USB flash drive instability and low efficiency of manual interaction are solved. This achieves efficient and secure automated deployment, improves production efficiency, and ensures data integrity.
Patent Information
- Application Number
- CN202610684240.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-18
- Publication Date
- 2026-08-25
AI Technical Summary
In existing technologies, the physical instability of USB flash drives leads to a high risk of data corruption, manual interaction results in low production efficiency, there is a lack of physical misoperation defense mechanisms, and they do not support secure hot-swapping, posing risks of virus infection and data leakage.
By monitoring the physical mounting events of USB devices to verify their legitimacy, a parallel pipeline system is built to perform streaming processing after entering environment lock mode. The system is automatically restarted after data writing is completed. An encrypted identifier file is used for handshake authentication and hash digest verification, and system key press responses are blocked.
It achieves automated deployment with zero touch and zero accidental touch, increasing production efficiency by more than 300%, ensuring data integrity and security, preventing risks caused by accidental USB drive insertion, and eliminating silent data corruption and equipment damage.
Smart Images

Figure CN122633505A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated production deployment technology, and in particular to a method, apparatus, computer equipment, and storage medium for automated deployment. Background Technology
[0002] The instability of physical media leads to a high risk of data corruption: USB flash drives on the production line undergo thousands of high-frequency insertions and removals, making their USB interfaces highly susceptible to physical loosening, and flash memory chips often develop bad blocks. Traditional solutions use "file system copying" (such as cp or dd commands). Once bad blocks or read errors are encountered, the deployment process often freezes for a long time, or worse, the operating system only reports successful copying while actually writing corrupted data, causing "silent data corruption." The problem only becomes apparent when the end user uses the equipment, severely impacting production yield.
[0003] Reliance on manual interaction leads to low production efficiency: Existing solutions typically require operators to manually click on confirmation pop-ups, select installation packages, and click "start" on the device screen after inserting a USB drive before the deployment process can begin. In actual working conditions where production line workers wear anti-static gloves or have oily fingers, touchscreen operation is extremely unreliable, resulting in a high rate of accidental touches. The operation time for a single device can reach 45 to 60 seconds, significantly reducing the production line cycle time.
[0004] Lack of physical accidental insertion prevention mechanisms: Existing systems struggle to distinguish between personal USB drives mistakenly inserted by employees and dedicated production deployment drives. This "indiscriminate response" mechanism carries the risk of introducing viruses, loading incorrect firmware, or leaking production data. Furthermore, traditional solutions do not support secure hot-swapping: if a USB drive is accidentally removed before data writing is complete, it can easily corrupt the target device's file system, potentially rendering the device unusable and requiring factory repair. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention proposes a method, apparatus, computer equipment, and storage medium for automated deployment, aiming to solve the problem of low production efficiency caused by reliance on manual interaction.
[0006] The technical solution proposed in this invention is: A method for automated deployment, the method comprising: Listen for physical mount events of USB devices; If a USB device is detected connecting, verify the validity of the USB device. If the USB device passes verification, it enters environment lockout mode; Construct a parallel pipeline system containing read threads, verification threads, and write threads to stream data from the USB device; Listen for physical removal events of USB devices; If a USB device is detected as being removed, the system will automatically restart.
[0007] Furthermore, the step of verifying the legitimacy of the USB device if it is detected that a USB device is connected includes: When an external USB device is detected to be connected, the encrypted identification file of the USB device is read. The signature validity of the encrypted identifier file is verified. If the verification passes, the USB device is determined to be a legitimate device.
[0008] Furthermore, the step of entering the environment lock mode includes: Enables a full-screen overlay window that obscures the user interface; Request a power management lock to force the CPU to remain awake; The response of physical buttons in the shielding system is disabled.
[0009] Furthermore, the step of constructing a parallel pipeline system comprising read threads, verification threads, and write threads to stream data from the USB device includes: Read thread: Reads data streams from the USB device in small data blocks. If a hardware I / O error is captured during the read process, the pipeline is immediately triggered to terminate the deployment and perform a rollback. Verification thread: Calculates the hash digest of the current data block in memory in real time and compares it with the standard value in the preset hash index table; Write thread: Writes the verified data blocks to the physical address of the target storage partition and periodically calls synchronization commands to force the data to be written to disk.
[0010] Furthermore, the step of monitoring the physical removal event of the USB device includes: Once all data blocks have been verified and written, they enter a state awaiting removal. Output a deployment completion notification signal and continuously listen for broadcasts of physical removal of USB devices.
[0011] Furthermore, the encrypted identification file is stored in a hidden partition or a specific directory of the USB device, and includes at least the device model identifier and production batch information, and is signed using an asymmetric encryption algorithm.
[0012] Further, after the step of calculating the hash digest of the current data block in real time in memory and comparing it with a standard value in a preset hash index table, the method includes: When the verification thread determines that the hash digest of the current data block does not match the standard value, it notifies the reading thread to reread the corresponding data block. After the number of retries reaches the preset threshold, the pipeline circuit breaker is triggered and the rollback is performed.
[0013] The present invention also provides an apparatus for automated deployment, the apparatus comprising: The first listening module is used to listen for physical mount events of USB devices; The verification module is used to verify the legitimacy of a USB device if a USB device is detected to be connected. A locking module is used to enter an environment lock mode if the USB device passes verification. The processing module is used to construct a parallel pipeline system containing a read thread, a verification thread, and a write thread to perform streaming processing on the data of the USB device. The second listening module is used to listen for physical removal events of USB devices; The restart module is used to automatically trigger a system restart if a USB device is detected as being removed.
[0014] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the preceding claims.
[0015] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the methods described above.
[0016] Based on the above technical solution, the present invention offers the following advantages: It monitors the physical mounting event of a USB device; if a USB device is detected being connected, its legitimacy is verified; if the USB device passes verification, the system enters an environment lock mode; a parallel pipeline system comprising read, verification, and write threads is constructed to stream the data from the USB device; it monitors the physical removal event of a USB device; if the USB device is detected being removed, a system restart is automatically triggered. The operator only needs to perform two actions: "insert" and "remove," with a single unit taking approximately 4 seconds, resulting in zero touch input and zero accidental touches. Testing on the same batch of aged USB flash drives showed that the streaming verification mechanism successfully intercepted all read errors caused by bad blocks, achieving 100% firmware integrity after deployment and resolving the problem of low production efficiency due to reliance on manual interaction. Attached Figure Description
[0017] Figure 1 This is a flowchart of the automated deployment method provided in the embodiments of the present invention; Figure 2 This is a functional block diagram of the automated deployment device provided in the embodiments of the present invention; Figure 3 This is a schematic block diagram of the structure of a computer device provided by an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0019] like Figure 1 As shown in the figure, this embodiment of the invention proposes an automated deployment method, which is applied to an automotive diagnostic instrument (Android operating system) to be burned. The deployment medium is a pre-made production-specific USB flash drive, which contains an encrypted identification file and firmware data file in the root directory, and a hash index table in the same directory.
[0020] The method includes: Step S101: Listen for the physical mount event of the USB device; Step S102: If a USB device is detected to be connected, verify the legitimacy of the USB device.
[0021] The target device (automotive diagnostic tool) system runs a resident service in the background. This service has registered a broadcast receiver to listen for physical mount events of USB devices. When the operator inserts a dedicated USB flash drive into the device's USB port, the validity of the USB flash drive is verified.
[0022] Step S103: If the USB device passes verification, it enters the environment lock mode.
[0023] Upon successful handshake authentication, the system enters environment lock mode, prohibiting operator interaction with the environment and achieving zero interaction.
[0024] Step S104: Construct a parallel pipeline system including a read thread, a verification thread, and a write thread to stream the data of the USB device.
[0025] A three-stage pipeline of read, write, and verification is used to process data from USB devices to ensure data integrity.
[0026] Step S105: Listen for the physical removal event of the USB device; Step S106: If the removal of a USB device is detected, the system will automatically restart.
[0027] Once all data blocks have been verified and written, the system enters a waiting-to-remove state; it outputs a deployment completion notification signal and continuously listens for the physical removal broadcast of the USB device; once the USB device is detected to be physically unplugged, the system automatically calls the underlying restart interface without any manual confirmation and enters the next production stage.
[0028] The system monitors the physical mounting event of USB devices. If a USB device is detected, its legitimacy is verified. If the USB device passes verification, the system enters an environment lock mode. A parallel pipeline system containing read, verification, and write threads is constructed to stream data from the USB device. The system also monitors the physical removal event of USB devices. If a USB device is detected as removed, a system restart is automatically triggered. Operators only need to perform two actions: "insert" and "remove," with a single unit taking approximately 4 seconds. There is zero touch input and zero accidental touches. Testing on the same batch of aged USB drives showed that the streaming verification mechanism successfully blocked all read errors caused by bad blocks. After deployment, the firmware integrity of the device reached 100%, resolving the problem of low production efficiency caused by reliance on manual interaction.
[0029] In this embodiment, the step of verifying the legitimacy of the USB device if a USB device is detected to be connected includes: When an external USB device is detected to be connected, the encrypted identification file of the USB device is read. The signature validity of the encrypted identifier file is verified. If the verification passes, the USB device is determined to be a legitimate device.
[0030] Upon receiving a mount broadcast, instead of mounting the USB drive's file system, the system directly reads a fixed sector or preset path from the USB drive via the underlying block device interface. It then uses the device's built-in public key to decrypt and verify the encrypted identification file. If verification succeeds and the parsed device model matches the current device, it is determined to be an authorized production disk, and the process proceeds to the next step. If a regular personal USB drive is inserted, no response is given due to the lack of a valid identification file.
[0031] In this embodiment, the step of entering the environment lock mode includes: Enables a full-screen overlay window that obscures the user interface; Request a power management lock to force the CPU to remain awake; The response of physical buttons in the shielding system is disabled.
[0032] Upon successful handshake authentication, the system immediately launches a full-screen overlay window, obscuring the original user interface. Specifically, a full-screen, non-closable floating window is launched, covering the entire interface, and the status bar and navigation bar are hidden. A power management lock is requested, forcing the CPU to remain awake and preventing the system from entering hibernation.
[0033] Disable the response of physical buttons in the system, such as HOME, BACK, POWER, etc., to prevent accidental manual touches that could cause abnormal interruptions to the process.
[0034] In this embodiment, the step of constructing a parallel pipeline system including a read thread, a verification thread, and a write thread to stream data from the USB device includes: Read thread: Reads data streams from the USB device in small data blocks. If a hardware I / O error is captured during the read process, the pipeline is immediately triggered to terminate the deployment and perform a rollback. Verification thread: Calculates the hash digest of the current data block in memory in real time and compares it with the standard value in the preset hash index table; Write thread: Writes the verified data blocks to the physical address of the target storage partition and periodically calls synchronization commands to force the data to be written to disk.
[0035] Start three parallel threads to deploy data from the USB device: Read thread: Reads data blocks sequentially from the USB drive in 4KB blocks (Block 1, Block 2, ..., BlockN). If a low-level input / output error occurs while reading a data block, the block is marked as bad, all threads are immediately stopped, and the error message "USB drive is damaged, please replace" is displayed.
[0036] Verification Thread: Each time the read thread reads a 4KB data block, it sends it to the verification thread. The verification thread calculates the CRC32 value of the block and compares it with the standard CRC32 value of the corresponding logical block in the index table. If they match, the data block is sent to the write queue; if they do not match, the read thread is notified to retry up to 3 times. If it still fails, the circuit breaker is triggered.
[0037] Write thread: Retrieves verified data blocks from the write queue and writes them to the corresponding physical address of the target storage partition. After writing each complete erase block (e.g., 1MB), a synchronization command is invoked to force the data to be written from the page cache to disk, ensuring that data is not lost after a power outage.
[0038] In this embodiment, the size of the data block is 4 kilobytes.
[0039] In this embodiment, the hash digest algorithm is MD5 or CRC32.
[0040] In this embodiment, the step of monitoring the physical removal event of the USB device includes: Once all data blocks have been verified and written, they enter a state awaiting removal. Output a deployment completion notification signal and continuously listen for broadcasts of physical removal of USB devices.
[0041] Once all data blocks have been successfully processed, the system state machine transitions to the "Waiting for Removal" state. A green checkmark icon and the text "Deployment Complete, Please Remove USB Drive" appear in the center of the screen. Simultaneously, the LED indicator on the top of the device flashes a green breathing light. The system begins listening for USB device removal broadcasts. Upon seeing the prompt, the operator physically removes the USB drive. The device immediately detects the removal event, automatically calls the underlying restart interface to perform a system reboot, and enters the user acceptance testing phase.
[0042] In this embodiment, the deployment completion prompt signal includes: displaying prompt information on the screen, controlling the indicator light to display a specific color or breathing effect, or emitting a prompt sound of a specific frequency through a buzzer.
[0043] In this embodiment, the encrypted identification file is stored in a hidden partition or a specific directory of the USB device, and includes at least the device model identifier and production batch information, and is signed using an asymmetric encryption algorithm.
[0044] In this embodiment, after the step of calculating the hash digest of the current data block in real time in memory and comparing it with the standard value in a preset hash index table, the following steps are included: When the verification thread determines that the hash digest of the current data block does not match the standard value, it notifies the reading thread to reread the corresponding data block. After the number of retries reaches the preset threshold, the pipeline circuit breaker is triggered and the rollback is performed.
[0045] If the hash digest of a data block does not match the standard value, it needs to be reread. If the number of rereads reaches a preset threshold and it still does not match, then the pipeline circuit breaker is triggered and a rollback is performed.
[0046] The core concept of this invention is to reconstruct the traditional "human-computer interaction logic" that relies on manual clicks into "hardware event-driven logic" that relies on physical plug-in signals, and to introduce a "read-write-verify three-level pipeline" streaming processing mechanism to solve the problem of physical medium instability.
[0047] The present invention has the following significant beneficial effects: Production efficiency increased by over 300%: This invention simplifies the traditional eight steps required by operators—"inserting USB drive → waiting for mounting → pulling down notification bar → clicking file browse → selecting installation package → clicking confirm → waiting for progress → clicking restart"—into just two physical actions: "inserting → removing". The entire process is zero-touch, reducing manual intervention time per device from 45-60 seconds to less than 5 seconds, significantly improving production line cycle time.
[0048] Completely eliminate "silent data corruption": Traditional file copying methods (cp / dd) only check the file length and cannot detect "bit flips" or data errors caused by bad blocks. This invention introduces a "three-stage read / write verification pipeline" that performs real-time hash verification on each 4KB data block in memory. Once the source data read is abnormal or the verification does not match, the process immediately circuit breakers and rolls back, ensuring that the data written to the device's Flash has 100% bit-level integrity, eliminating defects caused by aging USB flash drive media from the source.
[0049] Achieving physical-level security isolation: This invention abandons easily forged triggering mechanisms based on filenames (such as autorun.inf) and adopts handshake authentication based on encrypted identifier files. Only authorized "production-dedicated disks" can trigger the deployment process, effectively preventing data leakage, virus infection, or incorrect firmware loading risks caused by employees accidentally inserting personal USB drives.
[0050] Supporting system robustness in insecure unplugging scenarios: This invention uses a "waiting to remove" state machine design to bind the restart action to the physical unplugging action. Unplugging the USB drive before data writing is complete will not trigger any high-risk operations; only after all data has been verified and written to the disk will the system respond to the unplugging event and execute a restart. This fundamentally eliminates the risk of file system corruption or device "bricking" caused by accidental unplugging during data writing.
[0051] like Figure 2 As shown in the figure, an embodiment of the present invention proposes an automated deployment device 1, which includes a first monitoring module 11, a verification module 12, a locking module 13, a processing module 14, a second monitoring module 15, and a restart module 16.
[0052] The first listening module 11 is used to listen for physical mount events of USB devices; The verification module 12 is used to verify the legitimacy of the USB device if a USB device is detected to be connected.
[0053] The target device (automotive diagnostic tool) system runs a resident service in the background. This service has registered a broadcast receiver to listen for physical mount events of USB devices. When the operator inserts a dedicated USB flash drive into the device's USB port, the validity of the USB flash drive is verified.
[0054] The locking module 13 is used to enter an environment lock mode if the USB device passes the verification.
[0055] Upon successful handshake authentication, the system enters environment lock mode, prohibiting operator interaction with the environment and achieving zero interaction.
[0056] Processing module 14 is used to construct a parallel pipeline system including a read thread, a verification thread and a write thread to perform streaming processing on the data of the USB device.
[0057] A three-stage pipeline of read, write, and verification is used to process data from USB devices to ensure data integrity.
[0058] The second listening module 15 is used to listen for physical removal events of USB devices; Reboot module 16 is used to automatically trigger a system reboot if a USB device is detected to be removed.
[0059] Once all data blocks have been verified and written, the system enters a waiting-to-remove state; it outputs a deployment completion notification signal and continuously listens for the physical removal broadcast of the USB device; once the USB device is detected to be physically unplugged, the system automatically calls the underlying restart interface without any manual confirmation and enters the next production stage.
[0060] The system monitors the physical mounting event of USB devices. If a USB device is detected, its legitimacy is verified. If the USB device passes verification, the system enters an environment lock mode. A parallel pipeline system containing read, verification, and write threads is constructed to stream data from the USB device. The system also monitors the physical removal event of USB devices. If a USB device is detected as removed, a system restart is automatically triggered. Operators only need to perform two actions: "insert" and "remove," with a single unit taking approximately 4 seconds. There is zero touch input and zero accidental touches. Testing on the same batch of aged USB drives showed that the streaming verification mechanism successfully blocked all read errors caused by bad blocks. After deployment, the firmware integrity of the device reached 100%, resolving the problem of low production efficiency caused by reliance on manual interaction.
[0061] In this embodiment, the verification module 12 includes: The first sub-reading module is used to read the encrypted identification file of the USB device when an external USB device is detected to be connected. The first sub-verification module is used to verify the signature validity of the encrypted identifier file. The first sub-determination module is used to determine that the USB device is a legitimate device if the verification passes.
[0062] Upon receiving a mount broadcast, instead of mounting the USB drive's file system, the system directly reads a fixed sector or preset path from the USB drive via the underlying block device interface. It then uses the device's built-in public key to decrypt and verify the encrypted identification file. If verification succeeds and the parsed device model matches the current device, it is determined to be an authorized production disk, and the process proceeds to the next step. If a regular personal USB drive is inserted, no response is given due to the lack of a valid identification file.
[0063] In this embodiment, the locking module 13 includes: The first sub-launch module is used to launch a full-screen overlay window that obscures the user interface. The first sub-wake-up module is used to request a power management lock to force the CPU to remain awake. The first sub-shielding module is used to shield the system's physical button responses.
[0064] Upon successful handshake authentication, the system immediately launches a full-screen overlay window, obscuring the original user interface. Specifically, a full-screen, non-closable floating window is launched, covering the entire interface, and the status bar and navigation bar are hidden. A power management lock is requested, forcing the CPU to remain awake and preventing the system from entering hibernation.
[0065] Disable the response of physical buttons in the system, such as HOME, BACK, POWER, etc., to prevent accidental manual touches that could cause abnormal interruptions to the process.
[0066] In this embodiment, the processing module 14 includes: The read thread module is used to read data streams from the USB device in small data blocks. If a hardware I / O error is captured during the read process, the pipeline is immediately triggered to terminate the deployment and perform a rollback. The verification thread module is used to calculate the hash digest of the current data block in real time in memory and compare it with the standard value in the preset hash index table; The write thread module is used to write the verified data blocks to the physical address of the target storage partition and periodically call the synchronization command to force the data to be written to disk.
[0067] Start three parallel threads to deploy data from the USB device: Read thread: Reads data blocks sequentially from the USB drive in 4KB blocks (Block 1, Block 2, ..., BlockN). If a low-level input / output error occurs while reading a data block, the block is marked as bad, all threads are immediately stopped, and the error message "USB drive is damaged, please replace" is displayed.
[0068] Verification Thread: Each time the read thread reads a 4KB data block, it sends it to the verification thread. The verification thread calculates the CRC32 value of the block and compares it with the standard CRC32 value of the corresponding logical block in the index table. If they match, the data block is sent to the write queue; if they do not match, the read thread is notified to retry up to 3 times. If it still fails, the circuit breaker is triggered.
[0069] Write thread: Retrieves verified data blocks from the write queue and writes them to the corresponding physical address of the target storage partition. After writing each complete erase block (e.g., 1MB), a synchronization command is invoked to force the data to be written from the page cache to disk, ensuring that data is not lost after a power outage.
[0070] In this embodiment, the size of the data block is 4 kilobytes.
[0071] In this embodiment, the hash digest algorithm is MD5 or CRC32.
[0072] In this embodiment, the second monitoring module 15 includes: The first sub-module waiting to be removed is used to enter the waiting to be removed state after all data blocks have been verified and written. The first sub-processing module is used to output a deployment completion prompt signal and continuously listen for the physical removal broadcast of the USB device.
[0073] Once all data blocks have been successfully processed, the system state machine transitions to the "Waiting for Removal" state. A green checkmark icon and the text "Deployment Complete, Please Remove USB Drive" appear in the center of the screen. Simultaneously, the LED indicator on the top of the device flashes a green breathing light. The system begins listening for USB device removal broadcasts. Upon seeing the prompt, the operator physically removes the USB drive. The device immediately detects the removal event, automatically calls the underlying restart interface to perform a system reboot, and enters the user acceptance testing phase.
[0074] In this embodiment, the deployment completion prompt signal includes: displaying prompt information on the screen, controlling the indicator light to display a specific color or breathing effect, or emitting a prompt sound of a specific frequency through a buzzer.
[0075] In this embodiment, the encrypted identification file is stored in a hidden partition or a specific directory of the USB device, and includes at least the device model identifier and production batch information, and is signed using an asymmetric encryption algorithm.
[0076] In this embodiment, device 1 includes: The first sub-rollback module is used to notify the reading thread to reread the corresponding data block when the verification thread determines that the hash digest of the current data block does not match the standard value. After the number of retries reaches a preset threshold, the pipeline circuit breaker is triggered and the rollback is performed.
[0077] If the hash digest of a data block does not match the standard value, it needs to be reread. If the number of rereads reaches a preset threshold and it still does not match, then the pipeline circuit breaker is triggered and a rollback is performed.
[0078] The core concept of this invention is to reconstruct the traditional "human-computer interaction logic" that relies on manual clicks into "hardware event-driven logic" that relies on physical plug-in signals, and to introduce a "read-write-verify three-level pipeline" streaming processing mechanism to solve the problem of physical medium instability.
[0079] The present invention has the following significant beneficial effects: Production efficiency increased by over 300%: This invention simplifies the traditional eight steps required by operators—"inserting USB drive → waiting for mounting → pulling down notification bar → clicking file browse → selecting installation package → clicking confirm → waiting for progress → clicking restart"—into just two physical actions: "inserting → removing". The entire process is zero-touch, reducing manual intervention time per device from 45-60 seconds to less than 5 seconds, significantly improving production line cycle time.
[0080] Completely eliminate "silent data corruption": Traditional file copying methods (cp / dd) only check the file length and cannot detect "bit flips" or data errors caused by bad blocks. This invention introduces a "three-stage read / write verification pipeline" that performs real-time hash verification on each 4KB data block in memory. Once the source data read is abnormal or the verification does not match, the process immediately circuit breakers and rolls back, ensuring that the data written to the device's Flash has 100% bit-level integrity, eliminating defects caused by aging USB flash drive media from the source.
[0081] Achieving physical-level security isolation: This invention abandons easily forged triggering mechanisms based on filenames (such as autorun.inf) and adopts handshake authentication based on encrypted identifier files. Only authorized "production-dedicated disks" can trigger the deployment process, effectively preventing data leakage, virus infection, or incorrect firmware loading risks caused by employees accidentally inserting personal USB drives.
[0082] Supporting system robustness in insecure unplugging scenarios: This invention uses a "waiting to remove" state machine design to bind the restart action to the physical unplugging action. Unplugging the USB drive before data writing is complete will not trigger any high-risk operations; only after all data has been verified and written to the disk will the system respond to the unplugging event and execute a restart. This fundamentally eliminates the risk of file system corruption or device "bricking" caused by accidental unplugging during data writing.
[0083] like Figure 3 As shown, this embodiment of the invention also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 3As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data such as models of automated deployment methods. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements an automated deployment method.
[0084] The processor described above performs the following steps in the automated deployment method: Listen for physical mount events of USB devices; If a USB device is detected connecting, verify the validity of the USB device. If the USB device passes verification, it enters environment lockout mode; Construct a parallel pipeline system containing read threads, verification threads, and write threads to stream data from the USB device; Listen for physical removal events of USB devices; If a USB device is detected as being removed, the system will automatically restart.
[0085] Those skilled in the art will understand that Figure 3 The structures shown are merely block diagrams of some structures related to the present invention and do not constitute a limitation on the computer devices on which the present invention is applied.
[0086] The computer device in this embodiment of the invention monitors the physical mounting event of a USB device; if a USB device is detected being connected, its legitimacy is verified; if the USB device passes verification, the device enters an environment lock mode; a parallel pipeline system including read, verification, and write threads is constructed to stream the data from the USB device; the device also monitors the physical removal event of the USB device; if the removal is detected, a system restart is automatically triggered. The operator only needs to perform two actions: "insert" and "remove," with a single unit taking approximately 4 seconds, resulting in zero touch input and zero accidental touches. Testing on the same batch of aged USB flash drives showed that the streaming verification mechanism successfully intercepted all read errors caused by bad blocks, achieving 100% firmware integrity after deployment and resolving the problem of low production efficiency due to reliance on manual interaction.
[0087] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements an automated deployment method, specifically as follows: Listen for physical mount events of USB devices; If a USB device is detected connecting, verify the validity of the USB device. If the USB device passes verification, it enters environment lockout mode; Construct a parallel pipeline system containing read threads, verification threads, and write threads to stream data from the USB device; Listen for physical removal events of USB devices; If a USB device is detected as being removed, the system will automatically restart.
[0088] The storage medium of this invention monitors the physical mounting event of a USB device. If a USB device is detected, its legitimacy is verified. If the USB device passes verification, the system enters an environment lock mode. A parallel pipeline system comprising read, verification, and write threads is constructed to stream the data from the USB device. The system also monitors the physical removal event of the USB device. If the USB device is detected as removed, a system restart is automatically triggered. Operators only need to perform two actions: "insert" and "remove," with a single unit taking approximately 4 seconds, resulting in zero touch input and zero accidental touches. Testing on the same batch of aged USB flash drives showed that the streaming verification mechanism successfully intercepted all read errors caused by bad blocks. After deployment, the firmware integrity of the device reached 100%, resolving the problem of low production efficiency due to reliance on manual interaction.
[0089] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the present invention and embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0090] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for automated deployment, characterized in that, The method includes: Listen for physical mount events of USB devices; If a USB device is detected connecting, verify the legitimacy of the USB device. If the USB device passes verification, it enters environment lockout mode; Construct a parallel pipeline system containing read threads, verification threads, and write threads to stream data from the USB device; Listen for physical removal events of USB devices; If a USB device is detected as being removed, the system will automatically restart.
2. The automated deployment method according to claim 1, characterized in that, The step of verifying the legitimacy of a USB device if it is detected that a USB device is connected includes: When an external USB device is detected to be connected, the encrypted identification file of the USB device is read. The signature validity of the encrypted identifier file is verified. If the verification passes, the USB device is determined to be a legitimate device.
3. The automated deployment method according to claim 1, characterized in that, The step of entering the environment lockout mode includes: Enables a full-screen overlay window that obscures the user interface; Request a power management lock to force the CPU to remain awake; The response of physical buttons in the shielding system is disabled.
4. The automated deployment method according to claim 1, characterized in that, The step of constructing a parallel pipeline system comprising read threads, verification threads, and write threads to stream data from the USB device includes: Read thread: Reads data streams from the USB device in small data blocks. If a hardware I / O error is captured during the read process, the pipeline is immediately triggered to terminate the deployment and perform a rollback. Verification thread: Calculates the hash digest of the current data block in real time in memory and compares it with the standard value in the preset hash index table; Write thread: Writes the verified data blocks to the physical address of the target storage partition and periodically calls synchronization commands to force the data to be written to disk.
5. The automated deployment method according to claim 1, characterized in that, The step of monitoring the physical removal event of the USB device includes: Once all data blocks have been verified and written, they enter a state awaiting removal. Output a deployment completion notification signal and continuously listen for broadcasts of physical removal of USB devices.
6. The automated deployment method according to claim 2, characterized in that, The encrypted identification file is stored in a hidden partition or a specific directory of the USB device, and includes at least the device model identifier and production batch information, and is signed using an asymmetric encryption algorithm.
7. The automated deployment method according to claim 4, characterized in that, After the step of calculating the hash digest of the current data block in real time in memory and comparing it with a standard value in a preset hash index table, the following steps are included: When the verification thread determines that the hash digest of the current data block does not match the standard value, it notifies the reading thread to reread the corresponding data block. After the number of retries reaches the preset threshold, the pipeline circuit breaker is triggered and the rollback is performed.
8. An automated deployment device, characterized in that, The device includes: The first listening module is used to listen for physical mount events of USB devices; The verification module is used to verify the legitimacy of a USB device if a USB device is detected to be connected. A locking module is used to enter an environment lock mode if the USB device passes verification. The processing module is used to construct a parallel pipeline system containing a read thread, a verification thread, and a write thread to perform streaming processing on the data of the USB device. The second listening module is used to listen for physical removal events of USB devices; The restart module is used to automatically trigger a system restart if a USB device is detected as being removed.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. 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 according to any one of claims 1 to 7.
