Code reader control method and device, equipment, storage medium and program product

By performing combined tests of multiple imaging parameters and lighting parameters after the barcode reader is started, and evaluating and comparing them based on the image quality scoring mechanism, automatic optimization of barcode reader parameters and configuration is achieved. This solves the problem of poor decoding performance of the barcode reader in different application scenarios and improves recognition accuracy and stability.

CN120911495APending Publication Date: 2025-11-07TP-LINK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511041918.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing reader parameter adjustment schemes cannot adapt to different application scenarios, resulting in poor decoding performance.

Method used

After the barcode reader is started, it is controlled to acquire images under different lighting and imaging parameters. Based on the image quality score, the parameters are optimized to obtain the target parameter data, and the barcode reader parameters are updated to adapt to the current environment.

Benefits of technology

It improves the recognition accuracy and stability of the barcode reader in actual working conditions, and enables accurate recognition of barcode images under various complex lighting conditions, thereby improving the decoding success rate and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120911495A_ABST
    Figure CN120911495A_ABST
Patent Text Reader

Abstract

The invention provides a code reader control method and device, equipment, a storage medium and a program product, and the method comprises the steps: controlling a code reader to carry out the image collection under different light parameters and imaging parameters after the code reader is started, carrying out the parameter optimization of the code reader according to the image quality score of the collected image, obtaining the target parameter data of the code reader, and storing the target parameter data in a storage medium; the target parameter data comprises imaging parameters and light parameters; and according to the imaging parameter and the light parameter in the target parameter data, updating the parameter of the code reader, and controlling the code reader with the updated parameter to identify the to-be-identified code. And the imaging effect of each parameter combination is evaluated based on an image quality scoring mechanism, so that automatic optimization and configuration optimization of the code reader parameters are realized, the identification accuracy and stability of the code reader can be improved, code images under various complex illumination scenes can be accurately identified, the overall decoding success rate is improved, and the decoding efficiency is improved. And the decoding effect of the code reader is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of code reader, and in particular to a code reader control method, device, equipment, storage medium and program product. BACKGROUND

[0002] A code reader is a device used to identify and read various barcodes, two-dimensional codes and other code information. The code reader can convert image information into electronic data, facilitating subsequent processing, storage and transmission. With the rapid development of barcode and two-dimensional code technology, the application scenarios of code readers are becoming more and more extensive, including manufacturing, logistics, retail and other fields.

[0003] Since the performance of the code reader in different application scenarios is affected by the surrounding environment, when using the code reader to identify and decode code information, the related parameters of the code reader need to be adjusted so that the parameters of the code reader can be more adapted to the current environment to improve the decoding performance of the code reader. However, the parameter adjustment scheme of the code reader in the related technology is relatively simple and cannot adapt to different application scenarios, resulting in poor decoding effect of the code reader. SUMMARY

[0004] The present application provides a code reader control method, device, equipment, storage medium and program product to solve the problem that the parameter adjustment scheme of the code reader in the related technology cannot adapt to different application scenarios, resulting in poor decoding effect of the code reader.

[0005] In a first aspect, the present application provides a code reader control method, comprising:

[0006] After starting the code reader, the code reader is controlled to perform image acquisition under different light parameters and imaging parameters, so as to perform parameter optimization on the code reader according to the image quality score of the acquired image, and obtain target parameter data of the code reader, wherein the target parameter data includes imaging parameters and light parameters;

[0007] According to the imaging parameters and light parameters in the target parameter data, the parameters of the code reader are updated;

[0008] The code reader after parameter update is controlled to identify the code to be identified.

[0009] In an embodiment, the code reader is controlled to perform image acquisition under different light parameters and imaging parameters, so as to perform parameter optimization on the code reader according to the image quality score of the acquired image, and obtain target parameter data of the code reader, comprising:

[0010] The parameters of the code reader are initialized and adjusted so that the picture definition of the code reader meets the requirements, and the light brightness and algorithm parameters of the code reader reach the maximum parameter configuration;

[0011] The code reader is controlled according to the preset light parameter, and the code reader is controlled to perform image acquisition under different imaging parameters, so as to perform imaging parameter optimization according to the image quality scores of the acquired images, and target imaging parameters under the light parameter are obtained.

[0012] The light parameter of the code reader is updated, and the code reader is controlled to perform image acquisition under different imaging parameters and parameter optimization, target imaging parameters under different light parameters are obtained, and the acquired images corresponding to the target imaging parameters are taken as calibration acquisition images;

[0013] The calibration acquisition image with the highest image quality score in the plurality of calibration acquisition images is taken as a target acquisition image, and the light parameter and the target imaging parameter corresponding to the target acquisition image are output as target parameter data.

[0014] In an embodiment, the imaging parameters include exposure time and gain value, the code reader is controlled to perform image acquisition under different imaging parameters, so as to perform imaging parameter optimization according to the image quality scores of the acquired images, and target imaging parameters under the current light parameter are obtained, including:

[0015] The code reader is controlled based on the preset gain value, and the code reader is controlled to perform image acquisition under different exposure times, so as to perform exposure parameter optimization according to the image quality scores of the acquired images, and target exposure times corresponding to the preset gain value are obtained;

[0016] The gain value of the code reader is updated, and the exposure time is predicted based on the updated gain value by using a gain-exposure mapping relationship model, so as to obtain target exposure times corresponding to different gain values, and the gain-exposure mapping relationship model is constructed according to the mapping relationship between the preset gain value and the corresponding target exposure time;

[0017] The acquired image corresponding to the target exposure time is taken as a first acquisition image, and the gain value and the target exposure time corresponding to the first acquisition image with the highest image quality score are taken as target imaging parameters under the current light parameter.

[0018] In an embodiment, the gain value of the code reader is updated, and the exposure time is predicted based on the updated gain value by using a gain-exposure mapping relationship model, so as to obtain target exposure times corresponding to different gain values, including:

[0019] The gain value of the code reader is updated, and the exposure time is predicted based on the updated gain value by using a gain-exposure mapping relationship model, so as to obtain target exposure times corresponding to different gain values, including:

[0020] According to the size of the calibration interval, an exposure time interval centered on the predicted exposure time is determined;

[0021] The code reader is controlled to capture images with different exposure times within an exposure time interval, to optimize exposure parameters according to image quality scores of the captured images, and to obtain a target exposure time with an updated gain value.

[0022] In an embodiment, the image quality score of the captured image is determined by:

[0023] Code information in the captured image is recognized and located to determine a recognized code region in the captured image.

[0024] The recognized code region in the captured image is scored for image quality to obtain a plurality of quality parameter scores, including at least two of a contrast score, an edge sharpness score, an exposure score, and a brightness score.

[0025] The plurality of quality parameter scores are weighted and summed to obtain the image quality score of the captured image.

[0026] In an embodiment, after the code information in the captured image is recognized and located, the method further comprises:

[0027] When the recognized code region in the captured image is not located, the captured image is sampled for a calibration region and a random region to obtain a plurality of sampling regions in the captured image.

[0028] The plurality of sampling regions in the captured image are scored for image quality to obtain a plurality of quality parameter scores for each sampling region, and the plurality of quality parameter scores for each sampling region are weighted and summed to obtain a first quality score for each sampling region.

[0029] The image quality score of the captured image is determined according to the first quality scores of the sampling regions.

[0030] In an embodiment, the code reader is controlled to capture images under different light parameters and imaging parameters to optimize parameters of the code reader according to a target image quality score, including:

[0031] During the process of controlling the code reader to capture images, the code reader is controlled to capture at least two captured images under the same parameter to obtain image quality scores of the two captured images.

[0032] When a score difference between the image quality scores of the two captured images is less than a preset difference, an average value of the image quality scores of the two captured images is taken as a target image quality score corresponding to the same parameter to optimize parameters of the code reader according to the target image quality score.

[0033] In an embodiment, after the code reader is controlled to capture at least two captured images under the same parameter to obtain image quality scores of the two captured images, the method further comprises:

[0034] When the score difference of the image quality scores of the two captured images is greater than or equal to the preset difference value, the code reader is controlled to continue image capturing under the same parameter to obtain multiple captured images under the same parameter;

[0035] When the preset score error of the multiple captured images under the same parameter is less than the preset difference value, or the number of image capturing under the same parameter reaches the preset number, an average value of the image quality scores of the multiple captured images is taken as a target image quality score corresponding to the same parameter, so as to perform parameter optimization on the code reader according to the target image quality score. The preset score error is the maximum value of the absolute values of the differences between any two image quality scores in the remaining image quality scores after removing the maximum value and the minimum value in the image quality scores of the multiple captured images under the same parameter.

[0036] In a second aspect, an embodiment of the present application provides a code reader control device, which comprises:

[0037] a parameter optimization module, configured to control the code reader to perform image capturing under different light parameters and imaging parameters after the code reader is started, so as to perform parameter optimization on the code reader according to the image quality scores of the captured images, and obtain target parameter data of the code reader, wherein the target parameter data comprises the imaging parameters and the light parameters;

