Automatic test method, system and device, electronic equipment and readable storage medium
By using an automated testing system, real-time current monitoring and hardware protection are achieved through MOSFETs and operational amplifiers. Combined with multi-dimensional testing, the problems of low testing efficiency and incomplete coverage of electronic locks are solved, and efficient quality assessment and automated labeling are realized.
Patent Information
- Application Number
- CN202511497447.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies for testing electronic locks suffer from low efficiency and incomplete testing coverage, relying on manual operation and single-function instruments, resulting in problems of low testing efficiency and incomplete coverage.
An automated testing system is adopted, which achieves self-testing, power supply, short circuit protection, serial communication and signal logic testing through the collaborative work of test fixtures and electronic lock control system. Real-time current monitoring is carried out using MOSFETs and operational amplifiers. Combined with hardware protection circuits and microcontroller control, multi-dimensional testing is carried out to ensure product quality.
It enables comprehensive performance verification under simulated real-world working conditions, improving testing efficiency and coverage, ensuring accurate product quality assessment and automated labeling, and reducing errors caused by human intervention.
Smart Images

Figure CN121657631A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automated testing technology, and in particular to an automated testing method, system, device, electronic device, and readable storage medium. Background Technology
[0002] As a core component of the vehicle's safety system, the performance and reliability of steering locks directly affect driving safety and anti-theft effectiveness. In modern mass production systems, achieving rapid and comprehensive testing of their electrical characteristics, mechanical movements, and logical functions is a crucial step in ensuring product quality and controlling production pace.
[0003] Currently, the industry's common testing methods mainly rely on a combination of manual visual inspection and single-function instruments. Operators need to use tools such as multimeters to manually measure circuit continuity and resistance values, and observe whether the mechanical action of the locking tongue is in place through manual triggering. Although some semi-automated solutions have introduced independent testing modules, the testing process still requires manual switching and intervention, and the test results are also recorded manually. In essence, it has not yet broken away from the human-dominated operation mode.
[0004] Therefore, the current testing efficiency of electronic locks is low, and the testing scope is not comprehensive. Summary of the Invention
[0005] In view of this, embodiments of this application provide an automatic testing method, system, device, electronic device, and readable storage medium to solve the problems of low testing efficiency and incomplete testing coverage of electronic locks in the prior art.
[0006] A first aspect of this application provides an automatic testing method applied to an automated testing system. The automated testing system includes a test fixture and an electronic lock control system, comprising: The control test fixture performs a self-test and sends a power supply command to the electronic lock control system after the self-test passes. The electronic lock control system responds to a power supply command by turning on the first MOSFET of the electronic lock control system to establish a power supply circuit. In the power supply state, the current of the power supply circuit is monitored and compared by sampling resistor and operational amplifier. When an overcurrent occurs, the hardware protection path composed of self-locking circuit and second MOSFET is triggered to cut off the power. The microcontroller of the electronic lock control system controls the third MOSFET to reset the self-locking circuit and obtain the short circuit test result. The test fixture sends a version query command to the electronic lock control system via serial port and receives a reply message. It compares the software and hardware version number in the reply message with the standard version number to obtain the serial communication test result. The control test fixture sequentially applies predefined input signals and control commands under various conditions to the electronic lock control system, and verifies whether the electronic lock control system generates preset response information under each condition, thereby obtaining the signal logic test results; If the short-circuit test results, serial communication test results, and signal logic test results all meet the test pass conditions, the electronic lock control system is deemed to have passed the test, and a test pass message is output.
[0007] A second aspect of this application provides an automatic testing apparatus applied to an automated testing system. The automated testing system includes a testing fixture and an electronic lock control system, comprising: The first control module is used to control the test fixture to perform self-test, and after the self-test is passed, it sends a power supply command to the electronic lock control system. The second control module is used to control the electronic lock control system to respond to the power supply command and control the first MOS transistor of the electronic lock control system to turn on to establish a power supply circuit. The short-circuit test module is used to monitor and compare the current of the power supply circuit through a sampling resistor and an operational amplifier when the power supply is powered on. When an overcurrent occurs, it triggers the hardware protection path composed of a self-locking circuit and a second MOSFET to cut off the power. The microcontroller of the electronic lock control system controls the third MOSFET to reset the self-locking circuit and obtain the short-circuit test result. The serial communication test module is used to test whether the tooling sends a version query command to the electronic lock control system through the serial port, receives the reply message, compares the software and hardware version number in the reply message with the standard version number, and obtains the serial communication test result. The signal logic test module is used to control the test fixture to apply predefined input signals and control commands under various conditions to the electronic lock control system in sequence, and to verify whether the electronic lock control system generates preset response information under each condition, so as to obtain the signal logic test results. The test result output module is used to determine that the electronic lock control system has passed the test and output the test pass information if the short circuit test result, serial communication test result, and signal logic test result all meet the test pass conditions.
[0008] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.
[0009] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0010] The beneficial effects of this application embodiment compared with the prior art are as follows: The reliability of the test environment is ensured through self-testing of the test fixture. After passing the self-test, a power supply command is sent to the electronic lock control system, controlling the electronic lock control system to respond to the power supply command and control the first MOSFET of the electronic lock control system to conduct to establish a power supply circuit, so that subsequent test steps can be performed under power supply conditions. In the short-circuit protection test, a sampling resistor and operational amplifier are used to achieve real-time current monitoring. Combined with a hardware protection path composed of a self-locking circuit and a MOSFET, a rapid response of overcurrent protection is ensured. At the same time, the microcontroller controls the third MOSFET to complete the reset operation, forming a complete short-circuit protection test. Serial communication testing achieves automatic comparison of software and hardware version numbers through message interaction, ensuring product configuration consistency. Signal logic testing verifies the system's functional logic and safety interlocking mechanism by simulating input signals and control commands under various working conditions. Finally, based on the comprehensive judgment of multi-dimensional test results, accurate evaluation and automated marking of product quality are achieved. Thus, by constructing a complete automated testing process, comprehensive performance verification of various performance indicators of the electronic lock control system under simulated real working conditions is achieved, improving testing efficiency and testing coverage. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art 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.
[0012] Figure 1 This is a flowchart illustrating an automatic testing method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of an automatic testing method provided in an embodiment of this application; Figure 3 This is a flowchart illustrating a signal logic testing method provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0013] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0014] The technical terms used in the embodiments of this application are explained below: Test fixtures: Automated test equipment designed for product testing, including components such as controllers, signal generators, and human-machine interfaces. Their core functions are to simulate various input signals, execute test sequences, collect response data, and determine test results, thereby achieving automated inspection of the object under test.
[0015] Electronic lock control system: A vehicle electronic lock control unit with a microcontroller as its core, including modules for power management, motor drive, signal acquisition, and communication interface. This system is responsible for receiving various control commands, driving the bolt actuator, and providing real-time feedback on the system status.
[0016] Metal-Oxide-Semiconductor Field-Effect Transistor (MOSFET) is often simply referred to as a MOS transistor in modern electronic circuits.
[0017] Power supply circuit: The power supply path is controlled by the first MOSFET as an electronic switch. When the MOSFET is turned on, electrical energy flows to the load through the sampling resistor to establish the operating voltage; this circuit is the basic carrier for realizing power management and overcurrent protection.
[0018] Sampling resistor: Connected in series in the power supply circuit, it uses Ohm's law to convert the circuit current into a measurable voltage signal. This voltage signal is sent to the subsequent comparison circuit and is a key sensing element for current monitoring.
[0019] Operational amplifier: Configured to operate in voltage comparator mode, it compares the voltage across the sampling resistor with a precise reference voltage in real time. It immediately outputs a high level when the sampled voltage exceeds the reference, providing a fast response signal.
[0020] Hardware protection path: An independent protection path consisting of a self-locking circuit and a second MOSFET. The protection logic is implemented through hardware circuitry, independent of software programs, ensuring rapid power cut-off in the event of a microprocessor failure, with a response time in the microsecond range.
[0021] Self-locking circuit: A holding circuit with a trigger structure, which maintains the protection state once triggered until a clear reset signal is received, preventing repeated switching on and off under intermittent fault conditions.
[0022] Dynamic short-circuit protection algorithm: A test strategy that cyclically executes "trigger-reset" operations under software control. By counting the number of successful triggers within a specific time window and measuring the response time of each trigger, a quantitative evaluation of the protection circuit's performance and stability can be achieved.
[0023] Serial communication: An asynchronous serial communication protocol is used, employing a fixed baud rate, data bit, and parity bit format. The test fixture and electronic lock control system exchange information by sending and receiving data frames conforming to a predetermined format.
[0024] Position sensor: Installed at key locations along the bolt's movement trajectory. When the bolt reaches a specific position, the sensor outputs a corresponding level signal, providing direct feedback to verify the bolt's status.
[0025] Signal logic testing: By combining different input conditions, the system's response under various operating conditions is verified to ensure it conforms to preset safety logic. Particular emphasis is placed on testing the handling of mutual exclusion conditions, such as the prohibition of locking while driving, which is a crucial safety feature.
[0026] Defective Product Sorting Device: An automated actuator linked to the testing system, which can be a pneumatic push rod, a robotic arm, or a conveyor belt diversion device. When the system determines that a product is defective, it automatically separates it and guides it to a specific area, achieving full automation of the production line.
[0027] An automatic testing method and apparatus according to embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0028] Figure 1 This is a flowchart illustrating an automatic testing method provided in an embodiment of this application. Figure 1 Automated testing methods can be executed by automated testing systems. For example... Figure 1 As shown, the automated testing method includes: Step S101: Control the test fixture to perform a self-test, and after the self-test passes, send a power supply command to the electronic lock control system; The control test fixture executes a self-test process to functionally verify its power supply voltage, button circuit, and indicator light circuit. The preset self-test program ensures the normal operation of the test equipment, eliminates misjudgments caused by equipment malfunctions, and establishes a reliable testing foundation for all subsequent test items.
[0029] Step S102: In response to the power supply command, the electronic lock control system controls the first MOSFET of the electronic lock control system to turn on to establish a power supply circuit; After passing the self-test, the test fixture sends a power supply command to the electronic lock control system. Upon receiving the command, the microcontroller on the main control board of the electronic lock control system drives the first MOSFET to conduct, thereby establishing a complete power supply circuit to power the various modules inside the system.
[0030] By using MOSFETs as electronic switches, precise control of a high-current power supply circuit under low-power control signals is achieved. This enables controllable power-on during the testing process, providing a prerequisite for subsequent dynamic testing projects and avoiding the potential impact risks of uncontrolled power-on.
[0031] Step S103: In the power supply state, the current of the power supply circuit is monitored and compared by the sampling resistor and the operational amplifier. When an overcurrent occurs, the hardware protection path composed of the self-locking circuit and the second MOSFET is triggered to cut off the power. The microcontroller of the electronic lock control system controls the third MOSFET to reset the self-locking circuit and obtain the short circuit test result. Among them, a MOSFET is a voltage-controlled semiconductor device that uses the electric field effect to control current, and has advantages such as high input impedance, low drive power, and fast switching speed. In the embodiments of this application, the first MOSFET, as the main power switch, is controlled by the microcontroller signal and is responsible for connecting or disconnecting the power supply circuit of the entire system. Its on-resistance affects the system power consumption, and its switching speed affects the power supply response time. The second MOSFET is integrated into the hardware protection path as a protection execution switch. It is directly driven by the self-locking circuit, and once the overcurrent signal is confirmed, the power supply is immediately cut off at the hardware level. Its response speed is the key to ensuring system safety. The third MOSFET, as a reset control switch, is controlled by a dedicated pin of the microcontroller. It clears its protection state by applying a reset signal to the self-locking circuit, which is the key to the entire protection circuit being able to return to standby and perform cyclic testing. These three MOSFETs work together to realize an intelligent power control system that integrates power management, fast hardware protection, and software-controllable reset.
[0032] After the power supply loop is established, the system performs a short-circuit protection test. This test converts the loop current into a voltage signal using a precision sampling resistor connected in series in the power supply loop. This voltage signal is then fed into the non-inverting input of an operational amplifier and compared with a reference voltage connected to the inverting input. When the loop current exceeds a set threshold, the operational amplifier outputs a high level, triggering a hardware protection path consisting of a self-locking circuit and a second MOSFET, rapidly cutting off the power supply to achieve power-off protection. Subsequently, the microcontroller controls the third MOSFET via its dedicated short-circuit control pin to reset the self-locking circuit, preparing for the next test. The short-circuit test result is obtained by recording the number of times the "trigger-reset" cycle is successfully completed within a specific time window.
[0033] The hardware comparison circuit ensures the real-time performance of the protection, the self-locking circuit maintains the state, and the software retry mechanism distinguishes between transient anomalies and permanent faults. This provides a dynamic and reliable method for verifying short-circuit protection capabilities, which not only verifies the presence of protection functions but also assesses its stability and reliability during continuous operation, thereby significantly improving the product's safety level.
[0034] Step S104: The control test fixture sends a version query command to the electronic lock control system through the serial port and receives the reply message. It compares whether the software and hardware version number in the reply message is consistent with the standard version number to obtain the serial communication test result. Simultaneously, the system performs serial communication tests in parallel. The test fixture sends a formatted version query command message to the electronic lock control system via the serial port. Upon receiving the command, the microcontroller of the electronic lock control system reads the pre-stored hardware and software version number from its memory, frames the data according to the agreed communication protocol, and replies via the serial port. The test fixture parses the received reply message, extracts the version number information from the specified data segment, and compares it with the standard version number pre-stored in the fixture to obtain the serial communication test result.
[0035] A serial communication protocol is used to achieve data exchange between devices, and the consistency of product configurations is verified by data comparison. Automated verification of product hardware and software versions is implemented, ensuring the correctness and consistency of factory-delivered product configurations and effectively avoiding field failures caused by version mismatches.
[0036] Step S105: The control test fixture sequentially applies predefined input signals and control commands under various conditions to the electronic lock control system, and verifies whether the electronic lock control system generates preset response information under each condition, and obtains the signal logic test results; The test fixture simulates real vehicle operating conditions, sequentially applying a series of predefined input signals and control command combinations to the electronic lock control system. First, a high-level ignition signal is simulated to verify whether the system correctly returns a status and whether the latch remains stationary. Second, normal lock and unlock commands are sent, and feedback from the position sensors within the electronic lock control system verifies whether the latch moves accurately and into position. Finally, while maintaining a high-level ignition signal, a lock command is sent again to verify whether the system refuses to execute the lock action due to safety logic mutual exclusion, ensuring the latch remains stationary.
[0037] By constructing various typical and critical operating scenarios, the signal processing capabilities and actuator driving capabilities of the control system were comprehensively tested. This achieved closed-loop verification of the product's functional integrity and safety reliability under simulated real-world usage environments, particularly verifying key safety logic such as "automatic door locking during driving," significantly improving the test coverage and practical value.
[0038] Step S106: If the short-circuit test result, serial communication test result, and signal logic test result all meet the test pass conditions, the electronic lock control system is determined to be qualified and the test pass information is output.
[0039] After all tests are completed, the system comprehensively evaluates the short-circuit test results, serial communication test results, and signal logic test results. Only when all results meet the test pass conditions is the electronic lock control system finally deemed qualified. For qualified products, the test fixture outputs test pass information, typically manifested by the green indicator light illuminating, the buzzer emitting a single beep, and automatically triggering the marking machine to mark the qualified product, thus achieving closed-loop output and automated processing of test results.
[0040] Based on preset logical rules, multi-dimensional test data is fused and used to make decisions, driving the actuators to complete physical operations. This directly translates test results into production actions, significantly improving production efficiency and completely eliminating errors that might be introduced by human intervention, ensuring the objectivity and consistency of product quality assessment.
[0041] In the embodiments of this application, the reliability of the test environment is ensured through self-testing of the test fixture. After the self-test passes, a power supply command is sent to the electronic lock control system. The electronic lock control system responds to the power supply command by turning on the first MOSFET to establish a power supply circuit, enabling subsequent testing under power supply conditions. In the short-circuit protection test, a sampling resistor and operational amplifier are used to achieve real-time current monitoring. Combined with a hardware protection path composed of a self-locking circuit and a MOSFET, a rapid response to overcurrent protection is ensured. Simultaneously, a microcontroller controls the third MOSFET to complete the reset operation, forming a complete short-circuit protection test. Serial communication testing achieves automatic comparison of software and hardware version numbers through message interaction, ensuring product configuration consistency. Signal logic testing verifies the system's functional logic and safety interlocking mechanism by simulating input signals and control commands under various operating conditions. Finally, based on the comprehensive judgment of multi-dimensional test results, accurate evaluation and automated marking of product quality are achieved. Thus, by constructing a complete automated testing process, comprehensive performance verification of various performance indicators of the electronic lock control system under simulated real operating conditions is achieved, improving testing efficiency and test coverage.
[0042] In some embodiments, the operation of triggering the hardware protection path and resetting the self-locking circuit is executed cyclically within a single test cycle; Record the response time required from triggering the hardware protection path to successfully completing the self-locking circuit reset in each loop; If the number of successful triggers reaches the preset threshold within the time window, and all response times are shorter than the preset qualified response time, then the short circuit test result is determined to meet the test pass conditions. If the number of successful triggers within the time window does not reach the preset threshold, or if any response time exceeds the acceptable response time, the short-circuit test result is deemed unsatisfactory. Within a single test cycle, when the power supply circuit current exceeds the set threshold, the operational amplifier outputs a high level, triggering a hardware protection path consisting of a self-locking circuit and a second MOSFET to achieve rapid power-off. Subsequently, the microcontroller controls the third MOSFET via the short-circuit control pin to reset the self-locking circuit, completing one full test cycle.
[0043] During this process, the system accurately records the response time required from the triggering of the hardware protection path to the successful completion of the self-locking circuit reset in each loop. Utilizing the high-precision timer inside the microcontroller, timing starts when the hardware protection path is triggered and stops when the self-locking circuit reset signal is confirmed, thus obtaining accurate system response time data.
[0044] If the number of successful triggers reaches the preset threshold within the preset time window, and the response time in all loops is shorter than the preset acceptable response time, then the short-circuit test result is deemed to meet the test pass conditions. Conversely, if the number of successful triggers within the time window does not reach the preset threshold, or the response time of any loop exceeds the acceptable response time, then it is deemed abnormal. The number of triggers thresholds verifies the continuous reliability of the protection function, while the response time threshold ensures that the protection speed meets safety requirements.
[0045] By introducing response time as a key performance indicator, products that possess protection functions but fail to meet response speed standards can be more effectively screened out, thereby further improving product safety and reliability. Dynamic performance evaluation of the short-circuit protection function of the electronic lock control system was achieved, not only verifying whether the protection function was present, but more importantly, quantitatively evaluating the response speed and operational stability of the protection system.
[0046] In some embodiments, the time window is 10 seconds and the preset number of times threshold is 3.
[0047] This time window is precisely controlled by a timer inside the test fixture. The timer starts when the short-circuit protection test begins and automatically ends the test cycle after 10 seconds. Within this time window, the system needs to successfully complete at least three complete "trigger-reset" cycles, that is, the complete process from the moment the current overload triggers the hardware protection path to the moment the microcontroller controls the third MOSFET to complete the self-locking circuit reset.
[0048] The 10-second time window design fully considers the difference between transient interference and permanent faults, effectively capturing continuous fault phenomena. The three-times threshold ensures the statistical significance of the test; three consecutive reliable triggers and resets within the limited time fully demonstrate the protection system's continuous and stable operating capability. Furthermore, combining response time requirements with cycle count requirements constitutes a comprehensive evaluation system for the protection system's performance.
[0049] By quantifying time windows and frequency thresholds, a standardized and repeatable test benchmark was established, elevating short-circuit protection testing from qualitative verification to quantitative evaluation. This approach balances test reliability with efficiency, effectively distinguishing between intermittent anomalies and systemic failures. This parameterized testing method improves the consistency and comparability of product testing.
[0050] In some embodiments, step S105 includes: Step S201: Control the test fixture to simulate a high-level ignition signal and send it to the electronic lock control system to verify whether the electronic lock control system returns a status signal indicating that the ignition signal has been received, and simultaneously verify whether its lock tongue remains stationary. Step S202: Control the test fixture to send locking and unlocking commands, and verify whether the bolt moves to the locking and unlocking positions accordingly through the position sensor of the electronic lock control system. Step S203: While maintaining a high-level ignition signal, the control test fixture sends a locking command again to verify whether the locking tongue refuses to perform the locking action and remains stationary due to safety logic mutual exclusion, and obtains the signal logic test results.
[0051] This test comprehensively verifies the functional integrity and reliability of the electronic lock control system by simulating various operating conditions in actual vehicle use. First, the test fixture simulates a vehicle ignition signal, applying a high-level IGN signal to the electronic lock control system. At this point, the system needs to complete two verifications: first, verifying via serial communication whether the system returns the correct status signal, confirming its accurate perception of the input signal; second, verifying via a position sensor that monitors the latch state in real time, confirming whether it remains completely stationary. This verifies the system's basic response characteristics upon receiving the vehicle ignition signal, ensuring the system can correctly identify the signal and will not produce malfunctions, thus validating the accuracy of the electronic lock control system's input detection circuit and the stability of the system in standby mode.
[0052] The test fixture sequentially sends locking and unlocking commands to the electronic lock control system. During this process, the system monitors the movement trajectory and final position of the bolt in real time using built-in position sensors. When a locking command is received, the system verifies whether the bolt has accurately moved to the locked position and whether this is confirmed by the position sensor. Similarly, when an unlocking command is received, the system verifies whether the bolt has fully retracted to the unlocked position. By using position sensors to form a closed-loop feedback system, the accuracy and reliability of the actuator are evaluated by monitoring the matching degree between the actual position of the bolt and the position required by the command in real time. This ensures the accuracy of the execution of the electronic lock's basic functions and lays the foundation for subsequent security logic testing.
[0053] While maintaining a high-level ignition signal, the test fixture sends a locking command to the electronic lock control system again. At this point, the system needs to verify whether the latch refuses to perform the locking action and remains stationary due to safety logic mutual exclusion. Based on the safety design specifications of the electronic lock control system, when a high-level ignition signal is detected, the system should automatically block all locking commands to prevent safety hazards caused by accidental locking during driving. This verifies the reliability of the product's core safety logic and fully demonstrates the safety and intelligence of the product design.
[0054] The performance of the electronic lock control system under various operating conditions was comprehensively evaluated to ensure that it has both reliable functionality and comprehensive security capabilities in actual use.
[0055] In some embodiments, the step of obtaining the serial communication test result by comparing whether the software and hardware version number in the comparison reply message is consistent with the standard version number may specifically include the following steps: Extract the test version number from the specified data segment of the reply message according to the predefined data format and offset address; The test version number is compared one by one with the standard version number in the test fixture. If the reply message format is incorrect, the data segment is missing, or the version number is inconsistent, the serial communication test result is determined to be unsatisfactory. If the test version number and the standard version number are exactly the same, the serial communication test result is determined to meet the test pass conditions.
[0056] In serial communication testing, when the test fixture receives a reply message from the electronic lock control system, it first initiates the message parsing process. Following a predefined communication protocol, it extracts the hardware version number and software version number fields from the specified data segment of the message, based on preset offset addresses and data structures. Utilizing a standardized communication protocol framework, precise byte positioning and data type parsing ensure accurate and reliable extraction of the required information from the data stream.
[0057] The test fixture extracts the hardware and software version numbers and compares them one by one with a standard version number benchmark. This comparison process uses a byte-level precise matching algorithm to ensure that every character and every number is completely consistent. By establishing a standardized version benchmark library, automated comparison between production versions and design benchmarks is achieved.
[0058] During the parsing and comparison process, the system simultaneously detects various anomalies: if the frame header, frame trailer, or checksum of the reply message does not conform to the predefined format, it is recorded as a message format error; if valid data cannot be found at the specified offset address, it is recorded as a missing data segment; if the version number exists but does not match the standard value, it is recorded as a version inconsistency. Based on this multi-verification strategy, it not only focuses on the final content consistency but also comprehensively verifies the integrity of the communication process and the correctness of the data structure.
[0059] Standardized version extraction and precise comparison ensure absolute consistency in the hardware and software configurations of products leaving the factory, effectively preventing on-site failures caused by version mismatches. Simultaneously, the anomaly handling mechanism, capable of diagnosing error types, not only determines product conformity but also accurately pinpoints the specific reasons for non-conformity, providing precise data support for rapid problem identification and process improvement on the production line.
[0060] In some embodiments, outputting test pass information specifically includes: controlling the green indicator light to illuminate, controlling the buzzer to emit a single beep, and triggering the marking machine to mark the qualified product.
[0061] Once the electronic lock control system passes all tests, the testing fixture will initiate a multimodal pass / fail indication process: first, it will control the green indicator light to illuminate, providing an intuitive visual confirmation signal; at the same time, it will control the buzzer to emit a single beep lasting 0.5 seconds, forming a clear auditory confirmation; and simultaneously trigger the marking machine drive circuit to permanently mark the qualified product at the designated location.
[0062] Based on the multi-output control capability of the test fixture's main controller, the indicator circuit, audio circuit, and actuator are driven simultaneously through parallel processing to ensure the synchronous execution of various output commands. Specifically, the green indicator light is driven by a constant current source circuit to ensure stable illumination, the buzzer is driven by PWM modulation to ensure consistent tone, and the marking machine trigger uses an opto-isolation circuit to achieve strong and weak current isolation.
[0063] A complete closed-loop feedback mechanism for test results was established. Through triple verification of visual, auditory, and physical markings, clear status indicators were provided to operators, and automatic identification of qualified products was achieved, effectively avoiding errors that might occur due to manual judgment. This multi-channel collaborative output method significantly improved the automation and reliability of the testing process, ensuring that each qualified product has a traceable physical mark, and providing complete technical support for product quality management.
[0064] In some embodiments, if any one of the short-circuit test results, serial communication test results, and signal logic test results fails to meet the test pass condition, the electronic lock control system is determined to be unqualified, and a test failure message is output. The output test failure message includes at least one of the following: The system controls the red indicator light to illuminate, controls the buzzer to emit a warning sound, and generates a sorting control signal to drive the defective product sorting device to perform sorting actions.
[0065] If any of the test results in the short-circuit test, serial communication test, or signal logic test fails to meet the pass criteria, the system immediately determines that the electronic lock control system has failed the test and initiates the corresponding exception handling procedure. First, the test fixture will control the red indicator light to illuminate, providing a conspicuous visual alarm signal; at the same time, it will control the buzzer to emit a warning sound at specific intervals, forming a unique audible alarm mode; more importantly, the system will immediately generate a sorting control signal, which will drive the defective product sorting device to perform sorting actions through the isolated output circuit.
[0066] The system utilizes a real-time decision-making and multi-channel collaborative control mechanism based on the testing fixture. When any test item fails, the fixture's main controller immediately interrupts the normal testing process, outputting a high-level signal to drive a red LED indicator circuit. Simultaneously, a timer precisely controls the buzzer's frequency and interval to ensure standardized alarm signal output. The sorting control signal is generated using relay-isolated output. Once a test failure signal is confirmed, the fixture's main controller sends a 500ms pulse signal to the sorting device, triggering the sorting actuator to transfer defective products to a dedicated isolation area.
[0067] The combination of a red indicator light and three beeping alarms provides operators with clear criteria for identifying defective products, while the introduction of an automated sorting mechanism enables real-time separation of defective and qualified products, effectively preventing the risk of mixing. Simultaneously, by directly translating test results into physical sorting actions, human intervention is significantly reduced, improving overall production efficiency and product quality consistency.
[0068] Based on such Figure 1 The automated testing method shown in this application also provides an automated testing system, as detailed below. Figure 2 As shown, the automated testing system includes test fixtures and an electronic lock control system, as detailed below: The main control board of the electronic lock control system includes a microcontroller, a first MOSFET controlled by the microcontroller to switch the power supply circuit on and off, a sampling resistor for current sampling, an operational amplifier for voltage comparison, a hardware protection path consisting of a self-locking circuit and a second MOSFET, and a third MOSFET controlled by the microcontroller to reset the self-locking circuit. The test fixture includes a controller for sending commands and analog signals, and an indicator device for enabling human-machine interaction; The test fixture communicates with the electronic lock control system via a serial port. The automated test system consists of two main parts: the test fixture and the electronic lock control system, which establish a stable communication connection through the serial port. In the main control board of the electronic lock control system, a microcontroller serves as the core of the entire system, responsible for executing test commands, processing sensor data, and managing power control logic. The main control board integrates a complete power management unit, where the first MOSFET acts as the main power switch, directly controlled by the microcontroller, responsible for the on / off operation of the power supply circuit; the sampling resistor can be a 40mΩ precision resistor, connected in series in the power supply circuit for current signal acquisition; and the operational amplifier forms a voltage comparison circuit, comparing the voltage drop across the sampling resistor with a reference voltage in real time, providing a basis for overcurrent protection judgment.
[0069] The hardware protection path includes a latching circuit and a second MOSFET, forming an independent fast protection channel. When the operational amplifier detects an overcurrent condition, it immediately triggers the latching circuit and drives the second MOSFET to cut off the power supply. This hardware-level protection mechanism ensures system safety when the microprocessor cannot respond. Simultaneously, the system also includes a reset control channel. Controlled by the microcontroller via a third MOSFET, the latching circuit can be reset to restore the system to normal operating status.
[0070] The test fixture includes a high-performance controller and a complete human-machine interface (HMI). The controller generates various test commands and simulated signals, including ignition signal simulation, version query command transmission, and coordinated control of the test process. The HMI includes color indicator lights, a buzzer, and a display screen, providing operators with intuitive test status feedback. A serial port establishes a communication link between the test fixture and the electronic lock control system, used not only to transmit test commands and version information but also to synchronize test status and exchange data. Precise hardware circuit design ensures the safety of the testing process, while a flexible controller architecture enables configurability of the test process. This fully leverages the speed of hardware protection and the flexibility of software control, simulating real-world working conditions and executing rigorous pass / fail judgments, thus guaranteeing the quality verification of the electronic lock control system.
[0071] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0072] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0073] Figure 3 This is a schematic diagram of an automatic testing device provided in an embodiment of this application. Figure 3 As shown, the automatic testing device includes: The first control module 301 is used to control the test fixture to perform self-test, and after the self-test is passed, it sends a power supply command to the electronic lock control system. The second control module 302 is used to control the electronic lock control system to respond to the power supply command and control the first MOS transistor of the electronic lock control system to be turned on to establish a power supply circuit. The short-circuit test module 303 is used to monitor and compare the current of the power supply circuit through the sampling resistor and the operational amplifier when the power supply is powered on. When an overcurrent occurs, it triggers the hardware protection path composed of the self-locking circuit and the second MOSFET to cut off the power. The microcontroller of the electronic lock control system controls the third MOSFET to reset the self-locking circuit and obtain the short-circuit test result. The serial communication test module 304 is used to control the test fixture to send a version query command to the electronic lock control system through the serial port, and receive the reply message. It compares whether the software and hardware version number in the reply message is consistent with the standard version number to obtain the serial communication test result. The signal logic test module 305 is used to control the test fixture to sequentially apply predefined input signals and control commands under various conditions to the electronic lock control system, and to verify whether the electronic lock control system generates preset response information under each condition, thereby obtaining the signal logic test results. The test result output module 306 is used to determine that the electronic lock control system has passed the test and output the test pass information when the short circuit test result, serial communication test result and signal logic test result all meet the test pass conditions.
[0074] According to the technical solution provided in this application, the reliability of the test environment is ensured through self-testing of the test fixture. After the self-test passes, a power supply command is sent to the electronic lock control system. The electronic lock control system responds to the power supply command by turning on the first MOSFET to establish a power supply circuit, enabling subsequent testing under power supply conditions. In the short-circuit protection test, a sampling resistor and operational amplifier are used to achieve real-time current monitoring. Combined with a hardware protection path composed of a self-locking circuit and a MOSFET, a rapid response to overcurrent protection is ensured. Simultaneously, a microcontroller controls the third MOSFET to complete the reset operation, forming a complete short-circuit protection test. Serial communication testing achieves automatic comparison of software and hardware version numbers through message interaction, ensuring product configuration consistency. Signal logic testing verifies the system's functional logic and safety interlocking mechanism by simulating input signals and control commands under various operating conditions. Finally, based on the comprehensive judgment of multi-dimensional test results, accurate evaluation and automated marking of product quality are achieved. Thus, by constructing a complete automated testing process, comprehensive performance verification of various performance indicators of the electronic lock control system under simulated real operating conditions is realized, improving testing efficiency and test coverage.
[0075] In some embodiments, the short-circuit test module 303 is specifically used for: Within a single test cycle, the operation of triggering the hardware protection path and resetting the self-locking circuit is executed cyclically. Record the response time required from triggering the hardware protection path to successfully completing the self-locking circuit reset in each loop; If the number of successful triggers reaches the preset threshold within the time window, and all response times are shorter than the preset qualified response time, then the short circuit test result is determined to meet the test pass conditions. If the number of successful triggers within the time window does not reach the preset threshold, or if any response time exceeds the acceptable response time, the short circuit test result is determined to not meet the test pass conditions.
[0076] In some embodiments, the time window is 10 seconds and the preset number of times threshold is 3.
[0077] In some embodiments, the signal logic test module 305 is specifically used for: The control test fixture sequentially applies predefined input signals and control commands under various conditions to the electronic lock control system, and verifies whether the electronic lock control system generates preset response information under each condition, obtaining signal logic test results, including: The control test fixture simulates a high-level ignition signal and sends it to the electronic lock control system to verify whether the electronic lock control system sends back a status signal indicating that it has received the ignition signal, and simultaneously verifies whether its lock tongue remains stationary. The control test fixture sends locking and unlocking commands, and verifies whether the bolt moves to the corresponding locking and unlocking positions through the position sensor of the electronic lock control system. While maintaining a high-level ignition signal, the control test fixture sends a locking command again to verify whether the latch refuses to perform the locking action and remains stationary due to safety logic mutual exclusion, thus obtaining the signal logic test results.
[0078] In some embodiments, the serial communication test module 304 is specifically used for: Extract the test version number from the specified data segment of the reply message according to the predefined data format and offset address; The test version number is compared one by one with the standard version number in the test fixture. If the reply message format is incorrect, the data segment is missing, or the version number is inconsistent, the serial communication test result is determined to be unsatisfactory. If the test version number and the standard version number are exactly the same, the serial communication test result is determined to meet the test pass conditions.
[0079] In some embodiments, the test result output module 306 is further configured to determine that the electronic lock control system test is unqualified and output test failure information if any one of the short-circuit test result, serial communication test result, and signal logic test result fails to meet the test pass condition. Test result output module 306 is specifically used for: The system controls the red indicator light to illuminate, controls the buzzer to emit a warning sound, and generates a sorting control signal to drive the defective product sorting device to perform sorting actions.
[0080] In some embodiments, an automated testing system includes a test fixture and an electronic lock control system, characterized in that the main control board of the electronic lock control system includes a microcontroller as the control core, a first MOSFET controlled by the microcontroller to switch the power supply circuit on and off, a sampling resistor for current sampling, an operational amplifier for voltage comparison, a hardware protection path composed of a self-locking circuit and a second MOSFET, and a third MOSFET controlled by the microcontroller to reset the self-locking circuit. The test fixture includes a controller for sending commands and analog signals, and an indicator device for enabling human-machine interaction; The test fixture communicates with the electronic lock control system via a serial port.
[0081] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0082] Figure 4This is a schematic diagram of the electronic device 6 provided in an embodiment of this application. Figure 4 As shown, the electronic device 6 of this embodiment includes a processor 601, a memory 602, and a computer program 603 stored in the memory 602 and executable on the processor 601. When the processor 601 executes the computer program 603, it implements the steps in the various method embodiments described above. Alternatively, when the processor 601 executes the computer program 603, it implements the functions of each module / unit in the various device embodiments described above.
[0083] Electronic device 6 can be a desktop computer, laptop, handheld computer, cloud server, or other electronic device. Electronic device 6 may include, but is not limited to, processor 601 and memory 602. Those skilled in the art will understand that... Figure 4 This is merely an example of electronic device 6 and does not constitute a limitation on electronic device 6. It may include more or fewer components than shown, or different components.
[0084] The processor 601 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0085] The memory 602 can be an internal storage unit of the electronic device 6, such as a hard disk or RAM of the electronic device 6. The memory 602 can also be an external storage device of the electronic device 6, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc., equipped on the electronic device 6. The memory 602 can also include both internal and external storage units of the electronic device 6. The memory 602 is used to store computer programs and other programs and data required by the electronic device.
[0086] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0087] If an integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program may include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in a computer-readable medium can be appropriately added to or subtracted according to the requirements of legislation and patent practice in a jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0088] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. An automatic testing method applied to an automated testing system, the automated testing system comprising test fixtures and an electronic lock control system, characterized in that, include: The test fixture is controlled to perform a self-test, and after the self-test passes, a power supply command is sent to the electronic lock control system. The electronic lock control system responds to the power supply command by turning on the first MOS transistor of the electronic lock control system to establish a power supply circuit. In the power supply state, the current of the power supply circuit is monitored and compared by sampling resistor and operational amplifier. When an overcurrent occurs, the hardware protection path composed of self-locking circuit and second MOSFET is triggered to cut off the power. The microcontroller of the electronic lock control system controls the third MOSFET to reset the self-locking circuit and obtain the short circuit test result. The test fixture is controlled to send a version query command to the electronic lock control system via a serial port and receive a reply message. The software and hardware version number in the reply message is compared with the standard version number to obtain the serial communication test result. The test fixture is controlled to sequentially apply predefined input signals and control commands under various conditions to the electronic lock control system, and the electronic lock control system is verified to generate preset response information under each condition, thereby obtaining the signal logic test results; If the short-circuit test results, serial communication test results, and signal logic test results all meet the test pass conditions, the electronic lock control system is determined to be qualified and the test pass information is output.
2. The method according to claim 1, characterized in that, The method further includes: Within a single test cycle, the operation of triggering the hardware protection path and resetting the self-locking circuit is executed cyclically. Record the response time required from triggering the hardware protection path to successfully completing the self-locking circuit reset in each loop; If the number of successful triggers reaches a preset threshold within the time window, and all response times are shorter than the preset qualified response time, then the short circuit test result is determined to meet the test pass condition. If the number of successful triggers within the time window does not reach the preset threshold, or if any of the response times exceeds the qualified response time, then the short-circuit test result is determined to not meet the test pass conditions.
3. The method according to claim 2, characterized in that, The time window is 10 seconds, and the preset number of times threshold is 3 times.
4. The method according to claim 1, characterized in that, The test fixture is controlled to sequentially apply predefined input signals and control commands under various conditions to the electronic lock control system, and to verify whether the electronic lock control system generates preset response information under each condition, thereby obtaining signal logic test results, including: The test fixture is controlled to simulate a high-level ignition signal and send it to the electronic lock control system to verify whether the electronic lock control system sends back a status signal indicating that the ignition signal has been received, and to simultaneously verify whether its lock tongue remains stationary. The test fixture is controlled to send locking and unlocking commands, and the position sensor of the electronic lock control system is used to verify whether the bolt moves to the locking and unlocking positions accordingly. The test fixture is controlled to send a locking command again while maintaining the high-level ignition signal, to verify whether the locking tongue refuses to perform the locking action and remains stationary due to safety logic mutual exclusion, and the signal logic test result is obtained.
5. The method according to claim 1, characterized in that, The comparison of the hardware and software version numbers in the response message with the standard version number yields the serial communication test results, including: The test version number is extracted from the specified data segment of the reply message according to the predefined data format and offset address; The test version number is compared one by one with the standard version number in the test fixture. If the reply message format is incorrect, the data segment is missing, or the version number is inconsistent, the serial communication test result is determined to be unsatisfactory. If the test version number and the standard version number are completely identical, then the serial communication test result is determined to meet the test pass conditions.
6. The method according to claim 1, characterized in that, The method further includes: If any one of the short-circuit test results, the serial communication test results, and the signal logic test results fails to meet the test pass conditions, the electronic lock control system is determined to be unqualified, and a test failure message is output. The output test failure message includes at least one of the following: The system controls the red indicator light to illuminate, controls the buzzer to emit a warning sound, and generates a sorting control signal to drive the defective product sorting device to perform sorting actions.
7. An automated testing system for implementing the method of any one of claims 1 to 6, comprising testing fixtures and an electronic lock control system, characterized in that, The main control board of the electronic lock control system includes: a microcontroller, a first MOSFET controlled by the microcontroller to switch the power supply circuit on and off, a sampling resistor for current sampling, an operational amplifier for voltage comparison, a hardware protection path composed of a self-locking circuit and a second MOSFET, and a third MOSFET controlled by the microcontroller to reset the self-locking circuit. The test fixture includes a controller for sending commands and analog signals, and an indicator device for enabling human-computer interaction. The test fixture is connected to the electronic lock control system via a serial port.
8. An automatic testing device, characterized in that, Applied to an automated testing system, the automated testing system includes test fixtures and an electronic lock control system, comprising: The first control module is used to control the test fixture to perform a self-test, and after the self-test is passed, send a power supply command to the electronic lock control system. The second control module is used to control the electronic lock control system to respond to the power supply command and control the first MOS transistor of the electronic lock control system to turn on to establish a power supply circuit. The short-circuit test module is used to monitor and compare the current of the power supply circuit through a sampling resistor and an operational amplifier when the power supply is powered on. When an overcurrent occurs, it triggers the hardware protection path composed of a self-locking circuit and a second MOSFET to cut off the power. The microcontroller of the electronic lock control system controls the third MOSFET to reset the self-locking circuit and obtain the short-circuit test result. The serial communication test module is used to send a version query command to the electronic lock control system through the serial port, receive a reply message, compare the software and hardware version number in the reply message with the standard version number, and obtain the serial communication test result. The signal logic test module is used to control the test fixture to sequentially apply predefined input signals and control commands under various conditions to the electronic lock control system, and to verify whether the electronic lock control system generates preset response information under each condition, thereby obtaining the signal logic test results. The test result output module is used to determine that the electronic lock control system has passed the test and output test pass information when the short circuit test result, serial communication test result and signal logic test result all meet the test pass conditions.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 6.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.