Teaching material recycling and pricing method

An automated system for textbook pricing using ISBN recognition, weight verification, and AI models addresses subjective pricing issues, improving efficiency and fairness in textbook recycling by providing objective and market-based pricing.

CN120317896APending Publication Date: 2025-07-15CHINA THREE GORGES UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510314083.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

The existing methods of recycling and pricing for textbooks rely on manual operations, which have strong subjectivity and low efficiency in pricing, and cannot achieve objective, fair and efficient pricing, and cannot meet the needs of both students and merchants.

Method used

Image acquisition equipment is used to identify the ISBN number of the textbook, combine the information crawling of the book website, and the weight detection of electronic scales, use support vector machines and random forest models to make price predictions, and optimize pricing through the page-weight model and blocking growth model.

Benefits of technology

It realizes rapid identification of textbook information, weighing and verifying false information and artificial intelligence pricing, improves recycling efficiency and fairness, provides a scientific pricing basis, and meets objective market laws.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120317896A_ABST
    Figure CN120317896A_ABST
Patent Text Reader

Abstract

The invention provides a textbook recycling and pricing method, which comprises the following steps of: firstly, shooting a book bar code by using a camera, importing the book bar code into Python, and identifying an ISBN (International Standard Bank Number); then, through a crawler mode, obtaining related information of the book through related entries of'broad bean reading '; estimating the approximate weight of the book, and weighing to determine that the book corresponds to the actual book; and finally, inputting the related information of the book into the trained random forest and support vector regression machine model, and estimating a proper recovery price. Through combination of hardware and software, rapid identification of teaching material information, weighing and false checking and artificial intelligence pricing are realized, and the recovery efficiency and fairness are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automated recycling pricing of second-hand textbooks, and particularly relates to a textbook recycling pricing method applicable to the recycling pricing of second-hand textbooks in places such as schools and bookstores. Background Art

[0002] Currently, second-hand bookstores are generally set up in major universities, and the recycling and selling of second-hand textbooks are very common. However, the recycling of second-hand textbooks mainly relies on manual operation, and there are the following problems: ① Strong subjectivity in pricing: The recycling price is evaluated manually and is easily affected by subjective factors, lacking an objective unified standard; ② Low efficiency: The processes of manually identifying textbook information, weighing, and pricing are cumbersome and time-consuming, further reducing the quality of recycling pricing.

[0003] Such a textbook recycling pricing method often fails to correctly estimate the actual value of textbooks, restricting the development of this industry: If the recycling price is too low, it is difficult to satisfy the student group; if the recycling price is too high, it cannot meet the revenue needs of merchants. Generally speaking, the current market needs an objective, fair, and efficient pricing method to balance the demand contradictions of both parties.

[0004] In the prior art, there is no device integrating functions of automatic identification, weighing and counterfeiting verification, and intelligent pricing, which cannot meet the requirements of efficient, transparent, and accurate textbook recycling. Summary of the Invention

[0005] The technical problem to be solved by the present invention is: aiming at the above deficiencies of the prior art, to provide a textbook recycling pricing method that can achieve rapid identification of textbook information, weighing and counterfeiting verification, and artificial intelligence pricing, improving recycling efficiency and fairness.

[0006] To achieve the above technical features, the object of the present invention is realized as follows: A textbook recycling pricing method includes the following steps: Use an image acquisition device to scan the barcode of the book to be recycled; When a clear and complete barcode image is scanned, the image acquisition device takes a photo of the barcode to obtain a barcode image; Process the obtained barcode image to identify the ISBN number of the book to be recycled; According to the identified ISBN number, crawl the relevant information of the book to be recycled on a book website; Conduct a weight detection on the book to be recycled and obtain the actual weight of the book to be recycled; Build a page-weight model. Based on the page information in the relevant information and with the help of the page-weight model, output the expected weight of the book to be recycled. Then compare the expected weight with the actual weight. If the weight test passes, proceed to the next pricing step; if the weight test fails, conduct manual inspection or re-inspection. In the pricing step, input the relevant information into the trained support vector machine price prediction model and random forest price prediction model respectively. Predict two predicted prices for the book to be recycled, and take the average of the two predicted prices as the optimal recycling price.

