A method and device for large-scale UKey robustness loading and detection

By performing grouped time-sharing loading and multiple time-slice gain detection on UKey devices, the problems of system resource blocking and wasted loading time during the loading of a large number of UKey devices are solved, achieving stable loading and efficient detection.

CN116107647BActive Publication Date: 2026-06-05AISINO CORPORATION

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AISINO CORPORATION
Filing Date
2022-12-27
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

The issues include system resource allocation blocking or freezing during the loading of large batches of UKey devices, and how to balance the contradiction between loading time and result accuracy.

Method used

By grouping and time-division loading the UKey devices, using a serial intermittent power-on method, and combining multiple time-slice gain detection, the final stable quantity is obtained.

Benefits of technology

It achieves stable loading of a large number of UKey devices, avoids system blocking and freezing, and optimizes loading time and the accuracy of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116107647B_ABST
    Figure CN116107647B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for large-scale UKey robust loading and detection, comprising: grouping UKey devices according to the total number of connected UKey devices in the system and the maximum number of UKey devices powered on in a single batch; robustly loading each group of UKey devices through serial intermittent power-on according to the maximum number of UKey devices powered on in a single batch and a preset intermittent duration; obtaining the average duration of UKey device loading completion in historical data, determining the time slice gain amount according to the average duration and a gain factor; after waiting for the time slice gain amount each time, performing UKey device system detection once, and obtaining the number of UKey devices detected multiple times; taking the same number of UKey devices detected multiple times as the final stable number of UKey devices. The application prevents the system from being blocked and dead due to large batches of UKey loading tasks, avoids regular detection errors and long waiting time, and perfectly balances the correctness of the detection result and the waiting time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of equipment testing technology, and specifically to a method and apparatus for robust loading and testing of large-scale UKeys. Background Technology

[0002] In large-scale UKey application scenarios, such as UKey issuance and application devices in the tax field and UKey disk cloud invoicing devices, there are a large number of onboard UKeys. The stable loading and efficient testing of these devices are the foundation for upper-layer business applications.

[0003] 1. The system may contain a large number of UKey devices. These devices can only be detected by upper-layer applications after being correctly loaded by the operating system. Loading each UKey requires system resources such as the operating system's serial port, bus, and USB mass storage device handle. If these devices are loaded simultaneously, it may cause system resource allocation blockage or freezing. How to stably load a large number of UKey devices is a critical issue faced by large-scale UKey system applications.

[0004] 2. Loading a large number of UKey devices takes time. If the waiting time is too short, the correct loading result cannot be obtained. However, simply extending the waiting time to obtain the correct loading result will inevitably cause a lot of unnecessary time waste. How to balance this contradiction is a thorny issue. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention provides a method for robust loading and detection of large-scale USB keys, comprising:

[0006] Based on the total number of UKey devices connected in the system and the maximum number of UKey devices powered on in a single batch, the UKey devices are grouped for power-on.

[0007] Robust loading of each group of UKey devices is performed by serial intermittent power-on based on the maximum number of UKey devices powered on in a single batch and the preset interval duration.

[0008] Obtain the average time taken for the UKey device to complete loading in historical data, and determine the time slice gain based on the average time taken and the gain factor;

[0009] After each waiting time slice gain, a UKey device system test is performed to obtain multiple UKey device detection counts; the same number of consecutive UKey device detections is taken as the final stable number of UKey devices.

[0010] Furthermore, based on the total number of UKey devices connected to the system and the maximum number of UKey devices powered on in a single batch, the UKey devices are grouped for power-on, including:

[0011] Determine the number of UKey cards connected in the system (CardNum), and the number of UKeys connected to each UKey card (CardUKeyNum);

[0012] Based on the number of UKey cards, CardNum, the UKey cards are divided into multiple groups;

[0013] Based on the maximum number of UKey devices powered on within a single batch (BatchUkNum), the UKey devices connected to each UKey board are grouped for power-on.