[0038] a parameter updating module, configured to update the parameters of the code reader according to the imaging parameters and the light parameters in the target parameter data;

[0039] a control module, configured to control the code reader after parameter updating to recognize the to-be-recognized code.

[0040] In a third aspect, an embodiment of the present application provides an electronic device, which comprises a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, the steps of the code reader control method described above are implemented.

[0041] In a fourth aspect, an embodiment of the present application provides a readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the code reader control method described above are implemented.

[0042] In a fifth aspect, an embodiment of the present application provides a computer program product, which comprises a computer program. When the computer program is executed, the code reader control method described above is executed.

[0043] In one scheme of the code reader control method, the code reader control device, the code reader control equipment, the storage medium, and the program product, after the code reader is started, the code reader is controlled to perform image acquisition under different light parameters and imaging parameters, so as to perform parameter optimization on the code reader according to the image quality score of the acquired image, obtain target parameter data of the code reader, and the target parameter data includes the imaging parameter and the light parameter; and the parameter of the code reader is updated according to the imaging parameter and the light parameter in the target parameter data, and the code reader after the parameter is updated is controlled to recognize the code to be recognized. In the embodiment, the combination test of multiple imaging parameters and light parameters is performed after the code reader is started, and the imaging effects of the parameter combinations are evaluated and compared based on the image quality score mechanism, so as to realize automatic optimization and configuration optimization of the parameters of the code reader, so that the code reader can adapt to the current environment, the recognition accuracy and stability of the code reader in the actual working state can be improved, accurate code image recognition in various complex light scenes can be realized, the overall decoding success rate is improved, and the decoding effect of the code reader is improved. BRIEF DESCRIPTION OF DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0045] Figure 1 is a structural schematic diagram of a code reader control system in an embodiment of the present application;

[0046] Figure 2 is a flowchart of a code reader control method in an embodiment of the present application;

[0047] Figure 3 is Figure 2 is an implementation flowchart of step S10 in the method;

[0048] Figure 4 is Figure 3 is an implementation flowchart of step S13 in the method;

[0049] Figure 5 is Figure 2 is another implementation flowchart of step S10 in the method;

[0050] Figure 6 is a determination flowchart of image quality score in an embodiment of the present application;

[0051] Figure 7 is a Laplace operator schematic diagram when edge sharpness score calculation is performed in an embodiment of the present application;

[0052] Figure 8 is another determination flow diagram of image quality score in an embodiment of the present application;

[0053] Figure 9 is Figure 1 is a structural diagram of a code reader control device in the embodiment of the present application;

[0054] Figure 10 is a structural diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0055] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.

[0056] It should be understood that the term "comprising" as used in the specification and the appended claims indicates the presence of the described features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should also be understood that the term "and / or" as used in the specification and the appended claims indicates any combination of associated listed items, as well as all possible combinations of the items, and includes the combination.

[0057] In addition, in the description of the present application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish descriptions, and cannot be understood as indicating or implying relative importance.

[0058] In the present application, the reference "one embodiment" or "some embodiments" means that the specific features, structures or characteristics described in connection with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in further some embodiments" and the like appearing in different places in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "including", "containing", "having" and their variants mean "including but not limited to", unless otherwise specifically emphasized.

[0059] It should be understood that the size of the serial number of each step in the following embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0060] In order to illustrate the technical solutions of the present application, specific examples are used for illustration below.

[0061] With the rapid development of bar code and two-dimensional code technology, the application scenarios of code readers are more and more extensive, including manufacturing, logistics, retail and other fields. Because the performance of the code reader in different application scenarios is affected by the surrounding environment, when the code information is identified and decoded by using the code reader, the related parameters of the code reader need to be adjusted, so that the parameters of the code reader can be more adaptive to the current environment, so as to improve the decoding performance of the code reader. However, the parameter adjustment scheme of the code reader in the related art is relatively simple, which cannot adapt to different application scenarios, resulting in poor decoding effect of the code reader.

[0062] For example, when the code reader identifies code information, the exposure or gain of the code reader is usually adjusted manually or based on an automatic exposure system (AE) to ensure that the picture brightness is sufficient, so that the bar code or two-dimensional code can be identified. In other schemes, the user will manually adjust the parameters of the light compensation lamp of the code reader according to the environmental light to identify the corresponding code information. On the one hand, the exposure or gain parameters of the code reader are simply adjusted without considering the influence of the light compensation lamp parameters or algorithm parameters (such as polarity, version, type), and the parameter adjustment effect is poor and cannot adapt to different application scenarios, such as low light environment, poor environmental adaptability, which may increase the decoding failure rate and reduce the decoding quality. On the other hand, simple manual or AE system based parameter adjustment is easy to be affected by user subjective experience or AE system limitation, and it is difficult to cover multiple scenarios, so the parameter adjustment effect is poor. In addition, manual parameter adjustment needs to be adjusted one by one, and the adjustment process is time-consuming, so the parameter adjustment efficiency is low, resulting in low decoding efficiency and poor decoding effect.

[0063] To solve the above problems, the embodiment of the present application provides a code reader control method, device, equipment, storage medium and program product. Wherein, after the code reader is started, the code reader control device controls the code reader to collect images under different light parameters and imaging parameters, so as to optimize the imaging parameters and light parameters of the code reader according to the image quality score of the collected images, obtain the target parameter data of the code reader, and the target parameter data includes the imaging parameters and light parameters; update the parameters of the code reader according to the imaging parameters and light parameters in the target parameter data, and control the code reader after the parameter update to identify the code to be identified. Through the combination test of multiple imaging parameters and light parameters after the code reader is started, and the evaluation and comparison of the imaging effect of each parameter combination based on the image quality score mechanism, the automatic optimization and configuration optimization of the parameters of the code reader are realized, so that the code reader can adapt to the current application environment, the identification accuracy and stability of the code reader in the actual working state can be improved, the accurate identification of the code image under various complex lighting scenes is realized, the overall decoding success rate and decoding efficiency are improved, and the decoding effect of the code reader is improved.

[0064] The code reader control method provided by the embodiment of the present application can be applied in the code reader control system as shown in the figure. Figure 1 The code reader control system includes a code reader and a code reader control device, wherein the code reader communicates with the code reader control device through a network or a cable.

[0065] After the code reader is started, the code reader is controlled to collect images under different light parameters and imaging parameters, so as to optimize the imaging parameters and light parameters of the code reader according to the image quality score of the collected images, obtain the target parameter data of the code reader, and the target parameter data includes the imaging parameters and light parameters; update the parameters of the code reader according to the imaging parameters and light parameters in the target parameter data, and control the code reader after the parameter update to identify the code to be identified.

[0066] In the embodiment, the combination test of multiple imaging parameters and light parameters is performed after the code reader is started, and the imaging effect of each parameter combination is evaluated and compared based on the image quality score mechanism, so as to realize the automatic optimization and configuration optimization of the parameters of the code reader, so that the code reader can adapt to the current application environment, the identification accuracy and stability of the code reader in the actual working state can be improved, the accurate identification of the code image under various complex lighting scenes is realized, the overall decoding success rate is improved, and the decoding effect of the code reader is improved.

[0067] The reader control device can be a controller of the reader. In other embodiments, the reader control device can also be an electronic device independent of the reader, such as a terminal device including various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The terminal device can control the reader to perform image acquisition and modification of light compensation parameters and image parameters by using a software interface provided by a related platform. The reader control device can also be a server, which can be implemented by an independent server or a server cluster composed of multiple servers.

[0068] In an embodiment, as shown in Figure 2 , a reader control method is provided. The method is applied to the reader control device in Figure 1 , and includes the following steps:

[0069] S10: After starting the reader, the reader is controlled to perform image acquisition under different light parameters and imaging parameters, so as to perform parameter optimization on the reader according to image quality scores of the acquired images, and obtain target parameter data of the reader.

[0070] After starting the reader, the reader control device can control the reader to perform the parameter optimization process, that is, the reader control device can control the reader to perform image acquisition under different light parameters and imaging parameters, so as to perform parameter optimization on the reader according to image quality scores of the acquired images, and obtain target parameter data of the reader.

[0071] The target parameter data can at least include imaging parameters and light parameters of the reader. In other embodiments, the target parameter data can also include algorithm parameters of the reader. The algorithm parameters are parameters related to the reader decoding algorithm in the reader, such as code polarity, version, and type parameters.

[0072] S20: The parameters of the reader are updated according to the imaging parameters and the light parameters in the target parameter data.

[0073] After the target parameter data of the reader is obtained by optimization, the reader control device can update the parameters of the reader according to the imaging parameters and the light parameters in the target parameter data. That is, the imaging parameters in the target parameter data are used as the imaging structure parameters of the reader, and the light parameters in the target parameter data are used as the light compensation parameters of the reader, so that the reader works according to the imaging parameters and the light parameters in the target parameter data.