[0007] Preferably, the image acquisition device includes an image acquisition module. The image acquisition module is connected to the core control module through a communication module, and the core control module is connected to a first display module for displaying the image screen. Preferably, the image acquisition module uses a camera. The core control module uses a single-chip microcomputer. The communication module uses a USB to serial port module to realize data transmission between the hardware and the upper computer. The first display module uses a display screen to display the camera image and assist in shooting.

[0008] Preferably, the specific process of processing the obtained barcode image to identify the ISBN number of the book to be recycled is as follows: Install the Pyzbar library in Python, and with the help of the Pyzbar library, convert the input barcode image into an ISBN number for output. The specific implementation steps are as follows: ① Read the previously saved barcode image with the help of the cv library and perform grayscale processing using the cvtColor function. ② Identify the barcode using the decode function in the Pyzbar library. ③ Draw the bounding box of the barcode in the image and label the barcode data and type.

[0009] Preferably, according to the identified ISBN number, the specific process of crawling the relevant information of the book to be recycled from the book website is as follows: Mainly obtain book information from the website "Douban Reading". The specific implementation steps are as follows: ① Use the Selenium library to open the browser driver and enter the corresponding search page of "Douban Reading" according to the ISBN number. ② Use By.CLASS_NAME to obtain the detail page link and access it. ③ Use the requests library to parse the detail page. ④ Screen out and print the relevant information such as the publication year, pricing, number of pages, and binding through string splitting and matching methods.

[0010] Preferably, the specific process of establishing the page number-weight model is as follows: By statistically analyzing the weights and page numbers of a certain number of books and performing regression analysis on the weights and page numbers, the corresponding regression curve can be obtained. Thus, the expected weight of a book can be determined based on the page number of the book. When the weight of the book to be sold by the customer is less than the expected weight of this book by more than a certain value, then this book is considered a low-quality book and its weight detection will not pass; The established regression curve of the page number and weight of the book is as follows: ; (1)

[0011] Preferably, the specific process of detecting the weight of the book to be recycled and obtaining the actual weight of the book to be recycled is as follows: An electronic scale module is used for weighing, and the electronic scale module is connected to a single-chip microcomputer; The electronic scale module consists of a weighing platform, an HX711 chip, and a resistive strain pressure sensor; The resistive strain pressure sensor is made based on the principle that the resistance value changes due to the deformation of the material under force for pressure measurement; The HX711 chip is a 24-bit A / D converter chip designed for high-precision electronic scales.

[0012] Preferably, the specific process of establishing the support vector machine price prediction model and the random forest price prediction model is as follows: Collect data on the used book website to obtain a dataset, where the dataset reflects the relationship between the publication year, pricing information, and actual second-hand market price of second-hand books; Use the dataset to train the support vector regression machine model and the random forest model respectively. Among them, during the model training process, the hyperparameters of the model are tuned using the hyperparameters of the Sklearn library; Finally, use the trained support vector regression machine model and random forest model to predict the optimal pricing of the target book respectively, and take the average value as the optimal recycling price.

[0013] Preferably, during the process of tuning the hyperparameters, first use the random search algorithm to roughly determine the parameter size, and then use the grid search algorithm to find more accurate parameters. Among them, mainly tune the n_estimators, max_features, max_depth, and min_samples_split hyperparameters of the random forest model and the support vector regression machine model; After that, complete the training of the machine learning model with the help of the Sklearn library of Python.

[0014] Preferably, in the process of determining the optimal recycling price, the logistic growth model is used to adjust the recycling price to avoid overpricing. The specific process is as follows: The preliminary recycling price obtained by the machine learning model is , and the final price is . Then the logistic growth model is expressed as: ; (2)

[0015] The present invention has the following beneficial effects: 1. By combining hardware and software, the present invention realizes rapid identification of teaching material information, weighing and counterfeiting verification, and artificial intelligence pricing, improving recycling efficiency and fairness.

[0016] 2. By adopting the above-mentioned image acquisition device, automatic acquisition of the barcode image on the book can be realized, and the accuracy and efficiency of acquisition can be guaranteed.

[0017] 3. Through the above-mentioned graphic processing process, the ISBN number of the book can be identified according to the barcode of the book.

[0018] 4. Through the above-mentioned specific method, the information of the book can be accurately obtained according to the ISBN number.

[0019] 5. Through the page number-weight model, the expected weight of the book can be determined according to the number of pages of the book. When the weight of the book to be sold by the customer is less than the expected weight of this book by a certain value, it is considered that this book is of poor quality and its weight detection fails.

