Circuit board stacking processing control method and system based on two-dimensional code

By adopting a QR code-based control method for PCB stacking, the problem of format differences and material mixing when processing barcodes from different manufacturers in PCB stacking equipment has been solved. This method achieves high versatility of the equipment and automated anti-mixing verification, ensuring the accuracy of the stacking sequence and the continuity of production.

CN123180193APending Publication Date: 2026-11-27KUNSHAN MINXIN ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611660457.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-26
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing printed circuit board stacking equipment suffers from problems such as large format differences, inconsistent letter layer number recognition, lack of secondary verification methods, and inconsistent barcode data management when processing barcodes from different manufacturers, resulting in poor system universality and high risk of mixed materials.

Method used

A QR code-based circuit board stacking processing control method is adopted. By pre-setting multiple mutually exclusive layer number field extraction strategies, letter layer number bijective mapping table and two-level cache structure, the barcode format can be flexibly adapted and automatically converted. Combined with layer number comparison and part number verification, localized anti-mixing verification is provided.

Benefits of technology

It improves the versatility and flexibility of the stacking equipment during production line changes, reduces the need for manual intervention, ensures the accuracy of the stacking sequence and the continuity of production, and enhances the user-friendliness and efficiency of equipment operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123180193A_ABST
    Figure CN123180193A_ABST
Patent Text Reader

Abstract

The application discloses a circuit board stacking material processing control method and system based on a two-dimensional code, which comprises the following steps: obtaining an original barcode string collected by a code scanning gun, and extracting a layer number field from the original barcode string according to a preset configuration strategy flag. The configuration strategy flag is used to indicate one of a plurality of mutually exclusive layer number field extraction strategies. When the layer number field contains letters, a corresponding bijective mapping table is called according to the case type of the letters to convert the layer number field into an integer layer number. When the layer number field is a pure number, the layer number field is directly determined as an integer layer number. The integer layer number is compared with a target layer number of a current layer in a stacking sequence table. After the comparison, a to-be-verified barcode is obtained from a current code scanning buffer or a history buffer, a first N-bit substring of the to-be-verified barcode is intercepted, N is a preset integer, and it is judged whether the current production material number string contains the first N-bit substring. If yes, a stacking material release instruction signal is outputted, and if not, an alarm instruction signal is outputted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of automated production technology and relates to a method and system for controlling the stacking of circuit boards based on QR codes. Background Technology

[0002] In the multilayer board stacking process of printed circuit boards, operators need to place the inner core boards into the stacking machine layer by layer according to the predetermined stacking order. To facilitate automated identification, each inner core board has a barcode containing layer number information printed on its edge or process edge area. The stacking equipment reads the barcode with a barcode scanner, and the control system identifies the layer number and checks it against the pre-configured stacking order to prevent incorrect stacking sequence.

[0003] Existing stacking equipment suffers from the following problems when processing barcodes. First, the barcode encoding formats vary significantly between different PCB manufacturers and even between different batches from the same manufacturer. The position, length, and separation method of the layer number field in the barcode are inconsistent. Existing equipment's barcode parsing logic is typically bound to a specific format, requiring rewriting the parsing code or adjusting equipment parameters when changing product models or manufacturers, resulting in poor system versatility. Second, for multilayer boards with more than nine layers, some manufacturers use letters instead of numbers for layer number encoding. Furthermore, some manufacturers' barcode encoding rules assign uppercase and lowercase letters to even and odd layers respectively. Specific letters, such as L and M, also have unconventional interchangeable orders. Existing equipment lacks an automatic conversion mechanism for such letter layer numbers. Third, even if the layer number comparison passes, the misuse of inner core boards of different versions or part numbers under the same layer number cannot be detected in a timely manner. Existing solutions lack secondary verification methods beyond layer number comparison on the equipment itself. Furthermore, the lifespan of barcode data in the control system's memory differs between the first-piece learning scenario and normal operation. During first-piece learning, the barcode is retained in the cache, while during normal operation, it is cleared after layer number comparison. This leads to inconsistencies in how subsequent processes, such as weighing, acquire barcode data, increasing the complexity of the program logic. These issues mean that the existing system still has shortcomings in barcode format adaptation, layer number recognition reliability, and the integrity of anti-mixing verification.

[0004] Existing technologies include automated stacking solutions that combine barcode recognition with layer number comparison, but as mentioned earlier, they still have many limitations in terms of barcode format adaptation flexibility, automatic processing of letter layer numbers, and localized secondary verification. Summary of the Invention

[0005] To address the problems existing in the background technology, this invention proposes a method and system for controlling the stacking of circuit boards based on QR codes.

[0006] The first aspect of the present invention provides a method for controlling the stacking of circuit boards based on QR codes, comprising: Obtain the raw barcode string collected by the barcode scanner; According to the preset configuration strategy flag, the layer number field is extracted from the original barcode string; the configuration strategy flag is used to indicate one of a variety of mutually exclusive layer number field extraction strategies; When the layer number field contains letters, the corresponding bijective mapping table is called according to the case of the letters to convert the layer number field into an integer layer number; when the layer number field is a pure numeric string, the layer number field is directly determined as an integer layer number. Compare the integer layer number with the target layer number of the current layer in the stacking sequence table; In response to the successful comparison, the barcode to be verified is obtained from the current scanning buffer or the historical buffer, and the first N substrings of the barcode to be verified are extracted, where N is a preset integer. It is then determined whether the current production part number string contains the first N substrings. When obtaining the barcode to be verified, it is preferentially obtained from the current scanning buffer. If the current scanning buffer is empty, it is obtained from the historical buffer. If the current production part number string contains the first N substrings, output a stacking release indication signal; if the current production part number string does not contain the first N substrings, output an alarm indication signal.

[0007] Optionally, the multiple mutually exclusive layer number field extraction strategies include: A truncation strategy based on start and end positions; Strategy for extracting intermediate substrings using double delimiters; Suffix-based cropping and anchor character positioning extraction strategy; The strategy is to extract the substring from the end based on the anchor string identifier.

[0008] Optionally, the suffix-based cropping and anchor character positioning extraction strategy includes: Delete a fixed number of characters from the end of the original barcode string; In the remaining string, locate the nearest lowercase letter 'l' from right to left, and determine the lowercase letter 'l' as the anchor character; Taking the first character after the lowercase letter 'l' as the starting position and the position before the next separator as the ending position, the substring between the two is extracted as the layer number field; Specifically, when there is no separator after the lowercase letter 1, all characters after the lowercase letter 1 are extracted as the layer number field.

[0009] Optionally, in the bijective mapping table, the mapping values ​​of the letters L and M are interchanged relative to the normal alphabetical order, wherein the uppercase letter M is mapped to the integer 32, the uppercase letter L is mapped to the integer 34, the lowercase letter m is mapped to the integer 33, and the lowercase letter l is mapped to the integer 35.

[0010] Optionally, determining whether the current production part number string contains the first N substrings includes: The verification passes when the current production part number string contains the first N substrings; The verification fails when the current production part number string does not contain the first N substrings. When the current production part number string is empty, the barcode to be verified is empty, or N is less than or equal to zero, the verification is directly determined to be successful.