[0074] S30: The reader with updated parameters is controlled to recognize the to-be-recognized code.

[0075] After updating the reader's parameters based on the imaging and lighting parameters in the target parameter data, the reader control device controls the updated reader to identify and decode the code to be identified, thereby obtaining the relevant data of the code to be identified.

[0076] In this embodiment, after the barcode reader is started, it is controlled to acquire images under different lighting and imaging parameters. Based on the image quality score of the acquired images, the barcode reader's parameters are optimized to obtain target parameter data. According to the imaging and lighting parameters in the target parameter data, the barcode reader's parameters are updated, and the updated barcode reader is controlled to recognize the barcode to be identified. By performing multiple combinations of imaging and lighting parameters for testing after the barcode reader starts, and evaluating and comparing the imaging effect of each parameter combination based on the image quality scoring mechanism, automatic optimization and configuration of the barcode reader parameters are achieved. This allows the barcode reader to adapt to the current application environment, improving the recognition accuracy and stability of the barcode reader in actual working conditions. It enables accurate recognition of barcode images under various complex lighting scenarios, improves the overall decoding success rate, and enhances the decoding effect of the barcode reader.

[0077] In one embodiment, such as Figure 3 As shown, in step S10, the barcode reader is controlled to acquire images under different lighting and imaging parameters. Based on the image quality score of the acquired images, the parameters of the barcode reader are optimized to obtain the target parameter data of the barcode reader. This specifically includes the following steps:

[0078] S11: Initialize and adjust the parameters of the barcode reader to ensure that the image clarity of the barcode reader meets the requirements, and that the brightness of the barcode reader's lights and algorithm parameters reach the maximum parameter configuration.

[0079] Specifically, after the barcode reader is started, the barcode reader control device receives a parameter adjustment command. This command can be input by the user through the terminal device or by the user through the adjustment buttons on the barcode reader. Upon receiving the parameter adjustment command, the barcode reader control device controls the barcode reader to execute a parameter initialization adjustment process to adjust the barcode reader's image clarity to meet the requirements, and to maximize the barcode reader's light brightness and algorithm parameters.

[0080] The code reader control device controls the code reader to perform Gamma adjustment and AE adjustment at the same time, so that the picture brightness of the code reader meets the brightness required by the AF system automatic adjustment, and the picture definition reaches the preset definition. At the same time, the maximum algorithm parameter configuration of the code reader is enabled, that is, all code types are opened, the algorithm timeout control is cancelled, and the code polarity, version and other parameters are all set to the maximum. At the same time, the light compensation lamp parameter of the code reader is set to the maximum parameter configuration, that is, the light compensation lamp constant light time control and other adjustments are adjusted to the maximum, to ensure that the light compensation lamp brightness is the highest.

[0081] S12: Control the code reader according to the preset light parameter, and control the code reader to perform image acquisition under different imaging parameters, to perform imaging parameter optimization according to the image quality score of the acquired image, and obtain the target imaging parameter under the light parameter.

[0082] After completing the parameter initialization adjustment of the code reader, the code reader control device obtains a set of preset light parameters, and then controls the code reader according to the preset light parameters, and controls the code reader to perform image acquisition under different imaging parameters, to perform imaging parameter optimization according to the image quality score of the acquired image, and obtain the target imaging parameter under the light parameter.

[0083] For example, when controlling the code reader according to the preset light parameter, a plurality of different imaging parameters can be set, each of which can include exposure time or gain; when controlling the code reader for the same light parameter, the code reader is controlled according to one set of imaging parameters and image acquisition is performed under the set of imaging parameters; then, the next set of imaging parameters is changed until all imaging parameters are traversed, and the acquisition images under different imaging parameters under the preset light parameter are obtained.

[0084] After obtaining the acquisition image, the image quality of the acquisition image is evaluated to obtain the image quality score of the acquisition image; then, according to the image quality scores of the acquisition images under different imaging parameters under the preset light parameter, the imaging parameters of the code reader are optimized, that is, the acquisition image with the maximum image quality score is found out, and the imaging parameter corresponding to the acquisition image with the maximum image quality score is taken as the target imaging parameter under the preset light parameter.

[0085] S13: Update the light parameter of the code reader, and control the code reader to perform image acquisition and parameter optimization under different imaging parameters, to obtain the target imaging parameter under different light parameters, and take the acquisition image corresponding to each target imaging parameter as the calibration acquisition image.

[0086] The preset light parameter is used to represent the on-off state of different lights in the light compensation lamp group of the code reader.

[0087] After obtaining the target imaging parameters under a set of light parameters, the code reader control device updates the light parameters of the code reader, i.e., changes the on-off state of at least one light in the light group of the light compensation lamp of the code reader; after updating the light parameters of the code reader, the code reader control device can control the code reader to perform image acquisition and parameter optimization under different imaging parameters to obtain target imaging parameters under different light parameters. The image acquisition and target imaging parameter processes are described above and will not be repeated here.

[0088] After determining the target imaging parameters under different light parameters, the acquisition images corresponding to the target imaging parameters are taken as calibration acquisition images. That is, after obtaining the target exposure time and gain combination under different light parameters, the acquisition image corresponding to the target exposure time and gain combination is taken as the calibration acquisition image.

[0089] Specifically, the light parameters of the code reader can be a pre-calibrated light control path of the light compensation lamp group. Wherein, controlling the code reader according to the preset light parameters can include: obtaining a plurality of pre-calibrated light control paths, and selecting a set of light control paths from the plurality of light control paths, and controlling the light compensation lamp group of the code reader to operate. Correspondingly, updating the light parameters of the code reader can include: after obtaining the target imaging parameters under a set of light parameters, i.e., obtaining the target imaging parameters under a set of light control paths, obtaining the next set of light control paths and controlling the light compensation lamp group of the code reader according to the next set of light control paths, i.e., updating the light parameters of the code reader. After updating the light parameters of the code reader each time, a set of light control paths is updated and the light compensation lamp group of the code reader is controlled until all pre-calibrated light control paths are traversed.

[0090] For example, the light compensation lamp group of the code reader includes 14 groups of lights. In one light control path, the on-off state of a certain group or several groups of lights can be set to the open state (such as only turning on the upper half of the lights, or only turning on the lower half of the lights, or only turning on the lights at the four corners), and the constant time of the open light group is set, and the remaining light groups are in the off state. Wherein, the open light group is different in different light control paths. The pre-calibrated multiple light control paths are used to control the light parameters of the code reader, which is simple and easy to operate.

[0091] In other embodiments, the light parameter of the code reader can also refer to the on-off state of any one of the light group of the supplementary light. Wherein, controlling the code reader according to the preset light parameter can include: controlling all the lights of the light group of the supplementary light of the code reader to be turned on, and controlling the code reader to perform image acquisition at this time to obtain the acquisition image when all the lights of the supplementary light are turned on (i.e. the calibration acquisition image); controlling any one of the light group of the supplementary light of the code reader to be turned off, and controlling the code reader to perform image acquisition at this time to obtain the acquisition image when the light is turned off (i.e. the contrast acquisition image); comparing the image quality scores of the calibration acquisition image and the contrast acquisition image, taking the light state of the light corresponding to the image with the highest image quality score as the target control state of the light (i.e. the preset light), and outputting the target control state of the light and the control state (such as the on state) of the other lights as the preset light parameter for code reader control.

[0092] Correspondingly, updating the light parameter of the code reader can be: controlling the preset light according to the target control state of the preset light determined according to the on-off state of the preset light regulated by the last light parameter, controlling another light in the light group of the supplementary light of the code reader to be turned off, and repeating the above steps to obtain the target control state of the light, and controlling the light according to the target control state when updating the light parameter next time, until the target control states of all the lights in the light group of the supplementary light and the acquisition images corresponding to each light parameter are obtained. By traversing the on and off states of each light, and taking the best control state of the light according to the selection of the on and off states as the light parameter, the fineness of light control is further improved, and the image decoding effect is improved.

[0093] S14: Taking the calibration acquisition image with the highest image quality score in the plurality of calibration acquisition images as the target acquisition image, and outputting the light parameter and the target imaging parameter corresponding to the target acquisition image as the target parameter data.

[0094] The code reader control device can take the calibration acquisition image with the highest image quality score in the plurality of calibration acquisition images as the target acquisition image, and output the light parameter and the target imaging parameter corresponding to the target acquisition image as the target parameter data.

[0095] In an embodiment, the algorithm parameter, the light parameter and the target imaging parameter corresponding to the target acquisition image can also be output as the target parameter data, that is, the algorithm parameter (including the polarity, type and version of the code, and the code distortion correction switch, maximum recognition time and other parameters), the light parameter and the target imaging parameter of the code reader when collecting the target acquisition image are output as the target parameter data, improving the diversity and accuracy of the target parameter data, so that when the code reader works according to the target parameter data, it can adapt to different environments, and can also automatically adapt to the corresponding code type, version and polarity, achieving the best decoding performance.