[0014] Furthermore, robust loading of each group of UKey devices is performed through serial intermittent power-on based on the maximum number of UKey devices powered on within a single batch and a preset interval duration, including:

[0015] Identify the UKey board and its corresponding serial port number for this group, and then open the serial port.

[0016] Select a specific batch of UKey devices within this UKey board group and power them on.

[0017] After the previous batch of UKey devices has finished powering on, the next batch of UKey devices will be powered on after a preset interval JxTime. This process is repeated to power on all batches of UKey devices in the group.

[0018] Furthermore, the average time for a UKey device to complete loading in historical data is obtained using the following formula:

[0019]

[0020] In the formula, The average time for a UKey device to complete loading is denoted by m, where m is the gain factor and n is the number of UKey devices.

[0021] Furthermore, based on the average duration and gain factor, the time slice gain is determined, and the specific formula for the time slice gain is as follows:

[0022]

[0023] In the formula, The average time for the UKey device to complete loading is denoted as m, where m is the gain factor.

[0024] Furthermore, after each waiting time slice gain increment, a UKey device system test is performed to obtain multiple UKey device detection counts; the number of consecutive identical UKey device detection counts is taken as the final stable number of UKey devices, including:

[0025] After the UKey device group is powered on, the system waits for the UKey device to load by setting the pre-wait time W.

[0026] After waiting for a time slice gain ΔT, perform a UKey device system test and obtain the number of UKey devices detected each time.

[0027] Set the repetition gain K. When the number of UKey devices detected is the same for k consecutive times, the detection will terminate.

[0028] The number of UKey devices detected in k consecutive tests is taken as the final stable number of UKey devices.

[0029] This invention also provides an apparatus for robust loading and detection of large-scale USB keys, comprising:

[0030] The grouping unit is used to group the UKey devices for power-on based on the total number of UKey devices connected in the system and the maximum number of UKey devices powered on in a single batch.

[0031] The loading unit is used to robustly load each group of UKey devices by serial intermittent power-on according to the maximum number of UKey devices powered on in a single batch and the preset interval duration;

[0032] The gain determination unit is used to obtain the average duration of UKey device loading in historical data, and determine the time slice gain based on the average duration and the gain factor.

[0033] The detection unit is used to perform a UKey device system detection after each waiting time slice gain measurement to obtain the number of UKey devices detected multiple times; the number of the same UKey devices detected in multiple consecutive times is taken as the final stable number of UKey devices.

[0034] Furthermore, the grouping units include:

[0035] The board and UKey quantity determination subunit is used to determine the number of UKey boards connected in the system, CardNum, and the number of UKeys connected to each UKey board, CardUKeyNum.

[0036] The board grouping subunit is used to divide the UKey boards into multiple groups according to the number of UKey boards, CardNum;

[0037] The UKey device grouping subunit is used to group the UKey devices connected to each UKey board into power-on groups based on the maximum number of UKey devices powered on in a single batch, BatchUkNum.

[0038] Furthermore, the loading unit includes:

[0039] The serial port open sub-unit is used to identify the UKey board and its corresponding serial port number in this group and open the serial port;

[0040] The first batch of electronic units is used to select a specific batch of UKey devices within this group of UKey boards for power-on operation;

[0041] The second batch of electronic units is used to power on the next batch of UKey devices after the previous batch has finished powering on, after a preset interval of JxTime. This process is repeated to power on all batches of UKey devices in the group.

[0042] Furthermore, the detection unit includes:

[0043] The UKey device loading subunit is used to wait for the system to load the UKey device after the UKey device group is powered on by setting a pre-waiting time W.

[0044] The detection subunit is used to perform a UKey device system detection after waiting for a time slice gain amount ΔT each time, and to obtain the number of UKey devices detected each time;

[0045] The detection termination subunit is used to set the repetition gain K. When the number of UKey devices detected is the same for k consecutive times, the detection terminates.