[0011] Optionally, during the normal stacking operation phase, the original barcode string in the current scanning buffer is cleared after the integer layer number and the target layer number are compared and passed, and the original barcode string is stored in the history cache before being cleared; during the first piece learning phase, the original barcode string is retained in the current scanning buffer after the comparison is passed.

[0012] Optionally, the circuit board stacking processing control method based on QR codes further includes: In response to the fact that the current production part number string does not contain the first N substrings, a current alarm message is generated; The content of the current alarm message is compared with that of the historical alarm messages; When the content of the current alarm message is the same as the content of the historical alarm message, suppress the output of the alarm pop-up window; When the content of the current alarm message differs from the content of the historical alarm message, the alarm pop-up command is output, and the current alarm message is updated to the historical alarm message.

[0013] Optionally, the bijective mapping table conversion step and / or the step of determining whether the current production part number string contains the first N substrings each have independent configuration switches; When the configuration switch is in the off state, the corresponding step returns to pass and continues to execute the subsequent steps.

[0014] A second aspect of the present invention provides a circuit board stacking processing control system based on QR codes, comprising: The barcode acquisition module is used to acquire the raw barcode string collected by the barcode scanner; The layer number field extraction module is used to extract the layer number field from the original barcode string according to a preset configuration strategy flag; the configuration strategy flag is used to indicate one of a variety of mutually exclusive layer number field extraction strategies. The letter layer number conversion module is used to convert the layer number field into an integer layer number by calling the corresponding bijective mapping table according to the case of the letter when the layer number field contains letters; when the layer number field is a pure numeric string, the layer number field is directly determined as an integer layer number. The layer number comparison module is used to compare the integer layer number with the target layer number of the current layer in the stacking order table; The part number verification module is used to, in response to the successful comparison, obtain the barcode to be verified from the current scanning buffer or the historical buffer, extract the first N substrings of the barcode to be verified, where N is a preset integer, and determine whether the current production part number string contains the first N substrings; wherein, when obtaining the barcode to be verified, it is preferentially obtained from the current scanning buffer, and if the current scanning buffer is empty, it is obtained from the historical buffer; The output control module is used to output a stacking release indication signal in response to the current production part number string containing the first N substrings; and to output an alarm indication signal in response to the current production part number string not containing the first N substrings.

[0015] Optionally, the QR code-based circuit board stacking control system further includes: The alarm deduplication module is used to generate a current alarm message in response to the current production part number string not containing the first N substrings. The content of the current alarm message is compared with that of the historical alarm messages; When the content of the current alarm message is the same as the content of the historical alarm message, suppress the output of the alarm pop-up window; When the content of the current alarm message differs from the content of the historical alarm message, the alarm pop-up command is output, and the current alarm message is updated to the historical alarm message.

[0016] Compared with the prior art, the present invention has the following beneficial effects: This invention discloses a method and system for controlling circuit board stacking based on QR codes. By pre-setting multiple mutually exclusive layer number field extraction strategies and using configuration flags for runtime selection, the same set of barcode processing logic can adapt to different manufacturers and barcode encoding specifications of different formats. It achieves compatibility with multiple barcode formats without modifying software code or changing hardware, significantly improving the versatility and flexibility of the stacking equipment in production line changeover scenarios. Second, by establishing a deterministic bijective mapping relationship between uppercase letters and even-numbered layer numbers, and lowercase letters and odd-numbered layer numbers, and explicitly fixing the unconventional order conventions of specific letters, automatic conversion from letter layer numbers to integer layer numbers is achieved, avoiding conversion errors and code redundancy caused by manually consulting lookup tables or writing conditional branch code. Third, by further performing local verification based on the inclusion relationship between barcode prefixes and production part numbers after layer number comparison is passed, it provides effective interception of mixed-version material issues within the same layer without relying on the manufacturing execution system network connection. Furthermore, the verification computation is minimal and does not affect the overall cycle time of the stacking process. Fourth, by setting up a two-level storage structure of the current scanning buffer and the historical buffer, and adopting a current code priority and historical code fallback acquisition strategy, the barcode acquisition logic is unified for both first-piece learning and normal operation scenarios. This simplifies the program implementation for subsequent processes to call barcode data and avoids null pointer exceptions or data loss caused by premature barcode clearing. Fifth, by setting independent configuration switches for each verification step, users can selectively enable or disable specific verification steps according to actual production line needs, making this technical solution flexibly adaptable to various production control scenarios from simple to complex. Sixth, by comparing the current alarm message with historical alarm messages when an alarm is triggered, and only outputting an alarm pop-up when the alarm content changes, the user experience degradation and system resource waste caused by repeated triggering of the same alarm due to the same fault during high-frequency polling of the control system are effectively avoided, improving the human-machine interaction friendliness of equipment operation. Attached Figure Description

[0017] Figure 1 This is a flowchart of a circuit board stacking processing control method based on QR codes in one embodiment of the present invention; Figure 2 This is a flowchart of the first-level multi-strategy decision tree in one embodiment of the present invention; Figure 3 This is a schematic diagram of the second-level letter layer number mapping bijection relationship in one embodiment of the present invention; Figure 4 This is a flowchart of the third-level part number prefix verification in one embodiment of the present invention; Figure 5 This is a schematic diagram of a circuit board stacking processing control system based on QR codes in one embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] In one embodiment, such as Figure 1 As shown, a method for controlling the stacking of circuit boards based on QR codes is provided, which can be applied to... Figure 1 Taking China as an example, the following specific steps will be used: S10: Obtain the raw barcode string collected by the barcode scanner.

[0020] Specifically, the stacking equipment controller establishes a communication connection with the barcode scanner. After the operator triggers the scanning action, the barcode scanner scans the barcode printed on the edge or process edge area of ​​the inner core board. The barcode can be in one-dimensional or two-dimensional form. The barcode scanner performs photoelectric conversion and decoding on the acquired barcode image to generate a raw barcode string, which is then sent to the stacking equipment controller via the communication interface. Upon receiving the raw barcode string, the stacking equipment controller stores it in the current scanning buffer. The current scanning buffer is a memory area used to store the current scanned data. This step provides the raw data foundation for subsequent barcode parsing and layer number extraction. This automatic scanning method avoids the errors and inefficiencies that might result from manual layer number entry by the operator.

[0021] S20: Extract the layer number field from the original barcode string according to the preset configuration strategy flag; the configuration strategy flag is used to indicate one of a variety of mutually exclusive layer number field extraction strategies.

[0022] Specifically, after acquiring the original barcode string, the stacking equipment controller calls the layer number field extraction function, named GetCodeSplit. This function reads pre-set configuration strategy flags at runtime. These configuration strategy flags are boolean parameters loaded from a persistent Extensible Markup Language (EXPLAIN) configuration file at system startup; only one of the multiple mutually exclusive strategy flags can be true at any given time. The GetCodeSplit function determines which extraction strategy to use based on the true / false status of the configuration strategy flags, and then locates and extracts the layer number field from the original barcode string according to the algorithm logic of that strategy. This step allows the same barcode processing logic to adapt to different manufacturers' barcode formats without modifying the program code. When the production line changes product models or switches PCB manufacturers, operators only need to modify the strategy flags in the configuration interface, and the system can correctly extract the layer number field according to the new barcode format, significantly reducing the debugging workload during equipment changeovers.