[0020] 6. Through the above-mentioned electronic scale module, accurate detection of weight can be realized.

[0021] 7. Through the above-mentioned machine learning model, the price can be predicted and a scientific pricing basis can be provided.

[0022] 8. Through the above-mentioned logistic growth model, the scientific nature of pricing is improved, and thus the objective laws of the market can be better satisfied. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The present invention will be further described below with reference to the drawings and embodiments.

[0024] Figure 1 is the overall working principle and process of the teaching material recycling pricing machine.

[0025] Figure 2 is the specific output schematic diagram of photographing and identifying the barcode of the book.

[0026] Figure 3 is the schematic diagram of the book details page and the information acquisition result.

[0027] Figure 4 It is a schematic diagram of the book weight and recycling price output.

[0028] Figure 5 It is a structural diagram of the weighing circuit.

[0029] Figure 6 It is a regression graph of the number of pages - weight of the book.

[0030] Figure 7 It is a prediction effect diagram of the test set of the machine learning model.

[0031] Figure 8 It is a schematic diagram of the logistic growth model and its effect. Specific implementation manners

[0032] Next, the technical solutions of the present invention will be clearly and completely described in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0033] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0034] In the description of the present invention, it should be noted that unless otherwise clearly specified and limited, the terms "installed", "connected", "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.

[0035] In addition, the technical features involved in different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0036] Embodiment 1: Refer to Figure 1 , a method for pricing textbook recycling, including the following steps: Step 1: Use an image acquisition device to scan the barcode of the book to be recycled; Step 2: When a clear and complete barcode image is scanned, the image acquisition device takes a photo of the barcode to obtain the barcode image; Step 3: Process the obtained barcode image to identify the ISBN number of the book to be recycled; Step 4: According to the identified ISBN number, crawl the relevant information of the book to be recycled on the book website; Step 5: Conduct a weight detection on the book to be recycled and obtain the actual weight of the book to be recycled; Step 6: Establish a page number - weight model. According to the page number information in the relevant information and with the help of the page number - weight model, output the expected weight of the book to be recycled, and then compare the expected weight with the actual weight. If the weight detection passes, proceed to the next pricing step; if the weight detection fails, conduct manual detection or re - detection; Step 7: In the pricing step, input the relevant information into the trained support vector machine price prediction model and random forest price prediction model respectively, predict two predicted prices for the book to be recycled, and take the average of the two predicted prices as the optimal recycling price.

[0037] Furthermore, the image acquisition device includes an image acquisition module. The image acquisition module is connected to the core control module through a communication module, and the core control module is connected to a first display module for displaying the image screen; the image acquisition module uses a camera; the core control module uses a single - chip microcomputer; the communication module uses a USB - to - serial port module to realize data transmission between the hardware and the upper computer; the first display module uses a display screen to display the camera screen for assisting in shooting. By using the above - mentioned image acquisition device, automatic acquisition of the barcode image on the book can be realized, and the accuracy and efficiency of the acquisition can be guaranteed.

[0038] Furthermore, the specific process of processing the obtained barcode image to identify the ISBN number of the book to be recycled is as follows: Install the Pyzbar library in Python, and with the help of the Pyzbar library, convert the input barcode image into an ISBN number for output. The specific implementation steps are as follows: ① Read the previously saved barcode image with the help of the cv library and perform grayscale processing using the cvtColor function; ② Identify the barcode with the help of the decode function in the Pyzbar library; ③ Draw the bounding box of the barcode in the image and label the barcode data and type.

[0039] Through the above - mentioned graphic processing process, the ISBN number of the book can be identified according to the barcode of the book.

[0040] Further, according to the recognized ISBN number, the specific process of crawling relevant information of the book to be recycled from the book website is as follows: Mainly obtain book information from the website "Douban Reading". The specific implementation steps are as follows: ① Use the Selenium library to open the browser driver and enter the corresponding search page of "Douban Reading" according to the ISBN number; ② Use By.CLASS_NAME to obtain the link to the detail page and access it; ③ Use the requests library to parse the detail page; ④ Screen out and print relevant information such as publication year, price, number of pages, and binding through string splitting and matching methods.

[0041] Through the above specific method, the information of the book can be accurately obtained according to the ISBN number.