[0046] The stable quantity stator unit is used to take the number of UKey devices detected in k consecutive cycles as the final stable quantity of UKey devices.

[0047] This invention provides a method and apparatus for robust loading and detection of large-scale USB keys. It supports robust loading of large batches of USB keys and prevents the system from being blocked or frozen by controlling the batch and time-sharing of USB key loading tasks. Loading a large batch of USB keys takes time. If the waiting time is too short, the correct loading result cannot be obtained. However, simply trying to obtain the correct loading result may waste a long waiting time. This invention adopts multiple time-slice gain detection, avoiding conventional detection errors and long waiting times, and perfectly balancing the correctness of the detection result and the waiting time. Attached Figure Description

[0048] Figure 1This is a flowchart illustrating a method for robust loading and detection of large-scale UKeys provided by the present invention.

[0049] Figure 2 This is a physical view of the large-scale UKey system involved in this invention;

[0050] Figure 3 This is a schematic diagram illustrating the effect of the multi-time-slice gain detection method involved in this invention;

[0051] Figure 4 This is a schematic diagram of a device for robust loading and detection of large-scale USB keys provided by the present invention. Detailed Implementation

[0052] Numerous specific details are set forth in the following description to provide a full understanding of the invention. However, the invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0053] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments.

[0054] Figure 1 This is a flowchart illustrating a method for robust loading and detection of large-scale USB keys provided by the present invention, comprising the following steps:

[0055] Step S101: Based on the total number of UKey devices connected in the system and the maximum number of UKey devices powered on in a single batch, the UKey devices are grouped for power-on.

[0056] like Figure 2 As shown, a large-scale UKey system mainly consists of an industrial control computer / host, UKey boards, and UKey devices. A large-scale UKey system contains multiple boards, each with multiple UKeys. The industrial control computer / host and the UKey boards are connected via an actual COM port or a virtual serial port (referred to as a serial port in this invention). The UKey boards have multiple USB ports (i.e., U-ports), and the UKeys are plugged into these U-ports. Essentially, a UKey is a type of "USB mass storage device."

[0057] The system determines the number of UKey cards connected in the system (CardNum) and the number of UKeys connected to each UKey card (CardUKeyNum). Based on the CardNum, the UKey cards are divided into multiple groups. Then, based on the maximum number of UKey devices powered on in a single batch (BatchUkNum), the UKey devices connected to each group of UKey cards are grouped for power-on. For example, the U60 series UKey cards from a certain company have 6*10=60 USB ports per card, meaning one card can support 60 UKey devices. Similarly, the U45 series UKey cards have 3*15=45 USB ports per card, meaning one card can support 45 UKey devices. The U180 cloud invoicing series integrates four U45 cards, meaning the system can support 45*4=180 UKeys.

[0058] Step S102: Robustly load each group of UKey devices by serially and intermittently powering them on, based on the maximum number of UKey devices powered on in a single batch and the preset interval duration.

[0059] Specifically, determine the UKey board and its corresponding serial port number for this group, and open the serial port; select a batch of UKey devices within this group to power on; after the previous batch of UKey devices has finished powering on, after a preset interval JxTime, power on the next batch of UKey devices, and so on, to power on all batches of UKey devices within this group.

[0060] Furthermore, loading each UKey requires system resources such as the operating system's serial port, bus, and USB mass storage device handle. If these devices are loaded simultaneously, it can cause system resource allocation to become blocked or freeze. To prevent a large number of UKey loading tasks from blocking or freezing the system, a batch loading and time-sharing control can be implemented for large numbers of onboard UKeys.

[0061] The grouping and batching refers to dividing a large number of onboard UKeys into several batches by grouping them by board and further batching the UKeys inside the board, with each batch of UKeys undergoing a power-on loading process separately.