[0096] In one aspect, the reading device is parameterized to make the picture definition meet the requirements, and the light brightness and algorithm parameters reach the maximum parameter configuration. After the parameter initialization of the reading device, the picture definition meets the requirements, and the light and algorithm parameters are set to the maximum configuration, so as to ensure that the optimization starting point of the reading device has the maximum recognition capability range. In another aspect, a plurality of images are collected under different combinations of light parameters and imaging parameters, and the images are optimized and selected layer by layer based on the image quality score, so as to finally determine an optimal imaging and lighting parameter. The step-by-step optimization idea of fixed light parameter, optimized imaging, updated light parameter, and optimized imaging again can orderly strip and cope with the coupling effect of different parameters on the image quality, improve the optimization efficiency and effect stability, and enable the reading device to perceive the image scene and automatically match the optimal imaging condition, thereby improving the image definition, brightness balance, and code recognition rate, and enhancing the self-adaptability of the system to complex environments.

[0097] In one embodiment, the imaging parameters of the reading device include an exposure time and a gain value. As shown in FIG. 13, in step S13, the reading device is controlled to collect images under different imaging parameters, so as to optimize the imaging parameters according to the image quality score of the collected images, and obtain the target imaging parameters under the current light parameters. The step includes the following steps. Figure 4

[0098] S131: The reading device is controlled based on the preset gain value, and the reading device is controlled to collect images under different exposure times, so as to optimize the exposure parameters according to the image quality score of the collected images, and obtain the target exposure time corresponding to the preset gain value.

[0099] In this embodiment, the imaging parameters of the reading device include an exposure time and a gain value.

[0100] After the reading device is controlled according to the preset light parameters, the reading device control apparatus obtains a plurality of preset gain values. The plurality of gain values can be all gain values in a gain interval that does not introduce image noise, or the plurality of gain values can be obtained by sampling the gain interval. The reading device control apparatus can control the reading device based on one gain value in the plurality of gain values, and then control the reading device to collect images under different exposure times, so as to optimize the exposure parameters according to the image quality score of the collected images, and obtain the target exposure time corresponding to the preset gain value.

[0101] ​For example, after the reader is controlled according to the preset light parameter and gain value, a plurality of exposure times can be set, the reader control device controls the reader according to each exposure time in turn and performs image acquisition to obtain an acquisition image under the exposure time; then, the next set of exposure times is changed until all exposure times are traversed to obtain acquisition images under different exposure times under the light parameter and gain value. Then, according to the image quality scores of the acquisition images under different exposure times, the acquisition image with the maximum image quality score is determined from the acquisition images under different exposure times, and the exposure time corresponding to the acquisition image with the maximum image quality score is taken as the target exposure time under the light parameter and gain value.

[0102] The plurality of exposure times can be all exposure times in a preset exposure time range, or can be a plurality of exposure times obtained by exposure time sampling on the exposure time range. The exposure time range is an exposure time interval that is pre-calibrated and does not introduce image noise, or can be an exposure time interval obtained by interval modification of the exposure time interval that is pre-calibrated and does not introduce image noise.

[0103] S132: updating the gain value of the reader, and performing exposure time prediction based on the updated gain value by using the gain-exposure mapping relationship model to obtain target exposure times corresponding to different gain values.

[0104] After obtaining the target exposure time corresponding to the first set of gain values (i.e., the preset gain value), the reader control device can determine the mapping relationship between the preset gain value and the corresponding target exposure time to construct the gain-exposure mapping relationship model. That is, the gain-exposure mapping relationship model is constructed according to the mapping relationship between the preset gain value and the corresponding target exposure time.

[0105] Since the gain and the corresponding optimal exposure time are different under different light parameters, and the optimal exposure time corresponding to different gains is also different under the same light parameter, for example, the optimal exposure time of 1 times gain value is 2000us and the optimal exposure time of 2 times gain is 1000us when all the fill light lamps are turned on. Therefore, when constructing the gain-exposure mapping relationship model, the mapping relationship between the light parameter, the gain value and the target exposure time is constructed according to the preset light parameter, the preset gain value and the corresponding target exposure time, and the influence of the light parameter and the gain value on the target exposure time, so as to obtain the gain-exposure mapping relationship model. That is, the compensation value of the picture brightness on the exposure time corresponding to the preset light parameter can be determined, and then the mapping relationship between the gain value and the target exposure time is compensated according to the compensation value to obtain the gain-exposure mapping relationship model. This scheme can improve the accuracy of the model to improve the accuracy of the target exposure time.

[0106] The reader control device can update the gain value of the reader, use the gain-exposure mapping relationship model, and perform exposure time prediction based on the updated gain value (and the current light parameter) to obtain target exposure times corresponding to different gain values.

[0107] For example, the updated gain value can be input into the gain-exposure mapping relationship model to perform exposure time presetting, and the exposure time corresponding to the updated gain value is obtained as the target exposure time of the gain value. Thus, the target exposure times corresponding to other gain values can be obtained, which is simple and convenient, and does not need to traverse all exposure times to perform exposure time optimization according to the image quality score of the collected image. On the basis of ensuring the accuracy of the parameters, the data processing can be reduced, and the speed of parameter optimization can be improved.

[0108] After the target exposure times corresponding to different gain values are determined, the reader is controlled according to each gain value and the target exposure time corresponding thereto, and image collection is performed to obtain collected images corresponding to different target exposure times, and determine the image quality scores of the collected images corresponding to the target exposure times.

[0109] S133: The collected image corresponding to the target exposure time is taken as the first collected image, and the gain value and the target exposure time corresponding to the first collected image with the largest image quality score are taken as the target imaging parameters under the current light parameter.

[0110] After the collected images corresponding to different target exposure times and the corresponding image quality scores are obtained, the reader control device takes the collected image corresponding to the target exposure time as the first collected image, and takes the gain value and the target exposure time corresponding to the first collected image with the largest image quality score among the plurality of first collected images as the target imaging parameters under the current light parameter.

[0111] In this embodiment, the code reader is controlled based on the preset gain value, and the code reader is controlled to collect images with different exposure times, so as to perform exposure parameter optimization according to the image quality scores of the collected images, to obtain a target exposure time corresponding to the preset gain value; the gain value of the code reader is updated, and an exposure-gain mapping relationship model is used to predict the exposure time based on the updated gain value, to obtain a target exposure time corresponding to each gain value, which is obtained according to the mapping relationship between the preset gain value and the corresponding target exposure time; the collected image corresponding to the target exposure time is taken as a first collected image, and the gain value and the target exposure time corresponding to the first collected image with the largest image quality score are taken as the target imaging parameters under the current light parameter. By constructing and using the mapping relationship model between the gain and the exposure time, the optimal exposure time is quickly predicted under different gain configurations, the complexity of high-dimensional parameter iterative optimization is reduced, efficient prediction and optimization of the imaging parameters are realized, the efficiency bottleneck caused by full parameter traversal is avoided, the parameter optimization speed is improved under the premise of ensuring the image quality, and the adaptability, recognition stability and imaging consistency of the code reader in a multi-illumination scene are improved.

[0112] In an embodiment, in step S132, the gain value of the code reader is updated, and an exposure-gain mapping relationship model is used to predict the exposure time based on the updated gain value, to obtain a target exposure time corresponding to each gain value, which specifically includes the following steps:

[0113] S1321: The gain value of the code reader is updated, and an exposure-gain mapping relationship model is used to predict the exposure time based on the updated gain value, to obtain a predicted exposure time.

[0114] Since the exposure-gain mapping relationship model is used to directly predict the exposure time, there may be a certain error between the predicted exposure time output by the model and the optimal exposure time corresponding to the gain value under the light parameter. Therefore, exposure time interval optimization can be performed based on the predicted exposure time output by the model, that is, the accuracy of the target exposure time can be improved, and the optimization speed of the target exposure time can also be improved.

[0115] Specifically, the code reader control device can update the gain value of the code reader under the light parameter, and input the current light parameter and the gain value into the exposure-gain mapping relationship model after updating the gain value of the code reader, to predict the exposure time by the exposure-gain mapping relationship model, to obtain a predicted exposure time.

[0116] S1322: According to the size of the calibration interval, an exposure time interval centered on the predicted exposure time is determined.

[0117] After obtaining the predicted exposure time, the code reader control device can determine an exposure time interval centered on the predicted exposure time according to the calibration interval size. For example, the calibration interval size can be 300us, and the predicted exposure time can be 1000us. Then, the exposure time interval centered on 1000us, i.e., [900us, 1100us], can be used as the target exposure time interval.

[0118] In step S1323, the code reader is controlled to perform image acquisition at different exposure times within the exposure time interval, so as to perform exposure parameter optimization according to the image quality scores of the acquired images, and obtain the target exposure time under the updated gain value.