[0023] In this invention, the various mutually exclusive layer number field extraction strategies are detailed below: The first strategy is a start-and-end position-based truncation strategy, indicated by the configuration flag grBWordSplit. When grBWordSplit is true, the GetCodeSplit function reads the pre-configured start-position parameter gWordOne and end-position parameter gWordTwo. The function calculates the truncation length, which is equal to the end-position parameter gWordTwo minus the start-position parameter gWordOne plus one. The function then extracts a substring of the calculated length from the position indicated by the start-position parameter gWordOne in the original barcode string as the layer number field. This strategy is suitable for applications with a fixed barcode format and where the layer number field is located within a known range in the barcode.

[0024] The second strategy is to extract the intermediate substring using double delimiters, indicated by the configuration flag `grBDoubleIdentifiersSplit`. When `grBDoubleIdentifiersSplit` is true, the `GetCodeSplit` function reads the pre-configured first delimiter character `DoubleIdentifierOne` and the second delimiter character `DoubleIdentifierTwo`. The function first splits the original barcode string using the first delimiter character, obtaining the second array element after splitting. Then, it splits this array element using the second delimiter character, obtaining the first array element as the layer number field. This strategy is suitable for barcode formats where the layer number field is sandwiched between two fixed delimiter characters.

[0025] The third strategy is a suffix-based cropping and anchor character positioning extraction strategy, indicated by the configuration flag grBHSSpecialSplit. When grBHSSpecialSplit is true, the GetCodeSplit function executes the suffix-based cropping and anchor character positioning extraction strategy. This strategy is suitable for barcode formats where the layer number field is preceded by a lowercase letter 'l'; for barcode formats where the layer number field is preceded by other characters, other extraction strategies are selected through the configuration strategy flag. The specific implementation of this strategy is detailed in subsequent step S23.

[0026] The fourth strategy is to extract the barcode by truncation from the end of the anchor string identifier. This is the default strategy and is selected when all other strategy flags mentioned above are false. The `GetCodeSplit` function reads the pre-configured anchor string identifier `IdentifierOne`. The function locates the last occurrence of the anchor string identifier from right to left, starting from the end of the original barcode string. If the anchor string identifier cannot be located, the function returns zero as the extraction result. If the location is successful, the position after the anchor string identifier is taken as the starting position. The function checks if this starting position exceeds the length of the original barcode string; if it does, it returns zero. If it does not exceed the length, at most two characters after the starting position are taken as the layer number field, i.e., the truncation length is the smaller value between the remaining length of the original barcode string and two. This strategy is suitable for barcode formats where the layer number field is located at the end of the barcode and is guided by a specific identifier.

[0027] By configuring the above four strategies, this invention can be compatible with multiple barcode formats, significantly improving the system's versatility.

[0028] S30: When the layer number field contains letters, the corresponding bijective mapping table is called according to the case of the letters to convert the layer number field into an integer layer number; when the layer number field is a pure numeric string, the layer number field is directly determined as an integer layer number.

[0029] Specifically, after the stacking equipment controller extracts the layer number field in step S20, it iterates through and checks the string content of the layer number field to determine if it contains any letter characters. If the detection result indicates that the layer number field contains letter characters, it further checks whether the string content of the layer number field is a pure number between 2 and 9. If so, the layer number field is directly determined as an integer layer number without performing letter mapping conversion. If the layer number field contains letter characters and is not a number between 2 and 9, it checks the case of the letter characters. When the letter is uppercase, the uppercase letter bijective mapping function ChangToABC is called for conversion. This function has a built-in deterministic mapping table from uppercase letters to even integer layer numbers. When the letter is lowercase, the lowercase letter bijective mapping function ChangToabc is called for conversion. This function has a built-in deterministic mapping table from lowercase letters to odd integer layer numbers. If the detection result indicates that the layer number field does not contain any letter characters and is a pure numeric string, then the string is directly converted to an integer type to obtain an integer layer number. This step allows the system to automatically identify and convert alphanumeric layer number codes, eliminating conversion delays and human errors caused by manually consulting lookup tables. For multilayer boards with more than nine layers, when the layer number in the barcode appears in alphanumeric form, the system can automatically convert it into the correct integer layer number without manual intervention.

[0030] In one specific embodiment of the present invention, the specific mapping relationship of the bijective mapping table is as follows. In the uppercase letter mapping table, uppercase letter A is mapped to integer 10, uppercase letter B is mapped to integer 12, uppercase letter C is mapped to integer 14, uppercase letter D is mapped to integer 16, uppercase letter E is mapped to integer 18, uppercase letter F is mapped to integer 20, uppercase letter G is mapped to integer 22, uppercase letter H is mapped to integer 24, uppercase letter I is mapped to integer 26, uppercase letter J is mapped to integer 28, uppercase letter K is mapped to integer 30, uppercase letter M is mapped to integer 32, uppercase letter L is mapped to integer 34, uppercase letter N is mapped to integer 36, uppercase letter O is mapped to integer 38, uppercase letter P is mapped to integer 40, and uppercase letter Q is mapped to integer 42. In the lowercase letter mapping table, the lowercase letter 'a' is mapped to the integer 11, the lowercase letter 'b' to the integer 13, the lowercase letter 'c' to the integer 15, the lowercase letter 'd' to the integer 17, the lowercase letter 'e' to the integer 19, the lowercase letter 'f' to the integer 21, the lowercase letter 'g' to the integer 23, the lowercase letter 'h' to the integer 25, the lowercase letter 'i' to the integer 27, the lowercase letter 'j' to the integer 29, the lowercase letter 'k' to the integer 31, the lowercase letter 'm' to the integer 33, the lowercase letter 'l' to the integer 35, the lowercase letter 'n' to the integer 37, the lowercase letter 'o' to the integer 39, the lowercase letter 'p' to the integer 41, and the lowercase letter 'q' to the integer 43.

[0031] In the above mapping relationship, uppercase mapping values ​​start from the integer 10, with a step size of 2, covering the even number sequence from 10 to 42. Lowercase mapping values ​​start from the integer 11, with a step size of 2, covering the odd number sequence from 11 to 43. This mapping relationship covers the letter range of uppercase A to Q and lowercase a to q, meeting the layer number encoding requirements of the printed circuit board industry for boards with more than nine layers and up to forty-three layers. When the layer number field contains letters outside this range, the system triggers an alarm to prompt the operator to check the barcode format. In the above mapping table, the mapping values ​​of the letters L and M are interchanged relative to the normal alphabetical order. Uppercase letter M is mapped to the integer 32 while uppercase letter L is mapped to the integer 34, and lowercase letter m is mapped to the integer 33 while lowercase letter l is mapped to the integer 35. The aforementioned interchangeability is part of the barcode layer number encoding rule adopted in this embodiment. Specifically, in this embodiment, the letter M in the layer number field indicates an integer layer number 32, the letter L indicates an integer layer number 34, the letter m indicates an integer layer number 33, and the letter l indicates an integer layer number 35. The bijective mapping table on the stacking equipment side is pre-constructed according to this encoding rule, ensuring that the integer layer number obtained after the letter layer number in the barcode is converted by the table matches the layer number indicated by the encoding rule. This mapping table enumerates and completely provides a one-to-one correspondence between each letter in the range A to Q and a to q and the integer layer number. The conversion from letter layer number to integer layer number is entirely determined by the table lookup, without needing to infer the letter order during runtime. For example, when the extracted layer number field is M, the table lookup yields an integer layer number 32; when the extracted layer number field is l, the table lookup yields an integer layer number 35. This integer layer number is then compared with the target layer number in the stacking sequence table in step S40. Since step S40 will trigger an alarm when the two are inconsistent, the consistency between the mapping table and the barcode encoding rules can be verified in real time during the first piece learning stage and normal operation, and will not directly lead to incorrect stacking and release due to mapping errors.

