RFID-based intelligent book automatic sorting method and device
By decoding the electronic tag information of books using an STM32 microcontroller and a high-frequency RC522 RFID module, and combining SolidWorks modeling and 3D printing technology to create adaptable structural parts, a modular programming system was constructed. This solved the problems of hardware universality and control system standardization in existing automatic book sorting devices, and achieved efficient and stable automatic book sorting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- QUANZHOU NORMAL UNIV
- Filing Date
- 2026-06-22
- Publication Date
- 2026-07-21
AI Technical Summary
Existing RFID-based automated book sorting devices suffer from problems such as a lack of universality in hardware structure, a lack of standardization in control system program development, imperfect sorting status monitoring and abnormal alarm mechanisms, low sorting efficiency, and poor compatibility, making them difficult to meet the actual application needs of large and medium-sized libraries.
Using an STM32 microcontroller as the control core, combined with a high-frequency RC522 RFID module to decode the electronic tag information of books, adaptable structural parts are made through SolidWorks modeling and 3D printing technology, a modular programming system is built, and infrared sensors are used to monitor the status of books to achieve accurate sorting and full box detection. The status is displayed and alarms are provided through an OLED display and a buzzer.
It has achieved a significant improvement in book sorting efficiency, high classification accuracy, strong hardware adaptability, intuitive status monitoring, stable and reliable system, reduced maintenance costs, and meets the application needs of large and medium-sized libraries.
Smart Images