[0119] After determining the exposure time interval centered on the predicted exposure time, the code reader control device can use all exposure times in the exposure time interval as sampling exposure times to obtain a plurality of sampling exposure times. Then, the code reader is controlled according to each sampling exposure time, and the code reader is controlled to perform image acquisition to obtain acquired images corresponding to different sampling exposure times. Further, exposure parameter optimization is performed according to the image quality scores of the acquired images corresponding to different sampling exposure times, so as to use the sampling exposure time corresponding to the acquired image with the highest image quality score as the target exposure time under the current light parameter and the current gain (updated gain value).

[0120] In this embodiment, the gain value of the code reader is updated, the exposure time of the updated gain value is predicted by using the gain-exposure mapping relationship model, the exposure time interval centered on the predicted exposure time is determined according to the calibration interval size, the code reader is controlled to perform image acquisition at different exposure times within the exposure time interval, and exposure parameter optimization is performed according to the image quality scores of the acquired images, so as to obtain the target exposure time under the updated gain value. By introducing the interval optimization mechanism on the basis of the predicted exposure time, the accuracy is further improved while the speed of exposure parameter optimization is ensured, so that the code reader can obtain the exposure time with the optimal imaging quality under different gain values, thereby improving the image clarity, brightness balance, and recognition success rate, and realizing the unity of efficiency and accuracy of code reader parameter optimization.

[0121] In an embodiment, in step S1323, the code reader is controlled to perform image acquisition at different exposure times within the exposure time interval, so as to perform exposure parameter optimization according to the image quality scores of the acquired images, and obtain the target exposure time under the updated gain value. Specifically, the following steps are included.

[0122] In step S13231, exposure time sampling is performed on the exposure time interval, the code reader is controlled to perform image acquisition at the sampling exposure time, and interval optimization is performed on the exposure time interval according to the image quality scores of the acquired images under the sampling exposure time, so as to obtain the optimized exposure time interval.

[0123] After determining the exposure time interval centered on the predicted exposure time, the code reader control device can perform an interval optimization process on the exposure time interval to obtain an optimized exposure time interval. Specifically, the exposure time interval can be sampled to obtain an initial sampling exposure time, and the code reader can be controlled to perform image acquisition at the initial sampling exposure time to obtain an acquisition image and an image quality score thereof at the initial sampling exposure time.

[0124] S13232: The exposure time interval is sampled and interval optimized until the interval size of the optimized exposure time interval is smaller than the preset threshold, and the optimized exposure time interval with the interval size smaller than the preset threshold is determined as the target exposure time interval.

[0125] The code reader control device can use a preset interval optimization search method to perform interval optimization on the exposure time interval based on the image quality score of the acquisition image at the initial sampling exposure time, and sample the optimized exposure time interval to obtain a corresponding sampling exposure time, and control the code reader to perform image acquisition at the sampling exposure time to obtain an acquisition image and an image quality score thereof at the sampling exposure time, so as to continue to perform interval optimization on the optimized exposure time interval based on the image quality score of the acquisition image. The interval optimization process is repeated iteratively until the interval size of the last optimized exposure time interval is smaller than the preset threshold, the interval optimization process is stopped, and the optimized exposure time interval with the interval size smaller than the preset threshold is determined as the target exposure time interval.

[0126] The preset interval optimal search method can be a golden section method combined with image scores. First, two endpoints (i.e., a maximum value and a minimum value) of the exposure time interval can be used as initial sampling exposure times, and the code reader is controlled to perform image acquisition under the two initial sampling exposure times, to acquire acquired images under the initial sampling exposure times and corresponding image quality scores. Then, the golden section method can be used to sample the exposure time interval according to the image quality scores of the acquired images under the initial sampling exposure times, that is, a golden section point in the exposure time interval is determined, and the code reader is controlled to perform image acquisition according to the sampling exposure time corresponding to the golden section point, to acquire an acquired image under the sampling exposure time corresponding to the golden section point and a corresponding image quality score of the acquired image. According to the image quality score of the acquired image corresponding to the golden section point, the exposure time interval is optimized (i.e., the interval is reduced), to obtain an optimized exposure time interval. The interval optimization process is repeated in the optimized exposure time interval, that is, the code reader is controlled to perform image acquisition according to the two endpoints of the exposure time interval, and the golden section method is used to sample the optimized exposure time interval according to the image quality scores of the acquired images. The processes of exposure time sampling, image acquisition, and interval optimization are repeated and iterated until the size of the last optimized exposure time interval is less than a preset threshold, to obtain a target exposure time interval. Finally, an exposure time at which the center of the target exposure time interval is located is determined as a target exposure time.

[0127] In this embodiment, the golden section method is used to perform exposure time interval optimization, which can quickly complete iteration in a single parameter dimension (such as exposure time), and can accelerate the exposure time optimization process while ensuring optimization accuracy.

[0128] S13233: An exposure time at which the center of the target exposure time interval is located is determined as a target exposure time under the updated gain value.

[0129] An exposure time at which the center of the target exposure time interval is located is determined as a target exposure time under a current light parameter and a current gain value (i.e., an updated gain value). In other embodiments, an exposure time at which a golden section point of the target exposure time interval is located can also be determined as a target exposure time under the current light parameter and the current gain value.

[0130] In the embodiment, the exposure time is effectively optimized under the current gain value by exposure time sampling and image acquisition within the exposure time interval and exposure time interval optimization based on the image quality score of the acquired image, thereby realizing high-precision optimization of the imaging parameters of the code reader, improving the image definition and brightness balance, enhancing the adaptability and recognition stability of the system to complex imaging environments, and improving the imaging definition and recognition stability of the code reader, which has good scene adaptability, decoding efficiency and engineering realizability.

[0131] In an embodiment, as shown in FIG. 10, in step S10, the code reader is controlled to perform image acquisition under different light parameters and imaging parameters to optimize the parameters of the code reader according to the target image quality score, which includes the following steps: Figure 5

[0132] S01: In the process of controlling the code reader to perform image acquisition, the code reader is controlled to correspondingly acquire at least two acquisition images under the same parameter to obtain the image quality scores of the two acquisition images.

[0133] In the process of controlling the code reader to perform image acquisition, as in steps S10 and S13231 above, the code reader is controlled to correspondingly acquire at least two acquisition images under the same parameter (such as the same exposure data), and the image quality of the two acquisition images is evaluated to obtain the image quality scores of the two acquisition images under the same parameter.

[0134] S02: Determine whether the score difference of the image quality scores of the two acquisition images under the same parameter is less than a preset difference value.

[0135] After determining the image quality scores of the two acquisition images under the same parameter, it is determined whether the score difference (i.e., the score error) of the image quality scores of the two acquisition images is greater than a preset difference value, so as to determine whether the image acquisition under the parameter needs to be retriggered according to the comparison between the score difference and the preset difference value, to ensure the quality of the acquisition images.

[0136] The preset difference value can be a pre-calibrated fixed threshold. In other embodiments, the preset difference value can also be a dynamic threshold determined according to the image quality scores of the two acquisition images, to improve the accuracy of the preset difference value and reduce unnecessary image acquisition operations. For example, a preset proportion (such as 10%) of the average value of the image quality scores of the two acquisition images can be determined as the preset difference value, and a certain proportion of the average value of the two acquisition images is used as the preset difference value, so that the preset difference value can dynamically change according to the actual image acquisition quality of the current scene, improving the accuracy of the preset difference value, reducing unnecessary image acquisition operations, and improving the speed of parameter optimization.

[0137] ​S03: When the score difference of the image quality scores of the two captured images is less than the preset difference, taking the average value of the image quality scores of the two captured images as the target image quality score corresponding to the same parameter, so as to perform parameter optimization on the code reader according to the target image quality score.

[0138] When it is determined that the score difference of the image quality scores of the two captured images is less than the preset difference, that is, the image quality error of the two captured images is small, and the image capturing effect of the code reader is consistent, the image capturing under the same parameter does not need to be performed again at this time, and the code reader control device can directly take the average value of the image quality scores of the two captured images as the target image quality score corresponding to the same parameter, that is, as the representative of the image quality score of the captured image under the parameter, and the code reader can be subsequently parameter-optimized according to the target image quality score to obtain a corresponding target parameter (such as a target exposure time), so as to obtain the target parameter data of the code reader.

[0139] S04: When the score difference of the image quality scores of the two captured images is greater than or equal to the preset difference, the code reader is controlled to continue image capturing under the same parameter to obtain multiple captured images under the same parameter.