[0032] In one specific embodiment of the present invention, the bijective mapping table conversion step and the step of determining whether the current production part number string contains the first N substrings each have independent configuration switches. The configuration switch corresponding to the bijective mapping table conversion step is strCodeTypeABC. When strCodeTypeABC is off, the bijective mapping table conversion step is bypassed, directly returning a pass result and continuing to execute subsequent steps. The configuration switch corresponding to the part number prefix verification step is grBQRCodeCheck. When grBQRCodeCheck is off, the part number prefix verification step is bypassed, directly returning a pass result and continuing to execute subsequent steps. The above configuration switches are loaded from the persistent extensible markup language configuration file when the system starts, and there is no switching overhead during operation. Through the setting of the above independent configuration switches, users can flexibly choose to enable or disable specific verification steps according to the actual quality control needs of the production line, realizing the free combination of multiple working modes and enhancing the system's adaptability to different production management requirements.

[0033] S40: Compare the integer layer number with the target layer number of the current layer in the stacking order table.

[0034] Specifically, after obtaining the integer layer number in step S30, the stacking equipment controller reads the stacking sequence table from memory. The stacking sequence table is a pre-configured data structure stored in the control system, recording the target layer number corresponding to the inner core board to be placed in each layer according to the stacking order. The stacking equipment controller obtains the layer position number corresponding to the current stacking process and queries the stacking sequence table for the target layer number corresponding to that layer position number. The controller compares the integer layer number obtained in step S30 with the target layer number. If they are equal, the comparison is considered successful, and subsequent steps are allowed to continue. If they are not equal, the comparison is considered unsuccessful, and the controller triggers an alarm and terminates the current stacking process. This step automates the verification of the stacking sequence, preventing the scrapping of the entire batch of PCBs due to incorrect placement order of the inner core boards. Compared to manual visual verification of layer numbers, this automatic comparison method eliminates the quality risks caused by human error.

[0035] S50: In response to the successful comparison, obtain the barcode to be verified from the current barcode scanning buffer or the historical buffer, extract the first N substrings of the barcode to be verified, where N is a preset integer, and determine whether the current production part number string contains the first N substrings; wherein, when obtaining the barcode to be verified, it is preferentially obtained from the current barcode scanning buffer, and if the current barcode scanning buffer is empty, it is obtained from the historical buffer.

[0036] Specifically, when the layer number comparison result in step S40 is successful, the stacking equipment controller enters the barcode part number verification stage, calling the part number verification function CheckQRCodeValidation. This function further calls the pure function ValidateQRCode to execute the core verification logic. The controller first performs the acquisition operation of the barcode to be verified. The acquisition logic prioritizes checking the current barcode buffer. If there is a non-empty barcode string in the current barcode buffer, the barcode string is directly read from the current barcode buffer as the barcode to be verified. If the current barcode buffer is empty, the barcode string is read from the historical buffer LastGetCode as the barcode to be verified. The historical buffer is the barcode data backup area saved when the layer number comparison is successful. After acquiring the barcode to be verified, the controller performs a string truncation operation on the barcode to be verified according to the preset truncation bit length N, that is, takes the first N characters of the barcode string as a substring. The controller then reads the production part number string corresponding to the current production task and determines whether the production part number string contains the first N substrings obtained in step S50. This step achieves adaptive acquisition of barcode sources through a two-level caching system, correctly acquiring the barcode to be verified in both first-piece learning and normal operation scenarios. This step also implements secondary anti-mixing verification beyond layer number comparison through inclusion relationship validation; even if the layer number is correct, the barcode will still be blocked if the barcode prefix does not match the current production part number.

[0037] In one specific embodiment of the present invention, the truncation length N is a preset integer parameter, usually a positive integer. The value of N is based on the length of the common prefix between the barcode and the production part number: N should not be greater than the length of the common prefix, otherwise the truncated first N substrings will not be contained in the production part number string, resulting in verification failure; the smaller N is, the more lenient the verification, and the larger N is, the more stringent the verification. In engineering, N can be selected within this range according to the tolerance for false release and false interception. In this embodiment, the common prefix of the barcode HSXXX_l04-v1_20261012 and the production part number HSXXX_l04-V2 is HSXXX_l, with a length of 7, so N is 7. When the barcode format or production part number encoding rules change, N can be adjusted accordingly during system configuration.

[0038] In one specific embodiment of the present invention, during the normal stacking operation, the original barcode string in the current scanning buffer is cleared after the comparison between the integer layer number and the target layer number passes, and the original barcode string is stored in the historical cache before being cleared. Specifically, after the layer number comparison in step S40 is determined to be successful, the stacking equipment controller performs a memory management operation on the barcode data. The controller first reads the content of the original barcode string in the current scanning buffer and copies the content to the historical cache for persistent storage. The historical cache is a storage area in memory independent of the current scanning buffer, specifically used to store processed barcode data. After completing the data copying, the controller clears the content of the original barcode string in the current scanning buffer, that is, sets the current scanning buffer to an empty string state. After the current scanning buffer is cleared, the stacking equipment controller can proceed to subsequent processes, such as the weighing process. If the weighing process or other subsequent processes need to obtain barcode data, they can read it from the historical cache. This clearing operation provides a clean memory state for subsequent processes, avoiding interference from old barcode data with the next round of scanning results. Meanwhile, the data backup in the historical cache ensures the traceability of barcode information in subsequent processes, providing a consistent barcode data access experience in both the first-piece learning scenario and normal operation scenarios. It should be noted that the above clearing operation is only performed during the normal stacking operation phase; during the first-piece learning phase, the original barcode string in the current scanning buffer remains in the current scanning buffer after successful comparison, and the above clearing operation is not performed, so that the barcode data can continue to be used in subsequent steps of the first-piece learning process.

[0039] In one specific embodiment of the present invention, the step of determining whether the current production part number string contains the first N substrings includes the following specific verification logic. The pure function ValidateQRCode receives three input parameters: the current production part number productNo, the barcode to be verified qrCode, and the truncation length checkLength. When the current production part number is empty or the barcode to be verified is empty, ValidateQRCode directly returns a true value, indicating that the verification passed. When the truncation length is less than or equal to zero, ValidateQRCode directly returns a true value, indicating that the verification passed. When the length of the barcode string to be verified is less than the truncation length, ValidateQRCode returns a false value, indicating that the verification failed. When none of the above defensive conditions are met, ValidateQRCode extracts the first N characters from the starting position of the barcode to be verified to obtain the first N substrings, and then determines whether the current production part number string contains the first N substrings. If it contains them, it returns a true value, indicating that the verification passed; if it does not contain them, it returns a false value, indicating that the verification failed. The verification logic uses an inclusion relationship rather than an equality relationship, allowing barcode prefixes to be embedded in different positions within the production part number string, thus accommodating different manufacturers' part number and barcode combination formats. Through this defensive design, the verification logic prioritizes ensuring the continuity of the production process when faced with abnormal data, avoiding unnecessary downtime due to the loss of non-critical data.