[0062] The serial intermittent loading refers to the sequential loading of each group and batch of UKeys, with each batch of UKeys requiring a certain period of sleep (called the intermittent duration) after power-on to allow the operating system to complete loading. This prevents concurrent power-on loading between batches of UKeys from preempting system resources (potentially exceeding system capacity and causing system blockage). Note: Due to limitations in the performance of the operating system when loading hardware devices, especially in older operating systems like Windows 7 and earlier, loading large numbers of USB devices is not very efficient. The serial rather than parallel approach is used to further reduce system load and prevent system-level blockage.

[0063] Step S103: Obtain the average time taken for the UKey device to complete loading in historical data, and determine the time slice gain based on the average time taken and the gain factor.

[0064] The specific formula for average duration is:

[0065]

[0066] In the formula, The average time for a UKey device to complete loading is denoted by m, where m is the gain factor and n is the number of UKey devices.

[0067] The time-slice gain is determined based on the average duration and the gain factor, using the following formula:

[0068]

[0069] In the formula, The average time for the UKey device to complete loading is denoted as m, where m is the gain factor.

[0070] Step S104: After each waiting time slice gain, perform a UKey device system test to obtain multiple UKey device detection counts; take the same number of consecutive UKey device detections as the final stable number of UKey devices.

[0071] After the UKey devices are grouped and powered on, a pre-wait time W is set to wait for the system to load the UKey devices. After waiting for a time slice gain ΔT each time, a UKey device system detection is performed, and the number of UKey devices detected each time is obtained. A repetition gain K is set, and the detection terminates when the number of UKey devices detected is the same for k consecutive times. The number of UKey devices detected for k consecutive times is taken as the final stable number of UKey devices.

[0072] Example 1: Large-scale UKey grouping and batching, serial intermittent loading

[0073] 1. System Initialization: The system determines the current UKey card model, quantity, corresponding serial port number, maximum number of UKeys a single UKey card can support (CardUKeyNum), maximum number of UKeys in a single batch (BatchUkNum), and interval duration (JxTime) through configuration loading or system self-test. Among these, BatchUkNum and JxTime are variable coefficients that need to be set and can be loaded through configuration. Other parameters can be automatically obtained through system self-test.

[0074] The following example uses a company's U180 cloud invoicing series product, which integrates four U45 boards, meaning the system can carry 45*4=180 UKeys.

[0075] CardNum: 4, CardUKeyNum: 45, BatchUkNum: 15.

[0076] 2. Large batches of UKeys can be grouped and divided into batches, including: grouping by board and batching within the board.

[0077] Specific methods:

[0078] Grouped by circuit board: The four circuit boards are labeled A, B, C, and D and divided into four groups;

[0079] Intra-board batching: Batching is performed based on CardUKeyNum and BatchUkNum.

[0080] For example, when CardUKeyNum: 45 and BatchUkNum: 15, it can be divided into CardUKeyNum / BatchUkNum = 3 batches. Each batch contains the following UKeys: [U1, U2…U15], [U16, U17…U30], [U31, U32…U45], where U1 represents the UKey inserted into the U-port with serial number 1 on the board, and so on.

[0081] For example, when CardUKeyNum: 45 and BatchUkNum: 20, it can be divided into CardUKeyNum / BatchUkNum = 2.25, which is 3 batches. Each batch contains the following UKeys: [U1, U2…U20], [U21, U22…U40], [U41, U42…U45].

[0082] 3. Based on the above grouping and batching results, perform serial intermittent power-on loading for each batch of UKeys.

[0083] 1) For a specific group, identify the board and its corresponding serial port number, and open the serial port;

[0084] 2) Select all UKeys from a specific batch within this group and perform a power-on operation. This involves sending a power-on command according to the serial communication protocol agreed upon between the system and the board to power on the UKey, allowing the operating system to automatically load the UKeys.

[0085] 3) After each batch is powered on, it sleeps for a specified duration (i.e., the interval duration JxTime) to allow time for the system to load the UKey normally.

[0086] 4) Repeat the above steps. After all batches of UKeys in this group are powered on, close the serial port corresponding to the board in this group to release system resources.