[0042] Further, the specific process of establishing the page number-weight model is as follows: By counting the weights and page numbers of a certain number of books and performing regression analysis on the weight and page number, the corresponding regression curve is obtained. Thus, the expected weight of the book can be determined according to the page number of the book. When the weight of the book to be sold by the customer is less than the expected weight of this book by more than a certain value, then this book is considered a poor-quality book and its weight detection fails; The established page number of the book and weight The regression curve is as follows: ; (1)

[0043] Further, the specific process of detecting the weight of the book to be recycled and obtaining the actual weight of the book to be recycled is as follows: Use an electronic scale module for weighing. The electronic scale module is connected to the single-chip microcomputer; the electronic scale module consists of a weighing platform, an HX711 chip, and a resistive strain pressure sensor; the resistive strain pressure sensor is made using the principle that the resistance value changes due to the deformation of the material under force for pressure measurement; the HX711 chip is a 24-bit A / D converter chip designed for a high-precision electronic scale. Through the above electronic scale module, accurate weight detection can be achieved.

[0044] Further, the specific process of establishing the support vector machine price prediction model and the random forest price prediction model is as follows: Collect data on the used book website to obtain a data set. Among them, the data set reflects the relationship between the publication year, price information of second-hand books and the actual second-hand market price; The support vector regression machine model and the random forest model are trained using the dataset respectively. During the model training process, the hyperparameters of the model are tuned using the hyperparameters of the Sklearn library. Finally, the trained support vector regression machine model and random forest model are used to predict the optimal price of the target book respectively, and the average value is taken as the optimal recovery price.

[0045] Through the above machine learning model, the price can be predicted and a scientific pricing basis can be provided.

[0046] Furthermore, during the hyperparameter tuning process, the random search algorithm is first used to roughly determine the parameter size, and then the grid search algorithm is used to find more accurate parameters. Among them, the hyperparameters of n_estimators, max_features, max_depth, and min_samples_split of the random forest model and the support vector regression machine model are mainly tuned. After that, the training of the machine learning model is completed with the help of the Sklearn library of Python.

[0047] Furthermore, during the determination process of the optimal recovery price, the logistic growth model is used to adjust the recovery price to avoid too high recovery pricing. The specific process is as follows: The preliminary recovery pricing obtained by the machine learning model is , and the final pricing is , then the logistic growth model is expressed as: ; (2)

[0048] Through the above logistic growth model, the scientific nature of the pricing is improved, and thus the objective laws of the market are better met.

[0049] Embodiment 2: As Figure 1 shown, the main working principle and process of the present invention are as follows: OV7670 continuously scans the barcodes on the back of the book, and the barcode is displayed on the screen above the machine in real time. When the barcode is complete and clear enough, the barcode is photographed and uploaded to the computer. The ISBN number of the book is recognized by a python program, and then the information of the book is automatically crawled from the website "Douban Reading" and waits for the information crawling to be completed. During or after the information crawling process, the book can be weighed on an electronic scale. After the crawling is completed, the weight of the book is uploaded to the computer, and the Python program conducts a weight detection on it. If the weight detection fails, it enters the manual detection or re-detection link; if the weight detection passes, it enters the artificial intelligence pricing link, automatically prices the book with the help of SVR and RF respectively, and finally takes the average of the two prices as the final recycling price, and this book recycling ends.

[0050] Among them, the product hardware structure and functions are as shown in Table 1 below: Table 1: Product Hardware Structure and Function Table

[0051] The specific working principle of the product is as follows: 1. OV7670 takes pictures of the book barcode: The OV7670 / OV7171 CAMERACHIPTM image sensor is small in size and low in operating voltage, providing all the functions of a single-chip VGA camera and image processor. It can be controlled through the SCCB bus and output 8-bit image data of various resolutions in ways such as full-frame, subsampling, and windowing. The VGA image of this product reaches up to 30 frames per second. Users can fully control the image quality, data format, and transmission method. All image processing function processes, including gamma curve, white balance, saturation, chroma, etc., can be programmed through the SCCB interface. The OmmiVision image sensor applies unique sensor technology to improve the image quality and obtain clear and stable color images by reducing or eliminating optical or electronic defects such as fixed pattern noise, smear, and floating dispersion.