[0040] S60: In response to the current production part number string containing the first N substrings, output a stacking release indication signal; in response to the current production part number string not containing the first N substrings, output an alarm indication signal.

[0041] Specifically, the stacking equipment controller executes corresponding control outputs based on the judgment result of step S50. When the current production part number string in step S50 contains the first N substrings of the barcode, it indicates that the inner core board corresponding to the barcode not only matches the layer number but also that its barcode prefix is ​​consistent with the current production part number. The controller determines that the inner core board is the correct material required for the current process and then outputs a stacking release instruction signal to the external stacking machine execution mechanism. After receiving the release instruction signal, the stacking machine execution mechanism executes the placement action of the inner core board of the current layer and then enters the next layer stacking cycle. When the current production part number string in step S50 does not contain the first N substrings of the barcode, it indicates that although the layer number comparison is successful, the barcode prefix does not match the production part number, posing a risk of mixing different versions of the same layer. The controller determines that the current material has a version or model error and then outputs an alarm instruction signal to the external stacking machine execution mechanism. After receiving the alarm instruction signal, the stacking machine execution mechanism suspends operation and waits for manual intervention. This step automates the stacking process by signaling the verification results, ensuring timely shutdown of the production line when an anomaly is detected and preventing incorrect materials from being added to the product.

[0042] In one specific embodiment of the present invention, steps S10 to S60 constitute a barcode processing pipeline shared by the first-piece learning stage and the normal stacking operation stage. The first-piece learning stage and the normal stacking operation stage are two different operation stages in the stacking process, not two states coexisting at the same time. In the first-piece learning stage, after the barcode scanner collects the barcode, the original barcode string is stored in the current scanning buffer GetCode. This barcode data is always retained in the current scanning buffer during the execution of subsequent steps. After the comparison in step S40 passes, no clearing operation is performed. Therefore, when obtaining the barcode to be verified in step S50, it is directly read from the current scanning buffer. In the normal stacking operation stage, after the layer number comparison in step S40 passes, the original barcode string in the current scanning buffer is cleared. Therefore, when obtaining the barcode to be verified in step S50, the current scanning buffer is empty, and the system automatically reads the barcode data from the historical buffer LastGetCode. The acquisition logic of step S50 itself does not distinguish between stages; it always acquires the barcode to be verified in the order of priority for the current scanning buffer and fallback for the historical buffer. Through the above-mentioned code source adaptive mechanism, the two production scenarios share the same set of verification logic. The caller does not need to be aware of the scenario differences, which simplifies the program implementation and avoids null pointer exceptions caused by the barcode being cleared in advance.

[0043] The following example illustrates the complete workflow of steps S10 to S60.

[0044] For example, in a normal operating scenario, the original barcode string collected by the barcode scanner is HSXXX_l04-v1_20261012, and the current production part number is HSXXX_l04-V2. Step S10 obtains the original barcode string and stores it in the current scanning buffer GetCode. In step S20, the strategy flag grBHSSpecialSplit is configured to true, and a suffix-based cropping and anchor character positioning extraction strategy is adopted. The GetCodeSplit function first deletes the last four characters of the original barcode string, i.e., the last four characters of 20261012, to obtain HSXXX_l04-v1. The function locates the nearest lowercase letter 'l' in HSXXX_l04-v1 from right to left. After successful positioning, the substring 04-v1 after the anchor character 'l' is extracted. The function searches for the delimiter, i.e., the hyphen character, in this substring. After locating the hyphen, the substring 04 before the hyphen is extracted as the layer number field. In step S30, the layer number field 04 is detected as a pure numeric string, so the layer number field is directly determined as the integer layer number 4. Step S40 compares the integer layer number 4 with the target layer number 4 of the current layer in the stacking order table; the comparison passes. The original barcode string in the current scan buffer GetCode is cleared, and simultaneously stored in the history buffer LastGetCode. Step S50 calls CheckQRCodeValidation to perform part number verification. Since the current scan buffer GetCode is empty, the barcode to be verified, HSXXX_l04-v1_20261012, is read from the history buffer LastGetCode. The truncation bit length N is set to 7, based on the length of the common prefix HSXXX_l of the barcode and the production part number being 7; the first 7 bits of the barcode substring HSXXX_l are extracted. It is determined whether the current production part number HSXXX_l04-V2 contains HSXXX_l; the result is yes. Step S60 outputs a stacking release indication signal.

[0045] The three-stage processing pipeline of this invention can correctly complete barcode parsing, layer number comparison and material number verification under normal operating conditions, and finally output a release signal.

[0046] In one embodiment, step S20, namely the multiple mutually exclusive layer number field extraction strategies, further includes the following steps: S21: Truncation strategy based on start and end positions.

[0047] S22: Strategy for extracting intermediate substrings by double delimiters.

[0048] S23: Suffix-based cropping and anchor character positioning extraction strategy.

[0049] S24: Truncation strategy based on anchor string identifier from the end.

[0050] Specifically, such as Figure 2 As shown, steps S21 to S24 constitute the complete process of the first-level multi-strategy decision tree. After the original barcode string is input into the GetCodeSplit function, the function first determines whether the configuration flag grBWordSplit is true. If grBWordSplit is true, then step S21 is executed to extract the substring by locating the start and end positions. If grBWordSplit is false, then the function further determines whether the configuration flag grBDoubleIdentifiersSplit is true. If grBDoubleIdentifiersSplit is true, then step S22 is executed to extract the middle substring by double delimiters. If grBDoubleIdentifiersSplit is false, then the function further determines whether the configuration flag grBHSSpecialSplit is true. If grBHSSpecialSplit is true, then step S23 is executed to extract the substring by suffix trimming and anchor character location. If grBHSSpecialSplit is false, then step S24 is executed to extract the substring by locating the anchor string identifier from the end as the default strategy. The four strategies described above are executed mutually exclusively, with only one strategy selected at a time, ensuring the determinism and consistency of the extracted results from the layer number field. This decision tree structure is clear, and the strategies are independent of each other, facilitating rapid system location of the selected strategy and execution of the corresponding extraction logic during runtime.

[0051] In one embodiment, step S23, namely the extraction strategy based on suffix clipping and anchor character positioning, further includes the following steps: S231: Delete a fixed number of characters at the end of the original barcode string.

[0052] Specifically, when the suffix-based cropping and anchor character positioning extraction strategy is triggered, the GetCodeSplit function first obtains the total length of the original barcode string. The function then determines whether this total length is greater than a preset number of characters to be cropped at the end. In this embodiment, the number of characters to be cropped at the end is fixed at four. If the total length is less than or equal to four, the original barcode string is returned directly as the extraction result without performing subsequent cropping and positioning operations to prevent cropping operations from causing empty strings or out-of-bounds errors. If the total length is greater than four, the function starts truncating from the beginning of the original barcode string, with the truncated length being the total length minus four, thus obtaining the remaining string after deleting the last four characters. This suffix cropping step is used to remove serial numbers, date codes, or batch information at the end of the barcode that are unrelated to the layer number, avoiding these interfering information from affecting the subsequent anchor positioning accuracy.

