Motor detection method and device and motor detection system
By establishing a sliding window in motor testing and statistically analyzing the percentage of test errors, and dynamically switching testing schemes, the problems of false detection and missed detection in traditional motor component testing methods are solved, achieving efficient and accurate motor testing.
Patent Information
- Application Number
- CN202511382723.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2025-11-14
AI Technical Summary
Traditional motor component testing methods are difficult to adapt to the actual production trends of motor components, which can easily lead to false detections or missed detections, and the testing efficiency is low.
The current testing scheme is used to test the motors. A sliding window is established by acquiring a predetermined number of motor images that continuously arrive at the testing station. The percentage of testing errors is statistically analyzed, and the testing scheme is dynamically switched to adapt to changes in motor type until all motors have been tested.
It reduces the false detection rate of detection errors, improves the accuracy and efficiency of detection, ensures that the detection scheme is dynamically adjusted according to the motor type, and avoids false detection and missed detection.
Smart Images

Figure CN120949043A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of motor component testing technology, and more specifically, to a method, apparatus, computer-readable storage medium, and motor testing system for testing motors. Background Technology
[0002] Currently, motor component inspection systems typically employ traditional 2D vision inspection methods to inspect motors and their components one by one. These methods usually require comprehensive inspection of each motor sample, including all possible component types, resulting in a fixed inspection process and low efficiency. Furthermore, traditional inspection methods struggle to adapt to the trends in the presence or absence of motor components in actual production, easily leading to false positives or false negatives, especially during continuous inspections where the inspection strategy lacks dynamic optimization capabilities. Summary of the Invention
[0003] The main objective of this application is to provide a method, apparatus, computer-readable storage medium, and motor testing system for testing motors, so as to at least solve the problem that traditional testing methods are difficult to adaptively adjust according to the trend of the presence or absence of motor parts in actual production, and are prone to false detection or missed detection.
[0004] To achieve the above objectives, according to one aspect of this application, a method for detecting a motor is provided, comprising: detecting a motor to be detected using a current detection scheme; determining whether the motor to be detected triggers a detection error; the motor to be detected includes motors with target accessories and motors without target accessories; the current detection scheme is a detection scheme for motors with target accessories or a detection scheme for motors without target accessories; the triggering condition for the detection error is that the motor to be detected is not the motor type corresponding to the current detection scheme; acquiring a current sliding window, the current sliding window including images of a predetermined number of motors to be detected arriving at the detection station consecutively; switching the current detection scheme when the proportion of motors to be detected that trigger the detection error in the current sliding window is greater than or equal to a predetermined proportion; updating the current sliding window and determining whether to switch the current detection scheme based on the updated current sliding window when the next motor to be detected arrives at the detection station, until all motors to be detected have been detected.
[0005] Optionally, the current detection scheme is used to detect the motor under test, and it is determined whether the motor under test triggers a detection error, including: triggering a detection error for the motor under test when the current detection scheme is a detection scheme for a motor with the target accessory and the target accessory is not present in the image of the motor under test; and triggering a detection error for the motor under test when the current detection scheme is a detection scheme for a motor without the target accessory and the target accessory is present in the image of the motor under test.
[0006] Optionally, the target accessory is a retaining ring. The method of using the current detection scheme to detect the motor under test and determining whether the motor under test triggers a detection error further includes: triggering a detection error for the motor under test if the current detection scheme detects whether the motor has the retaining ring and the retaining ring is not present in the image of the motor under test; and triggering a detection error for the motor under test if the current detection scheme detects whether the motor does not have the retaining ring and the target accessory is present in the image of the motor under test.
[0007] Optionally, obtaining the current sliding window includes: at the start of detection, initializing the sliding window to clear it; when the motor to be detected arrives at the detection station, acquiring an image of the motor to be detected and adding the image of the motor to be detected to the sliding window until the number of images in the sliding window is equal to the predetermined number, and determining the sliding window as the current sliding window.
[0008] Optionally, if the proportion of motors under test that trigger the detection error in the current sliding window is greater than or equal to a predetermined proportion, the current detection scheme is switched, including: obtaining the number of motors under test that trigger the detection error in the current sliding window to obtain the number of errors; calculating the ratio of the number of errors to the predetermined number to obtain the error proportion; if the error proportion is greater than or equal to the predetermined proportion and the current detection scheme is a detection scheme for motors with the target accessory, switching the current detection scheme to a detection scheme for motors without the target accessory; if the error proportion is greater than or equal to the predetermined proportion and the current detection scheme is a detection scheme for motors without the target accessory, switching the current detection scheme to a detection scheme for motors with the target accessory.
[0009] Optionally, when the next motor to be tested arrives at the testing station, updating the current sliding window includes: acquiring an image of the next motor to be tested when the next motor to be tested arrives at the testing station; adding the image of the next motor to be tested to the current sliding window; and deleting the earliest acquired image of the motor to be tested in the current sliding window.
[0010] Optionally, after all the motors to be tested have been tested, the method further includes: sending images of all the motors to be tested that triggered the detection error to the terminal for secondary testing.
[0011] According to another aspect of this application, a motor testing device is provided, comprising: a determining unit, configured to test a motor under test using a current testing scheme, and determine whether the motor under test triggers a testing error, wherein the motor under test includes a motor with a target accessory and a motor without the target accessory, the current testing scheme is a testing scheme for a motor with the target accessory or a testing scheme for a motor without the target accessory, and the triggering condition for the testing error is that the motor under test is not a motor type corresponding to the current testing scheme; an acquiring unit, configured to acquire a current sliding window, the current sliding window including images of a predetermined number of motors under test that have continuously arrived at the testing station; a switching unit, configured to switch the current testing scheme when the proportion of motors under test that have triggered the testing error in the current sliding window is greater than or equal to a predetermined proportion; and an updating unit, configured to update the current sliding window when the next motor under test arrives at the testing station and determine whether to switch the current testing scheme based on the updated current sliding window, until all motors under test have been tested.
[0012] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform any of the described motor detection methods.
[0013] According to another aspect of this application, a motor detection system is provided, comprising: a camera, one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including methods for performing any of the motor detection methods described above.
[0014] Applying the technical solution of this application, in the above-mentioned motor detection method, since there are two types of motors to be tested: one with target accessories and the other without target accessories, if the current detection scheme uses the detection scheme for motors with target accessories, then the motors to be tested without target accessories will trigger detection errors. Conversely, if the current detection scheme uses the detection scheme for motors without target accessories, then the motors to be tested with target accessories will trigger detection errors. By continuously sending images of a predetermined number of motors to be tested to the detection station, a current sliding window is established. The proportion of motors to be tested that trigger detection errors in the current sliding window is counted. If the proportion is greater than or equal to a predetermined proportion, it indicates that the type of motor being tested has changed, and the current detection scheme is switched. The subsequent detection process continuously updates the current sliding window, so that the current detection scheme dynamically switches according to the type of motor to be tested until all motors to be tested are detected. This prevents a large number of false detection errors caused by a fixed detection scheme, greatly reducing the false detection rate. At the same time, timely switching of the current detection scheme avoids missed detections due to incorrect selection of the detection scheme, thus improving the accuracy of the detection. Attached Figure Description
[0015] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0016] Figure 1 A hardware structure block diagram of a mobile terminal for performing a motor detection method according to an embodiment of this application is shown;
[0017] Figure 2 A schematic flowchart of a method for detecting an electric motor according to an embodiment of this application is shown;
[0018] Figure 3 A schematic diagram of a motor structure according to an embodiment of this application is shown;
[0019] Figure 4 A schematic flowchart of another method for detecting a motor according to an embodiment of this application is shown;
[0020] Figure 5 A structural block diagram of a motor detection device provided according to an embodiment of this application is shown.
[0021] The above figures include the following reference numerals:
[0022] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. Detailed Implementation
[0023] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] As described in the background section, traditional testing methods are difficult to adaptively adjust to the presence or absence of motor parts in actual production, which can easily lead to false detections or missed detections. To solve this problem, embodiments of this application provide a method, apparatus, computer-readable storage medium, and motor testing system for testing motors.
[0027] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0028] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a motor detection method according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0029] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the motor detection method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0030] This embodiment provides a method for detecting a motor that runs on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0031] Figure 2 This is a flowchart of a motor detection method according to an embodiment of this application. Figure 2 As shown, the method includes the following steps:
[0032] Step S201: Use the current detection scheme to detect the motor under test, and determine whether the motor under test triggers a detection error. The motor under test includes motors with target accessories and motors without target accessories. The current detection scheme is a detection scheme for motors with target accessories or a detection scheme for motors without target accessories. The triggering condition for the detection error is that the motor under test is not the motor type corresponding to the current detection scheme.
[0033] Specifically, since there are two types of motors to be tested: one with the target accessory and the other without, the current testing scheme is for motors with the target accessory. If the motor to be tested does not have the target accessory, a detection error will be triggered; otherwise, no detection error will be triggered. Conversely, if the motor to be tested has the target accessory, a detection error will be triggered; otherwise, no detection error will be triggered.
[0034] Step S202: Obtain the current sliding window, which includes images of a predetermined number of motors to be inspected that continuously arrive at the inspection station;
[0035] Specifically, the motors to be tested arrive at the testing station in sequence, and images of each motor are collected one by one. The length of the current sliding window is a predetermined number N. When the number of images reaches the predetermined number N, the current sliding window is full.
[0036] Step S203: If the proportion of the motors under test that triggered the above detection error in the current sliding window is greater than or equal to a predetermined proportion, switch the above current detection scheme.
[0037] Specifically, if the percentage of motors under test that trigger the above detection error in the current sliding window is greater than or equal to a predetermined percentage P, for example, P = 80%, meaning that more than 80% of the motors under test trigger the detection error, then the current detection scheme is switched.
[0038] Step S204: When the next motor to be tested arrives at the testing station, update the current sliding window and determine whether to switch the current testing scheme based on the updated current sliding window, until all the motors to be tested have been tested.
[0039] Specifically, when the next motor to be tested arrives at the testing station, an image of the next motor to be tested is acquired and added to the current sliding window to update the current sliding window. The updated current sliding window then needs to determine again whether to switch the current testing scheme to continue testing the next motor to be tested, until all the above-mentioned motors to be tested have been tested.
[0040] In the above-mentioned motor testing method, since there are two types of motors to be tested: one with target accessories and the other without, if the current testing scheme uses the testing scheme for motors with target accessories, then the motors to be tested without target accessories will trigger a testing error. Conversely, if the current testing scheme uses the testing scheme for motors without target accessories, then the motors to be tested with target accessories will trigger a testing error. By continuously sending images of a predetermined number of motors to be tested to the testing station, a current sliding window is established. The percentage of motors to be tested that trigger a testing error in the current sliding window is counted. If the percentage is greater than or equal to... The predetermined ratio indicates that if the type of motor being tested changes, the current testing scheme will be switched. Subsequent testing processes continuously update the current sliding window, allowing the current testing scheme to dynamically switch according to the type of motor being tested until all motors being tested have been tested. This prevents a large number of false detection errors caused by a fixed testing scheme, greatly reducing the false detection rate. At the same time, timely switching of the current testing scheme avoids missed detections due to incorrect selection of the testing scheme, thus improving the accuracy of the test. This solves the problem that traditional testing methods are difficult to adaptively adjust according to the trend of the presence or absence of motor parts in actual production, which easily leads to false detections or missed detections.
[0041] To determine the detection result, in one optional implementation, step S201 includes:
[0042] Step S2011: If the current detection scheme is a detection scheme for a motor with the target accessory and the target accessory is not present in the image of the motor to be detected, trigger the detection error of the motor to be detected.
[0043] Step S2012: If the current detection scheme is a detection scheme for a motor that does not have the target accessory, and the target accessory is present in the image of the motor to be detected, the detection error of the motor to be detected is triggered.
[0044] In the above embodiments, if the current detection scheme is a detection scheme for a motor with the target accessory, then the motor to be tested with the target accessory is qualified; otherwise, it is unqualified. Therefore, if the target accessory is not present in the image of the motor to be tested, it is unqualified, triggering the detection error of the motor to be tested. If the current detection scheme is a detection scheme for a motor without the target accessory, then the motor to be tested without the target accessory is qualified; otherwise, it is unqualified. Therefore, if the target accessory is present in the image of the motor to be tested, it is unqualified, triggering the detection error of the motor to be tested.
[0045] To determine the test results, in one optional implementation, the target component is a retaining ring, and step S201 further includes:
[0046] Step S2013: If the current detection scheme is to detect whether the motor has the aforementioned retaining ring and the retaining ring is not present in the image of the motor to be detected, then the detection error of the motor to be detected is triggered.
[0047] Step S2014: If the current detection scheme is to detect whether the motor does not have the aforementioned retaining ring and the target accessory is present in the image of the motor to be detected, the detection error of the motor to be detected is triggered.
[0048] In the above embodiments, the target component is a retaining ring. Therefore, there are two types of motors to be tested: one type is a motor with a retaining ring, such as... Figure 3 As shown, another type is a motor without a retaining ring. If the current detection scheme is to detect whether the motor has the aforementioned retaining ring, and the image of the motor to be tested does not contain the aforementioned retaining ring, then the motor to be tested is unqualified, triggering the aforementioned detection error for the motor to be tested. If the current detection scheme is to detect whether the motor does not have the aforementioned retaining ring, and the image of the motor to be tested contains the aforementioned retaining ring, then the motor to be tested is unqualified, triggering the aforementioned detection error for the motor to be tested.
[0049] In one optional implementation, to obtain the current sliding window, step S202 above includes:
[0050] Step S2021: At the start of the detection, initialize the sliding window to clear the sliding window.
[0051] Step S2022: When the motor to be tested arrives at the testing station, an image of the motor to be tested is acquired and added to the sliding window until the number of images in the sliding window is equal to the predetermined number, and the sliding window is determined as the current sliding window.
[0052] In the above implementation, the sliding window is initialized to be empty. The motors to be tested arrive at the testing station in sequence, and images of the motors to be tested are collected one by one. The length of the sliding window is a predetermined number N. When the number of images reaches the predetermined number N, the sliding window is full, and the current sliding window can be obtained.
[0053] In order to switch the current detection scheme, in one optional implementation, step S203 above includes:
[0054] Step S2031: Obtain the number of motors under test that triggered the above detection error in the current sliding window, and get the number of errors;
[0055] Step S2032: Calculate the ratio of the number of errors reported to the predetermined number of errors reported to obtain the error reporting percentage;
[0056] Step S2033: If the error rate is greater than or equal to the predetermined rate and the current detection scheme is a detection scheme for a motor with the target component, the current detection scheme is switched to a detection scheme for a motor without the target component.
[0057] Step S2034: If the error rate is greater than or equal to the predetermined rate and the current detection scheme is a detection scheme for a motor that does not have the target component, the current detection scheme is switched to a detection scheme for a motor that has the target component.
[0058] In the above implementation, the number of detection errors triggered among the N motors to be tested in the current sliding window is the number of errors, and the ratio of the number of errors to a predetermined number is the error percentage. If the error percentage is greater than or equal to the predetermined percentage P, the current detection scheme is switched. If the current detection scheme is a detection scheme for motors with the target accessory, it is switched to a detection scheme for motors without the target accessory.
[0059] In an optional implementation, to update the current sliding window, step S204 above includes:
[0060] Step S2041: When the next motor to be tested arrives at the testing station, acquire an image of the next motor to be tested.
[0061] Step S2042: Add the next image of the motor to be tested to the current sliding window, and delete the earliest image of the motor to be tested in the current sliding window.
[0062] In the above embodiment, when the next motor to be tested arrives at the testing station, the image of the next motor to be tested is added to the current sliding window, and the earliest image of the motor to be tested obtained in the current sliding window is deleted, so that the number of images in the current sliding window is kept at a predetermined number, so as to update the current sliding window.
[0063] To improve detection accuracy, in one optional implementation, after all the aforementioned motors to be tested have been tested, the method further includes:
[0064] Step S301: Send the images of all the motors to be tested that triggered the above detection error to the terminal for secondary detection.
[0065] In the above embodiments, the test results may not be accurate. For example, the current test plan is to test motors with target accessories, but the next batch of motors will be motors without target accessories. The current test plan cannot be switched in time, resulting in some test results being inaccurate. Secondary testing is required to ensure the accuracy of the test. Of course, the current test plan can be switched dynamically. The number of inaccurate test results is small, and the workload of secondary testing is low. This avoids the situation where the current test plan is fixed, there are many test errors, and the workload of secondary testing is large.
[0066] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the motor detection method of this application will be described in detail below with reference to specific embodiments.
[0067] This embodiment relates to a specific method for detecting a motor, such as... Figure 4 As shown, it includes the following steps:
[0068] Step S1: System initialization, start the vision inspection equipment and industrial control system; initialize the inspection state to "parts present inspection mode" (such as inspecting motor retaining rings); set the sliding window length N (10 in this embodiment); set the no-parts ratio judgment threshold P (80% in this embodiment); initialize the sliding window to be empty, and prepare to record the parts identification results (present / absent); clear the historical judgment state.
[0069] Step S2: Acquire images for each workpiece and perform accessory recognition. For each motor product transported from the production line, perform the following sub-steps in sequence: Acquire motor images using a 2D industrial camera; use image recognition algorithms to determine the presence or absence of fixed accessory installation positions (such as motor retainer positions) in the images, and obtain the detection results: if a retainer is detected: the result is recorded as "present"; if no retainer is detected: the result is recorded as "absent". Add the recognition result to a sliding window: if the current window length is greater than N, remove the oldest record to keep the window length unchanged.
[0070] Step S3: Dynamic detection mode determination and switching. When the sliding window is full (i.e., the detection results of the most recent 10 motors are recorded): count the number of "no snap ring" results in the window; calculate the proportion of no parts = number of no snap rings / N; determine whether it exceeds the threshold P (80%): if the proportion of no parts is ≥80%, the motor is currently determined to be a "no snap ring part model"; the system switches to the detection mode of "no snap ring detection required"; pause the snap ring detection process and only retain the appearance or other detection content; otherwise: maintain or restore the "with parts detection mode".
[0071] Step S4: Status recovery mechanism. In the "no parts detection mode", the system still monitors the image: if a certain detection result is determined to be "with spring clip", it is inferred that the current batch may switch back to "with parts detection mode"; continue to slide the window to record, and repeat step three.
[0072] Step S5: Output and processing of test results. For each motor product, the system outputs the final judgment result according to the current mode: In the "parts-with-parts-with-test-mode": if the retaining ring is not detected, it is marked as defective; if the retaining ring is detected, it is marked as qualified; In the "no-parts-with-test-mode": the retaining ring is not involved in the judgment; the system only performs the test on other parts, and the result is determined according to other judgment items; The test results can be used for: controlling the rejection device of the production line; data traceability and storage; production line switching prompts in the upper system.
[0073] Step S6: System operation and continuous updates. The system continuously executes the above process in a loop, automatically adapting to changes in the current online motor models, ensuring that the testing strategy always matches the actual products, without the need for manual intervention, thus improving testing efficiency and accuracy.
[0074] This application also provides a motor detection device. It should be noted that the motor detection device of this application can be used to execute the motor detection method provided in this application. This device is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0075] The following describes the motor detection device provided in the embodiments of this application.
[0076] Figure 5 This is a schematic diagram of a motor detection device according to an embodiment of this application. Figure 5 As shown, the device includes:
[0077] The determining unit 10 is used to detect the motor under test using the current detection scheme, and to determine whether the motor under test triggers a detection error. The motor under test includes a motor with the target accessory and a motor without the target accessory. The current detection scheme is a detection scheme for a motor with the target accessory or a detection scheme for a motor without the target accessory. The triggering condition for the detection error is that the motor under test is not the motor type corresponding to the current detection scheme.
[0078] Specifically, since there are two types of motors to be tested: one with the target accessory and the other without, the current testing scheme is for motors with the target accessory. If the motor to be tested does not have the target accessory, a detection error will be triggered; otherwise, no detection error will be triggered. Conversely, if the motor to be tested has the target accessory, a detection error will be triggered; otherwise, no detection error will be triggered.
[0079] Acquisition unit 20 is used to acquire the current sliding window, which includes images of a predetermined number of motors to be inspected that continuously arrive at the inspection station;
[0080] Specifically, the motors to be tested arrive at the testing station in sequence, and images of each motor are collected one by one. The length of the current sliding window is a predetermined number N. When the number of images reaches the predetermined number N, the current sliding window is full.
[0081] The switching unit 30 is used to switch the current detection scheme when the proportion of the motors under test that trigger the detection error in the current sliding window is greater than or equal to a predetermined proportion.
[0082] Specifically, if the percentage of motors under test that trigger the above detection error in the current sliding window is greater than or equal to a predetermined percentage P, for example, P = 80%, meaning that more than 80% of the motors under test trigger the detection error, then the current detection scheme is switched.
[0083] The updating unit 40 is used to update the current sliding window and determine whether to switch the current detection scheme based on the updated current sliding window when the next motor to be tested arrives at the detection station, until all the motors to be tested have been detected.
[0084] Specifically, when the next motor to be tested arrives at the testing station, an image of the next motor to be tested is acquired and added to the current sliding window to update the current sliding window. The updated current sliding window then needs to determine again whether to switch the current testing scheme to continue testing the next motor to be tested, until all the above-mentioned motors to be tested have been tested.
[0085] In the aforementioned motor testing device, since there are two types of motors to be tested: one with target accessories and the other without, if the current testing scheme uses the testing scheme for motors with target accessories, then the motors to be tested without target accessories will trigger a testing error. Conversely, if the current testing scheme uses the testing scheme for motors without target accessories, then the motors to be tested with target accessories will trigger a testing error. By continuously sending images of a predetermined number of motors to be tested to the testing station, a current sliding window is established. The percentage of motors to be tested that trigger testing errors in the current sliding window is counted. If the percentage is greater than or equal to a predetermined percentage, it indicates that the type of motor being tested has changed, and the current testing scheme is switched. Subsequent testing processes continuously update the current sliding window, so that the current testing scheme dynamically switches according to the type of motor to be tested until all motors to be tested are tested. This prevents a large number of false testing errors caused by a fixed testing scheme, greatly reducing the false detection rate of testing errors. At the same time, timely switching of the current testing scheme avoids missed detections due to incorrect selection of the testing scheme, thus improving the accuracy of the testing.
[0086] To determine the detection result, in one optional implementation, the determining unit includes:
[0087] The first triggering module is used to trigger a detection error for the motor under test when the current detection scheme is a detection scheme for a motor with the target accessory and the target accessory is not present in the image of the motor under test.
[0088] The second triggering module is used to trigger a detection error for the motor under test when the current detection scheme is a detection scheme for a motor that does not have the target accessory and the target accessory is present in the image of the motor under test.
[0089] In the above embodiments, if the current detection scheme is a detection scheme for a motor with the target accessory, then the motor to be tested with the target accessory is qualified; otherwise, it is unqualified. Therefore, if the target accessory is not present in the image of the motor to be tested, it is unqualified, triggering the detection error of the motor to be tested. If the current detection scheme is a detection scheme for a motor without the target accessory, then the motor to be tested without the target accessory is qualified; otherwise, it is unqualified. Therefore, if the target accessory is present in the image of the motor to be tested, it is unqualified, triggering the detection error of the motor to be tested.
[0090] To determine the test results, in one optional implementation, the target component is a retaining ring, and the determining unit further includes:
[0091] The third trigger module is used to trigger the detection error of the motor under test when the current detection scheme is to detect whether the motor has the snap ring and the snap ring is not present in the image of the motor under test.
[0092] The fourth trigger module is used to trigger the detection error of the motor under test when the current detection scheme is to detect whether the motor does not have the aforementioned retaining ring and the image of the motor under test contains the aforementioned target accessory.
[0093] In the above embodiments, the target component is a retaining ring. Therefore, there are two types of motors to be tested: one type is a motor with a retaining ring, such as... Figure 3 As shown, another type is a motor without a retaining ring. If the current detection scheme is to detect whether the motor has the aforementioned retaining ring, and the image of the motor to be tested does not contain the aforementioned retaining ring, then the motor to be tested is unqualified, triggering the aforementioned detection error for the motor to be tested. If the current detection scheme is to detect whether the motor does not have the aforementioned retaining ring, and the image of the motor to be tested contains the aforementioned retaining ring, then the motor to be tested is unqualified, triggering the aforementioned detection error for the motor to be tested.
[0094] In one optional implementation, to obtain the current sliding window, the obtaining unit includes:
[0095] The initialization module is used to initialize the sliding window at the start of the detection, so that the sliding window is cleared.
[0096] The first acquisition module is used to acquire an image of the motor to be tested when the motor to be tested arrives at the testing station and add the image of the motor to be tested to the sliding window until the number of images in the sliding window is equal to the predetermined number, and then determine the sliding window as the current sliding window.
[0097] In the above implementation, the sliding window is initialized to be empty. The motors to be tested arrive at the testing station in sequence, and images of the motors to be tested are collected one by one. The length of the sliding window is a predetermined number N. When the number of images reaches the predetermined number N, the sliding window is full, and the current sliding window can be obtained.
[0098] In an optional implementation, to switch the current detection scheme, the switching unit includes:
[0099] The second acquisition module is used to acquire the number of motors to be detected that triggered the above-mentioned detection error in the current sliding window, and to obtain the number of errors.
[0100] The calculation module is used to calculate the ratio of the above-mentioned number of errors to the above-mentioned predetermined number, and obtain the error rate.
[0101] The first switching module is used to switch the current detection scheme to a detection scheme for a motor without the target component when the error rate is greater than or equal to the predetermined rate and the current detection scheme is a detection scheme for a motor with the target component.
[0102] The second switching module is used to switch the current detection scheme to a detection scheme for a motor with the target component when the error rate is greater than or equal to the predetermined rate and the current detection scheme is a detection scheme for a motor without the target component.
[0103] In the above implementation, the number of detection errors triggered among the N motors to be tested in the current sliding window is the number of errors, and the ratio of the number of errors to a predetermined number is the error percentage. If the error percentage is greater than or equal to the predetermined percentage P, the current detection scheme is switched. If the current detection scheme is a detection scheme for motors with the target accessory, it is switched to a detection scheme for motors without the target accessory.
[0104] In one optional implementation, to update the current sliding window, the update unit includes:
[0105] The second acquisition module is used to acquire an image of the next motor to be tested when the next motor to be tested arrives at the testing station.
[0106] The update module is used to add the next image of the motor to be detected to the current sliding window and delete the earliest image of the motor to be detected in the current sliding window.
[0107] In the above embodiment, when the next motor to be tested arrives at the testing station, the image of the next motor to be tested is added to the current sliding window, and the earliest image of the motor to be tested obtained in the current sliding window is deleted, so that the number of images in the current sliding window is kept at a predetermined number, so as to update the current sliding window.
[0108] To improve detection accuracy, in one optional embodiment, the above-mentioned device further includes:
[0109] The sending unit is used to send the images of all the motors under test that triggered the above-mentioned detection error to the terminal after all the above-mentioned motors under test have been detected, so as to perform secondary detection.
[0110] In the above embodiments, the test results may not be accurate. For example, the current test plan is to test motors with target accessories, but the next batch of motors will be motors without target accessories. The current test plan cannot be switched in time, resulting in some test results being inaccurate. Secondary testing is required to ensure the accuracy of the test. Of course, the current test plan can be switched dynamically. The number of inaccurate test results is small, and the workload of secondary testing is low. This avoids the situation where the current test plan is fixed, there are many test errors, and the workload of secondary testing is large.
[0111] The aforementioned motor detection device includes a processor and a memory. The determining unit, acquiring unit, switching unit, and updating unit are all stored as program units in the memory. The processor executes these program units stored in the memory to achieve the corresponding functions. All of the above modules reside in the same processor; alternatively, the modules may be located in different processors in any combination.
[0112] The processor contains a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured. By adjusting kernel parameters, the problems of traditional detection methods, which struggle to adapt to the presence or absence of motor components in actual production and are prone to false positives or false negatives, can be addressed.
[0113] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0114] This invention provides a computer-readable storage medium including a stored program, wherein the program, when running, controls the device containing the computer-readable storage medium to execute the motor detection method.
[0115] Specifically, the testing methods for motors include:
[0116] Step S201: Use the current detection scheme to detect the motor under test, and determine whether the motor under test triggers a detection error. The motor under test includes motors with target accessories and motors without target accessories. The current detection scheme is a detection scheme for motors with target accessories or a detection scheme for motors without target accessories. The triggering condition for the detection error is that the motor under test is not the motor type corresponding to the current detection scheme.
[0117] Step S202: Obtain the current sliding window, which includes images of a predetermined number of motors to be inspected that continuously arrive at the inspection station;
[0118] Step S203: If the proportion of the motors under test that triggered the above detection error in the current sliding window is greater than or equal to a predetermined proportion, switch the above current detection scheme.
[0119] Step S204: When the next motor to be tested arrives at the testing station, update the current sliding window and determine whether to switch the current testing scheme based on the updated current sliding window, until all the motors to be tested have been tested.
[0120] This invention provides a processor for running a program, wherein the program executes the motor detection method during operation.
[0121] Specifically, the testing methods for motors include:
[0122] Step S201: Use the current detection scheme to detect the motor under test, and determine whether the motor under test triggers a detection error. The motor under test includes motors with target accessories and motors without target accessories. The current detection scheme is a detection scheme for motors with target accessories or a detection scheme for motors without target accessories. The triggering condition for the detection error is that the motor under test is not the motor type corresponding to the current detection scheme.
[0123] Step S202: Obtain the current sliding window, which includes images of a predetermined number of motors to be inspected that continuously arrive at the inspection station;
[0124] Step S203: If the proportion of the motors under test that triggered the above detection error in the current sliding window is greater than or equal to a predetermined proportion, switch the above current detection scheme.
[0125] Step S204: When the next motor to be tested arrives at the testing station, update the current sliding window and determine whether to switch the current testing scheme based on the updated current sliding window, until all the motors to be tested have been tested.
[0126] This invention provides a motor detection system, which includes a camera, a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:
[0127] Step S201: Use the current detection scheme to detect the motor under test, and determine whether the motor under test triggers a detection error. The motor under test includes motors with target accessories and motors without target accessories. The current detection scheme is a detection scheme for motors with target accessories or a detection scheme for motors without target accessories. The triggering condition for the detection error is that the motor under test is not the motor type corresponding to the current detection scheme.
[0128] Step S202: Obtain the current sliding window, which includes images of a predetermined number of motors to be inspected that continuously arrive at the inspection station;
[0129] Step S203: If the proportion of the motors under test that triggered the above detection error in the current sliding window is greater than or equal to a predetermined proportion, switch the above current detection scheme.
[0130] Step S204: When the next motor to be tested arrives at the testing station, update the current sliding window and determine whether to switch the current testing scheme based on the updated current sliding window, until all the motors to be tested have been tested.
[0131] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0132] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps:
[0133] Step S201: Use the current detection scheme to detect the motor under test, and determine whether the motor under test triggers a detection error. The motor under test includes motors with target accessories and motors without target accessories. The current detection scheme is a detection scheme for motors with target accessories or a detection scheme for motors without target accessories. The triggering condition for the detection error is that the motor under test is not the motor type corresponding to the current detection scheme.
[0134] Step S202: Obtain the current sliding window, which includes images of a predetermined number of motors to be inspected that continuously arrive at the inspection station;
[0135] Step S203: If the proportion of the motors under test that triggered the above detection error in the current sliding window is greater than or equal to a predetermined proportion, switch the above current detection scheme.
[0136] Step S204: When the next motor to be tested arrives at the testing station, update the current sliding window and determine whether to switch the current testing scheme based on the updated current sliding window, until all the motors to be tested have been tested.
[0137] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0138] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0139] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0140] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0141] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0142] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0143] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0144] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0145] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0146] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0147] As can be seen from the above description, the embodiments of this application achieve the following technical effects:
[0148] 1) In the motor detection method of this application, since there are two types of motors to be tested: one with target accessories and the other without target accessories, if the current detection scheme adopts the detection scheme for motors with target accessories, then the motors to be tested without target accessories will trigger detection errors. Conversely, if the current detection scheme adopts the detection scheme for motors without target accessories, then the motors to be tested with target accessories will trigger detection errors. By continuously sending images of a predetermined number of motors to be tested to the detection station, a current sliding window is established. The proportion of motors to be tested that trigger detection errors in the current sliding window is counted. If the proportion is greater than or equal to a predetermined proportion, it indicates that the type of motor being tested has changed, and the current detection scheme is switched. The current sliding window is continuously updated in the subsequent detection process, so that the current detection scheme dynamically switches with the type of motor to be tested until all motors to be tested are detected. This prevents a large number of false detection errors caused by a fixed detection scheme, greatly reducing the false detection rate of detection errors. At the same time, timely switching of the current detection scheme avoids the detection errors from not being triggered due to incorrect selection of the detection scheme, thus improving the accuracy of detection.
[0149] 2) In the motor testing device of this application, since there are two types of motors to be tested: one with target accessories and the other without target accessories, if the current testing scheme adopts the testing scheme for motors with target accessories, then the motors to be tested without target accessories will trigger a testing error. Conversely, if the current testing scheme adopts the testing scheme for motors without target accessories, then the motors to be tested with target accessories will trigger a testing error. By continuously sending images of a predetermined number of motors to be tested to the testing station, a current sliding window is established. The proportion of motors to be tested that trigger testing errors in the current sliding window is counted. If the proportion is greater than or equal to a predetermined proportion, it indicates that the type of motor being tested has changed, and the current testing scheme is switched. The current sliding window is continuously updated in the subsequent testing process, so that the current testing scheme dynamically switches according to the type of motor to be tested until all motors to be tested are tested. This prevents a large number of false detection errors caused by a fixed testing scheme, greatly reducing the false detection rate of detection errors. At the same time, timely switching of the current testing scheme avoids the detection error not being triggered due to an incorrect testing scheme selection, thus improving the accuracy of the test.
[0150] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for testing an electric motor, characterized in that, include: The current testing scheme is used to test the motor under test. It is determined whether the motor under test triggers a testing error. The motor under test includes motors with target accessories and motors without target accessories. The current testing scheme is either a testing scheme for motors with target accessories or a testing scheme for motors without target accessories. The triggering condition for the testing error is that the motor under test is not the motor type corresponding to the current testing scheme. Obtain the current sliding window, which includes images of a predetermined number of motors to be inspected that continuously arrive at the inspection station; If the proportion of the motors under test that trigger the detection error in the current sliding window is greater than or equal to a predetermined proportion, the current detection scheme is switched. When the next motor to be tested arrives at the testing station, the current sliding window is updated and the current testing scheme is determined based on the updated current sliding window, until all the motors to be tested have been tested.
2. The method according to claim 1, characterized in that, The current testing method is used to test the motor under test, and it is determined whether the motor under test triggers a detection error, including: If the current detection scheme is a detection scheme for a motor with the target accessory and the target accessory is not present in the image of the motor to be detected, a detection error is triggered for the motor to be detected. If the current detection scheme is for a motor that does not have the target accessory, but the target accessory is present in the image of the motor to be detected, an error is triggered in the detection of the motor to be detected.
3. The method according to claim 2, characterized in that, The target component is a retaining ring. The current testing method is used to test the motor under test, determining whether the motor triggers a testing error. This also includes: If the current detection scheme is to detect whether the motor has the retaining ring and the retaining ring is not present in the image of the motor to be detected, an error is triggered in the detection of the motor to be detected; If the current detection scheme is to detect whether the motor does not have the retaining ring and the target accessory is present in the image of the motor to be detected, an error is triggered in the detection of the motor to be detected.
4. The method according to claim 1, characterized in that, Get the current sliding window, including: At the start of the detection, the sliding window is initialized and then cleared. When the motor to be tested arrives at the testing station, an image of the motor to be tested is acquired and added to the sliding window until the number of images in the sliding window equals the predetermined number, and the sliding window is determined as the current sliding window.
5. The method according to claim 1, characterized in that, If the proportion of motors under test that trigger the detection error in the current sliding window is greater than or equal to a predetermined proportion, the current detection scheme is switched, including: Obtain the number of motors under test that triggered the detection error in the current sliding window, and get the number of errors; Calculate the ratio of the number of reported errors to the predetermined number to obtain the error rate percentage; If the error rate is greater than or equal to the predetermined rate and the current detection scheme is a detection scheme for a motor with the target component, the current detection scheme shall be switched to a detection scheme for a motor without the target component. If the error rate is greater than or equal to the predetermined rate and the current detection scheme is a detection scheme for a motor without the target accessory, the current detection scheme shall be switched to a detection scheme for a motor with the target accessory.
6. The method according to claim 1, characterized in that, When the next motor to be tested arrives at the testing station, update the current sliding window, including: When the next motor to be tested arrives at the testing station, an image of the next motor to be tested is acquired; Add the next image of the motor to be tested to the current sliding window, and delete the earliest image of the motor to be tested in the current sliding window.
7. The method according to any one of claims 1 to 6, characterized in that, After all the motors to be tested have been tested, the method further includes: Images of all the motors to be tested that triggered the detection error are sent to the terminal for secondary detection.
8. A testing device for an electric motor, characterized in that, include: The determining unit is used to detect the motor under test using the current detection scheme, and to determine whether the motor under test triggers a detection error. The motor under test includes a motor with a target accessory and a motor without the target accessory. The current detection scheme is a detection scheme for a motor with the target accessory or a detection scheme for a motor without the target accessory. The triggering condition for the detection error is that the motor under test is not the motor type corresponding to the current detection scheme. An acquisition unit is used to acquire the current sliding window, which includes images of a predetermined number of motors to be inspected that continuously arrive at the inspection station; The switching unit is used to switch the current detection scheme when the proportion of the motors under test that trigger the detection error in the current sliding window is greater than or equal to a predetermined proportion. The update unit is used to update the current sliding window and determine whether to switch the current detection scheme based on the updated current sliding window when the next motor to be tested arrives at the detection station, until all the motors to be tested have been detected.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the motor detection method according to any one of claims 1 to 7.
10. A motor detection system, characterized in that, include: A camera, one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including a method for performing a detection method for a motor according to any one of claims 1 to 7.