Sample tube rack visual identification method, system and chip
Patent Information
- Application Number
- CN202510342288.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2045-03-21
AI Technical Summary
[0003]本发明要解决的技术问题是现有的管理系统采用RFID标签和天线矩阵,其缺点为设备成本高昂,维护成本高,适用性差,本发明提供一种样品管排组视觉识别方法,本发明还提供一种样品管排组视觉识别系统,能够在降低成本、提高适用性和识别率的同时,增加了核验、统计和自定义规则的功能,显著提升了样品识别和排列管理的效率和准确性,用以解决现有技术导致的缺陷
[0046]低成本:通过二维码(或条形码)和视觉识别技术,避免了现有技术中RFID标签和天线矩阵的高成本问题,降低了设备及维护费用;高适用性:无需样品容器适配特定设备,提升了技术的通用性和灵活性;高识别率:在保证高识别率的前提下,实现了对样品排列方式的批量识别和孔位-样品映射图的生成;核验功能:能够核验样品孔位是否正确,并通过用户自定义规则判断样品排列是否满足要求,提升了操作的准确性和智能化;统计功能:可对识别到的样品进行统计,进一步增强了数据处理能力;灵活性:允许用户自定义规则,满足多样化的排列需求,提升了技术的实用性;总之,本发明在降低成本、提高适用性和识别率的同时,增加了核验、统计和自定义规则的功能,显著提升了样品识别和排列管理的效率和准确性。
Smart Images