[0053] S232: In the remaining string, locate the nearest lowercase letter l from right to left, and determine the lowercase letter l as the anchor character.

[0054] Specifically, the GetCodeSplit function performs a reverse search operation from right to left in the remaining string obtained in step S231. Starting from the last character of the remaining string, the function iterates through each character to the left, searching for the presence of a lowercase letter 'l'. In this barcode format, a lowercase letter 'l' always appears before the layer number field as a leading character; therefore, this lowercase letter 'l' is used as the anchor character. In this embodiment, the extraction strategy described in step S23 is applicable to barcode formats where the layer number field is preceded by a lowercase letter 'l'; for barcode formats where the layer number field is preceded by other characters, the extraction strategy described in steps S21, S22, or S24 is selected by configuring the strategy flag. The search stops when the first lowercase letter 'l' is found, and the index position of this lowercase letter 'l' in the remaining string is recorded. If no lowercase letter 'l' is found after traversing the entire remaining string, the original barcode string is returned directly as the extraction result without performing subsequent truncation operations. The returned original barcode string will be detected in step S30 and compared with the target layer number in step S40. If it does not conform to the stacking order, an alarm will be triggered, thereby avoiding the output of incorrect layer numbers due to missing anchor points. This right-to-left positioning method ensures that when there are multiple lowercase letters 'l' in the remaining string, the one closest to the end of the layer number field is always taken as the positioning reference, improving the accuracy of positioning.

[0055] S233: Taking the first character after the anchor character as the starting position and the position before the next separator as the ending position, extract the substring between the two as the layer number field; wherein, when there is no separator after the anchor character, extract all characters after the anchor character as the layer number field.

[0056] Specifically, after locating the index position of the lowercase letter 'l' in step S232, the GetCodeSplit function uses the first character after 'l' as the starting position of the layer number field. The function then traverses the remaining string to the right from this starting position, searching for a separator (in this embodiment, a hyphen). If a separator is found, the position before the separator is used as the ending position of the layer number field, and the substring from the starting position to the ending position is extracted as the layer number field. If no separator is found from the starting position to the end of the string, all characters from the lowercase letter 'l' to the end of the string are extracted as the layer number field. This step, through dual positioning of anchor characters and separators, accurately extracts the layer number field, eliminating version numbers or other additional information bounded by separators, ensuring the purity of the extraction result. This suffix trimming and anchor character positioning extraction strategy can accurately extract layer number information from long barcodes containing, for example, dates and serial numbers, providing correct input for subsequent layer number comparisons.

[0057] In one embodiment, in step S30, i.e. in the bijective mapping table, the mapping values ​​of the letters L and M are swapped relative to the normal alphabetical order, wherein the uppercase letter M is mapped to integer 32, the uppercase letter L is mapped to integer 34, the lowercase letter m is mapped to integer 33, and the lowercase letter l is mapped to integer 35.

[0058] Specifically, such as Figure 3 As shown, the bijective mapping table is a pre-constructed, deterministic mapping table of letters to integers, embedded in the program code. In this mapping table, uppercase letters A through K are mapped sequentially to even-numbered sequences starting from 10 with a step size of two: uppercase A maps to 10, uppercase B to 12, uppercase C to 14, uppercase D to 16, uppercase E to 18, uppercase F to 20, uppercase G to 22, uppercase H to 24, uppercase I to 26, uppercase J to 28, and uppercase K to 30. Uppercase letter M maps to integer 32, uppercase letter L to integer 34, uppercase letter N to integer 36, uppercase letter O to integer 38, uppercase letter P to integer 40, and uppercase letter Q to integer 42. This mapping table explicitly interchanges the mapping values ​​of letters L and M relative to the normal alphabetical order. The lowercase letters a through k are mapped sequentially to odd-numbered sequences of two increments starting from 11: lowercase a maps to 11, lowercase b to 13, lowercase c to 15, lowercase d to 17, lowercase e to 19, lowercase f to 21, lowercase g to 23, lowercase h to 25, lowercase i to 27, lowercase j to 29, and lowercase k to 31. The lowercase letter m maps to the integer 33, lowercase l to 35, lowercase n to 37, lowercase o to 39, lowercase p to 41, and lowercase q to 43. All uppercase mappings are even-numbered, and all lowercase mappings are odd-numbered, together covering all integer levels from 10 to 43. The mapping table described above is constructed according to the barcode layer number encoding rules adopted in this embodiment: in this encoding rule, uppercase letters indicate even layer numbers, lowercase letters indicate odd layer numbers, and the layer indicated by the letter M appears before the layer indicated by the letter L. Therefore, in the mapping table, the letter M corresponds to the integer 32, the letter L corresponds to the integer 34, the letter m corresponds to the integer 33, and the letter l corresponds to the integer 35. This mapping table records the correspondence between each letter in the range A to Q and a to q and the integer layer number in an enumerated manner. Those skilled in the art can complete the conversion from letter layer number to integer layer number according to this table. The conversion result will also be compared with the target layer number in the stacking order table in step S40. If they are inconsistent, an alarm will be triggered, thereby verifying the consistency between the mapping table and the barcode encoding rules.

[0059] In one embodiment, in step S30, namely the bijective mapping table conversion step and / or the step of determining whether the current production part number string contains the first N substrings, each has an independent configuration switch; when the configuration switch is in the off state, the corresponding step directly returns to pass and continues to execute subsequent steps.

[0060] Specifically, the bijective mapping table conversion step has an independent first configuration switch, strCodeTypeABC, which controls whether the conversion function from letter layer numbers to integer layer numbers is enabled. When strCodeTypeABC is enabled (true), the bijective mapping table conversion step is executed normally; that is, if the layer number field contains letters, it is converted according to the bijective mapping table. When strCodeTypeABC is disabled (false), the bijective mapping table conversion step is bypassed, and a pass result is returned directly, continuing to execute subsequent steps. In this case, regardless of whether the layer number field contains letters, no letter conversion operation is performed, and the layer number field directly participates in subsequent processing in its original string form. The step of determining whether the current production part number string contains the first N substrings, i.e., the part number prefix verification step, has an independent second configuration switch, grBQRCodeCheck, which controls whether the part number prefix verification function is enabled. When grBQRCodeCheck is enabled (true), the part number prefix verification step is executed normally. When grBQRCodeCheck is off (i.e., false), the part number prefix verification step is bypassed, and the CheckQRCodeValidation function directly returns true without executing any verification logic. The above configuration switch is loaded from the persistent extensible markup language configuration file at system startup, incurring no switching overhead during runtime. By setting these independent configuration switches, users can flexibly choose to enable or disable specific verification steps according to the actual quality control needs of the production line, achieving multiple working modes from layer number comparison only to complete three-level verification, thus enhancing the system's adaptability to different production management requirements.

[0061] In one embodiment, step S50, namely determining whether the current production part number string contains the first N substrings, further includes the following steps: S51: The verification passes when the current production part number string contains the first N substrings.

[0062] S52: The verification fails when the current production part number string does not contain the first N substrings.