[0140] When it is determined that the score difference of the image quality scores of the two captured images is greater than or equal to the preset difference, that is, the image quality error of the two captured images is large, and the image capturing effect of the code reader is unstable, the code reader control device can control the code reader to continue image capturing under the same parameter, that is, image capturing under the corresponding parameter (such as an exposure time), to obtain multiple captured images (including at least three captured images) under the same parameter. Then, according to the image quality scores of the multiple captured images under the same parameter, a preset score error corresponding to the multiple captured images is determined, and it is determined whether the preset score error is less than the preset difference. The preset score error is the maximum value of the absolute values of the score differences of any two image quality scores in the remaining multiple image quality scores after removing the maximum value and the minimum value of the image quality scores of the multiple captured images under the same parameter. That is, the maximum value and the minimum value (that is, the extreme values) of the image quality scores of the multiple captured images under the same parameter can be removed, and then the score difference of any two image quality scores in the remaining multiple image quality scores (the score difference is the absolute value of the image quality score difference) is determined to obtain multiple score differences, and the maximum value of the multiple score differences is determined as the preset score error corresponding to the multiple captured images under the same parameter. By removing the extreme values of the image quality scores of the multiple captured images under the same parameter and then determining the preset score error corresponding thereto, and then performing error judgment, the judgment accuracy can be improved.

[0141] S05: When the preset score error corresponding to the plurality of collected images under the same parameter is less than the preset difference value, or the image collection times under the same parameter reaches the preset number of times, the average value of the image quality scores of the plurality of collected images is taken as the target image quality score corresponding to the same parameter, so as to optimize the parameters of the code reader according to the target image quality score.

[0142] When the preset score error corresponding to the plurality of collected images under the same parameter is less than the preset difference value, that is, the image quality error of the two collected images is small, and the image collection effect of the code reader is consistent, the code reader control device can directly take the average value of the image quality scores of the plurality of collected images (which can be the plurality of collected images after removing the collected images corresponding to the maximum and minimum image quality scores) under the same parameter as the target image quality score corresponding to the same parameter, so as to optimize the parameters of the code reader according to the target image quality score, so as to obtain the corresponding target parameter (such as the target exposure time), thereby obtaining the target parameter data of the code reader.

[0143] In addition, after the code reader continues to collect images under the same parameter, when the score difference of the image quality scores of any two collected images under the parameter is greater than or equal to the preset difference value, the image collection and the judgment of the score difference of the image quality scores continue; when the image collection times under the same parameter reaches the preset number of times (such as 5 times), the score difference of the image quality scores of any two collected images under the same parameter is still greater than or equal to the preset difference value, at this time, the image collection under the parameter is stopped, and the average value of the image quality scores of the plurality of collected images under the same parameter is directly taken as the target image quality score corresponding to the same parameter, so as to optimize the parameters of the code reader according to the target image quality score, so as to obtain the corresponding target parameter (such as the target exposure time), thereby obtaining the target parameter data of the code reader.

[0144] In other embodiments, it can also be determined whether the score difference of the image quality scores of any two collected images in the plurality of collected images under the same parameter is less than the preset difference value; when the score difference of the image quality scores of any two collected images is less than the preset difference value, or the image collection times under the same parameter reaches the preset number of times, the average value of the image quality scores of the two collected images is taken as the target image quality score corresponding to the same parameter, so as to optimize the parameters of the code reader according to the target image quality score, and obtain the target parameter data of the code reader.

[0145] In the embodiment, in the process of image acquisition under different light parameters and imaging parameters, the code reader is controlled to correspondingly acquire at least two acquisition images under the same parameter to obtain image quality scores of the two acquisition images; when a score difference of the image quality scores of the two acquisition images is less than a preset difference value, an average value of the image quality scores of the two acquisition images is taken as a target image quality score corresponding to the same parameter, so as to perform parameter optimization on the code reader according to the target image quality score, and target parameter data of the code reader is obtained. Multiple images are acquired under the same parameter configuration, multiple frames of images are dynamically sampled at each parameter point, and the image quality score error of the acquisition images is compared, so that a stability judgment mechanism of the image quality evaluation result is introduced, the stability and accuracy of the image quality score are improved, and then the average value of the image quality score is taken as the basis for parameter optimization when the image quality score is stable, the score deviation caused by accidental interference is avoided, and the accuracy, reliability and anti-interference ability of the parameter optimization result of the code reader are enhanced.

[0146] In an embodiment, as shown in FIG. 13, Figure 6 The image quality score of the acquisition image is determined in the following manner in step S10, step S12, step S14 or step S13232.

[0147] S101: Code information recognition and positioning are performed on the acquisition image to determine a recognized code region in the acquisition image.

[0148] After obtaining the acquisition image, the code reader control device can perform code information recognition and positioning on the acquisition image to determine a recognized code region in the acquisition image. For example, an artificial intelligence model can be used to position the code to be recognized in the acquisition image to determine the recognized code region in the acquisition image.

[0149] S102: Image quality scoring is performed on the recognized code region in the acquisition image to obtain multiple quality parameter scores.

[0150] After determining the recognized code region in the acquisition image, the code reader control device performs image quality scoring on the recognized code region in the acquisition image to obtain multiple quality parameter scores of the recognized code region. The multiple quality parameter scores include at least two of a contrast score, an edge sharpness score, an exposure score and a brightness score. The exposure score represents the exposure condition of the pixels in the recognized code region.

[0151] Specifically, the determination process of the exposure score of the identification code region comprises: determining the pixel quantity of the first pixel and the pixel quantity of the second pixel in the identification code region; wherein the first pixel refers to the pixel that is too dark in the identification code region, such as the first pixel being the pixel with a pixel value of 0 or a pixel value less than 2; the first pixel refers to the pixel that is too bright in the identification code region, and the second pixel is the pixel with a pixel value of 255 or a pixel value greater than 254. Then, according to the ratio of the absolute value of the difference between the pixel quantity of the first pixel and the pixel quantity of the second pixel in the identification code region and the total pixel quantity of the identification code region, the exposure score of the identification code region is determined. By calculating the difference between the number of dark and bright pixels in the identification code region and the ratio with the total pixel number of the region, the exposure score index is formed, which can efficiently determine whether the image has the problems of uneven exposure, overexposure or underexposure, and can quickly and accurately evaluate the exposure quality of the region, thereby improving the accuracy of image quality evaluation and providing a reliable basis for identification stability and parameter optimization.

[0152] wherein the exposure score of the identification code region can be represented by the following formula:

[0153]

[0154] wherein s1 represents the exposure score of the identification code region; d n represents the pixel quantity of the first pixel in the identification code region; b n represents the pixel quantity of the first pixel in the identification code region; n represents the total pixel quantity of the identification code region.

[0155] Specifically, the determination process of the brightness score of the identification code region comprises: taking the average brightness of all pixels in the identification code region as the overall brightness of the identification code region, and determining the overall brightness score of the identification code region according to the overall brightness; dividing the identification code region into a plurality of sub-regions, respectively determining the average brightness of each sub-region, and the average brightness of the sub-region being the average brightness of all pixels in the sub-region; determining the maximum average brightness and the minimum average brightness in the average brightness of each sub-region, and determining the brightness uniformity score of the identification code region according to the ratio of the minimum average brightness and the maximum average brightness; and weighting and summing the brightness uniformity score and the overall brightness score of the identification code region to obtain the brightness score of the identification code region. By combining the overall brightness level and the brightness distribution uniformity of the identification code region, a multi-dimensional brightness score mechanism is constructed, which can accurately reflect the influence of brightness on code recognition quality and improve the judgment and robustness of the image scoring system, thereby providing reliable support for imaging parameter optimization and recognition success rate.

[0156] wherein the overall brightness of the identification code region can be represented by the following formula:

[0157]

[0158] wherein s 2a represents the overall brightness score of the identification code region; L represents the overall brightness of the identification code region, i.e. the average brightness of all pixels in the identification code region.

[0159] wherein the brightness uniformity of the identification code region can be represented by the following formula:

[0160]

[0161] wherein s 2b represents the brightness uniformity score of the identification code region; b min represents the minimum average brightness among the average brightness of each sub-region in the identification code region; b max represents the maximum average brightness among the average brightness of each sub-region in the identification code region.

[0162] wherein the brightness score of the identification code region can be represented by the following formula:

[0163] s2=w 2a *s 2a +w 2b *s 2b ;

[0164] wherein s2represents the brightness score of the identification code region; s 2a represents the overall brightness score of the identification code region; s 2b represents the brightness uniformity score of the identification code region; w 2a represents the weight of the overall brightness score; w 2b represents the weight of the brightness uniformity score. In some embodiments, the weights of the overall brightness score and the brightness uniformity score can be the same, both being 0.5; in other embodiments, the weights of the overall brightness score and the brightness uniformity score can be different, and can be calibrated according to actual needs.

[0165] Specifically, the determination process of the contrast score of the identification code region comprises: determining the brightness standard deviation of all pixels in the identification code region, and determining the average brightness of the pixels in the identification code region; taking the product of the ratio of the brightness standard deviation of all pixels in the identification code region to the average brightness and a preset coefficient as the contrast score of the identification code region. By calculating the ratio of the brightness standard deviation to the average brightness of the identification code region as the contrast score, the degree of gray scale change of the image can be effectively measured, the accuracy and efficiency of the image contrast judgment can be improved, and a stable and reliable basis can be provided for the image quality evaluation and parameter optimization of the code reader.