Figure CN120411665B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual recognition of sample tube arrays, and specifically to a visual recognition method, system and chip for sample tube arrays. Background Technology
[0002] Currently, in one or more sample containers, the arrangement of one or more samples is identified in batches to generate a well-sample mapping map to verify whether the sample is in the correct well position. User-defined rules are used to determine whether the sample arrangement in each direction meets the requirements, and the identified samples are statistically analyzed. Compared to existing technologies (such as the RFID-based intelligent management system and method for biobanks, patent number CN113762435A), which uses RFID tags and antenna matrices, the disadvantages of these technologies include high equipment costs, high maintenance costs, and poor applicability (the sample containers must be compatible with the antenna matrix). Therefore, an innovative visual recognition scheme using QR code (or barcode) tags is needed. This scheme overcomes the above disadvantages while ensuring the highest possible recognition rate and allows users to define their own rules to determine whether the arrangement requirements are met. Summary of the Invention
[0003] The technical problem this invention aims to solve is that existing management systems using RFID tags and antenna matrices suffer from drawbacks such as high equipment costs, high maintenance costs, and poor applicability. This invention provides a visual recognition method for sample tube arrays, and also provides a visual recognition system for sample tube arrays. This system can reduce costs, improve applicability and recognition rate, while adding verification, statistical and custom rule functions, significantly improving the efficiency and accuracy of sample identification and array management, thereby overcoming the shortcomings caused by existing technologies.
[0004] To solve the above-mentioned technical problems, the present invention provides the following technical solutions:
[0005] In a first aspect, a visual recognition method for sample tube arrays includes the following steps:
[0006] Acquire image data of the sample based on the received control commands;
[0007] A mapping table is generated based on image data processing;
[0008] Obtain rule data;
[0009] Based on the rule data, determine whether the mapping table meets the rules to obtain comparison data.
[0010] The above-mentioned visual recognition method for sample tube arrays includes the following specific method for generating a mapping table based on the image data:
[0011] The image data is standardized to obtain image preprocessed data;
[0012] The image preprocessing data is subjected to visual recognition to obtain the image's label information;
[0013] The tag information is sorted and grouped to obtain a mapping table.
[0014] The above-mentioned visual recognition method for sample tube arrays includes standard formatting processing, which includes format conversion, grayscale threshold sampling, effective area recognition, image horizontal correction, and cropping.
[0015] The label information includes image content data and geometric coordinate information of the image QR code / barcode;
[0016] The sorting process includes rasterizing the geometric coordinate information of the image QR code / barcode to determine the row and column of each sample, and outputting the sample-well mapping table.
[0017] In a second aspect, a visual recognition system for sample tube arrays includes an image sampling device, a control terminal, a cloud server, and a user interaction module. Multiple image sampling devices establish connections with the control terminal for data interaction, multiple control terminals establish connections with the cloud server for data interaction, and the cloud server establishes a connection with the user interaction module for data interaction.
[0018] The image sampling device is used to receive control commands and perform image sampling according to the control commands to obtain image data;
[0019] The control terminal includes a communication control module, a data processing module, a data management module, and a data recording and statistics module;
[0020] The communication control module is used to communicate with the image sampling device to transmit the control commands, receive the image data, and also to communicate with the cloud server to obtain rule data.
[0021] The data processing module is used to process the image data to obtain a mapping table;
[0022] The data management module is used to obtain the rule data and the mapping table, and compare the mapping table to see if it satisfies the rule data to obtain comparison data;
[0023] The data recording and statistics module is used to acquire and store the image data, the rule data, the mapping table, and the comparison data, and then transmit them to the cloud server through the communication control module for storage and monitoring.
[0024] The user interaction module is used for data interaction between the user and the cloud server.
[0025] The cloud server is used to synchronize historical data with each of the control terminals in real time.
[0026] The above-mentioned sample tube arrangement visual recognition system, wherein the data processing module includes an image preprocessing module, a visual recognition module, and an arrangement algorithm module;
[0027] The image preprocessing module is used to perform standard formatting on the image data to obtain image preprocessed data;
[0028] The visual recognition module is used to perform visual recognition on the image preprocessing data and output the image's label information;
[0029] The sorting algorithm module is used to sort the tag information to obtain a mapping table.
[0030] The above-mentioned visual recognition system for sample tube arrays includes standard formatting processing, which includes grayscale threshold sampling and image horizontal correction and cropping.
[0031] The label information includes image content data and geometric coordinate information of the image QR code / barcode;
[0032] The sorting process includes rasterizing the geometric coordinate information of the image QR code / barcode to determine the row and column of each sample, and outputting the sample-well mapping table.
[0033] In the above-mentioned visual recognition system for sample tube arrays, the data recording and statistics module has a built-in terminal status data module, and the image sampling device has a built-in device status data module.
[0034] The terminal status data module is used to collect terminal status data of the control terminal and store it in the data recording and statistics module. The terminal status data includes terminal operation log, terminal running log, and terminal abnormal data.
[0035] The device status data module is used to collect device status data of the image sampling device and transmit it to the data recording and statistics module. The device status data includes device working status, device operation log, device operation log, and device error warning information.
[0036] The data recording and statistics module is used to acquire the terminal status data and the device status data and upload them to the cloud server.
[0037] In the above-mentioned visual recognition system for sample tube arrays, the cloud server has a built-in data storage module and a data monitoring module. The data storage module is used to acquire and store the image data, the rule data, the mapping table, the comparison data, the terminal status data, and the device status data. The data monitoring module is used to monitor the above data to obtain monitoring data.
[0038] The above-mentioned visual recognition system for sample tube arrays includes a communication control module comprising a DSL compiler, a DSL bytecode interpreter, a basic communication program module, a hardware abstraction layer, and a remote communication program module.
[0039] The DSL compiler is used to read DSL files and compile them into DSL bytecode, which is binary data.
[0040] The DSL bytecode interpreter contains a processing scheme for interpreting and executing manipulation data defined by the DSL file;
[0041] The basic communication program module is used to transmit the interpreted manipulation data to the image sampling device through a hardware interface;
[0042] The hardware abstraction layer is used to call the DSL bytecode and also to derive fixed functions;
[0043] The remote communication program module is used to receive and update the DSL file distributed by the cloud server, and also to execute and respond to the control commands issued by the cloud server, and send the execution results of the commands.
[0044] Thirdly, a chip, wherein the chip stores a computer program that, when executed by a processor, implements the steps of the method described in any one of the first aspects.
[0045] The technical solutions provided by the visual recognition method, system, and chip for sample tube arrays according to the present invention have the following technical effects:
[0046] Low cost: By using QR codes (or barcodes) and visual recognition technology, the high cost of RFID tags and antenna matrices in existing technologies is avoided, reducing equipment and maintenance costs; High applicability: No sample container needs to be adapted to specific equipment, improving the versatility and flexibility of the technology; High recognition rate: While ensuring a high recognition rate, batch recognition of sample arrangement and generation of well position-sample mapping diagrams are achieved; Verification function: It can verify whether the sample well positions are correct and determine whether the sample arrangement meets the requirements through user-defined rules, improving the accuracy and intelligence of the operation; Statistical function: It can perform statistics on the identified samples, further enhancing data processing capabilities; Flexibility: It allows users to define rules to meet diverse arrangement needs, improving the practicality of the technology; In summary, this invention, while reducing costs, improving applicability and recognition rate, adds verification, statistical, and custom rule functions, significantly improving the efficiency and accuracy of sample identification and arrangement management. Attached Figure Description
[0047] Figure 1 This is a flowchart of a visual recognition method for sample tube arrays according to the present invention;
[0048] Figure 2 This is a schematic diagram of the structure of a visual recognition system for sample tube arrays according to the present invention;
[0049] Figure 3 This is a schematic diagram of the communication control module in a visual recognition system for sample tube arrays according to the present invention.
[0050] Figure 4 This is a diagram illustrating the compilation results of DSL.
[0051] Figure 5 This is a schematic diagram of the hardware abstraction layer call process;
[0052] Figure 6 This is a flowchart illustrating the workflow of the image preprocessing module in a visual recognition system for sample tube arrays according to the present invention.
[0053] Figure 7 This is a diagram showing the effect of image preprocessing module in a visual recognition system for sample tube arrays according to the present invention.
[0054] Figure 8 This is a flowchart illustrating the workflow of the visual recognition module in a sample tube array visual recognition system of the present invention.
[0055] Figure 9 This is a schematic diagram of the recognition result of the visual recognition module in a sample tube array visual recognition system of the present invention;
[0056] Figure 10 A schematic diagram of the rectangular area for QR code recognition;
[0057] Figure 11 This is a flowchart illustrating the workflow of the grouping algorithm module in a visual recognition system for sample tube grouping according to the present invention.
[0058] Figure 12 This is a schematic diagram of the result of the grouping algorithm module in a sample tube grouping visual recognition system of the present invention;
[0059] Figure 13 This is the final rendering;
[0060] Figure 14 This is a flowchart illustrating the workflow of the data management module in a visual recognition system for sample tube arrays according to the present invention.
[0061] Figure 15 The DSL file only shows a description diagram of the lighting control section;
[0062] Figure 16 The DSL file only shows a description diagram of the lighting control section.
[0063] The accompanying figure is labeled as follows:
[0064] Image sampling device 100, control terminal 200, cloud server 300, user interaction module 400, communication control module 101, data processing module 102, data management module 103, data recording and statistics module 104, image preprocessing module 105, visual recognition module 106, grouping algorithm module 107, DSL compiler 108, DSL bytecode interpreter 109, basic communication program module 110, hardware abstraction layer 111, remote communication program module 112, data storage module 301, and data monitoring module 302. Detailed Implementation
[0065] In order to make the technical means, inventive features, objectives and effects of the invention easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to specific illustrations. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0066] 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.
[0067] It should be noted that the structures, proportions, sizes, etc., illustrated in the accompanying drawings of this specification are only used to complement the content disclosed in the specification for those skilled in the art to understand and read, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.
[0068] Furthermore, the terms such as "upper," "lower," "left," "right," "middle," and "one" used in this specification are merely for clarity of description and are not intended to limit the scope of the invention. Any changes or adjustments to their relative relationships, without substantially altering the technical content, should also be considered within the scope of the invention.
[0069] The purpose of this invention is to reduce costs, improve applicability and recognition rate, while adding verification, statistical and custom rule functions, which significantly improves the efficiency and accuracy of sample identification and arrangement management.
[0070] like Figure 1 As shown in the first embodiment, a visual recognition method for sample tube arrays includes the following steps:
[0071] Acquire image data of the sample based on the received control commands;
[0072] A mapping table is generated based on image data processing;
[0073] Obtain rule data;
[0074] Based on the rule data, determine whether the mapping table meets the rules to obtain comparison data.
[0075] The above-mentioned visual recognition method for sample tube arrays includes the following specific method for generating a mapping table based on image data processing:
[0076] Image data is standardized to obtain image preprocessed data;
[0077] Image label information is obtained by performing visual recognition on preprocessed image data;
[0078] The tag information is sorted and grouped to obtain a mapping table.
[0079] The above-mentioned visual recognition method for sample tube arrays includes standard formatting processing, which includes format conversion, grayscale threshold sampling, effective area recognition, image horizontal correction, and cropping.
[0080] The label information includes image content data and geometric coordinate information of the image QR code / barcode;
[0081] The sorting process involves rasterizing the geometric coordinates of the image QR code / barcode to determine the row and column of each sample, and outputting a sample-well mapping table.
[0082] Second embodiment, such as Figure 2 As shown, a visual recognition system for sample tube arrays includes an image sampling device 100, a control terminal 200, a cloud server 300, and a user interaction module 400. Multiple image sampling devices 100 establish connections with the control terminal 200 to interact with data, multiple control terminals 200 establish connections with the cloud server 300 to interact with data, and the cloud server 300 establishes connections with the user interaction module 400 to interact with data.
[0083] The image sampling device 100 is used to receive control commands and perform image sampling to obtain image data according to the control commands;
[0084] The control terminal 200 includes a communication control module 101, a data processing module 102, a data management module 103, and a data recording and statistics module 104;
[0085] The communication control module 101 is used to communicate with the image sampling device 100 to transmit control commands, receive image data, and also to communicate with the cloud server 300 to obtain rule data.
[0086] The data processing module 102 is used to process image data to obtain a mapping table;
[0087] The data management module 103 is used to obtain rule data and mapping table, and compare whether the mapping table meets the rule data to obtain comparison data;
[0088] The data recording and statistics module 104 is used to acquire and store image data, rule data, mapping table, and comparison data, and then transmits them to the cloud server 300 via the communication control module 101 for storage and monitoring.
[0089] The user interaction module 400 is used for data interaction between the user and the cloud server 300. It includes a user interaction interface program. The user can control the image sampling device 100 through the user interaction module 400. The interface of the user interaction module 400 displays the scan results to the user, as well as warning or error messages (if any). It also provides an interface for the user to query historical records.
[0090] Cloud server 300 is used to synchronize historical data with each control terminal 200 in real time;
[0091] The cloud server 300 provides network data storage services, enabling terminals to synchronize data via network links. The cloud server 300 provides unified monitoring services for terminals among users, including: version control of the control terminal 200 program, including update checks and OTA upgrades; updating, switching, and publishing the device DSL file of the control terminal 200; access permissions for users of the control terminal 200; publishing and updating user rules; and monitoring the status of the image sampling device 100, including remote fault location and remote control of the image sampling device 100.
[0092] like Figure 6-7 As shown, the image processing module includes an image preprocessing module 105, a visual recognition module 106, and a grouping algorithm module 107.
[0093] Image preprocessing module 105 (IPM) processes the image data transmitted back from image sampling device 100 and is responsible for the following functions:
[0094] Standard format conversion: The image data format returned by the image sampling device 100 is usually determined by the manufacturer, such as 32bpp ARGB, 24bpp RGB, etc. In order to facilitate unified processing by downstream modules, the image preprocessing module 105 converts it into a unified standard format.
[0095] Grayscale sampling: The image data grid returned by the image sampling device 100 is usually a color image. However, color images are not conducive to visual recognition and do not require color data. Therefore, the image preprocessing module 105 converts it into a grayscale image by grayscale threshold sampling. It should be noted that in order to improve recognition accuracy, the image preprocessing module 105 usually performs multiple samplings according to different thresholds and then synthesizes a grayscale image. Different parts of the image have different exposure levels. For example, the part directly under the light source has a much higher brightness than the surrounding parts due to reflection. If a fixed threshold is used for grayscale sampling, some image data will be lost.
[0096] Horizontal correction and cropping: The original image may contain blank areas. A large number of blank areas are not only not conducive to accurate recognition, but also greatly affect the processing efficiency of downstream modules. Therefore, the image preprocessing module 105 will first perform edge scanning to identify the rectangular border of the largest effective area. In some cases, the rectangle may not be horizontal, so it is necessary to perform horizontal correction on the rectangular area to restore it to horizontal, and then crop out the effective area.
[0097] like Figure 8-10As shown, the visual recognition module 106 (VRM) primarily functions to recognize all QR codes or barcodes in an image and collect the geometric coordinates of the QR code regions. Existing QR code products have low recognition accuracy for small-sized QR codes in complex images, failing to meet the needs of current business scenarios. To address this issue, this solution employs multi-instance aggregation scanning (MIAS) and region overlap merging (ROM) technologies to significantly improve the QR code recognition rate. The implementation method is as follows:
[0098] Different recognition algorithms have different success rates for recognizing QR codes in different states. Therefore, Mias creates different instances of multiple algorithms to recognize images in parallel.
[0099] Different instance running parameters (such as scaling ratio, brightness or grayscale, edge sharpness, edge detection sensitivity, etc.) result in different QR code recognition success rates in different states. Therefore, Mias creates predefined parameter combinations for some common scenarios and creates an instance for each combination to recognize images in parallel.
[0100] The results returned by the parallel recognition above will inevitably have duplicates. Therefore, ROM technology must be used to traverse the results and merge the overlapping QR code areas. In principle, the recognition areas of two different QR codes or barcodes cannot overlap. See the "Identification Result Diagram" for the effect.
[0101] The visual recognition module 106 will ultimately output a result set, i.e., label information, containing all successfully recognized results and the geometric coordinates of each result—the four vertices of the rectangular area of the QR code or barcode, such as... Figure 10 As shown in the diagram, the vertex markers are in the rectangular area for QR code recognition.
[0102] like Figure 11-13 As shown, the main function of the grouping algorithm module 107 (GAM) is to summarize and identify the permutation and combination layout of the VRM output result set through XY axis cross-clustering technology (XY-ACC, XY axis-cross-clustering) and make a mapping table.
[0103] XY-ACC implementation method:
[0104] 1) Calculate the geometric center of each QR code rectangular region in the result set of the VRM output;
[0105] 2) Calculate the projections of the geometric center onto the X and Y axes respectively, such as Figure 12 As shown, this is a schematic diagram of the GAM results, with the geometric center projected onto the XY axis;
[0106] 2) Using a density-scan clustering algorithm, the projected coordinates along the X-axis (horizontal) and Y-axis (vertical) are clustered and summarized to obtain several clusters, such as... Figure 12 As shown in the diagram, the GAM results are obtained by clustering the projections onto the X and Y axes respectively;
[0107] 3) Cross-compare the summarization results of the two axes. The clusters obtained by projection onto the Y-axis can determine the row number, and the clusters obtained by projection onto the X-axis can determine the column number. The summarization can determine the hole position of each result, such as... Figure 12 As shown in the diagram, the GAM effect is illustrated, and the pore coordinates are obtained by comparing the cluster number.
[0108] Standard formatting processing includes grayscale thresholding and image horizontal correction cropping;
[0109] The label information includes image content data and geometric coordinate information of the image QR code / barcode;
[0110] The sorting process involves rasterizing the geometric coordinates of the image QR code / barcode to determine the row and column of each sample, and outputting a sample-well mapping table.
[0111] like Figure 14 As shown, the data management module 103 (URM) has the following functions:
[0112] 1) After obtaining the well location mapping table, it is necessary to check whether the arrangement of the samples meets the conditions according to the user-defined rules, and collect warning or error messages (defined by the user);
[0113] 2) Query the mapping table data of the previous scan. If it exists, determine whether each sample is consistent with the previous well position. If they are inconsistent, generate a warning or error message. If not, store the mapping table data of this scan in the database (the storage method is implemented by the data recording and statistics module 104. Implementation method: one or more general scripting languages can be selected to allow users to customize. Common ones include JavaScript, Python and VBS. If the designed rules are relatively simple, they can be defined using a plain text configuration file. Regardless of which language is used to define the rules, a corresponding interpreter is required. The interpreter is responsible for interpreting the rules, reading the mapping table output by GAM, judging and collecting information).
[0114] The Data Recording and Statistics Module 104 (DRSM) has the following functions:
[0115] It is responsible for storing the mapping table data generated by GAM; providing interfaces for querying historical records and sample statistical results; storing operation logs, including comparison results, error messages, and warning messages; transmitting the above data to cloud server 300 via the network so that various terminals can process collaboratively; and temporarily storing the data in a local queue when the network is unavailable, and retransmitting the data to cloud server 300 in sequence when the network is restored.
[0116] The data recording and statistics module 104 has a built-in terminal status data module, and the image sampling device 100 has a built-in device status data module;
[0117] The terminal status data module is used to collect terminal status data of the control terminal 200 and store it in the data recording and statistics module 104. The terminal status data includes terminal operation log, terminal running log, and terminal abnormal data.
[0118] The device status data module is used to collect device status data of the image sampling device 100 and transmit it to the data recording and statistics module 104. The device status data includes device working status, device operation log, device operation log, device error warning information, and device firmware version control.
[0119] The data recording and statistics module 104 is used to acquire terminal status data and device status data and upload them to the cloud server 300.
[0120] The cloud server 300 has a built-in data storage module 301 and a data monitoring module 302. The data storage module 301 is used to acquire and store image data, rule data, mapping table, comparison data, terminal status data, and device status data. The data monitoring module 302 is used to monitor the above data and obtain monitoring data.
[0121] like Figure 3-4 As shown, the communication control module 101 includes a DSL compiler 108, a DSL bytecode interpreter 109, a basic communication program module 110, a hardware abstraction layer 111, and a remote communication program module 112.
[0122] The DSL compiler 108 is used to read DSL files and compile them into DSL bytecode, which is binary data.
[0123] The DSL bytecode interpreter 109 contains a processing scheme for interpreting and executing manipulation data defined by the DSL file;
[0124] The basic communication program module 110 is used to transmit the interpreted manipulation data to the image sampling device 100 through the hardware interface;
[0125] Hardware Abstraction Layer 111 is used to call DSL bytecode and also to export fixed functions;
[0126] The remote communication program module 112 is used to receive and update the DSL file distributed by the cloud server 300, and also to execute and respond to the control commands issued by the cloud server 300, and send the execution results of the commands.
[0127] When the image sampling device 100 performs sampling, it is based on the label information of QR code / barcode. In order to ensure the recognition accuracy and precision of small QR codes (effective area size less than 8mm×8mm), the image sampling device 100 adopts ultra-high-definition equipment (imaging photos greater than 20 million pixels). However, it should be noted that ultra-high-definition equipment is not necessary. In some scenarios (for example, QR code labels on some large sampling tubes are allowed to exceed the above size), the equipment specifications can be reduced.
[0128] The control terminal 200 may be a Windows PC device (but is not limited to this), and the core computer program running on the control terminal 200 includes all the necessary program modules as follows:
[0129] like Figure 3 As shown, the communication control module (ECC module) is responsible for controlling the underlying data transmission between the terminal 200 and the image sampling device 100, and interpreting the data according to the protocol described in the DSL, so that the ECC program can correctly send instructions to the image sampling device 100 and make correct responses based on the received data; the ECC module periodically reports the device operating status, event logs, and error warning information to the cloud server 300 via the MQTT protocol; the monitoring instructions received by the ECC module from the cloud server 300 include: DSL file updates and device status control;
[0130] Relevant definitions:
[0131] like Figure 5 As shown, Hardware Abstraction Layer 111 (HAL) is a very mature technology in the traditional computer field, widely used for the interaction between computer operating systems and underlying hardware. Its initial design purpose was to simplify the calls made by computer operating system programs to the underlying hardware; essentially, it is an abstract encapsulation of the hardware call interface, while hardware manufacturers are responsible for the specific implementation of the interface. In this solution, the role of HAL is similar. To enable the program to correctly call device functions, a custom HAL needs to be defined. It is impossible to require all devices to implement the HAL interface; therefore, to achieve this function, it must be combined with a DSL.
[0132] like Figure 15-16As shown, DSL, Domain-Specific Language, is essentially a custom programming language or scripting language, distinct from general programming languages (C++, Java, etc.). DSL is dedicated to specific business scenarios and is used to describe business data and business logic related to specific scenarios. In this solution, a custom DSL is used to describe the communication protocols of different devices.
[0133] MQTT is an asynchronous network communication protocol commonly used in the IoT field for communication between edge devices and hosts. It features high efficiency, stability, and low power consumption.
[0134] The image sampling device 100 must integrate RS232 serial port or TTL communication hardware to receive control commands from the control terminal 200 and transmit image data. Control commands include, but are not limited to, lighting control, focus control, and focal length control. However, due to the different communication protocols used by various manufacturers, to achieve cost-efficient adaptation and integration, this solution uses a communication control module 101 within the control terminal 200, employing a Hardware Abstraction Layer (HAL) and a Domain Specific Language (DSL) for technical implementation. The specific implementation theory is as follows:
[0135] 1. Basic communication program: responsible for transmitting binary data to the hardware interface via a data link (wired or wireless);
[0136] 2. DSL file: a communication protocol description file defined for a specific device;
[0137] 3. DSL Compiler 108: During program startup and when switching DSL files, the read DSL file is compiled into bytecode. Since DSL files are text files, program interpretation and execution are inefficient; therefore, the compiler compiles them into bytecode to improve the efficiency of interpretation and execution. After compilation, a function table is generated, containing the names of specific methods and the entry addresses of the DSL bytecode (e.g., ...). Figure 4 As shown in the diagram, this is a schematic of the DSL compilation result.
[0138] 4. DSL bytecode: Binary data compiled from DSL text, which is convenient for the DSL bytecode interpreter 109 to execute;
[0139] 5. DSL bytecode interpreter 109: Used to interpret and execute methods for manipulating data as defined in the DSL file, including but not limited to data conversion, data transmission, data reading, and data interpretation;
[0140] 6. HAL: Hardware Abstraction Layer 111 is responsible for exporting fixed functions externally. Other modules control the device by calling these exported functions. Based on this technology, ECC encapsulates and hides the specific implementation details of the terminal-device communication protocol (defined by the DSL). Internally, it is responsible for querying and calling specific DSL bytecode. When HAL receives a call to a fixed exported function, it first finds the entry address corresponding to the function name in the function table. If the corresponding entry address is found, it notifies the DSL bytecode interpreter 109 to execute the bytecode at the corresponding address (e.g., ...). Figure 5 (See diagram for HAL call flow)
[0141] 7. Fixed exported functions: Standard functions with uniform parameters and uniform return values.
[0142] To put it in simpler terms: if ECC is a company, HAL is the communication center, fixed exported functions are the standard forms set by the communication center, and DSLs are the SOPs (Standard Operating Procedures) of each department. When a customer (other program modules) needs to submit a request to a department, they don't need to know how each department operates. They only need to fill out and submit the standard form to the communication center. The communication center will then pass the request to the specific department. After the department completes the work order according to the SOP, it returns the result data to the communication center, which then provides feedback to the customer in a standard form.
[0143] To achieve the same function, such as controlling the brightness of a device to its maximum:
[0144] like Figure 15 As shown, in the equipment manufactured by Manufacturer A, the instructions for adjusting the light intensity are as follows:
[0145]
[0146] Explanation: Bits 0 and 1 represent the frame header (in this example, a complete instruction is a frame, starting with a fixed 2-byte frame header A1A2), bit 2 represents the length of the following data (in this example, the following data length is two bytes, i.e., C1FF), bit 3 represents the specific command, in this example, C1 represents controlling the light, and bit 4 represents the brightness of the light, with a value range of 00 to FF, where 00 is off and FF is the brightest.
[0147] like Figure 16 As shown, in the equipment manufactured by Manufacturer B, the instructions for adjusting the light intensity are as follows:
[0148]
[0149] Explanation: Bit 0 represents the frame header (in this example, a complete instruction is a frame, starting with a fixed 1-byte frame header FE), bit 1 represents the total frame length, bits 2 represent the specific command, in this example 0D indicates controlling the light, bits 3 indicate the brightness range of the light is 00-64 (i.e., 0-100 in decimal, expressed as a percentage of brightness), FF indicates off; the last two bits are the CRC16 checksum (a data verification algorithm used to check whether data is distorted during transmission).
[0150] Furthermore, the devices' responses to commands vary, which will not be elaborated upon here.
[0151] This demonstrates that different manufacturers can use vastly different communication protocols and control commands for their devices. Developing using traditional general-purpose programming languages would require significant effort for adaptation and would prevent easy modification to new devices. However, the HAL+DSL technology in this solution suffices, requiring only relatively simple DSL definitions for each device. The program can then correctly call the device's lighting adjustment function using fixed functions exported from HAL. Because the DSL file can be dynamically compiled at runtime, there's no need to redevelop and debug the program every time a device is changed; simply switching to the corresponding DSL file is sufficient for device adaptation.
[0152] A third embodiment is a chip, wherein the chip stores a computer program that, when executed by a processor, implements the steps of any of the methods in the first embodiment.
[0153] For example, memory may include random access memory, flash memory, read-only memory, programmable read-only memory, non-volatile memory, or registers, etc.
[0154] The processor can be a central processing unit (CPU) or a graphics processing unit (GPU). The memory can store executable instructions.
[0155] The processor can execute instructions stored in memory to implement the various processes described in this paper.
[0156] It is understood that the memory in this embodiment can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
[0157] The non-volatile memory can be ROM (Read-Only Memory), PROM (Programmable ROM), EPROM (Erasable PROM), EEPROM (Electrically Erasable EPROM), or flash memory.
[0158] Volatile memory can be RAM (Random Access Memory), which is used as an external cache;
[0159] By way of example, but not limitation, many forms of RAM are available, such as SRAM (Static RAM), DRAM (Dynamic RAM), SDRAM (Synchronous DRAM), DDR SDRAM (Double Data Rate SDRAM), ESDRAM (Enhanced SDRAM), SLDRAM (Synchlink DRAM), and DRRAM (Direct Rambus RAM). The memory described herein is intended to include, but is not limited to, these and any other suitable types of memory 205.
[0160] In some implementations, the memory stores elements such as upgrade packages, executable units, or data structures, or subsets thereof, or extended sets thereof: operating systems and applications;
[0161] The operating system, which includes various system programs such as the framework layer, core library layer, and driver layer, is used to implement various basic business functions and handle hardware-based tasks.
[0162] Applications, encompassing various applications, are used to implement various application services. Programs implementing the methods of embodiments of the present invention can be included within these applications.
[0163] Those skilled in the art will understand that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of software and electronic hardware.
[0164] Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution.
[0165] Those skilled in the art can implement the described functions in different ways for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0166] In the embodiments of this application, the disclosed systems, apparatus and methods can be implemented in other ways;
[0167] For example, the division of units or modules is only a logical functional division, and there may be other division methods in actual implementation;
[0168] For example, multiple units, modules, or components can be combined or integrated into another system;
[0169] In addition, each functional unit or module in the embodiments of this application can be integrated into a processing unit or module, or it can exist as a separate physical entity, etc.
[0170] It should be understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0171] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a machine-readable storage medium.
[0172] Therefore, the technical solution of this application can be embodied in the form of a software product, which can be stored in a machine-readable storage medium and may include several instructions to cause an electronic device to execute all or part of the process of the technical solution described in the embodiments of this application.
[0173] The aforementioned storage media may include various media capable of storing program code, such as ROM, RAM, removable disk, hard disk, magnetic disk, or optical disk.
[0174] In summary, the visual recognition method, system, and chip for sample tube arrays of the present invention can reduce costs, improve applicability and recognition rate, while adding verification, statistical and custom rule functions, significantly improving the efficiency and accuracy of sample recognition and array management.
[0175] The specific embodiments of the invention have been described above. It should be understood that the invention is not limited to the specific embodiments described above, and the devices and structures not described in detail should be understood to be implemented in a manner common to the art; those skilled in the art can make various modifications or alterations within the scope of the claims, and make several simple deductions, variations or substitutions, which do not affect the substantive content of the invention.
Claims
1. A visual recognition method for sample tube arrays, characterized in that, Includes the following steps: Acquire image data of the sample based on the received control commands; A mapping table is generated based on image data processing; Obtain rule data; Based on the rule data, determine whether the mapping table meets the rules to obtain comparison data; The specific method for generating the mapping table based on the image data processing is as follows: The image data is standardized to obtain image preprocessed data; The image preprocessing data is subjected to visual recognition to obtain the image's label information; The tag information is sorted and grouped to obtain a mapping table; The grouping process employs XY-axis cross-clustering technology, specifically including the following steps: Calculate the geometric center coordinates of each QR code / barcode geometric region; Project each geometric center onto the X-axis and Y-axis respectively to obtain the set of X-axis projection points and the set of Y-axis projection points; Using a density-scan-based clustering algorithm, the X-axis projection point set and the Y-axis projection point set are clustered and summarized respectively to obtain several X-axis clusters and several Y-axis clusters. Each X-axis cluster corresponds to one column and each Y-axis cluster corresponds to one row. The geometric center coordinates of each QR code / barcode are cross-referenced with the X-axis and Y-axis clusters to determine the row and column number of each sample, and the sample-well mapping table is output.
2. The visual recognition method for sample tube arrays as described in claim 1, characterized in that, The standard formatting process includes format conversion, grayscale threshold sampling, effective region identification, image horizontal correction, and cropping. The label information includes image content data and geometric coordinate information of the image QR code / barcode; The sorting process includes rasterizing the geometric coordinate information of the image QR code / barcode to determine the row and column of each sample, and outputting the sample-well mapping table.
3. A visual recognition system for sample tube arrays, characterized in that, The system includes image sampling devices, a control terminal, a cloud server, and a user interaction module. The multiple image sampling devices establish connections with the control terminal to interact with data, the multiple control terminals establish connections with the cloud server to interact with data, and the cloud server establishes connections with the user interaction module to interact with data. The image sampling device is used to receive control commands and perform image sampling according to the control commands to obtain image data; The control terminal includes a communication control module, a data processing module, a data management module, and a data recording and statistics module; The communication control module is used to communicate with the image sampling device to transmit the control commands, receive the image data, and also to communicate with the cloud server to obtain rule data. The communication control module includes a DSL compiler, a DSL bytecode interpreter, a basic communication program module, a hardware abstraction layer, and a remote communication program module; The DSL compiler is used to read DSL files and compile them into DSL bytecode, which is binary data. The DSL bytecode interpreter is used to interpret and execute manipulation data defined by the DSL file; The hardware abstraction layer is used to call the DSL bytecode and export fixed functions, and transmit the execution result of the DSL bytecode interpreter to the image sampling device through the basic communication program module; The remote communication program module is used to receive and update the DSL file distributed by the cloud server, and also to execute and respond to the control commands issued by the cloud server, and send the execution results of the commands. The data processing module is used to process the image data to obtain a mapping table; The data management module is used to obtain the rule data and the mapping table, and compare the mapping table to see if it satisfies the rule data to obtain comparison data; The data recording and statistics module is used to acquire and store the image data, the rule data, the mapping table, and the comparison data, and then transmit them to the cloud server through the communication control module for storage and monitoring. The user interaction module is used for data interaction between the user and the cloud server. The cloud server is used to synchronize historical data with each of the control terminals in real time. The mapping table is obtained in the following way: When performing grouping, calculate the geometric center coordinates of each QR code / barcode geometric area; Project each geometric center onto the X-axis and Y-axis respectively to obtain the set of X-axis projection points and the set of Y-axis projection points; Using a density-scan-based clustering algorithm, the X-axis projection point set and the Y-axis projection point set are clustered and summarized respectively to obtain several X-axis clusters and several Y-axis clusters. Each X-axis cluster corresponds to one column and each Y-axis cluster corresponds to one row. The geometric center coordinates of each QR code / barcode are cross-referenced with the X-axis and Y-axis clusters to determine the row and column number of each sample, and the sample-well mapping table is output.
4. The sample tube array visual recognition system as described in claim 3, characterized in that, The data processing module includes an image preprocessing module, a visual recognition module, and a sorting algorithm module; The image preprocessing module is used to perform standard formatting on the image data to obtain image preprocessed data; The visual recognition module is used to perform visual recognition on the image preprocessing data and output the image's label information; The sorting algorithm module is used to sort the tag information to obtain a mapping table.
5. The visual recognition system for sample tube arrays as described in claim 4, characterized in that, The standard formatting process includes grayscale threshold sampling and image horizontal correction cropping. The label information includes image content data and geometric coordinate information of the image QR code / barcode; The sorting process includes rasterizing the geometric coordinate information of the image QR code / barcode to determine the row and column of each sample, and outputting the sample-well mapping table.
6. The sample tube array visual recognition system as described in claim 5, characterized in that, The data recording and statistics module has a built-in terminal status data module, and the image sampling device has a built-in device status data module. The terminal status data module is used to collect terminal status data of the control terminal and store it in the data recording and statistics module. The terminal status data includes terminal operation log, terminal running log, and terminal abnormal data. The device status data module is used to collect device status data of the image sampling device and transmit it to the data recording and statistics module. The device status data includes device working status, device operation log, device operation log, and device error warning information. The data recording and statistics module is used to acquire the terminal status data and the device status data and upload them to the cloud server.
7. The sample tube array visual recognition system as described in claim 6, characterized in that, The cloud server has a built-in data storage module and a data monitoring module. The data storage module is used to acquire and store the image data, the rule data, the mapping table, the comparison data, the terminal status data, and the device status data. The data monitoring module is used to monitor the above data to obtain monitoring data.
8. The visual recognition system for sample tube arrays as described in claim 3, characterized in that, The communication control module includes a DSL compiler, a DSL bytecode interpreter, a basic communication program module, a hardware abstraction layer, and a remote communication program module; The DSL compiler is used to read DSL files and compile them into DSL bytecode, which is binary data. The DSL bytecode interpreter contains a processing scheme for interpreting and executing manipulation data defined by the DSL file; The basic communication program module is used to transmit the interpreted manipulation data to the image sampling device through a hardware interface; The hardware abstraction layer is used to call the DSL bytecode and also to derive fixed functions; The remote communication program module is used to receive and update the DSL file distributed by the cloud server, and also to execute and respond to the control commands issued by the cloud server, and send the execution results of the commands.
9. A chip, characterized in that, The chip stores a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1-2.
Citation Information
Patent Citations
Biological sample library intelligent management system based on RFID and management method thereof
CN113762435A
Sample tube batch code reading method, code reading device and storage library
CN118246463A