[0063] S53: When the current production part number string is empty, the barcode to be verified is empty, or N is less than or equal to zero, the verification is directly determined to be successful.

[0064] Specifically, such as Figure 4As shown, the pure function `ValidateQRCode` executes the core validation logic. The function first performs defensive condition checks. It checks whether the current production part number string or the barcode to be validated is empty. If either is empty, it returns true, meaning the validation passed. The function also checks whether the preset truncation length N is less than or equal to zero. If N is less than or equal to zero, it returns true, meaning the validation passed. When none of the above defensive conditions are met, the function checks whether the total length of the barcode string to be validated is less than the preset truncation length N. If the length is insufficient, it returns false, meaning the validation failed. When the barcode length is greater than or equal to N, the function truncates the first N characters from the starting position of the barcode to obtain the first N substrings. The function then uses a string inclusion check to check whether the current production part number string contains these first N substrings. If it does, the validation passed; otherwise, it failed. This validation logic uses an inclusion relationship rather than an equality relationship, allowing the barcode prefix to be embedded in different positions within the production part number string, adapting to different manufacturers' part number and barcode combination formats. Through the above defensive design, the verification logic can prioritize ensuring the continuity of the production process when faced with abnormal data, avoiding unnecessary downtime caused by the lack of non-critical data, while providing accurate matching judgment when the verification data is complete.

[0065] In one embodiment, the circuit board stacking processing control method based on QR codes further includes the following steps: S70: In response to the fact that the current production part number string does not contain the first N substrings, generate a current alarm message.

[0066] Specifically, when the stacking equipment controller determines in step S50 that the current production part number string does not contain the first N substrings (i.e., the part number prefix verification fails), it performs an alarm message generation operation. The controller generates a current alarm message containing error type information and relevant data based on the specific reason for the verification failure. The current alarm message includes the current production part number string, at least a portion of the barcode to be verified, and a description of the reason for the verification failure. This alarm message is stored in the controller's alarm message cache for subsequent alarm deduplication and pop-up display.

[0067] S80: Compare the content of the current alarm message with the historical alarm messages.

[0068] Specifically, after generating the current alarm message in step S70, the stacking equipment controller reads the previously saved historical alarm message from memory. The historical alarm message is the content of the alarm message generated and saved when the previous verification failed. The controller performs a string content comparison operation, performing a complete match comparison between the string content of the current alarm message and the string content of the historical alarm message. If the two string contents are exactly the same, it is determined to be a duplicate alarm; if the two string contents are different, it is determined to be a new alarm.

[0069] S90: When the content of the current alarm message is the same as the content of the historical alarm message, suppress the output of the alarm pop-up window.

[0070] Specifically, when the comparison result of step S80 shows that the current alarm message is the same as the historical alarm message, the stacking equipment controller determines that the current verification failure and the previous verification failure belong to the same fault cause. At this time, the controller suppresses the output of the alarm pop-up, that is, it does not send a pop-up display command to the human-machine interface. Since the control system uses a high-frequency polling method to check the verification results, the same error will be repeatedly triggered if the fault is not eliminated. This suppression mechanism avoids the repeated pop-up of alarm pop-ups with the same content in a short period of time, prevents the alarm window from blocking the human-machine interface, and significantly improves the fault handling experience of the operator.

[0071] S100: When the content of the current alarm message is different from the content of the historical alarm message, output the alarm pop-up command and update the current alarm message to the historical alarm message.

[0072] Specifically, when the comparison result of step S80 shows that the current alarm message differs from the historical alarm message, the stacking equipment controller determines that the current verification failure is a new fault type or a change in the cause of the fault. At this time, the controller outputs an alarm pop-up command to an external display device. This command carries the content of the current alarm message and is used to display the alarm information on the human-machine interface to prompt the operator. Simultaneously with outputting the alarm pop-up command, the controller saves the content of the current alarm message to the historical alarm message storage area to update the historical alarm messages. After this update operation, the next verification failure will use the updated alarm message as the comparison benchmark. Through this alarm deduplication mechanism, different types of errors can be promptly displayed to the operator, while recurring errors of the same type are automatically suppressed, simplifying alarm prompts and facilitating operators to quickly locate and resolve production line anomalies.

[0073] In one embodiment, such as Figure 5As shown, a QR code-based circuit board stacking processing control system is provided. This QR code-based circuit board stacking processing control system corresponds one-to-one with the QR code-based circuit board stacking processing control method in the above embodiments. The QR code-based circuit board stacking processing control system includes: a barcode acquisition module, a layer number field extraction module, an alphanumeric layer number conversion module, a layer number comparison module, a part number verification module, and an output control module. The detailed descriptions of each functional module are as follows: The barcode acquisition module is used to acquire the raw barcode string collected by the barcode scanner.

[0074] The layer number field extraction module is used to extract the layer number field from the original barcode string according to a preset configuration strategy flag; the configuration strategy flag is used to indicate one of a variety of mutually exclusive layer number field extraction strategies.

[0075] The letter layer number conversion module is used to convert the layer number field into an integer layer number by calling the corresponding bijective mapping table according to the case of the letter when the layer number field contains letters; when the layer number field is a pure numeric string, the layer number field is directly determined as an integer layer number.

[0076] The layer number comparison module is used to compare the integer layer number with the target layer number of the current layer in the stacking order table.

[0077] The part number verification module is used to, in response to the successful comparison, obtain the barcode to be verified from the current scanning buffer or the historical buffer, extract the first N substrings of the barcode to be verified, where N is a preset integer, and determine whether the current production part number string contains the first N substrings; wherein, when obtaining the barcode to be verified, it is preferentially obtained from the current scanning buffer, and if the current scanning buffer is empty, it is obtained from the historical buffer.

[0078] The output control module is used to output a stacking release indication signal in response to the current production part number string containing the first N substrings; and to output an alarm indication signal in response to the current production part number string not containing the first N substrings.

[0079] Specifically, the barcode acquisition module operates within the stacking equipment controller, establishing a communication connection with the barcode scanner and receiving the raw barcode string sent by the scanner. The layer number field extraction module receives the raw barcode string from the barcode acquisition module, reads the preset configuration strategy flag, selects the corresponding extraction strategy based on the flag, and extracts the layer number field according to the algorithm logic of the selected strategy. The letter layer number conversion module receives the layer number field from the layer number field extraction module, performs letter detection and case sensitivity judgment on the field, and calls the corresponding bijective mapping table or directly performs integer conversion based on the judgment result, outputting an integer layer number. The layer number comparison module receives the integer layer number from the letter layer number conversion module, reads the target layer number of the current layer from the stacking sequence table, compares the two, and outputs the comparison result. The part number verification module is triggered when the layer number comparison result is successful. It obtains the barcode to be verified from the current scanning buffer or historical buffer, extracts the first N substrings, determines whether the production part number contains this substring, and outputs the verification result. The output control module receives the verification result from the part number verification module and outputs a stacking release indication signal or an alarm indication signal to the stacking machine's actuator based on the verification result. The data transmission between the above modules forms a complete automated processing chain of barcode parsing, layer number recognition, layer number comparison, part number verification, and control output. The functional division of each module is clear, which facilitates software implementation and subsequent functional expansion.