[0166] wherein the contrast score of the identification code region can be represented by the following formula:

[0167]

[0168] wherein s3 represents the contrast score of the identification code region; σ represents the standard deviation of brightness of all pixels in the identification code region; μ represents the average value of brightness of all pixels in the identification code region; a represents a preset coefficient calibrated in advance, which can be 78.125 according to the measured data.

[0169] It should be understood that a large standard deviation of brightness of pixels indicates that the image gray scale changes strongly, and the image contrast is high, and a small standard deviation of brightness of pixels indicates that the image gray scale changes weakly, and the image contrast is low. In the present scheme, the contrast score is determined according to the ratio of the standard deviation of brightness to the average brightness in the identification code region, the brightness level is obtained by normalizing the ratio of the standard deviation of brightness to the average brightness, the influence of brightness offset is eliminated, the strong and weak degrees of image gray scale change can be objectively reflected, the fast, stable and quantifiable evaluation of image contrast is realized, and thus the accuracy of the image quality evaluation system and the identification success rate of the code reading system are improved.

[0170] Specifically, the determination process of the edge sharpness score of the identification code region comprises: performing convolution calculation on the identification code region by using a Laplace operator to obtain the second-order gradient of the identification code region, that is, the second-order derivative of the identification code region after the image gray scale change; wherein the Laplace operator used in the present embodiment can be a 4-neighborhood convolution kernel template without diagonal direction, as shown in FIG. 4. Figure 7 The standard deviation of the second-order gradient of the identification code region is calculated to obtain the standard deviation of the second-order gradient of the identification code region; and the standard deviation of the second-order gradient of the identification code region is numerically normalized to scale it to a preset score interval, such as to the interval (0, 100), to obtain the edge sharpness score of the identification code region.

[0171] For an image with clear edges, the second-order gradient result will present a two-level differentiation situation, the gradient is high at the edge, and the gradient is close to zero in other regions, and at this time the standard deviation will be large. The second-order gradient of the edge fuzzy image is generally small, and the calculation result of the standard deviation is also small. In the present scheme, the edge information is extracted by applying the Laplace operator to the identification code region, and the standard deviation of the second-order gradient is used to measure the sharpness intensity, and finally the score is normalized for evaluating the image edge sharpness, so as to realize efficient and stable image sharpness determination, and the image edge sharpness can be accurately evaluated through the edge sharpness score, so as to improve the accuracy and consistency of the identification code image quality evaluation, and provide reliable support for decoding performance optimization.

[0172] S103: The plurality of quality parameter scores are weighted and summed to obtain the image quality score of the captured image.

[0173] After the plurality of quality parameter scores of the code region in the captured image are determined, weights of the quality parameter scores are obtained, and the plurality of quality parameter scores are weighted and summed to obtain an image quality score of the captured image.

[0174] Taking the plurality of quality parameter scores including the contrast score, the edge sharpness score, the exposure score, and the brightness score of the code region as an example, the image quality score of the captured image can be represented by the following formula:

[0175] S = w1*s1 + w2*s2 + w3*s3 + w4*s4;

[0176] wherein s1 represents the exposure score of the code region; s2 represents the brightness score of the code region; s3 represents the contrast score of the code region; s4 represents the edge sharpness score of the code region; w1, w2, w3, and w4 are weights of the exposure score, the brightness score, the contrast score, and the edge sharpness score, respectively, and each weight is a fixed value calibrated according to actual measurement data.

[0177] In this embodiment, the code information in the captured image is recognized and positioned to determine the code region in the captured image, the code region in the captured image is scored for image quality to obtain a plurality of quality parameter scores, the plurality of quality parameter scores include at least two of the contrast score, the edge sharpness score, the exposure score, and the brightness score, the plurality of quality parameter scores are weighted and summed to obtain an image quality score of the captured image. On the one hand, the quality of the code region in the captured image is analyzed to avoid the interference of non-target regions in the whole image scoring on the evaluation, focus on the image quality of the target region, so that the image quality score is closer to the key influencing factors of the actual recognition effect, and the pertinence and reliability of the scoring result are improved. On the other hand, the image quality of the code region is scored by multiple parameters and fused by weighting, so that the image quality score can more accurately reflect the imaging quality of the recognition region, thereby effectively guiding the optimization of image acquisition parameters and the adjustment of recognition strategies, and improving the decoding accuracy, robustness, and environmental adaptability of the system as a whole.

[0178] In an embodiment, as shown in FIG. 1, after step S101, i.e., after the code information in the captured image is recognized and positioned, the method further includes the following steps: Figure 8

[0179] S104: When the code region in the captured image is not recognized and positioned, the captured image is sampled for a calibration region and a random region to obtain a plurality of sampling regions in the captured image.

[0180] ​After code information recognition and positioning of the captured image, if the recognition code region in the captured image is not recognized and positioned, i.e. in a no-code scene, the read code control device samples the captured image in a calibration region and a random region to obtain a plurality of sampling regions in the captured image.

[0181] That is, when the recognition code region in the captured image is not recognized and positioned, the read code control device determines a good calibration region in the captured image, which can be a preset size region centered on the center position of the captured image, such as a preset size rectangular region centered on the center of the captured image, and the preset size is determined according to the size of a commonly used code. At the same time, the read code control device can sample the captured image in a random region according to the preset size to obtain a plurality of random regions; and then, the calibration region and the plurality of random regions obtained by random sampling are driven as sampling regions to obtain a plurality of sampling regions in the captured image.

[0182] S105: image quality scores of the plurality of sampling regions in the captured image are respectively calculated to obtain a plurality of quality parameter scores of each sampling region, and a weighted sum of the plurality of quality parameter scores of each sampling region is calculated to obtain a first quality score of each sampling region.

[0183] After the plurality of sampling regions in the captured image are sampled, for each sampling region, the read code control device calculates image quality scores of the sampling region, i.e. at least two of contrast score, edge sharpness score, exposure score and brightness score of the sampling region, to obtain a plurality of quality parameter scores of the sampling region; then, a weighted sum of the plurality of quality parameter scores of the sampling region is calculated to obtain a first quality score of the sampling region; and the first quality scores of the plurality of sampling regions are obtained by traversing the plurality of sampling regions.

[0184] The determination process of the contrast score, the edge sharpness score, the exposure score and the brightness score of the sampling region can refer to the determination process of the corresponding score in the recognition code region, which will not be described here.

[0185] S106: an image quality score of the captured image is determined according to the first quality scores of the plurality of sampling regions.

[0186] After the first quality scores of the plurality of sampling regions are obtained, the read code control device can directly determine the average value of the first quality scores of the plurality of sampling regions as the image quality score of the captured image, which is simple and convenient.

[0187] In other embodiments, the weights of the calibration region and the random region in the plurality of sampling regions can also be determined, and a weighted sum of the first quality scores of the plurality of sampling regions is calculated according to the weight of the calibration region and the weight of the random region to obtain the image quality score of the captured image.

[0188] In the embodiment, after the code information recognition and positioning on the collected image, when the recognition code region in the collected image is not recognized and positioned, the collected image is sampled to obtain a plurality of sampling regions in the collected image; the image quality scores of the plurality of sampling regions in the collected image are obtained, a plurality of quality parameter scores of each sampling region are obtained, and the plurality of quality parameter scores of each sampling region are weighted and summed to obtain a first quality score of each sampling region; and the image quality score of the collected image is determined according to the first quality score of each sampling region. In the case where the recognition code region is not recognized, the image quality score of the sampling region is used to estimate the image quality of the collected image as a whole, which can effectively evaluate the image quality when decoding fails or initial recognition is unsuccessful, avoids interruption or misjudgment of the score, realizes the continuity and robustness of the image quality evaluation mechanism in the case where there is no recognition code, and provides effective guarantee for imaging parameter optimization and abnormal processing strategy of the system.

[0189] It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

[0190] In an embodiment, a code reader control device is provided, which corresponds to the code reader control method in the above embodiment. As shown in the figure, the code reader control device includes a parameter optimization module 901, a parameter update module 902 and a control module 903. The functions of each functional module are described in detail as follows: Figure 9

[0191] The parameter optimization module 901 is used to control the code reader to collect images under different light parameters and imaging parameters after the code reader is started, to optimize the parameters of the code reader according to the image quality score of the collected image, and to obtain target parameter data of the code reader, the target parameter data including imaging parameters and light parameters;

[0192] The parameter update module 902 is used to update the parameters of the code reader according to the imaging parameters and light parameters in the target parameter data;

[0193] The control module 903 is used to control the code reader after parameter update to recognize the to-be-recognized code.