[0052] This invention uses the STM32F103C8T6 minimum system board to control the OV7670 with fifo to obtain the barcode photo of the book. This process is mainly realized by functions such as camera_refresh(), OV7670_RedData(), and Serial_SendByte() in the OV7670 example program. The main idea of its C code is as follows: ① Set the clock, initialize the display screen, serial port, camera, external interrupt, and timer; ② Set the corresponding pins for the photo-taking button, etc.; ③ Continuously read the camera image and stop updating the image when it detects that the button is pressed; ④ Send the instruction header and communication protocol to the host computer (computer) Python through the serial port; ⑤ Re-read the captured image data and display it on the display screen; ⑥ Transmit the image data to the host computer through the serial port, clear the frame terminal flag and communication protocol, and complete the transmission.

[0053] Meanwhile, execute the corresponding Python receiving program in the upper computer. The main idea is as follows: ① Use the serial library to obtain the serial port list and try to open the serial port; ② Loop, and start receiving photos from the lower computer (STM32) after receiving the instruction header; ③ After receiving, decode, display, and save them.

[0054] 2. Recognize barcodes with the Pyzbar library: The Pyzbar library is a Python library that reads barcodes and QR codes with the help of the open-source software suite ZBar. In this invention, this library is used to convert the input photo of the book barcode into an ISBN number for output. The specific implementation steps are as follows: ① Use the cv library to read the previously saved barcode image and perform grayscale processing using the cvtColor function; ② Use the decode function in the Pyzbar library to recognize the barcode; ③ Draw the bounding box of the barcode in the image and label the barcode data and type.

[0055] 3. Crawl book information with the Selenium library: This invention obtains book information from the website "Douban Reading". Considering that there are dynamic web page links on this website and the link to the book details page cannot be obtained by parsing the web page code after searching for the ISBN number, we then use the Selenium library to simulate mouse clicks to enter the details page. After that, use the requests library of Python, etc. to obtain and parse the code of the details page to obtain relevant information. The main idea is as follows: ① Use the Selenium library to open the browser driver and enter the corresponding search page of "Douban Reading" according to the ISBN number; ② Use By.CLASS_NAME to obtain the link to the details page and access it; ③ Use the requests library to parse the details page; ④ Screen out relevant information such as the publication year, price, number of pages, binding, etc. through methods such as string splitting and matching and print them out.

[0056] 4. Weigh and verify authenticity with an electronic scale: To prevent some bad customers from passing off inferior goods, that is, selling books with severely missing pages or low-quality paper as genuine books, this invention statistically analyzed the weights and numbers of pages of more than 30 books and regressed the weight and number of pages to obtain the following regression curve. From this, the expected weight of the book can be determined from the number of pages of the book. When the weight of the book to be sold by the customer is much less than the expected weight of this book, this book is considered an inferior book. The regression curve of the number of pages x and weight y is as follows: ; The regression effect is as Figure 6 shown, and it can be seen that the effect is good and credible.

[0057] Among them, the actual weight of the book is obtained by the STM32-controlled electronic scale module.

[0058] The electronic scale consists of a weighing platform, an HX711 chip, a resistive strain pressure sensor, etc., and its structure is as Figure 5 shown. The following mainly introduces the resistive strain pressure sensor and the HX711 chip.

[0059] (1) Resistive strain pressure sensor: The resistive strain pressure sensor is a pressure measurement device made using the principle that the resistance value of a material changes when it is stressed and deformed. When the sensor is subjected to an external pressure, the sensitive element inside it (usually an elastomer made of materials such as metal or ceramic) will deform, and this deformation will cause a change in the lattice structure of the component, resulting in a change in its geometric dimensions or conductivity, thereby affecting the resistance value in the circuit.

[0060] Generally, this type of sensor includes a substrate, a strain gauge pasted on it, and a signal processing circuit connecting the strain gauge. When the pressure increases, the strain gauge will produce a tensile or compressive force proportional to the pressure, causing a corresponding change in the resistance of the strain gauge. During measurement, by connecting the strain gauges into a bridge circuit structure, usually four strain gauges form a full-bridge form, and the changing resistance will cause a change in the voltage difference of the bridge circuit, which can then be converted into a pressure signal. Then, through appropriate circuit amplification and processing, this electrical signal is output to reflect the magnitude of the pressure.