[0080] Furthermore, the aforementioned QR code-based circuit board stacking control system also includes: The alarm deduplication module is used to generate a current alarm message in response to the current production part number string not containing the first N substrings. The content of the current alarm message is compared with that of the historical alarm messages; When the content of the current alarm message is the same as the content of the historical alarm message, suppress the output of the alarm pop-up window; When the content of the current alarm message differs from the content of the historical alarm message, the alarm pop-up command is output, and the current alarm message is updated to the historical alarm message.

[0081] Specifically, the alarm deduplication module is triggered when the part number verification module outputs a verification failure. The module first generates a current alarm message containing the error reason and on-site data. Then, it reads the previously saved historical alarm message from the storage unit and performs a string-level comparison between the current alarm message and the historical alarm message. If the comparison results show identical content, the alarm deduplication module determines this alarm is a duplicate alarm and does not send a pop-up command to the display device. If the comparison results show different content, the alarm deduplication module determines this alarm is a new alarm, sends a pop-up command to the display device to show the current alarm message, and simultaneously writes the current alarm message to the storage unit to update the historical alarm message. Through this alarm deduplication module, the system will not repeatedly pop up alarm windows with the same content when the same type of verification fails consecutively, reducing the operator's workload in closing duplicate alarm windows and ensuring the cleanliness and usability of the human-machine interface.

[0082] Specific limitations regarding the QR code-based PCB stacking processing control system can be found in the above description of the limitations of the QR code-based PCB stacking processing control method, and will not be repeated here. Each module in the aforementioned QR code-based PCB stacking processing control system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0083] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc. 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 used as 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 system can be divided into different functional units or modules to complete all or part of the functions described above.

[0084] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for controlling the stacking of circuit boards based on QR codes, characterized in that, include: Obtain the raw barcode string collected by the barcode scanner; Based on the preset configuration strategy flag, the layer number field is extracted from the original barcode string; The configuration strategy flag is used to indicate one of a variety of mutually exclusive layer number field extraction strategies; When the layer number field contains letters, the corresponding bijective mapping table is called according to the case of the letters to convert the layer number field into an integer layer number; when the layer number field is a pure numeric string, the layer number field is directly determined as an integer layer number. Compare the integer layer number with the target layer number of the current layer in the stacking sequence table; In response to the successful comparison, the barcode to be verified is obtained from the current scanning buffer or the historical buffer, and the first N substrings of the barcode to be verified are extracted, where N is a preset integer. It is then determined whether the current production part number string contains the first N substrings. When obtaining the barcode to be verified, it is preferentially obtained from the current scanning buffer. If the current scanning buffer is empty, it is obtained from the historical buffer. If the current production part number string contains the first N substrings, output a stacking release indication signal; if the current production part number string does not contain the first N substrings, output an alarm indication signal.

2. The circuit board stacking processing control method based on QR codes according to claim 1, characterized in that, The various mutually exclusive layer number field extraction strategies include: A truncation strategy based on start and end positions; Strategy for extracting intermediate substrings using double delimiters; Suffix-based cropping and anchor character positioning extraction strategy; The strategy is to extract the substring from the end based on the anchor string identifier.

3. The circuit board stacking processing control method based on QR codes according to claim 2, characterized in that, The suffix-based cropping and anchor character positioning extraction strategy includes: Delete a fixed number of characters from the end of the original barcode string; In the remaining string, locate the nearest lowercase letter 'l' from right to left, and determine the lowercase letter 'l' as the anchor character; Taking the first character after the lowercase letter 'l' as the starting position and the position before the next separator as the ending position, the substring between the two is extracted as the layer number field; Specifically, when there is no separator after the lowercase letter 1, all characters after the lowercase letter 1 are extracted as the layer number field.

4. The circuit board stacking processing control method based on QR codes according to claim 1, characterized in that, In the bijective mapping table, the mapping values ​​of the letters L and M are swapped relative to the normal alphabetical order. The uppercase letter M is mapped to the integer 32, the uppercase letter L is mapped to the integer 34, the lowercase letter m is mapped to the integer 33, and the lowercase letter l is mapped to the integer 35.

5. The circuit board stacking processing control method based on QR codes according to claim 1, characterized in that, The step of determining whether the current production part number string contains the first N substrings includes: The verification passes when the current production part number string contains the first N substrings; The verification fails when the current production part number string does not contain the first N substrings. When the current production part number string is empty, the barcode to be verified is empty, or N is less than or equal to zero, the verification is directly determined to be successful.

6. The circuit board stacking processing control method based on QR codes according to claim 1, characterized in that, During the normal stacking operation phase, the original barcode string in the current scanning buffer is cleared after the integer layer number and the target layer number are matched and passed, and the original barcode string is stored in the history cache before being cleared; during the first piece learning phase, the original barcode string in the current scanning buffer is retained in the current scanning buffer after the comparison is passed.

7. The circuit board stacking processing control method based on QR codes according to claim 1, characterized in that, Also includes: In response to the fact that the current production part number string does not contain the first N substrings, a current alarm message is generated; The content of the current alarm message is compared with that of the historical alarm messages; When the content of the current alarm message is the same as the content of the historical alarm message, suppress the output of the alarm pop-up window; When the content of the current alarm message differs from the content of the historical alarm message, the alarm pop-up command is output, and the current alarm message is updated to the historical alarm message.

8. The circuit board stacking processing control method based on QR codes according to claim 1, characterized in that, The bijective mapping table conversion step and / or the step of determining whether the current production part number string contains the first N substrings each have independent configuration switches; When the configuration switch is in the off state, the corresponding step returns to pass and continues to execute the subsequent steps.

9. A circuit board stacking processing control system based on QR codes, characterized in that, include: The barcode acquisition module is used to acquire the raw barcode string collected by the barcode scanner; The layer number field extraction module is used to extract the layer number field from the original barcode string according to a preset configuration strategy flag; the configuration strategy flag is used to indicate one of a variety of mutually exclusive layer number field extraction strategies. The letter layer number conversion module is used to convert the layer number field into an integer layer number by calling the corresponding bijective mapping table according to the case of the letter when the layer number field contains letters; when the layer number field is a pure numeric string, the layer number field is directly determined as an integer layer number. The layer number comparison module is used to compare the integer layer number with the target layer number of the current layer in the stacking order table; The part number verification module is used to, in response to the successful comparison, obtain the barcode to be verified from the current scanning buffer or the historical buffer, extract the first N substrings of the barcode to be verified, where N is a preset integer, and determine whether the current production part number string contains the first N substrings; wherein, when obtaining the barcode to be verified, it is preferentially obtained from the current scanning buffer, and if the current scanning buffer is empty, it is obtained from the historical buffer; The output control module is used to output a stacking release indication signal in response to the current production part number string containing the first N substrings; and to output an alarm indication signal in response to the current production part number string not containing the first N substrings.

10. The circuit board stacking control system based on QR codes according to claim 9, characterized in that, Also includes: The alarm deduplication module is used to generate a current alarm message in response to the current production part number string not containing the first N substrings. The content of the current alarm message is compared with that of the historical alarm messages; When the content of the current alarm message is the same as the content of the historical alarm message, suppress the output of the alarm pop-up window; When the content of the current alarm message differs from the content of the historical alarm message, the alarm pop-up command is output, and the current alarm message is updated to the historical alarm message.