Figure CN122425018A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to an intelligent book automatic sorting method and device based on RFID. Background Technology
[0002] With the increasing demand for knowledge in society, the volume of books borrowed and returned in libraries continues to rise. Some large libraries have reached a massive daily volume of returned books, posing a significant challenge to the traditional manual book sorting and repositioning process. Manual sorting is not only time-consuming, labor-intensive, and inefficient, but it is also prone to errors due to fatigue or human negligence, leading to longer book shelving cycles and impacting the library's service quality and resource utilization.
[0003] To address these issues, automated sorting equipment has been increasingly adopted in libraries, becoming a key means of improving book management efficiency. Currently, the core identification solutions for automated book sorting systems mainly include three categories: text / pattern recognition, QR code / barcode recognition, and RFID (Radio Frequency Identification) technology. Among these, text or pattern recognition and QR code / barcode recognition solutions require image acquisition equipment and lighting systems, are significantly affected by ambient lighting conditions, and have relatively slow recognition speeds, making them difficult to meet the demands of high-throughput sorting. Meanwhile, RFID technology, with its advantages of moderate recognition distance, strong anti-interference capabilities, fast reading speed, and ability to penetrate non-conductive materials, has become the mainstream technology choice for modern library automated sorting systems.
[0004] While existing RFID-based book sorting devices have reduced labor costs to some extent, they still have several shortcomings: First, the hardware structure design lacks versatility. Sorting mechanisms, reader mounting components, and other structural parts are mostly custom-made, resulting in poor flexibility when adapting to different conveyor belt specifications or book types, and long processing cycles and high costs. Second, the control system program development lacks standardized processes, leading to conflicts in electronic component pin assignments and code writing, insufficient inter-module coordination stability, and low sorting accuracy. Third, the sorting status monitoring and abnormal alarm mechanisms are incomplete, making it difficult to provide real-time feedback on key information such as book classification results and collection bin storage status. Full bin alarm responses are delayed, easily causing book accumulation or sorting interruptions. Fourth, some devices suffer from low sorting efficiency and poor compatibility, making them unsuitable for the actual application scenarios of small and medium-sized libraries. Furthermore, the overall construction and maintenance costs are high, limiting the widespread adoption of the technology.
[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure and does not constitute information on prior art known to those skilled in the art. Summary of the Invention
[0006] According to one aspect of this application, an RFID-based intelligent automatic book sorting method is provided, comprising: receiving RFID radio frequency signals from book electronic tags, decoding them according to the signal specifications recognizable by an STM32 microcontroller, generating identification data containing book card numbers and classification information, acquiring conveyor belt running speed and sorting mechanism position information, and generating action delay parameters and sorting execution instructions; based on SolidWorks modeling and 3D printing process characteristics, integrating the card reader fixing parts, sorting mechanism gear racks and pinions, servo motor fixing devices, and collection baskets according to the specifications adapted to conveyor belt installation, fabricating various structural parts as 3D printed entities, assembling them onto the conveyor belt and side extension frames in the order of installation position, performing modification and re-printing operations only during structural part compatibility debugging, and generating hardware assembly result information of the book sorting device; extracting the pin definitions and functional control logic of each electronic component and encoding them according to KeiluVision5. The program specifications are integrated, and different GPIO pins of the STM32 microcontroller are divided as dedicated control interfaces for each component. After the program for each type of component is completed, it is burned, tested, and the program code is updated. After the overall program is debugged, it is uniformly fixed to the microcontroller, generating the program burning result information of the sorting device control system. Combining the hardware assembly results and the control system program, the corresponding sorting channel of the books is located by RFID identification data. By precisely adjusting the servo motor action time and conveyor belt speed, the storage status of the books in the collection basket is judged based on the infrared sensor detection signal, generating the automatic book sorting linkage execution result information. Based on the STM32 microcontroller main control interface, the book card number, category, and collection basket status during the sorting process are transmitted to the display module according to the OLED display display protocol. The full box detection signal of the infrared sensor is received to trigger the buzzer alarm, and the OLED screen display information is updated synchronously to generate sorting status display and abnormal alarm result information.
[0007] Another aspect of this application is an RFID-based intelligent book automatic sorting device, used to execute executable instructions to perform the above-described RFID-based intelligent book automatic sorting method.
[0008] According to another aspect of this application, an electronic device includes: a first processor; and a memory for storing executable instructions of the first processor; wherein the first processor is configured to execute the above-described RFID-based intelligent book automatic sorting method by executing the executable instructions.
[0009] According to another aspect of this application, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a second processor, implements the above-described RFID-based intelligent book automatic sorting method.
[0010] This application provides an RFID-based intelligent automatic book sorting method and device. Using an STM32 microcontroller as the control core, it reads electronic tag information from books via a high-frequency RC522 RFID module, and generates identification data through decoding and classification matching. Adaptable structural components are fabricated using SolidWorks modeling and 3D printing technology. A control system is built according to KeiluVision5 programming specifications, employing GPIO pin allocation and modular programming. Program stability is ensured through segmented functional verification and iterative algorithm optimization. The system calculates servo motor motion delays based on a distance-speed-time model, and uses infrared sensors to achieve precise sorting and full-box detection. Status display and alarms are provided via an OLED screen and a buzzer, forming a fully automated "identification-control-sorting-monitoring" system.
[0011] This application aims to significantly improve sorting efficiency, with automated processes reducing the book shelving cycle from 2-3 days to 1-3 hours, adapting to the needs of sorting massive volumes of books. It boasts high classification accuracy, with errors in card number recognition and angle control kept within acceptable limits through multiple algorithm verifications and parameter optimizations. The system exhibits strong hardware adaptability, with 3D printing technology enabling rapid customization of structural components, reducing adaptation costs for different scenarios. Intuitive status monitoring, real-time display, and timely alarm mechanisms prevent book accumulation and improve management convenience. The system is stable and reliable, with modular programs and multi-dimensional verification algorithms reducing malfunctions and maintenance costs, catering to the application needs of large and medium-sized libraries.
[0012] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0013] Figure 1 A flowchart illustrating an RFID-based intelligent book automatic sorting method according to an embodiment of this application is shown. Figure 2 This illustration shows a schematic diagram of the structure of an RFID-based intelligent book sorting device according to an embodiment of this application. Detailed Implementation
[0014] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0015] The following is combined Figure 1 This application describes an RFID-based intelligent book sorting method according to exemplary embodiments thereof. It should be noted that the following application scenarios are shown only to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way. Rather, the embodiments of this application are applicable to any suitable scenario.
[0016] In one implementation, Figure 1 A schematic flowchart of an RFID-based intelligent book automatic sorting method according to an embodiment of this application is shown.
[0017] S101 receives the RFID radio frequency signal from the electronic book tag, decodes it according to the signal specifications that the STM32 microcontroller can recognize, generates identification data containing the book card number and classification information, obtains the conveyor belt running speed and sorting mechanism position information, and generates action delay parameters and sorting execution instructions.
[0018] In one implementation, a high-frequency RC522 RFID module is used as the signal receiving core. This module operates at a fixed frequency of 13.56MHz, supports the ISO / IEC 14443 Type A protocol, and is compatible with the Fudan Microelectronics F08 electronic tag. The module continuously transmits radio frequency carrier signals through its built-in antenna. When the electronic tag on the book enters a sensing range of approximately 5cm, the tag acquires energy and activates through electromagnetic coupling, thereby establishing a wireless communication link with the reader and realizing bidirectional transmission of radio frequency signals.
[0019] A radio frequency (RF) signal filtering algorithm is employed to reduce noise in the received raw RF signal, filtering out noise signals caused by environmental electromagnetic interference and improving signal purity. The Manchester encoding / decoding algorithm is used to convert the modulated signal returned by the tag into a digital signal. This algorithm reconstructs data by identifying the timing of signal level transitions, following the encoding rule that "0" corresponds to no level transition and "1" corresponds to a level transition, thus achieving accurate parsing of the data stored in the electronic tag.
[0020] After decoding, the 4-byte unique identifier (UID) of the electronic tag is extracted as the book card number. Combined with a pre-defined card number-category mapping rule, a precise matching algorithm is used to compare the card number with pre-defined categories such as engineering, literature, and science, generating identification data containing the card number and its corresponding category. For example, card number "160-151-173-2" is identified as an engineering book after matching.
[0021] Adjust the input voltage of the DC motor through the stepless speed regulator supporting the conveyor belt. Adopt the pulse width modulation (PWM) speed measurement algorithm. Based on the linear relationship between the motor speed and voltage, collect the motor working voltage signal in real time and convert it into the actual running speed of the conveyor belt (such as a stable speed of 17.8 mm / s measured). Determine the fixed distances between each sorting mechanism and the RFID reader through mechanical installation calibration. For example, the engineering sorting mechanism is 80 mm away from the reader, the literature sorting mechanism is 142 mm away, and the science sorting mechanism is 202 mm away, forming a position parameter library. Calculate the action delay parameters. Adopt the distance - speed - time model algorithm. According to the formula "delay time = distance between the sorting mechanism and the reader ÷ conveyor belt speed", calculate the servo action delay corresponding to each classified book. For example, the delay corresponding to the literature book is 142 mm ÷ 17.8 mm / s ≈ 8 s.
[0022] Based on the GPIO pin resource allocation of the STM32 single - chip microcomputer, generate control instructions including servo channel selection, rotation angle (120° push, 0° reset), and action timing, ensuring that the sorting mechanism accurately executes the push action when the book reaches the specified position.
[0023] S102, based on the modeling of SolidWorks and the characteristics of 3D printing technology, integrate the reader fixture, sorting mechanism gear rack, servo fixture, and collection basket according to the specifications adapted to the conveyor belt. Make various structural parts in units of 3D printed entities, and assemble them to the conveyor belt and the extended frames on both sides in the order of installation positions. Only perform the modification and re - printing operations during the adaptability debugging of the structural parts, and generate the hardware assembly result information of the book sorting device.
[0024] In one implementation, combine the RFID radio frequency identification signal decoding result with the preset rules of book classification. Introduce an electronic tag card number verification mechanism and classification matching logic to identify the classification attributes of book electronic tag data and generate book classification result information. Combine the RFID radio frequency identification signal decoding result with the preset rules of book classification. Introduce an electronic tag card number verification mechanism and classification matching logic to identify the classification attributes of book electronic tag data and generate accurate book classification result information. The core adopts the accurate verification algorithm for electronic tag card numbers and the classification rule matching algorithm to construct a classification recognition system with double guarantees.
[0025] The card number verification algorithm focuses on verifying the format integrity and validity of the 4 - byte UID (unique identifier) of the electronic tag. This algorithm first performs byte - length verification on the decoded UID data to ensure that the data is in the standard 4 - byte structure, excluding problems such as byte loss or redundancy caused by interference during data transmission. Secondly, by verifying the logical legality of the UID data, identify the abnormal data characteristics of illegally tampered or damaged tags, such as judging whether the data of each byte is within a reasonable value range and whether the data check bits match, etc., so as to effectively filter out invalid tag signals and avoid misclassification.
[0026] The classification matching algorithm employs precise value comparison logic, relying on a pre-defined card number-category mapping rule base to perform the matching work. The rule base pre-stores the correspondence between legal electronic tag card numbers entered manually and book categories, covering preset categories such as engineering, literature, and science. For example, the card number "128-149-173-2" corresponds to literature, "160-151-173-2" corresponds to engineering, and "128-147-173-2" corresponds to science. It also supports expanding the mapping relationship between category types and card numbers according to actual application scenarios.
[0027] After the RFID reader completes the radio frequency signal decoding and obtains the electronic tag number, it first performs a comprehensive verification of the card number "160-151-173-2" using a card number verification algorithm to confirm that its byte length is compliant, the data logic is valid, and there are no signs of tampering or damage. Then, the classification matching algorithm calls the rule base to accurately compare the verified card number with all the mapping relationships stored in the database one by one, quickly locating the category entry corresponding to the card number. Finally, the book classification attribute recognition is completed, generating structured classification result information containing "Card Number: 160-151-173-2, Category: Engineering", providing core data support for subsequent sorting operations.
[0028] This algorithm processes book classification results by combining the requirements of book sorting operations with the collaborative work specifications of various mechanisms. It matches the linkage modes of the conveyor push sequence, sorting mechanism action delay, and collection basket adaptation, generating trigger signals for mechanism linkage control. Employing a timing-based collaborative matching algorithm and a mechanism adaptability analysis algorithm, it constructs a mechanism linkage control system for the entire book sorting process, ensuring precise and efficient action coordination among execution units. The timing-based collaborative matching algorithm uses book classification results as its core input, deeply relating them to two key parameters: the conveyor push cycle and the sorting mechanism response time. It also incorporates the time consumption characteristics of book transmission on the conveyor belt, calculating the optimal timing connection relationship for each mechanism's actions through dynamic timing planning logic. The algorithm first establishes a basic parameter library for conveyor push intervals, sorting mechanism action durations, and reset times. Then, based on the sorting channel positions corresponding to different book categories, it dynamically deduces the entire timing chain of "push-transmission-sorting," avoiding overlapping actions or excessively large gaps. This ensures that when books are smoothly transported to the sorting position on the conveyor belt, the sorting mechanism is precisely in a ready state.
[0029] The mechanism adaptability analysis algorithm is based on the dimensions of the collection basket (53mm long, 46mm wide, and 3mm thick). Combining the mechanical characteristics of the sorting mechanism, such as the pushing stroke and gear-rack transmission ratio, it uses path adaptability simulation logic to confirm the spatial compatibility between the sorting mechanism's pushing path and the collection basket. The algorithm simulates the movement trajectory of the books after they are pushed, verifying the matching degree between the pushing angle, force, and the entrance size of the collection basket. It also considers the installation position deviation of the collection basket, reserving a reasonable tolerance margin to ensure that books accurately fall into the corresponding collection basket, avoiding jamming or falling.
[0030] For different book categories such as engineering, literature, and science, the algorithm matches a specific linkage mode, clearly defining three core parameters: the timing of the conveyor's push, the delay of the sorting mechanism's action, and the correspondence between collection baskets. For example, when the RFID reader identifies a book as literature, the timing-coordinated matching algorithm first checks the current state of the corresponding sorting mechanism (the third servo motor). If the mechanism is in a reset completed state, it determines, according to preset timing rules, that the conveyor must push the book within 1 second, ensuring that the timing of the book's transfer to the sorting position precisely matches the timing of the mechanism's action. The mechanism adaptability analysis algorithm, by querying the category-collection basket mapping library and combining the simulation results of the collection basket size and the push path, confirms that literature books correspond to collection basket number 2, and that the push path has no spatial interference. Finally, the results of the two algorithms are integrated to generate a mechanism linkage control trigger signal of "the conveyor pushes after 1 second, the sorting mechanism delays for 8 seconds, and adapts to collection basket number 2," providing instruction support for the precise coordination of subsequent execution mechanisms.
[0031] Based on conveyor belt speed standards, book transport distance parameters, and mechanism linkage logic generation rules, a systematic verification of mechanism linkage control trigger signals is performed to ensure precise coordinated operation of each actuator. A parameter consistency verification algorithm and a logic conflict detection algorithm are employed to construct a two-dimensional linkage trigger signal verification system, ensuring the accuracy and reliability of the coordinated operation of each actuator. The parameter consistency verification algorithm uses preset equipment operating standards as its core basis, conducting systematic comparison and verification of key parameters in the linkage trigger signal. The algorithm first extracts two core parameters from the trigger signal: the actual conveyor belt speed and the book transport distance. Then, it calls a preset standard parameter library, specifying that the standard range for conveyor belt speed is 15-20 mm / s, and the allowable error for book transport distance is ±5 mm. The algorithm uses dynamic threshold comparison logic to verify the actual parameters against the standard parameters one by one. Simultaneously, a parameter stability analysis mechanism is introduced to eliminate misjudgments caused by instantaneous fluctuations, ensuring that the parameters not only conform to static standards but also possess the rationality for dynamic operation.
[0032] The logical conflict detection algorithm focuses on the temporal coordination of various mechanisms' actions. By constructing a temporal correlation graph, it identifies the sequential logical relationships of key actions such as conveyor pushing, sorting mechanism actions, and collection basket receiving. The algorithm pre-defines the core linkage logic of "pushing-identifying-sorting" and uses a temporal node traversal and conflict prediction mechanism to identify issues such as overlap, omission, or reversed order of actions in the temporal dimension. Simultaneously, the algorithm also considers the response latency characteristics and action duration of each mechanism to verify the rationality of temporal intervals, avoiding mechanical interference caused by overly tight action connections or excessively long intervals that affect sorting efficiency.
[0033] Taking the linkage trigger signal verification of literary books as an example, the parameter consistency verification algorithm first collects the actual running speed of the conveyor belt as 17.8 mm / s. After comparing it with the standard range of 15-20 mm / s, it is confirmed to be within a reasonable range. Then, the book transmission distance is extracted as 142 mm. Combined with the standard transmission distance (140 mm) corresponding to this category, the calculation error is 2 mm, which does not exceed the allowable range of ±5 mm, and the parameters are judged to be consistent and valid. The logic conflict detection algorithm confirms through time sequence graph analysis that the conveyor pushes the book 1 second after the sorting mechanism is reset. When the book is transported to the sorting position by the conveyor belt, the sorting mechanism performs the action after a delay of 8 seconds, and the collection basket is in a waiting state. The entire process strictly follows the sequence of "push-identify-sort", and the timing of each action is non-overlapping and non-omissionful, and the interval length is adapted to the response characteristics of the mechanism. After the joint verification of the two algorithms is passed, the precise coordinated operation of each execution mechanism is triggered to ensure the smooth and orderly book sorting action.
[0034] Based on the physical size characteristics of the books and the motion parameters of the sorting mechanism, the algorithm automatically matches the corresponding sorting force and pushing angle. An adaptation mechanism based on the compatibility of the mechanism's actions and the book's state is used to mark mismatches and correct the parameters. A dynamic optimization system for book sorting parameters is constructed using a physical feature adaptation algorithm and a motion state feedback correction algorithm to ensure that books of different sizes can fall smoothly and accurately into their corresponding collection baskets. The physical feature adaptation algorithm takes the core physical parameters of the books as input and deeply integrates the mechanical characteristics of the sorting mechanism to achieve precise matching of pushing parameters. The algorithm first extracts the book's dimensions (40mm length, 30mm width, 9mm thickness), combines this with the 1.25 module, 36-tooth gear parameters, and transmission ratio of the sorting mechanism's gear rack, and analyzes the force balance state of the book during pushing through mechanical simulation calculations. This determines the optimal pushing force that pushes the book without causing damage, while simultaneously matching an initial pushing angle of 120° to ensure precise alignment of the book's pushing trajectory with the collection basket entrance. The algorithm also considers the output torque characteristics of the servo motor (SG90 model), converting the pushing force into a control signal executable by the servo motor, ensuring stable and controllable force output.
[0035] The motion state feedback correction algorithm relies on a real-time monitoring mechanism to dynamically adjust and optimize sorting parameters. This algorithm tracks the complete movement trajectory of a book after it is pushed using infrared sensors and vision-assisted monitoring logic, focusing on identifying abnormal states such as deviation, jamming, and tilting. When it detects that the book's pushing trajectory deviates from the preset path, jams with the sorting mechanism, or tilts and falls into the collection bin, the algorithm marks the type and degree of the abnormality and calls upon a preset parameter correction model. Combining this with historical debugging data, it makes targeted adjustments to core parameters such as pushing force and pushing angle.
[0036] For standard-sized literary books, the physical feature adaptation algorithm first calculates the corresponding servo output torque based on the book's dimensions (40mm long, 30mm wide, and 9mm thick), combined with the gear and rack transmission ratio and the torque output characteristics of the SG90 servo motor. This determines the optimal pushing force and a 120° pushing angle to ensure the book's initial pushing direction accurately points to collection basket #2. During actual sorting, if the action status feedback correction algorithm detects that a book does not fall smoothly into the collection basket after being pushed, but instead contacts the basket at an angle (an abnormal state), it analyzes the cause of the tilt and determines that the pushing angle is too large, resulting in uneven force on the book. The pushing angle is then adjusted to 115°. After correction, the pushing action is executed again, resulting in more balanced force on the book, a smoother trajectory, and ultimately, a precise and stable fall into the collection basket, optimizing the sorting effect.
[0037] Following pre-defined book sorting data integration rules, the categorized book information is correlated and fused with matching linkage modes and corresponding institutional operating parameters to generate a precise and coordinated automated book sorting execution dataset. A multi-dimensional data correlation and fusion algorithm is employed to construct a full-process data integration system for book sorting, achieving structured fusion of classification information, linkage parameters, institutional parameters, and verification results, generating a standardized dataset that can directly drive the execution mechanism. This algorithm focuses on data correlation, first establishing a multi-dimensional data mapping model to clarify the correlation rules and priority weights of various data types, including book classification information, linkage mode parameters, institutional operating parameters, and verification results, ensuring logical consistency and adaptability of data from different sources. Simultaneously, a data format standardization processing mechanism is introduced to convert scattered unstructured data (such as card number strings, angle values, and verification status identifiers) into structured data in a unified format, laying the foundation for subsequent data integration.
[0038] The dataset's field design comprehensively covers the core information required for sorting execution, specifically including four major categories of key fields: First, the book basic information field records the book's unique identifier (4-byte UID card number) and classification result (engineering, literature, science, etc.), serving as the core index for data association; second, the linkage parameter field clarifies the timing parameters such as the conveyor push sequence (e.g., "after 1 second") and the sorting mechanism action delay (e.g., "8 seconds"), ensuring precise coordination of the actions of each mechanism; third, the mechanism operation parameter field covers mechanical execution parameters such as sorting push force (corresponding to servo motor output torque), push angle (e.g., "115°"), and collection basket number (e.g., "No. 2"), ensuring smooth and effective sorting actions; and fourth, the verification result field marks the results of parameter consistency verification and logical conflict detection (e.g., "verification passed"), ensuring the reliability of the dataset.
[0039] In the specific execution process, the algorithm first extracts raw data from each module: from the classification and recognition module, it obtains the card number "128-149-173-2" for literature books and the classification result "literature"; from the linkage mode matching module, it obtains the timing parameters of "push after 1 second" and the linkage parameters of "8-second action delay"; from the sorting parameter matching and correction module, it obtains the "115° push angle" corrected by the action status feedback and associates it with the corresponding collection basket number 2; from the linkage trigger signal verification module, it obtains the result information of "verification passed". Subsequently, the algorithm integrates various types of data according to the preset data structure, through field mapping and logical association, automatically fills in the data association gaps, removes redundant information, and finally generates a structured automatic book sorting execution dataset with the following structure: "Card number: 128-149-173-2, Category: Literature, Push timing: 1 second later, Action delay: 8 seconds, Push angle: 115°, Collection basket: No. 2, Verification status: Passed". This provides complete data support for the STM32 microcontroller to drive the precise operation of each actuator.
[0040] S103 extracts the pin definitions and functional control logic of each electronic component and integrates them according to the Keil uVision5 programming specification. It divides the different GPIO pins of the STM32 microcontroller as dedicated control interfaces for each component. After the program writing of each type of component is completed, it is burned, tested and updated. After the overall program is debugged, it is uniformly solidified to the microcontroller, generating the program burning result information of the sorting device control system.
[0041] In one implementation, the pin definitions and functional control logic of each electronic component are combined and matched with the Keil uVision5 programming specifications. A GPIO pin allocation algorithm and a component function-code mapping mechanism are introduced to achieve cross-module adaptation and logical integration of electronic component control requirements and programming specifications. The introduction of a dynamic GPIO pin allocation algorithm and a component function-code mapping algorithm constructs a precise adaptation system between electronic component control requirements and programming specifications, laying a core foundation for the development of the sorting device control system program. The dynamic GPIO pin allocation algorithm is based on the 37 programmable GPIO pin resources of the STM32F103C8T6 microcontroller, combining the interface requirement priority and pin function characteristics of each electronic component to achieve automatic allocation of conflict-free dedicated pins. The algorithm first establishes a pin resource database, clarifying the multiplexing function (such as SPI, TIM, UART, etc.), electrical characteristics, and current occupancy status of each GPIO pin. Then, it prioritizes components according to their functional importance, with core components (such as RFID readers and main control servos) having higher priority than auxiliary components (such as infrared sensors and buzzers). Finally, through conflict detection and dynamic scheduling logic, it assigns a dedicated pin to each component that matches its interface type (such as digital input / output, SPI communication, PWM output), ensuring efficient utilization of pin resources and no conflicts.
[0042] The component function-code mapping algorithm focuses on the correspondence between component functional requirements and Keil uVision5 programming syntax. By establishing a function-code association model, it achieves a precise mapping from component functional descriptions to executable code logic. The algorithm first breaks down the core functional modules of each component (such as card finding, collision avoidance, and card reading in an RFID reader; angle control and speed adjustment in an SG90 servo motor; and occlusion detection and signal output in a TCRT5000 infrared sensor). Then, it maps these modules to Keil uVision5's C language programming specifications and ST's official standard peripheral library functions (such as GPIO initialization functions, TIM timer configuration functions, and SPI communication functions), forming a standardized function-code mapping rule base. This ensures that functional requirements can be efficiently implemented using standardized programming syntax.
[0043] In actual implementation, the pin definitions and functional control logic of core components such as the RFID-RC522 card reader, SG90 servo motor, and TCRT5000 infrared sensor are first extracted through a component function analysis process: It is clarified that the card reader requires an SPI communication interface (SDA, SCK, MISO, MOSI pins), with core functions including card finding, anti-collision, and reading the electronic tag card number; the servo motor requires PWM signal pins, with core functions of precise angle rotation and speed control; and the infrared sensor requires digital signal input pins, with core functions of occlusion detection and signal feedback. This information is then combined and matched with the Keil uVision5 C language programming specifications and ST's official standard peripheral library usage rules to ensure that the control logic of each component conforms to the programming standards.
[0044] To address the SPI communication requirements of the RFID-RC522 reader, the GPIO pin dynamic allocation algorithm first searches the pin resource database and finds that pins PA3 and PA4 are unused and support SPI multiplexing. Simultaneously, considering the reader's core priority, it avoids PWM pins such as PA6 and PA7 used by the servo motor and digital pins such as PB10 and PB11 used by the infrared sensor. Ultimately, PA4 is assigned as the SDA pin, PA3 as the SCK pin, PA2 as the MOSI pin, and PA1 as the MISO pin, achieving conflict-free pin allocation. The component function-code mapping algorithm, based on a rule base, precisely maps the reader's "card search" function to a call to the pcdRequest function in the ST official standard peripheral library. By passing the card search command parameters, the reader is triggered to transmit an RF signal to detect electronic tags within the antenna range, completing the conversion from functional requirements to code logic. This ensures cross-module compatibility between the reader's functions and programming specifications, achieving efficient integration of control logic.
[0045] This paper aligns the STM32 microcontroller peripheral control standard with the operational requirements of various components, constructs a multi-component control association node model, calculates interface allocation weights through a pin occupancy conflict detection model, and establishes a dynamic association mechanism between components and the microcontroller interface. Employing peripheral control standard adaptation algorithms and pin occupancy conflict detection algorithms, a precise adaptation system between electronic components and STM32 microcontroller interfaces is built, providing core technical support for hardware interface allocation in the control system. The peripheral control standard adaptation algorithm focuses on the compatibility matching between the operational requirements of various electronic components and the microcontroller's peripheral control standard, achieving precise interface type adaptation by establishing a mapping relationship between component requirements and peripheral functions. The algorithm first analyzes the core operating requirements of each component, clarifying key information such as signal type (e.g., the SG90 servo requires a 50Hz PWM modulation signal, the TCRT5000 infrared sensor requires digital signal input, and the RFID-RC522 card reader requires SPI communication signals) and signal parameters (e.g., PWM signal period and communication baud rate). Then, it calls the STM32 microcontroller peripheral control standard library, covering the digital / analog modes of GPIO pins, the PWM output function of the TIM timer, and the configuration specifications of the SPI / I2C communication interface. Through function matching logic, it associates the component requirements with the corresponding peripheral functions, ensuring that the component's operating requirements are highly compatible with the microcontroller's peripheral capabilities.
[0046] The pin occupancy conflict detection algorithm uses the GPIO pin resources of a microcontroller as its core. Through dynamic traversal and weight calculation mechanisms, it achieves conflict-free pin allocation and prioritizes core resources. The algorithm first establishes a pin resource occupancy status table, recording the allocation status (occupied / unoccupied), associated components, and interface types of each GPIO pin in real time. Then, it assigns weight levels based on the importance of component functions, with core components (such as RFID readers and main control servos) having the highest weight, followed by auxiliary components (such as buzzers and OLED displays). Finally, by traversing the occupancy status of all pins and combining the weight calculation results, it prioritizes allocating unoccupied pins with matching weights to the components to be allocated, while avoiding the conflict risk of already allocated pins, ensuring the rationality and efficiency of pin resource allocation.
[0047] A multi-component control and association node model is constructed, with the microcontroller as the core node and various electronic components as associated nodes. The model clearly defines the signal transmission direction (e.g., control signal from the microcontroller to the servo motor, detection signal from the infrared sensor to the microcontroller), signal type, and pin occupancy rules between the core node and each associated node, forming a visualized node association graph. Based on this model, a dynamic association mechanism between components and the microcontroller interface is established. By monitoring the addition and removal of components in real time, the pin allocation scheme is automatically adjusted. When a new component is added, its weight is recalculated according to the algorithm logic, and idle pins are allocated. When a component is removed, the corresponding pin resources are released to an idle state, ensuring that pin allocation has flexible adjustment capabilities.
[0048] When assigning PWM output pins to the SG90 servo motor, the peripheral control standard adaptation algorithm first analyzes the servo motor's operating requirements: a 50Hz PWM signal is needed for angle control, with a duty cycle corresponding to a rotation angle of 0°-180°. Then, the STM32 microcontroller's peripheral resources are searched, confirming that the TIM3 timer supports PWM output. Its CH1 channel can be multiplexed via GPIO pins to achieve signal output, and the parameter configuration meets the servo motor's 50Hz PWM signal requirements. Finally, the PA6 pin corresponding to the CH1 channel of the TIM3 timer is selected for adaptation. The pin occupancy conflict detection algorithm simultaneously searches the pin resource occupancy status table, confirming that the PA6 pin is not occupied by other components such as RFID readers or infrared sensors. Simultaneously, it calculates that the servo motor, as the core power component of the sorting mechanism, has the highest weight, conforming to the priority allocation principle. Subsequently, through a dynamic association mechanism, the PA6 pin is bound to the servo motor signal control interface, synchronously updating the pin occupancy status table and the multi-component control association node model, completing the precise binding of the servo motor and microcontroller interfaces, ensuring stable transmission of the servo motor's PWM control signal.
[0049] With interface adaptation and compatibility as the core dimension, this system integrates control logic data, GPIO pin resource data, and programming syntax specification data from RFID readers, servo motors, and infrared sensors to construct a multi-dimensional control interface association matrix. This matrix visually presents the relationships between various components, pins, and code logic. Control logic data includes the functional implementation flow of each component (e.g., the occlusion detection logic of an infrared sensor, the low-level trigger logic of a buzzer); GPIO pin resource data includes pin numbers, operating modes (input / output, multiplexed functions), and occupancy status; programming syntax specification data includes function call formats, register configuration rules, etc.
[0050] The matrix lists components such as RFID readers, servo motors, infrared sensors, and OLED displays horizontally, and pin numbers, operating modes, control functions, and syntax specifications vertically. At the intersection of "RFID reader - SDA pin", it is labeled "PA4 pin, SPI multiplexing mode, pcdInit function initialization, and SPI communication protocol programming specifications", clearly presenting the relationship between each dimension and providing a basis for program writing.
[0051] By addressing logical gaps through a code compilation error correction model and enhancing the maintainability of control code through a modular programming mechanism for component functions, and integrating the results of a multi-component control association node model, a full-component collaborative control program framework for the sorting device is generated. This involves employing code compilation error correction algorithms and modular programming optimization algorithms. The code compilation error correction algorithm addresses gaps between component control logic and programming specifications (such as mismatched function parameters or incorrect register configurations) through syntax checking and logic vulnerability detection. The modular programming optimization algorithm decomposes the control logic of each component into independent functional modules, enhancing code maintainability and scalability. Combining the results of the multi-component control association node model, the corrected control logic modules of each component are integrated to generate a full-component collaborative control program framework that includes an initialization module, a functional control module, and a signal interaction module.
[0052] When integrating the alarm control logic of the infrared sensor and the buzzer, the code compilation error correction algorithm detected a mismatch in the parameter passing between the infrared sensor signal reading function and the buzzer trigger function, and automatically corrected the function interface format; the modular programming optimization algorithm split the logic into an "infrared occlusion detection module" and a "buzzer alarm control module", which were then integrated into the program framework along with the card reader control module and the servo motor control module, generating a well-structured collaborative control program framework.
[0053] Based on the program framework, the control code for various components was written and tested in segments. Functional verification feedback was used to continuously optimize the code logic and pin mapping relationships. After overall debugging, the complete program was burned into the STM32 microcontroller, generating the program burning result information for the sorting device control system. After completing the framework for the collaborative control of all components of the sorting device, the control logic modules of each electronic component were disassembled based on the framework. Following the principle of "core components first, related components later," dedicated control codes for components such as RFID readers, servo motors, infrared sensors, OLED displays, and buzzers were written sequentially. Then, a segmented functional verification algorithm was used to burn and test the code of each module individually. This algorithm sets standardized verification indicators and test procedures for the core functions of each component. By burning the code individually, interference between multiple modules is eliminated, and the implementation effect of the component's function is verified one by one. Before burning the code, the compatibility between the hardware interface and the code logic is pre-verified. After burning, a dedicated test command triggers the component to work, collects key data on the function implementation, and compares it with preset indicators to confirm whether the function meets the standards. Taking an RFID reader as an example, after its control code is burned, the core functions of card finding, anti-collision, and card reading are tested sequentially through a segmented function verification algorithm. Different electronic tags are placed on the reader's sensing area, and data such as the accuracy of card number reading and response speed are collected. If there are no errors or omissions in card number reading, and single tags can be effectively identified to avoid conflicts between multiple tags, then the reader module function verification is deemed to have passed. If problems such as card reading failure or garbled card numbers occur, the problem type is marked and subsequent tests are paused. Verification is then carried out again after the problem is resolved.
[0054] After completing the segmented programming and testing of the unit component code, targeted adjustments were made using an iterative optimization algorithm to address issues such as functional implementation deviations and hardware interface anomalies discovered during testing. This algorithm, guided by test feedback, establishes a correlation model of "problem type - optimization direction - verification standard." It first identifies the root cause of the problem—whether it's a code logic flaw, an unreasonable GPIO pin mapping, or a mismatch between hardware parameters and program control. Then, it continuously adjusts the code logic, pin mapping relationships, and component control parameters around the root cause. After adjustment, it is tested again using the segmented functional verification algorithm until the component function meets the preset standard. Taking the servo control module as an example, after programming the code, testing revealed a large deviation in the servo rotation angle. The root cause was determined to be a mismatch between the PWM signal duty cycle calculation logic and the angle control characteristics of the SG90 servo. The iterative optimization algorithm adjusted the mapping logic between the PWM signal period, duty cycle, and servo angle, optimized the pulse width calculation parameters, and verified the stability of the GPIO pin output signals corresponding to the servo. After adjustment, the code was reprogrammed, and the servo rotation accuracy was tested. After multiple iterations, the servo rotation angle error was controlled within the allowable range, and the accuracy met the standard.
[0055] Following the above process, the control code for all components, including the infrared sensor, OLED display, and buzzer, was written, functionally verified, and iteratively optimized in sequence. For the infrared sensor, its occlusion detection and signal output functions were verified; if false detection occurred, the signal recognition threshold and pin input logic were optimized. For the OLED display, its data reception and character display functions were verified; if garbled characters or a black screen appeared, the communication protocol and pin data transmission logic were adjusted. For the buzzer, its level triggering and alarm sounding functions were verified; if triggering was insensitive, the pin level control logic was optimized. After all unit modules passed functional verification, the optimized control code of each module was integrated according to the program framework to form a complete control system program for the sorting device. A full system integration test was then conducted to verify the collaborative working effect between components. If signal interference or timing conflicts occurred between modules, the code logic and timing parameters of each module were fine-tuned through iterative optimization algorithms to ensure the overall system stability.
[0056] Finally, the optimized and integrated program was burned into the STM32F103C8T6 microcontroller using the STLinkV2 programming tool, completing the programming of the sorting device control system. After programming, a final functional verification was performed to confirm that the microcontroller could effectively drive each component to work according to the preset logic, that all modules coordinated smoothly, and to generate the programming result information of the sorting device control system program, providing stable program support for the subsequent coordinated execution of automatic book sorting.
[0057] S104, combining hardware assembly results and control system program, locates the corresponding sorting channel for books through RFID identification data, precisely adjusts the servo motor action time and conveyor belt speed, judges the storage status of books in the collection basket based on infrared sensor detection signals, and generates automatic book sorting linkage execution result information.
[0058] In one implementation, combining the hardware assembly entity and the control system program functions, an RFID reader reads the electronic tag number of the book, matches it with preset classification rules to locate the corresponding sorting channel, obtains the actual running speed of the conveyor belt and the installation distance of the sorting mechanism, and accurately calculates the servo motor action delay parameters. Combining the completed hardware assembly entity structure and control system program functions, the card number information of the book's electronic tag is first read using a high-frequency RC522 RFID reader. The reader operates at a frequency of 13.56MHz, supports the ISO / IEC14443 Type A protocol, and is compatible with the Fudan Microelectronics F08 electronic tag. When the electronic tag on the book enters a sensing range of approximately 5cm, the tag is activated through electromagnetic coupling and establishes communication with the reader. After receiving the radio frequency signal, the reader uses a radio frequency signal filtering algorithm for noise reduction and a Manchester encoding / decoding algorithm for parsing to extract the 4-byte unique identifier (UID) of the electronic tag as the book's card number.
[0059] Subsequently, an exact matching algorithm is adopted to compare the obtained card number with the preset card number - classification mapping rule library to locate the sorting channel corresponding to the book. For example, the card number "128 - 149 - 173 - 2" is determined to be a literary book after matching and corresponds to sorting channel 2; the card number "160 - 151 - 173 - 2" is determined to be an engineering book after matching and corresponds to sorting channel 1.
[0060] The input voltage of the DC motor is adjusted by the stepless speed regulator supporting the conveyor belt. The pulse width modulation (PWM) speed measurement algorithm is adopted. Based on the linear relationship between the motor speed and voltage, the working voltage signal of the motor is collected in real time and converted into the actual running speed of the conveyor belt. Through actual measurement, a stable speed of 17.8 mm / s can be obtained. The fixed spacing between each sorting mechanism and the RFID reader is determined through mechanical installation calibration. For example, the engineering sorting mechanism is 80 mm away from the reader, the literary one is 142 mm, and the scientific one is 202 mm.
[0061] The distance - speed - time model algorithm is adopted. According to the core logic of "delay time = distance between sorting mechanism and reader ÷ conveyor belt speed", the servo action delay parameters corresponding to each classified book are accurately calculated. Taking literary books as an example, the corresponding delay time is 142 mm ÷ 17.8 mm / s ≈ 8 s, ensuring that the servo starts the action accurately when the book reaches the specified sorting channel.
[0062] The servo rotation angle and conveyor belt speed are adjusted and calibrated in multiple rounds to optimize the gear - rack transmission matching accuracy, ensuring that the book pushing action is smooth without jamming. At the same time, the detection signal of the infrared sensor is collected in real time to judge whether the book storage volume in the collection basket reaches the full - box threshold. The multi - round iterative debugging algorithm is adopted to repeatedly calibrate and optimize the servo rotation angle and conveyor belt speed. For the SG90 model servo, its angle is controlled by PWM signal, the control wave period is 20 ms, the frequency is 50 Hz, and the pulse width of 0.5 ms - 2.5 ms corresponds to the rotation angle of 0° - 180°. During the debugging process, the control accuracy of the 120° pushing angle and 0° reset angle is mainly optimized. By adjusting the calculation logic of the PWM signal duty cycle, the deviation of the servo rotation angle is corrected.
[0063] The conveyor belt speed is tested in multiple gears. Considering the book transmission stability and sorting efficiency, 17.8 mm / s is determined as the optimal running speed to avoid the book offset caused by too fast speed and the impact on sorting efficiency caused by too slow speed. At the same time, the gear - rack transmission matching accuracy is optimized. The gear is selected as a standard part with a modulus of 1.25, a pressure angle of 20°, and 36 teeth. The length of the rack is adapted to the conveyor belt width and meshing requirements. By adjusting the installation spacing and meshing depth, it is ensured that there is no jamming or slipping during the transmission process, and the book pushing action is smooth and continuous.
[0064] An infrared sensor-based continuous monitoring algorithm is employed, using a TCRT5000 infrared reflection sensor to collect the status signal of the collection basket in real time. This sensor has a detection range of 1mm-25mm. When the emitted infrared light is not reflected or the reflection intensity is insufficient, the output is high, and the indicator diode is off. When the book storage capacity in the collection basket reaches the full threshold, blocking the infrared sensor, the infrared light is reflected and the intensity meets the standard, causing the sensor output to switch to low, and the indicator diode to light up.
[0065] To avoid misjudgments caused by brief obstruction when books fall into the collection bins, an obstruction duration determination mechanism is introduced, with a threshold of 0.5 seconds. When the sensor detects a low-level signal for more than 0.5 seconds, the collection bin is determined to be full, ensuring the accuracy of the detection results. For example, when there are 3 books in collection bin #2 (literature category), the infrared sensor is continuously obstructed, triggering the full bin detection signal.
[0066] A linkage mechanism between sorting actions and status detection is established. When RFID identifies a book category, it triggers the corresponding sorting mechanism to push the book into the basket according to a preset delay. If the infrared sensor detects a full basket signal, it immediately feeds back to the control system to pause the sorting action of the corresponding channel. A closed-loop linkage mechanism of "identification-trigger-action-feedback" is established. After the RFID reader completes the book classification and identification, the STM32 microcontroller sends an action command to the servo motor of the corresponding sorting mechanism according to the preset sorting channel and delay parameters. Taking science books as an example, the corresponding sorting mechanism is 202mm away from the reader, and the calculated action delay is about 11.7s. After the delay ends, the microcontroller triggers the fourth servo motor to start the action at a 120° pushing angle, which drives the push rod to push the book into the No. 3 collection basket through gear and rack transmission.
[0067] During the sorting process, infrared sensors continuously monitor the status of the corresponding collection bins. If a full bin signal is detected, it immediately feeds back the signal to the STM32 microcontroller via a GPIO pin. Upon receiving the full bin signal, the microcontroller quickly executes an interrupt handler, pausing the sorting operation of the corresponding channel to prevent book overflow, and simultaneously triggering subsequent alarm and display update processes. For example, when collection bin number 1 (engineering books) is full, the infrared sensor sends a low-level signal, and the microcontroller immediately pauses the second servo motor's operation, stopping the sorting and pushing of engineering books.
[0068] By integrating sorting channel positioning results, mechanism motion parameters, and full-box detection feedback information, and leveraging an STM32 microcontroller to achieve coordinated operation of various modules, the system generates automated sorting execution results information demonstrating smooth book placement into baskets, accurate classification, and controllable status. Relying on the STM32 microcontroller's core control role, the system integrates sorting channel positioning results, mechanism motion parameters (servo motor angle, motion delay), and full-box detection feedback information. Through GPIO pin allocation and peripheral control logic, it enables the coordinated operation of modules such as RFID readers, servo motors, conveyor belts, and infrared sensors.
[0069] After receiving data signals from each module, the microcontroller performs real-time logic operations and instruction scheduling: on the one hand, it controls the servo motor to execute pushing actions according to preset parameters; on the other hand, it synchronously receives status feedback from the infrared sensors and dynamically adjusts the sorting process. For example, when a book is successfully pushed into the collection bin and the full bin signal is not triggered, the microcontroller controls the servo motor to reset, waiting for the sorting instruction for the next book; if the full bin signal is triggered, the sorting of the corresponding channel is paused, and signals are sent to the display module and the alarm module. Through the collaborative operation of multiple modules, the system ultimately generates automatic sorting linkage execution result information, which includes core data such as book card number, classification result, sorting channel, action parameters, and collection bin status, providing complete data support for subsequent display and anomaly handling.
[0070] The S105, based on the STM32 microcontroller main control interface, transmits the book card number, classification, and collection basket status during the sorting process to the display module according to the OLED display display protocol. It receives the full-box detection signal from the infrared sensor to trigger the buzzer alarm, synchronously updates the information displayed on the OLED screen, and generates sorting status display and abnormal alarm result information.
[0071] In one implementation, the book sorting status is monitored in real time using an STM32 microcontroller main control interface combined with the sorting process data stream and infrared sensor trigger signals. A display-alarm linkage model is constructed through a signal transmission adaptation algorithm, and the information display and alarm response adaptation under different states are simulated by inputting the core sorting data vector. Based on the STM32 microcontroller main control interface, the entire data stream of the sorting process is collected in real time, including core data such as book card numbers transmitted by RFID readers, classification results, servo motor action timing, and conveyor belt running speed. At the same time, trigger signals from three infrared sensors are received synchronously (high level indicates no obstruction, low level indicates obstruction), realizing real-time monitoring of the entire book sorting process status.
[0072] A signal transmission adaptation algorithm is employed to convert and adapt different types of data formats, ensuring that the sorting data stream and infrared sensor signals can be compatiblely input into the same analysis model. Based on this, a display-alarm linkage model is constructed. This model takes the core sorting data vector (including card number recognition status, classification results, collection bin occlusion status, and mechanism action status) as input and analyzes the degree of compatibility between the two by simulating information display requirements and alarm response logic under different scenarios. For example, when the input data vector is "card number successfully recognized + classified as literature + collection bin #2 not occluded + third servo motor not activated," the model simulates an adaptation scheme of "OLED screen displaying card number and classification + buzzer off." When the input data vector is "card number successfully recognized + classified as engineering + collection bin #1 occluded for more than 0.5 seconds," the model simulates an adaptation scheme of "OLED screen displaying card number, classification, and full bin indication + buzzer alarm."
[0073] When extracting features from sorting data during real-time monitoring, two core evaluation coefficients are introduced: the accuracy of book card number recognition and the coefficient for determining if the collection bin is full. The first is the book card number recognition accuracy coefficient, obtained by calculating the matching degree between the actual read card number and the original electronic tag number, used to quantify the reliability of the RFID reader. This coefficient is calculated based on a precise matching algorithm, comparing the decoded card number with the original tag UID byte by byte. If all four bytes of data match perfectly, the accuracy coefficient is 1.0 (completely accurate); if there is a one-byte deviation, the coefficient is 0.75, and so on. For example, if the original book tag number is "128-149-173-2", and the reader reads it as "128-149-173-2", the accuracy coefficient is 1.0; if the reading result is "128-148-173-2", the coefficient is 0.75.
[0074] Secondly, there is a full-bin determination coefficient, calculated by combining the duration and intensity of infrared sensor obstruction, to avoid false alarms caused by brief obstructions. This coefficient uses a baseline obstruction duration of 0.5 seconds. When the obstruction duration reaches 0.5 seconds, the determination coefficient is 1.0 (full bin confirmed). When the obstruction duration is between 0.1 seconds and 0.5 seconds, the coefficient increases linearly with time (e.g., 0.6 at 0.3 seconds). When the obstruction duration is less than 0.1 seconds, the coefficient is 0 (false obstruction). For example, if a literature book falls into collection bin #2 and briefly obstructs the infrared sensor for 0.2 seconds, the full-bin determination coefficient is 0.4, and the system does not trigger a full-bin alarm. When there are 3 books in the collection bin, and the sensor is continuously obstructed for 0.6 seconds, the determination coefficient is 1.0, and the system confirms the bin is full.
[0075] When analyzing the dynamic characteristics of the sorting status, the book classification results and the storage status sequence of the collection baskets are correlated, and the signal change chain within the time window is combined during the linkage response analysis. A correlation analysis algorithm is used to deeply bind the book classification results with the storage status sequence of the corresponding collection baskets. The storage status sequence records the occlusion status changes of the infrared sensor at 10ms intervals (e.g., "unoccluded - brief occlusion - unoccluded", "unoccluded - continuous occlusion", etc.). By tracking the trend of the sequence changes, the actual storage status of the collection basket is accurately determined. For example, when the classification result is "science", the status sequence of collection basket No. 3 is correlated. If the sequence shows "unoccluded - continuous occlusion (more than 0.5s)", it is interpreted as "science collection basket is full"; if the sequence is "unoccluded - brief occlusion (0.2s) - unoccluded", it is interpreted as "science books are normally placed in the basket, and the collection basket is not full".
[0076] In the linkage response analysis stage, a time window analysis algorithm is introduced. Starting from the moment the book is identified by RFID, a fixed time window (e.g., 15 seconds, covering the complete process from book identification to placement in the basket) is set to capture the signal change chain within the window. The signal change chain covers the complete link of "RFID identification signal - servo motor action signal - infrared sensor status signal". By analyzing the timing relationship and status changes of each signal in the link, it is determined whether the sorting process is normal. For example, the signal change chain for literature books is "RFID identification signal (t=0s) - third servo motor action signal (t=8s) - infrared sensor brief obstruction signal (t=8.2s) - infrared sensor unobstructed signal (t=8.4s)", which is analyzed and determined to be "sorry-free sorting process". If the signal chain is missing the servo motor action signal or the infrared sensor does not show a brief obstruction signal, it is determined to be "sorry-free sorting", and a corresponding display prompt is triggered.
[0077] After the display and alarm module outputs a preliminary display scheme containing multi-dimensional status indicators, it is verified and adjusted by comparing with the standard case library of the sorting system to generate a book sorting status display and abnormal alarm execution scheme and response details with dynamic status adaptation. Based on the above analysis, the display and alarm module outputs a preliminary display scheme containing multi-dimensional status indicators, including book card number, classification result, storage status of each collection basket, mechanism action status, alarm status, etc. For example, the preliminary scheme may be "OLED screen displays card number '128-149-173-2' on the first line, category 'Literature' on the second line, and 'Collection basket No. 2: Not full' on the third line, with the buzzer off."
[0078] Subsequently, a case library comparison and verification algorithm was used to compare the preliminary display plan with the standard case library for sorting system operation one by one. The standard case library stores a large number of normal and abnormal scenario cases that have been verified in practice, including "normal sorting display case", "collection bin full alarm case", "card number not entered display case", and "sorting abnormality prompt case", etc. By comparing the preliminary plan with the standard plans for similar scenarios in the case library, the completeness, accuracy and logical rationality of the indicator display were verified.
[0079] If the preliminary solution matches the standard case, it is directly adopted as the final execution solution. If there are differences (such as the collection bin status not being displayed or the alarm logic being inconsistent), adjustments and optimizations are made based on the standards in the case library. For example, if the preliminary solution does not display the "Status of Collection Bin No. 1", this indicator is added after comparing with the standard case; if the full bin alarm in the preliminary solution does not simultaneously label the collection bin number, it is adjusted to clearly label "Engineering Collection Bin Full" on the OLED screen. Finally, an execution solution and response details with dynamic status adaptation are generated, clarifying the display format, alarm triggering conditions, and response process under different scenarios.
[0080] The book card numbers and classification information during the sorting process are transmitted to the display module according to the OLED display protocol, updating the screen display content in real time. Simultaneously, it receives full-box detection signals from infrared sensors, triggering a buzzer alarm mechanism and simultaneously marking the corresponding full-box information on the OLED screen, generating a clear and timely display of the sorting status and abnormal alarm results. According to the generated execution plan, the STM32 microcontroller converts and adapts the book card numbers and classification information during the sorting process according to the OLED display's I2C communication protocol before transmitting them to the display module. The OLED screen uses a 128... The 64-pixel dot matrix uses a character encoding algorithm to convert text information into dot matrix data, updating the screen display content in real time. For example, when a book with card number "160-151-173-2" is recognized, the first line of the screen displays "Card Number: 1601511732", the second line displays "Category: Engineering", and the third to sixth lines display the real-time status of the three collection bins respectively.
[0081] Simultaneously, the microcontroller continuously receives full-box detection signals from the infrared sensor. When the full-box judgment coefficient of a collection basket reaches 1.0, it immediately triggers a buzzer alarm mechanism (low-level trigger, the buzzer sounds continuously). At the same time, the full-box information is marked on the corresponding collection basket status position on the OLED screen. For example, when collection basket number 1 is full, the screen displays "Collection Basket No. 1: Full (Please Clean)" and maintains this marking until the staff cleans the books and the infrared sensor is restored to an unobstructed state. Through this process, clear sorting status displays and timely alarm results are generated, ensuring that staff can monitor the sorting progress and equipment status in real time.
[0082] In one implementation, such as Figure 2 As shown, this application also provides an RFID-based intelligent automatic book sorting device, comprising: The identification module 201 is used to receive RFID radio frequency signals from electronic book tags. It introduces decoding algorithms and signal verification logic according to the signal specifications that the STM32 microcontroller can recognize. Combined with radio frequency signal filtering processing methods and card number classification matching mechanisms, it generates identification data containing book card numbers and classification information. It also acquires conveyor belt running speed parameters and sorting mechanism position coordinate data. Through distance-speed timing calculation models and action delay optimization algorithms, combined with mechanism response characteristic verification logic, it generates action delay parameters and sorting execution instructions. The hardware assembly module 202 is used to perform structural dimension adaptation design for card reader fixing parts, sorting mechanism gear racks and pinions, servo motor fixing devices, and collection baskets based on SolidWorks modeling specifications and 3D printing process characteristics. It integrates structural parameters according to conveyor belt installation standards and manufactures various structural parts in 3D printed units. It completes the assembly of structural parts with the conveyor belt and the two side extension frames according to the priority of installation position. Modification and reprinting operations are only performed during the structural part adaptation debugging stage, and the hardware assembly result information of the book sorting device is generated. The program development module 203 is used to extract the pin definitions and functional control logic of electronic components such as RFID readers, servo motors, and infrared sensors. It introduces syntax adaptation algorithms and logic verification mechanisms according to the Keil uVision5 programming specifications. Combining modular programming methods and interface compatibility design principles, it divides different GPIO pins of the STM32 microcontroller as dedicated control interfaces for each component. After the program for each type of component is completed, it performs burning tests and code iteration updates. After the overall program is debugged and passed, it is uniformly fixed to the microcontroller, generating the burning result information of the sorting device control system program. The linkage execution module 204 is used to combine the hardware assembly results with the control system program, and locate the corresponding sorting channel of the book by associating the sorting channel mapping model with RFID identification data; to perform multiple rounds of precise debugging of the servo motor action time and conveyor belt speed, and to optimize the gear and rack transmission matching accuracy; and to determine the storage status of the books in the collection basket by introducing a full box threshold judgment algorithm and continuous status detection logic based on the infrared sensor detection signal, and to generate automatic book sorting linkage execution result information. The display alarm module 205, based on the STM32 microcontroller main control interface, converts and adapts the book card number, classification information, and collection basket status data during the sorting process according to the OLED display display protocol, and transmits them to the display module for real-time display. It receives the full box detection signal from the infrared sensor, triggers the buzzer alarm mechanism, and synchronously updates the full box prompt information on the OLED screen, generating a clear sorting status display and timely alarm result information.
[0083] The computer-readable storage medium provided in the above embodiments of this application and the RFID-based intelligent book automatic sorting method provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application stored therein.
[0084] The various embodiments in this application are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments evaluating the RFID-based intelligent book automatic sorting method, electronic device, electronic device, and readable storage medium are relatively simple to describe because they are fundamentally similar to the embodiments of the RFID-based intelligent book automatic sorting method described above. Relevant parts can be referred to in the descriptions of the embodiments of the RFID-based intelligent book automatic sorting method described above.
Claims
1. A smart book automatic sorting method based on RFID, characterized in that, include: The system receives RFID radio frequency signals from electronic book tags, decodes them according to the signal specifications that the STM32 microcontroller can recognize, generates identification data containing book card numbers and classification information, obtains the conveyor belt running speed and sorting mechanism position information, and generates action delay parameters and sorting execution instructions. Based on the characteristics of SolidWorks modeling and 3D printing technology, the card reader fixing parts, sorting mechanism gears and racks, servo motor fixing devices, and collection baskets are integrated according to the specifications for installation on the conveyor belt. Various structural parts are made in 3D printed units and assembled onto the conveyor belt and the two side extension frames in the order of installation position. Modification and reprinting are only performed when the structural parts are tested for compatibility, generating hardware assembly result information of the book sorting device. Extract the pin definitions and functional control logic of each electronic component and integrate them according to the Keil uVision5 programming specification. Divide the different GPIO pins of the STM32 microcontroller as dedicated control interfaces for each component. After completing the program writing for each type of component, burn and test the program code and update the program code. After the overall program debugging is completed, it is uniformly solidified to the microcontroller to generate the program burning result information of the sorting device control system. By combining the hardware assembly results with the control system program, the corresponding sorting channel for books is located through RFID identification data. By precisely adjusting the servo motor action time and conveyor belt speed, the storage status of books in the collection basket is determined based on the infrared sensor detection signal, and the automatic book sorting linkage execution result information is generated. Based on the STM32 microcontroller main control interface, the book card number, classification, and collection basket status during the sorting process are transmitted to the display module according to the OLED display display protocol. The full box detection signal from the infrared sensor is received to trigger the buzzer alarm, and the OLED screen display information is updated synchronously to generate sorting status display and abnormal alarm result information.
2. The method as described in claim 1, characterized in that, Based on the characteristics of SolidWorks modeling and 3D printing technology, the card reader fixing parts, sorting mechanism gears and racks, servo motor fixing devices, and collection baskets are integrated according to the specifications adapted for conveyor belt installation. Various structural components are fabricated as 3D printed entities and assembled onto the conveyor belt and side extension frames in the order of their installation positions. Modification and re-printing are only performed during structural component compatibility testing to generate the hardware assembly result information of the book sorting device, including: By combining the RFID radio frequency identification signal decoding results with the book classification preset rules, an electronic tag card number verification mechanism and classification matching logic are introduced to identify the classification attributes of the book electronic tag data and generate book classification result information. The book classification results information is processed by combining the book sorting action execution requirements and the collaborative work specifications of various institutions. The linkage mode matching of the conveyor push sequence, sorting mechanism action delay, and collection basket adaptation is completed, and the linkage control trigger signal of the institution is generated. Based on the conveyor belt running speed standard, book transmission distance parameters and mechanism linkage logic generation rules, the mechanism linkage control trigger signal is systematically verified to complete the precise coordinated operation of each actuator. Based on the physical size characteristics of the book and the motion parameters of the sorting mechanism, the corresponding sorting force and pushing angle are automatically matched. Based on the adaptability detection mechanism between the mechanism action and the book status, abnormal matching is marked and the parameters are corrected. According to the preset book sorting data integration rules, the classified book information is associated and integrated with the matching linkage mode and the corresponding institution's operating parameters to generate a book automatic sorting execution dataset with accurate classification and coordinated actions.
3. The method as described in claim 1, characterized in that, The pin definitions and functional control logic of each electronic component are extracted and integrated according to the Keil uVision5 programming specifications. Different GPIO pins of the STM32 microcontroller are designated as dedicated control interfaces for each component. After programming each type of component is completed, the code is burned, tested, and updated. Once the overall program is debugged, it is uniformly burned into the microcontroller, generating the program burning result information for the sorting device control system, including: The pin definitions and functional control logic of each electronic component are combined and matched with the Keil uVision5 programming specifications. The GPIO pin allocation algorithm and component function-code mapping mechanism are introduced to achieve cross-module adaptation and logic integration of electronic component control requirements and programming specifications. By aligning with the STM32 microcontroller peripheral control standard and the operating requirements of each component, a multi-component control association node model is constructed. The interface allocation weight is calculated through a pin occupancy conflict detection model, and a dynamic association mechanism between the component and the microcontroller interface is established. With interface adaptation and compatibility as the core dimension, a multi-dimensional control interface association matrix is constructed by integrating control logic data, GPIO pin resource data, and programming syntax specification data from RFID readers, servos, and infrared sensors; By addressing logical gaps through code compilation error correction models, enhancing the maintainability of control code through modular programming mechanisms for component functions, and integrating the results of multi-component control association node models, a full-component collaborative control program framework for sorting devices is generated. Based on the program framework, the control code for various components was written and tested in segments. The code logic and pin mapping relationship were continuously optimized through functional verification feedback. After the overall debugging was successful, the complete program was solidified into the STM32 microcontroller, generating the program burning result information of the sorting device control system.
4. The method as described in claim 1, characterized in that, Combining the hardware assembly results with the control system program, the system locates the corresponding book sorting channel using RFID identification data. Through precise adjustments to the servo motor's action time and conveyor belt speed, and based on infrared sensor detection signals, it determines the book storage status in the collection baskets, generating automatic book sorting linkage execution result information, including: By combining the hardware assembly entity and the control system program function, the RFID reader reads the electronic tag number of the book, matches the preset classification rules to locate the corresponding sorting channel, obtains the actual running speed of the conveyor belt and the installation distance of the sorting mechanism, and accurately calculates the servo motor action delay parameters. Multiple rounds of debugging and calibration were carried out on the servo motor rotation angle and conveyor belt speed to optimize the gear and rack transmission matching accuracy and ensure that the book pushing action is smooth and without jamming. At the same time, infrared sensor detection signals were collected in real time to determine whether the storage capacity of books in the collection basket has reached the full box threshold. Establish a linkage mechanism between sorting actions and status detection. When RFID identifies the book category, it triggers the corresponding sorting mechanism to push the books into the basket according to the preset delay action. If the infrared sensor detects a full basket signal, it immediately feeds back to the control system to suspend the sorting action of the corresponding channel. By integrating the sorting channel positioning results, mechanism motion parameters, and full box detection feedback information, and using an STM32 microcontroller to achieve coordinated operation of each module, automatic sorting linkage execution result information is generated, which ensures that books are smoothly placed into the basket, accurately classified, and have a controllable status.
5. The method as described in claim 4, characterized in that, Based on the STM32 microcontroller main control interface, the book card number, category, and collection bin status during the sorting process are transmitted to the display module according to the OLED display protocol. The module receives a full-bin detection signal from the infrared sensor to trigger a buzzer alarm, synchronously updates the OLED screen display information, and generates sorting status display and abnormal alarm result information, including: Based on the STM32 microcontroller main control interface, combined with the sorting process data stream and infrared sensor trigger signals, the book sorting status is monitored in real time. A display-alarm linkage model is constructed through signal transmission adaptation algorithm. The core sorting data vector is input to simulate the information display and alarm response adaptation under different states. When extracting features from sorting data during real-time monitoring, the accuracy of book card number recognition and the coefficient for determining whether the collection basket is full are introduced. When analyzing the dynamic characteristics of the sorting status, the book classification results and the storage status sequence of the collection basket are correlated; when analyzing the linkage response, the signal change chain within the time window is combined. After the display and alarm module outputs a preliminary display scheme containing multi-dimensional status indicators, it is verified and adjusted by comparing with the standard case library of the sorting system to generate a book sorting status display and abnormal alarm execution scheme and response details with dynamic status adaptation. The book card number and classification information during the sorting process are transmitted to the display module according to the OLED display display protocol, and the screen display content is updated in real time. At the same time, the full box detection signal from the infrared sensor is received, triggering the buzzer alarm mechanism. The corresponding collection bin full information is marked on the OLED screen simultaneously, generating a clear display of sorting status and timely alarm results, as well as abnormal alarm results.
6. An RFID-based intelligent automatic book sorting device, characterized in that, The system is used to execute executable instructions to perform the RFID-based intelligent book automatic sorting method according to any one of claims 1 to 5.
7. An electronic device, characterized in that, include: First processor; and memory for storing executable instructions of the first processor; The first processor is configured to execute the RFID-based intelligent book automatic sorting method according to any one of claims 1 to 5 by executing the executable instructions.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the second processor, it implements the RFID-based intelligent book automatic sorting method according to any one of claims 1 to 5.