[0061] (2) HX711 chip: HX711 adopts the integrated circuit patent technology of Haixin Technology and is a 24-bit A / D converter chip designed specifically for high-precision electronic scales. The interface and programming between this chip and the backend MCU chip are very simple. All control signals are driven by pins, and there is no need to program the internal registers of the chip. The input selection switch can arbitrarily select Channel A or Channel B, which is connected to the internal low-noise programmable amplifier. The programmable gain of Channel A is 128 or 64, and the corresponding full-scale differential input signal amplitudes are ±20mV or ±40mV respectively. Channel B has a fixed gain of 32 and is used for system parameter detection. The regulated power supply provided inside the chip can directly supply power to external sensors and the A / D converter inside the chip, and no additional analog power supply is required on the system board. The clock oscillator inside the chip does not require any external devices.

[0062] Table 2: Description of HX711 chip pins

[0063] The working principle of HX711 is as follows: The voltage stabilizing circuit inside the HX711 chip can provide analog power to both the A / D converter and the external sensor simultaneously. The supply voltage (VSUP) of the regulated power supply can be the same as the digital power supply (DVDD). The output voltage value (VAVDD) of the regulated power supply is determined by the external voltage dividing resistors R1, R2 and the output reference voltage VBG of the chip, and VAVDD = VBG * (R1 + R2) / R2.

[0064] When the pressure sensor starts to bear the load, the bridge circuit will generate a tiny voltage difference, which is the differential output of the sensor. The analog differential input of channel A of the HX711 can be directly connected to the differential output of the bridge sensor. Since the signal output by the bridge sensor is small, in order to make full use of the input dynamic range of the A / D converter, the input voltage needs to be amplified. Therefore, an amplifier is added before the AD conversion. The amplified voltage signal is converted into a digital signal through analog-to-digital conversion and output from the DOUT pin.

[0065] (3)STM32F103C8T6 minimum system board controls the weighing module: The circuit of STM32 controlling the weighing module is as Figure 5 shown. Taking a 5Kg electronic scale as an example to introduce the weighing principle: ① Output voltage of the pressure sensor at full scale = excitation voltage * sensitivity 1.0mv / v; For example: the supply voltage is 5v multiplied by the sensitivity 1.0mv / v = 5mv at full scale. It is equivalent to generating 5mV voltage when there is a gravity of 5Kg; ② Channel A of the HX711 module has a signal gain of 128 times, which can amplify the 5mV voltage by 128 times, and then sample and output the value of 24-bit AD conversion. The single-chip microcomputer reads the 24-bit data through the specified timing; ③ Reverse-convert the AD value to the gravity value.

[0066] Assume the gravity is A Kg (A < 5), and the measured AD value is y.

[0067] The voltage output by the sensor is A Kg * VAVDD mv / 5Kg = A * VAVDD / 5mv. After a 128-fold gain, it is 25.6A * VAVDD mv. Converted to a 24-bit digital signal, value = y = 0.0256 A * 2^24. Knowing VAVDD, A can be calculated as A = y / (0.0256 * 2^24).