[0087] 5) Repeat the above steps until all UKeys in all groups and batches have been powered on.

[0088] 4. Parameter optimization

[0089] The variable coefficients BatchUkNum and JxTime can be adjusted.

[0090] While maintaining robust and stable loading, the overall efficiency of loading large batches of UKeys is optimized by appropriately increasing BatchUkNum and decreasing JxTime.

[0091] Example 2: Multiple Time-Slice Gain Detection

[0092] The problem addressed in the first embodiment above is the stability and robustness of loading UKeys. Since the entire process of loading a UKey takes time, it is affected by multiple factors such as the loading coefficient, actual system load, and system capacity. The time required for all UKey devices to complete loading also varies, and sometimes the variations can be very large (for example, a high actual load on the operating system at a certain moment can severely affect the loading efficiency of the hardware devices).

[0093] In Example 1, the total waiting time for the device to complete loading is: total time for grouped power-on + total pre-waiting time. If this pre-waiting time is set too short, there may be cases where the device has not yet successfully loaded, inevitably leading to errors in the result. If this pre-waiting time is set too long, the system will likely complete loading, but the waiting time will be very long.

[0094] Therefore, this invention proposes a multi-time-slice gain detection method, which can efficiently detect the completion status of system hardware loading, avoid conventional detection errors and long waiting times, and perfectly balance the accuracy of detection results and waiting time.

[0095] like Figure 3As shown, T1 is the first time point to perform gain detection, T2 is the second, and so on. Between T4 and T5, the operating system has actually finished loading all UKeys. At time points T5, T6, and T7, the number of UKeys detected is the same (reaching the maximum value and remaining constant). Therefore, at time point T7, we have sufficient reason to believe that the system has essentially finished loading all UKeys and is maintaining a constant number.

[0096] Specific procedures:

[0097] 1. Given a fixed operating system, host performance, and number of UKeys to be loaded, conduct large-scale data sampling statistics on the actual values ​​of the loading completion time T for all UKeys, and calculate their average.

[0098]

[0099] 2. Set the time slice gain ΔT and the repetition gain threshold K. in, The average loading time for all UKeys is denoted by m, where m is the gain factor, which is negatively correlated with the granularity of the time slice gain. The repetition gain threshold K indicates that the UKey detection process is terminated when the number of UKeys detected by the time slice gain is the same for K consecutive times.

[0100] 3. Set the pre-wait duration W. The purpose of the pre-wait is to wait for the operating system to load the UKey device after the phased power-on is performed. This value is an empirical value and is related to factors such as the operating system, host performance, and the number of UKeys to be loaded. It can also be set directly to 0 (in which case it depends entirely on the gain time detection).

[0101] 4. After the UKeys are powered on in batches, a pre-wait time W is set;

[0102] 5. After waiting for a time slice gain ΔT, perform a UKey device system test and record the current number of UKeys detected;

[0103] 6. Based on the repetition gain threshold K, determine whether the number of UKeys detected in the last K times is the same;

[0104] 7. If the number of K tests has not been reached, or the number of detections in the last K tests is different, repeat steps 5 and 6; otherwise, stop the testing process and take the number of detections that are the same in the last K tests as the final stable number of the UKey device.

[0105] This example depends on the operating system, host performance, and the number of UKeys to be loaded. Therefore, the various parameters are also related to these factors and are empirical values. In practice, it is necessary to conduct extensive experiments and set appropriate values ​​according to the specific actual scenario. For example, the gain factor can generally be selected from 6 to 10; the repetition gain threshold K can generally be selected from 3 to 5.

[0106] Parameter fine-tuning methods: If the gain factor is selected to be relatively large, the gain granularity will be small, and the repetitive gain threshold K should be appropriately increased; if the gain factor is selected to be relatively small, the gain granularity will be large, and the repetitive gain threshold K should be appropriately decreased.

[0107] Based on the same inventive concept, this invention also provides a device 400 for robust loading and detection of large-scale USB keys, such as... Figure 4 As shown, it includes:

[0108] Grouping unit 410 is used to group UKey devices based on the total number of UKey devices connected in the system and the maximum number of UKey devices powered on in a single batch.

[0109] The loading unit 420 is used to robustly load each group of UKey devices by serial intermittent power-on according to the maximum number of UKey devices powered on in a single batch and the preset interval duration;

[0110] The gain determination unit 430 is used to obtain the average duration of UKey device loading in historical data, and determine the time slice gain based on the average duration and the gain factor.

[0111] The detection unit 440 is used to perform a UKey device system detection after each waiting time slice gain, and obtain the number of UKey devices detected multiple times; the number of the same UKey devices detected in multiple consecutive times is taken as the final stable number of UKey devices.

[0112] Furthermore, the grouping units include:

[0113] The board and UKey quantity determination subunit is used to determine the number of UKey boards connected in the system, CardNum, and the number of UKeys connected to each UKey board, CardUKeyNum.

[0114] The board grouping subunit is used to divide the UKey boards into multiple groups according to the number of UKey boards, CardNum;

[0115] The UKey device grouping subunit is used to group the UKey devices connected to each UKey board into power-on groups based on the maximum number of UKey devices powered on in a single batch, BatchUkNum.

[0116] Furthermore, the loading unit includes:

[0117] The serial port open sub-unit is used to identify the UKey board and its corresponding serial port number in this group and open the serial port;

[0118] The first batch of electronic units is used to select a specific batch of UKey devices within this group of UKey boards for power-on operation;

[0119] The second batch of electronic units is used to power on the next batch of UKey devices after the previous batch has finished powering on, after a preset interval of JxTime. This process is repeated to power on all batches of UKey devices in the group.

[0120] Furthermore, the detection unit includes:

[0121] The UKey device loading subunit is used to wait for the system to load the UKey device after the UKey device group is powered on by setting a pre-waiting time W.

[0122] The detection subunit is used to perform a UKey device system detection after waiting for a time slice gain amount ΔT each time, and to obtain the number of UKey devices detected each time;

[0123] The detection termination subunit is used to set the repetition gain K. When the number of UKey devices detected is the same for k consecutive times, the detection terminates.

[0124] The stable quantity stator unit is used to take the number of UKey devices detected in k consecutive cycles as the final stable quantity of UKey devices.

[0125] This invention provides a method and apparatus for robust loading and detection of large-scale USB keys. It supports robust loading of large batches of USB keys and prevents the system from being blocked or frozen by controlling the batch and time-sharing of USB key loading tasks. Loading a large batch of USB keys takes time. If the waiting time is too short, the correct loading result cannot be obtained. However, simply trying to obtain the correct loading result may waste a long waiting time. This invention adopts multiple time-slice gain detection, avoiding conventional detection errors and long waiting times, and perfectly balancing the correctness of the detection result and the waiting time.