[0194] ​​In an embodiment, the parameter optimization module 901 is specifically configured to: perform parameter initialization adjustment on the code reader, so that the picture definition of the code reader meets the requirement, and the light brightness and the algorithm parameter of the code reader reach the maximum parameter configuration; control the code reader according to the preset light parameter, and control the code reader to perform image acquisition under different imaging parameters, so as to perform imaging parameter optimization according to the image quality score of the acquired image, and obtain the target imaging parameter under the light parameter; update the light parameter of the code reader, and control the code reader to perform image acquisition and parameter optimization under different imaging parameters, so as to obtain the target imaging parameter under different light parameters, and take the acquired image corresponding to each target imaging parameter as a calibration acquisition image; take the calibration acquisition image with the maximum image quality score in the multiple calibration acquisition images as a target acquisition image, and output the light parameter and the target imaging parameter corresponding to the target acquisition image as target parameter data.

[0195] In an embodiment, the parameter optimization module 901 is further configured to: perform code information recognition and positioning on the acquired image, so as to determine the code region in the acquired image; perform image quality scoring on the code region in the acquired image, so as to obtain multiple quality parameter scores, the multiple quality parameter scores including at least two of the contrast score, the edge sharpness score, the exposure score and the brightness score; and perform weighted summation on the multiple quality parameter scores, so as to obtain the image quality score of the acquired image.

[0196] In an embodiment, the parameter optimization module 901 is further configured to, after performing code information recognition and positioning on the acquired image, when the code region in the acquired image is not recognized and positioned, perform calibration region and random region sampling on the acquired image, so as to obtain multiple sampling regions in the acquired image; perform image quality scoring on the multiple sampling regions in the acquired image respectively, so as to obtain multiple quality parameter scores of each sampling region, and perform weighted summation on the multiple quality parameter scores of each sampling region respectively, so as to obtain a first quality score of each sampling region; and take the average value of the first quality scores of the multiple sampling regions as the image quality score of the acquired image.

[0197] It should be noted that the information interaction, execution process and the like between the above-described apparatuses / units are based on the same concept as the method embodiments of the present application, and specific functions and brought technical effects can be referred to the method embodiments part, which will not be described here in detail.

[0198] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0199] This application also provides an electronic device, such as... Figure 10 As shown, the electronic device includes: at least one processor 101, a memory 102, and a computer program 103 stored in the memory 102 and executable on the at least one processor 101. When the processor 101 executes the computer program 103, it implements the steps in any of the above-described method embodiments, or when the processor 101 executes the computer program 103, it implements the functions of each module / unit in the above-described device embodiments. For example, the computer program 103 can be divided into one or more modules / units, which are stored in the memory 102 and executed by the processor 101 to complete this application. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 103 in the electronic device. Those skilled in the art will understand that... Figure 9 This is merely an example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than shown, or combine certain components, or different components. For example, an electronic device may also include input / output devices, network access devices, buses, etc.

[0200] The processor can be a central processing unit, and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The memory can be an internal storage unit of the electronic device, such as a hard disk or a memory of the electronic device. The memory can also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. provided on the electronic device. Further, the memory can include both the internal storage unit and the external storage device of the electronic device.

[0201] The embodiments of the present application further provide a readable storage medium storing a computer program, and the computer program is executed by a processor to implement the steps in the above various method embodiments.

[0202] The embodiments of the present application provide a computer program product, and when the computer program product is run on an electronic device, the electronic device is caused to implement the steps in the above various method embodiments.

[0203] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the present application can implement all or part of the processes in the above-mentioned embodiment methods through a computer program to instruct relevant hardware to complete, and the computer program can be stored in a computer readable storage medium. When the computer program is executed by a processor, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms. The computer readable medium at least includes any entity or device capable of carrying the computer program code to the photographing device / terminal equipment, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer readable medium can not be an electrical carrier signal and a telecommunication signal.

[0204] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments. Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present application can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0205] In the embodiments provided in the present application, it should be understood that the disclosed devices / apparatuses and methods can be implemented in other ways. For example, the device / apparatus embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed mutually can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.

[0206] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may also be distributed to multiple network units. Part or all of the units can be selected to achieve the purpose of the embodiment scheme according to actual needs.

[0207] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A method of controlling a code reader, characterized by, The method comprises the following steps: After the code reader is started, the code reader is controlled to collect images under different light parameters and imaging parameters, so that the code reader is optimized in parameters according to the image quality scores of the collected images, and target parameter data of the code reader is obtained, wherein the target parameter data comprises imaging parameters and light parameters; According to the imaging parameters and light parameters in the target parameter data, the parameters of the code reader are updated; The code reader after the parameter update is controlled to recognize the to-be-recognized code.

2. The method of claim 1, wherein, The control of the code reader to collect images under different light parameters and imaging parameters, so as to optimize the parameters of the code reader according to the image quality scores of the collected images, comprises the following steps: The code reader is initialized and adjusted in parameters, so that the picture definition of the code reader meets the requirements, and the light brightness and algorithm parameters of the code reader reach the maximum parameter configuration; The code reader is controlled according to the preset light parameters, and the code reader is controlled to collect images under different imaging parameters, so as to optimize the imaging parameters according to the image quality scores of the collected images, and obtain target imaging parameters under the light parameters; The light parameters of the code reader are updated, and the code reader is controlled to collect images under different imaging parameters and to optimize the parameters, so as to obtain target imaging parameters under different light parameters, and the collected images corresponding to each target imaging parameter are taken as calibration collected images; The calibration collected image with the largest image quality score in the plurality of calibration collected images is taken as a target collected image, and the light parameters and target imaging parameters corresponding to the target collected image are output as the target parameter data.

3. The method of claim 2, wherein the read code is a barcode. The imaging parameters comprise exposure time and gain value, and the control of the code reader to collect images under different imaging parameters, so as to optimize the imaging parameters according to the image quality scores of the collected images, and obtain target imaging parameters under the current light parameters, comprises the following steps: The code reader is controlled based on the preset gain value, and the code reader is controlled to collect images under different exposure times, so as to optimize the exposure parameters according to the image quality scores of the collected images, and obtain target exposure times corresponding to the preset gain value; The gain value of the code reader is updated, and a gain-exposure mapping relationship model is used to predict the exposure time based on the updated gain value, so as to obtain target exposure times corresponding to different gain values, wherein the gain-exposure mapping relationship model is obtained according to the mapping relationship between the preset gain value and the corresponding target exposure time; The collected image corresponding to the target exposure time is taken as a first collected image, and the gain value and the target exposure time corresponding to the first collected image with the largest image quality score are taken as target imaging parameters under the current light parameters.

4. The method of claim 3, wherein the read code is a barcode. The update of the gain value of the code reader and the prediction of the exposure time based on the updated gain value by using the gain-exposure mapping relationship model to obtain target exposure times corresponding to different gain values, comprises the following steps: updating a gain value of the code reader, performing exposure time prediction on the updated gain value by using the gain-exposure mapping relationship model to obtain a predicted exposure time; determining an exposure time interval centered on the predicted exposure time according to a size of the calibration interval; controlling the code reader to perform image acquisition at different exposure times within the exposure time interval to perform exposure parameter optimization according to an image quality score of the acquired image to obtain a target exposure time under the updated gain value.

5. The method of claim 1-4, wherein, The image quality score of the acquired image is determined by: performing code information recognition and positioning on the acquired image to determine a recognized code region in the acquired image; performing image quality scoring on the recognized code region in the acquired image to obtain a plurality of quality parameter scores, the plurality of quality parameter scores including at least two of a contrast score, an edge sharpness score, an exposure score, and a brightness score; performing weighted summation on the plurality of quality parameter scores to obtain the image quality score of the acquired image.

6. The method of controlling a reader according to any one of claims 1 to 4, wherein, The controlling the code reader to perform image acquisition under different light parameters and imaging parameters to perform parameter optimization on the code reader according to the target image quality score includes: controlling the code reader to correspondingly acquire at least two of the acquired images under the same parameter during the process of controlling the code reader to perform image acquisition to obtain image quality scores of the two acquired images; when a score difference between the image quality scores of the two acquired images is less than a preset difference, taking an average value of the image quality scores of the two acquired images as a target image quality score corresponding to the same parameter to perform parameter optimization on the code reader according to the target image quality score.

7. A code reader control device characterized by comprising: includes: a parameter optimization module configured to control the code reader to perform image acquisition under different light parameters and imaging parameters after the code reader is started to perform parameter optimization on the code reader according to an image quality score of an acquired image to obtain target parameter data of the code reader, the target parameter data including imaging parameters and light parameters; a parameter updating module configured to update parameters of the code reader according to the imaging parameters and the light parameters in the target parameter data; a control module configured to control the code reader after parameter updating to recognize a code to be recognized.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the code reader control method according to any one of claims 1 to 6.

9. A readable storage medium, the readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the code reader control method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, The computer program is executed to cause the code reader control method according to any one of claims 1 to 6 to be performed.