[0068] Based on this, the calculation formula in the program can be designed as: (xWeight_Shiwu = (unsigned long)((float)Weight_Shiwu / GapValue).

[0069] If the weight is too large, increase the GapValue value. If the weight is too small, decrease the GapValue value.

[0070] The C code of the STM32 weighing module is similar to that of the camera module, which is also mainly for initialization, data collection, serial communication and display recognition. In addition, the Python data receiving program design of the host computer is basically the same as the above image receiving program, mainly using the serial library for reception.

[0071] 5. Machine learning automated pricing: Then, we use machine learning to automatically price the books, which is achieved through support vector regression (SVR) and random forest (RF). The data set used for model training comes from Kongfuzi.com, which mainly reflects the relationship between the publication year, pricing and other information of second-hand books and the actual second-hand market price.

[0072] Part 1, Support Vector Regression Machine Model: Support vector machine (SVM) is a classification model proposed by Corinna Cortes and Vapnik in 1995. The support vector machine maps the vector to a higher-dimensional space, establishes a maximum isolation hyperplane in this space, and then sets critical hyperplanes on both sides of it and classifies them in turn.

[0073] Support Vector Regression (SVR) is derived from Support Vector Machine and upgrades it from classification to regression. Support Vector Regression also constructs a hyperplane, but then minimizes the "distance" of the sample points farthest from the hyperplane.

[0074] Part 2, Random Forest Model: Random forest is a classification learner proposed by Leo Breiman and Adele Cutler, and can also be adapted as a regression learner. The basic principle of random forest is based on the idea that a large number of decision trees are trained, the classification methods of each decision tree are integrated, and the most common classification method is selected for classification, so as to obtain the optimal classification method.

[0075] Part 3, hyperparameter tuning and model training based on Sklearn library: When training a machine learning model, in order to improve the goodness of fit of the regression, it is necessary to tune the model's hyperparameters.

[0076] In this invention, the random search algorithm is first used to roughly determine the parameter sizes, and then the grid search algorithm is used to find more accurate parameters. Among them, the hyperparameters such as n_estimators, max_features, max_depth, and min_samples_split of the random forest model and the support vector regression machine are mainly optimized.

[0077] After that, the training of the machine learning model can be completed with the help of the Sklearn library in Python. The ideas of the Python code for specific hyperparameter tuning and model training are as follows: ① Import the dataset, quantify and standardize it; ② Divide the training set and the test set; ③ Given the approximate range of hyperparameters and use the Sklearn library for random search and optimal matching to narrow the range of optimal parameters; ④ Use the grid search algorithm to determine the specific optimal hyperparameters; ⑤ Train the model and save the model with the help of the pickle library. The training results are as Figure 7 shown, the goodness of fit of SVR is 0.6658, and the goodness of fit of RF is 0.7499.

[0078] Finally, the trained random forest model and the support vector regression machine are used to predict the optimal price of the target book respectively, and the average value is taken as the preliminary recovery price.

[0079] 6. Use the logistic growth model to adjust the recovery price: Considering that in the investigation of market demand, it is known that students tend to buy second-hand textbooks within 20 - 30 yuan. Accordingly, it can be deduced that the recovery price should also be roughly in this range. Therefore, in order to avoid too high a recovery price, a simple logistic growth model is established to control the maximum price at about 40 yuan. Denote the preliminary recovery price obtained by the machine learning model as a , and the final price as b , then the logistic growth model can be expressed as: ; As Figure 8 shown, under the action of this model, the prices of the books with machine learning pricing below 40 yuan remain roughly unchanged, while the prices of the books above 40 yuan show a logistic growth trend with an upper bound of 50 yuan. In this way, it can be ensured that the recovery price obtained by machine learning will not be too high, thereby avoiding the situation where the selling price is too high and the books cannot be sold.

[0080] Example 3: Select the second edition of "Discrete Mathematics" edited by Qu Wanling, Geng Suyun, and Zhang Li'ang as the recovery example.

[0081] (1) Connect the computer to the serial port and power on the product. Run the python main program, and the available serial port devices and serial port detail parameters will be displayed in the command line window.

[0082] Table 3: Available serial devices

[0083] Serial port details parameters: port='COM3', baudrate=115200, bytesize=8, parity='N',stopbits=1.

[0084] (2) Photograph the book barcode. Place the book barcode directly below the camera, and fine-tune the barcode position until the barcode image on the display is complete and clear. Then press the button and the camera will photograph the barcode. The command line window will show that the barcode image is being uploaded to the computer through the serial port. The computer will then process the image and identify its ISBN number. The output is as follows: Figure 2 shown.

[0085] (3) According to the ISBN number of the book, crawl relevant information on Douban Books. During the program running, the corresponding website will automatically pop up and crawl relevant information. The page link and relevant information of the book printed in the command line window are as follows: Figure 3 shown. (4) Weigh the book on an electronic scale. The weight information is uploaded to the computer. Then the book is tested for weight to confirm whether there are any missing pages. If the book passes the weight test, a regression prediction is performed for the recycling price. The relevant information printed in the command line window is as follows: Figure 4 At this point, the textbook recycling pricing machine has completed the pricing work for recycled second-hand textbooks.

[0086] These features and embodiments may be modified to suit specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the scope of protection of the present invention.

Claims

1. A textbook recycling pricing method, characterized in that, It includes the following steps: Use an image acquisition device to scan the barcode of the book to be recycled; When a clear and complete barcode image is scanned, the image acquisition device takes a photo of the barcode to obtain the barcode image; Process the obtained barcode image to identify the ISBN number of the book to be recycled; According to the identified ISBN number, crawl the relevant information of the book to be recycled on the book website; Conduct a weight detection on the book to be recycled and obtain the actual weight of the book to be recycled; Establish a page number-weight model. According to the page number information in the relevant information, and with the help of the page number-weight model, output the expected weight of the book to be recycled, and then compare the expected weight with the actual weight. If the weight detection passes, proceed to the next pricing step; if the weight detection fails, conduct manual detection or re-detection; In the pricing step, input the relevant information into the trained support vector machine price prediction model and the random forest price prediction model respectively, predict two predicted prices of the book to be recycled, and take the average of the two predicted prices as the optimal recycling price.

2. The method for pricing textbook recycling according to claim 1, wherein: The image acquisition device includes an image acquisition module. The image acquisition module is connected to the core control module through a communication module, and the core control module is connected to a first display module for displaying the image screen.

3. The textbook recycling pricing method according to claim 1, characterized in that: The image acquisition module uses a camera; The core control module uses a single-chip microcomputer; The communication module uses a USB to serial port module to realize data transmission between the hardware and the upper computer; The first display module uses a display screen to display the camera screen and assist in shooting.

4. The textbook recycling pricing method according to claim 1, wherein: The specific process of processing the obtained barcode image to identify the ISBN number of the book to be recycled is as follows: Install the Pyzbar library in Python, and with the help of the Pyzbar library, convert the input barcode image into an ISBN number for output. The specific implementation steps are as follows: ① Use the cv library to read the previously saved barcode image and perform grayscale processing using the cvtColor function; ② Use the decode function in the Pyzbar library to identify the barcode; ③ Draw the bounding box of the barcode in the image and label the barcode data and type.

5. The textbook recycling pricing method according to claim 1, wherein: The specific process of crawling the relevant information of the book to be recycled on the book website according to the identified ISBN number is as follows: Mainly obtain book information from the website "Douban Reading". The specific implementation steps are as follows: ① Use the Selenium library to open the browser driver and enter the corresponding search page of "Douban Reading" according to the ISBN number; ② Use By.CLASS_NAME to obtain the detail page link and access it; ③ Use the requests library to parse the detail page; ④ Through string splitting and matching methods, screen out and print relevant information such as the publication year, pricing, page number, and binding.

6. The textbook recycling pricing method according to claim 1, wherein: The specific establishment process of the page number-weight model is as follows: By counting the weights and page numbers of a certain number of books, and performing regression analysis on the weights and page numbers, the corresponding regression curve is obtained. Thus, the expected weight of the book can be determined according to the page number of the book. When the weight of the book to be sold by the customer is less than the expected weight of this book by more than a certain value, then this book is considered a low-quality book and its weight detection fails; The established number of book pages and weight has the following regression curve: ;(1) 7. The textbook recycling pricing method according to claim 3, wherein: The specific process of detecting the weight of the books to be recycled and obtaining the actual weight of the books to be recycled is as follows: Weighing is carried out using an electronic scale module, and the electronic scale module is connected to a single-chip microcomputer; The electronic scale module consists of a weighing platform, an HX711 chip, and a resistive strain pressure sensor; The resistive strain pressure sensor is made using the principle that the resistance value changes due to the force-induced deformation of the material for pressure measurement; The HX711 chip is a 24-bit A / D converter chip designed for high-precision electronic scales.

8. The textbook recycling pricing method according to claim 3, wherein: The specific establishment process of the support vector machine price prediction model and the random forest price prediction model is as follows: Collect data on the Internet of used books to obtain a data set, where the data set reflects the relationship between the publication year, pricing information of second-hand books, and the actual second-hand market price; The support vector regression machine model and the random forest model are trained using the data set respectively. During the model training process, the hyperparameters of the model are tuned using the hyperparameters of the Sklearn library; Finally, the trained support vector regression machine model and random forest model are used to predict the optimal pricing of the target books respectively, and the average value is taken as the optimal recycling price.

9. The textbook recycling pricing method according to claim 8, wherein: During the process of tuning the hyperparameters, the random search algorithm is first used to roughly determine the parameter sizes, and then the grid search algorithm is used to find more accurate parameters. Among them, the hyperparameters of n_estimators, max_features, max_depth, and min_samples_split of the random forest model and the support vector regression machine model are mainly tuned; After that, the training of the machine learning model is completed with the help of the Sklearn library in Python.

10. The textbook recycling pricing method according to claim 8, characterized in that: During the process of determining the optimal recycling price, the logistic growth model is used to adjust the recycling price to avoid too high recycling pricing. The specific process is as follows: Preliminarily price the recycling obtained by the machine learning model as , and finally price it as , then the logistic growth model is expressed as: ;(2)。