[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of the claims of the present invention.

Claims

1. A method for robust loading and detection of large-scale USB keys, characterized in that, include: Based on the total number of UKey devices connected in the system and the maximum number of UKey devices powered on in a single batch, the UKey devices are grouped for power-on. Robust loading of each group of UKey devices is performed by serial intermittent power-on based on the maximum number of UKey devices powered on in a single batch and the preset interval duration. Obtain the average time taken for the UKey device to complete loading in historical data, and determine the time slice gain based on the average time taken and the gain factor; After each waiting time slice gain, perform a UKey device system test to obtain the number of UKey devices detected multiple times. The number of consecutive detections of the same UKey device is taken as the final stable number of UKey devices. Based on the total number of UKey devices connected to the system and the maximum number of UKey devices powered on in a single batch, the UKey devices are grouped for power-on, including: Determine the number of UKey cards connected in the system (CardNum), and the number of UKeys connected to each UKey card (CardUKeyNum); Based on the number of UKey cards, CardNum, the UKey cards are divided into multiple groups; Based on the maximum number of UKey devices powered on within a single batch (BatchUkNum), the UKey devices connected to each UKey board are grouped for power-on. Robust loading of each group of UKey devices is performed through serial intermittent power-on, based on the maximum number of UKey devices powered on within a single batch and a preset interval duration. This includes: Identify the UKey board and its corresponding serial port number for this group, and then open the serial port. Select a specific batch of UKey devices within this UKey board group and power them on. After the previous batch of UKey devices has finished powering on, after a preset interval of JxTime, the next batch of UKey devices will be powered on. This process is repeated to power on all batches of UKey devices in the group. Based on the average duration and gain factor, the time slice gain is determined, and the specific formula for the time slice gain is as follows: T = / m , In the formula, The average time for the UKey device to complete loading, where m is the gain factor; After each waiting time slice gain adjustment, a UKey device system test is performed to obtain multiple UKey device detection counts. The number of consecutive identical UKey device detection counts is taken as the final stable number of UKey devices, including: After the UKey devices are powered on in batches, the system waits for the UKey devices to load by setting a pre-wait time W. Gain amount after each time slice After T, perform a UKey device system test and obtain the number of UKey devices detected each time; Set the repetition gain K. When the number of UKey devices detected is the same for k consecutive times, the detection will terminate. The number of UKey devices detected in k consecutive tests is taken as the final stable number of UKey devices.

2. The method according to claim 1, characterized in that, The formula for obtaining the average time for a UKey device to complete loading in historical data is as follows: In the formula, This represents the average time for a UKey device to complete loading, where n is the number of UKey devices.

3. An apparatus for robust loading and detection of large-scale USB keys, the apparatus being used to implement the method according to any one of claims 1-2, characterized in that, include: The grouping unit is used to group the UKey devices for power-on based on the total number of UKey devices connected in the system and the maximum number of UKey devices powered on in a single batch. The loading unit is used to robustly load each group of UKey devices by serial intermittent power-on according to the maximum number of UKey devices powered on in a single batch and the preset interval duration; The gain determination unit is used to obtain the average duration of UKey device loading in historical data, and determine the time slice gain based on the average duration and the gain factor. The detection unit is used to perform a UKey device system detection after each waiting time slice gain measurement to obtain the number of UKey devices detected multiple times; the number of the same UKey devices detected in multiple consecutive times is taken as the final stable number of UKey devices.

4. The apparatus according to claim 3, characterized in that, Grouping units, including: The board and UKey quantity determination subunit is used to determine the number of UKey boards connected in the system, CardNum, and the number of UKeys connected to each UKey board, CardUKeyNum. The board grouping subunit is used to divide the UKey boards into multiple groups according to the number of UKey boards, CardNum; The UKey device grouping subunit is used to group the UKey devices connected to each UKey board into power-on groups based on the maximum number of UKey devices powered on in a single batch, BatchUkNum.

5. The apparatus according to claim 3, characterized in that, Loading unit, including: The serial port open sub-unit is used to identify the UKey board and its corresponding serial port number in this group and open the serial port; The first batch of electronic units is used to select a specific batch of UKey devices within this group of UKey boards for power-on operation; The second batch of electronic units is used to power on the next batch of UKey devices after the previous batch of UKey devices has finished powering on, after a preset interval of JxTime, thus completing the power-on of all batches of UKey devices in this group.

6. The apparatus according to claim 3, characterized in that, The detection unit includes: The UKey device loading subunit is used to wait for the system to load the UKey devices after they are powered on in batches by setting a pre-waiting time W. The detection subunit is used to measure the gain amount each time a time slice is waited. After T, perform a UKey device system test and obtain the number of UKey devices detected each time; The detection termination subunit is used to set the repetition gain K. When the number of UKey devices detected is the same for k consecutive times, the detection terminates. The stable quantity stator unit is used to take the number of UKey devices detected in k consecutive cycles as the final stable quantity of UKey devices.