Control method and device of scanning equipment

By creating independent worker threads in the scanning device control interface, processing user operations and generating control instructions, the problems of user interface lag and command blocking are solved, and the operation and scanning efficiency is improved, and the user experience is improved.

CN119937880APending Publication Date: 2025-05-06SCANTECH (HANGZHOU) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510428006.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

When the user frequently operates the scanning device, a large number of event commands are triggered in the main thread, causing the scanning device to fail to process, causing the user interface to be stuck and command blocked.

Method used

Create an independent worker thread, obtain the status attributes of each control in the scan control interface through the loop call process, determine the target control in the selected state, and generate control instructions based on its properties to output it to the scanning device.

Benefits of technology

It effectively solves the problems of lag in the scanning control interface and blocking of scanning equipment instructions, improves the operation efficiency of terminal equipment and the scanning efficiency of scanning equipment, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119937880A_ABST
    Figure CN119937880A_ABST
Patent Text Reader

Abstract

The invention discloses a control method and device of scanning equipment, and relates to the technical field of scanning, the method comprises the following steps: creating an independent working thread, enabling the independent working thread to enter a loop calling process, and executing the following steps in each loop: obtaining a state attribute of each control in a scanning control interface, and determining a target control in a selected state based on each state attribute, determining a working parameter of the scanning device according to the attribute of the target control, generating a control instruction based on the working parameter of the scanning device, and outputting the control instruction to the scanning device. According to the method and the device, the problem of jamming of the scanning control interface and the problem of instruction blockage of the scanning equipment can be solved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of scanning technology, and in particular to a control method and device for a scanning device. Background Art

[0002] When a user uses a scanning device to scan a target object, the user usually connects the scanning device to a terminal device installed with scanning software, and sets some parameters in the scanning process or issues control instructions through the scanning software on the terminal device to control the scanning device.

[0003] The user realizes human-computer interaction through the user interface of the scanning software. The user interface contains interface elements such as icons, windows, and controls. Controls can include sliders, buttons, check boxes, etc. Users can set relevant parameters by clicking buttons or dragging sliders. When the user clicks a button or drags a slider, an event command for modifying parameters is triggered in the main thread of the user interface. When the user frequently clicks a button or drags a slider, a large number of event commands will be triggered in the main thread, and even dozens of event commands may be issued per second. Due to the limited processing speed of the peripheral scanning device, if dozens of control commands are issued to the scanning device per second, the scanning device often does not have time to process them, resulting in obvious freezes in the user interface. Summary of the invention

[0004] The purpose of this application is to provide a control method for a scanning device, which can solve the problem of freezing of the scanning control interface and the problem of command blocking of the scanning device, thereby improving the user experience.

[0005] In a first aspect, the present application provides a method for controlling a scanning device, the method comprising: Create an independent working thread and make the independent working thread enter a loop calling process. Perform the following steps in each loop: Obtain the status attributes of each control in the scanning control interface, determine the target control in the selected state based on each status attribute, determine the working parameters of the scanning device according to the attributes of the target control, generate control instructions based on the working parameters of the scanning device, and output the control instructions to the scanning device, wherein the status attribute is a selected state or an unselected state.

[0006] Furthermore, the method also includes: In response to the response information returned by the scanning device, the next cycle is executed after a preset time threshold, wherein the response information is information generated by the scanning device based on the control instruction.

[0007] Further, determining the target control in the selected state based on each state attribute includes: Get the properties of the target control; If the attribute of the target control is the first attribute value, determining that the target control is a low-precision scanning mode control; If the property of the target control is the second property value, it is determined that the target control is a high-precision scanning mode control.

[0008] Furthermore, the working parameters of the scanning device are determined according to the target control, including: In response to the target control being a low-precision scanning mode control, determining that the scanning mode of the scanning device is a low-precision scanning mode; Determine a corresponding first brightness control based on the low-precision scanning mode control, and obtain a first brightness value corresponding to a trigger position of the first brightness control; Based on the low-precision scanning mode and the first brightness value, working parameters of the imaging module of the scanning device are determined, wherein the working parameters are at least one of the following: exposure time of the speckle laser, hardware analog gain, and hardware digital gain.

[0009] Furthermore, the working parameters of the scanning device are determined according to the target control, including: In response to the target control being a high-precision scanning mode control, determining that the scanning mode of the scanning device is a high-precision scanning mode; Determine a corresponding second brightness control based on the high-precision scanning mode control, and obtain a second brightness value corresponding to a trigger position of the second brightness control; Based on the high-precision scanning mode and the second brightness value, the working parameters of the imaging module of the scanning device are determined, wherein the working parameters are at least one of the following: exposure time, hardware analog gain, and hardware digital gain.

[0010] Furthermore, the working parameters of the scanning device are determined according to the target control, including: In response to the target control being a high-precision scanning mode control, determining a first sub-control in a selected state among sub-controls under the high-precision scanning mode control; If the attribute of the first sub-control is the third attribute value, determining that the scanning mode corresponding to the first sub-control is the small-format speckle sub-mode; Obtaining a second brightness value corresponding to the trigger position of the second brightness control; Based on the small-area speckle sub-pattern and the second brightness value, working parameters of an imaging module of a scanning device are determined, wherein the working parameters are at least one of the following: exposure time of a speckle laser, hardware analog gain, and hardware digital gain.

[0011] Furthermore, the working parameters of the scanning device are determined according to the target control, including: In response to the target control being a high-precision scanning mode control, determining a second sub-control in a selected state among the sub-controls under the high-precision scanning mode control; If the attribute of the second subcontrol is the fourth attribute value, determining that the scanning mode corresponding to the second subcontrol is the infrared laser submode; Obtaining a second brightness value corresponding to the trigger position of the second brightness control; Based on the infrared linear laser sub-mode and the second brightness value, the working parameters of the imaging module of the scanning device are determined, wherein the working parameters are at least one of the following: exposure time of the speckle laser, exposure time of the infrared linear laser, hardware analog gain, and hardware digital gain.

[0012] Furthermore, the working parameters of the scanning device are determined according to the target control, including: In response to the target control being a high-precision scanning mode control, determining a third sub-control in a selected state among the sub-controls under the high-precision scanning mode control; If the attribute of the third subcontrol is the fifth attribute value, it is determined that the scanning mode corresponding to the third subcontrol is a blue linear laser submode; Obtaining a second brightness value corresponding to the trigger position of the second brightness control; Based on the blue linear laser sub-mode and the second brightness value, the working parameters of the imaging module of the scanning device are determined, wherein the working parameters are at least one of the following: exposure time of the speckle laser, exposure time of the blue linear laser, hardware analog gain, and hardware digital gain.

[0013] Further, an independent working thread is created, and the independent working thread enters a loop calling process, including: In the independent working thread, construct a while loop task to make the independent working thread enter the loop calling process.

[0014] In a second aspect, the present application provides a control device for a scanning device, the device comprising: The thread module is used to create an independent working thread and make the independent working thread enter a loop calling process; A loop execution module is used to perform the following steps in each loop: obtain the state attributes of each control in the scanning control interface, determine the target control in the selected state based on each state attribute, determine the working parameters of the scanning device according to the attributes of the target control, generate a control instruction based on the working parameters of the scanning device, and output the control instruction to the scanning device, wherein the state attribute is a selected state or an unselected state.

[0015] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps of the control method of the scanning device as described above.

[0016] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the control method of the scanning device as described above are implemented.

[0017] The present application creates an independent working thread, executes cyclic tasks in the independent working thread, polls the status attributes of each control in the scanning control interface, determines the target control in the selected state according to the status attributes of each control, determines the working parameters of the scanning device according to the attributes of the target control, and generates and outputs control instructions to the scanning device. It can solve the problem of freezing of the scanning control interface and the problem of command blocking of the scanning device, improve the operating efficiency of the terminal device, improve the scanning efficiency of the scanning device, and thus improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 An application scenario diagram of the control method of a scanning device provided in an embodiment of the present application; Figure 2 A first flow chart of a method for controlling a scanning device provided in an embodiment of the present application; Figure 3 A second flow chart of the control method of the scanning device provided in the embodiment of the present application; Figure 4 A third flow chart of the control method of the scanning device provided in the embodiment of the present application; Figure 5 A fourth flow chart of a method for controlling a scanning device provided in an embodiment of the present application; Figure 6 A fifth flow chart of a method for controlling a scanning device provided in an embodiment of the present application; Figure 7 A sixth flow chart of a method for controlling a scanning device provided in an embodiment of the present application; Figure 8 A seventh flow chart of a method for controlling a scanning device provided in an embodiment of the present application; Fig. 9 An eighth flow chart of a method for controlling a scanning device provided in an embodiment of the present application; Fig.10 A system block diagram of a control device for a scanning device provided in an embodiment of the present application; Fig.11 A system block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0019] The present application will be described in detail below in conjunction with the specific implementation modes shown in the accompanying drawings, but these implementation modes do not limit the present application. Structural, methodological, or functional changes made by ordinary technicians in the field based on these implementation modes are included in the protection scope of the present application.

[0020] QT is a cross-platform graphical user interface application development framework. It can be used to develop both GUI programs and non-GUI programs, such as console tools and servers. QT is an object-oriented framework that uses special code generation extensions (called Meta Object Compiler (moc)) and some macros to make it easy to expand and allow component programming. The signal and slot mechanism is the core mechanism of QT and is applied to communication between objects. In QT, the control reading of the user interface is implemented by binding an event callback function to the control itself. For example, when the user interacts with the interface (such as clicking a radio button or moving a slider), the radio button control (QRadioButton) or the slider control (QSlider) will emit a corresponding cliked signal. These signals are bound to specific slot functions by connecting (connect), that is, the cliked signal of the radio button is bound to a custom member function, or the valueChanged signal of the slider is bound to a custom member function. When the radio button is clicked or the value of the slider changes, the corresponding slot function is called. The event callback mechanism enables GUI applications to run in an event-driven manner. However, when users frequently operate controls in the graphical interface, such as changing the value of the slider by dragging the slider with the mouse, the QSlider valueChanged signal will be issued dozens of times per second, thereby outputting dozens of commands to modify device parameters to the scanning device. Due to the limited processing speed of the scanning device, for example, it takes 400ms or even longer to modify and calculate certain device parameters, the scanning device is not able to process frequent instructions in time. The instructions for processing these controls are usually in the main thread of UI processing, so the above situation will cause obvious freezes in the user interface and block the instructions of the scanning device. Therefore, the present application proposes a control method for a scanning device, which creates an independent working thread with a loop call function, obtains the state attributes of each control in the scanning control interface, determines the target control in the selected state based on each state attribute, determines the working parameters of the scanning device based on the target control, generates control instructions based on the working parameters of the scanning device, and outputs the control instructions to the scanning device, which can solve the technical problem of freezes in the user interface.

[0021] Figure 1 : is an application scenario diagram of the control method of the scanning device of the embodiment of the present application. Figure 1As shown, the terminal device 101 is connected to the scanning device 102 for communication. The terminal device 101 creates an independent working thread, which enters a loop calling process and executes in each loop: obtaining the state attributes of each control in the scanning control interface of the terminal device 101, determining the target control in the selected state based on each state attribute, determining the working parameters of the scanning device 102 according to the attributes of the target control, generating a control instruction based on the working parameters of the scanning device 102, and outputting the control instruction to the scanning device 102 so that the scanning device 102 performs subsequent operations.

[0022] The scanning device 102 may be any optical scanning device for three-dimensional scanning, such as a handheld three-dimensional scanner or a tracking three-dimensional scanner. The terminal device 101 may be any device with computing and communication capabilities and a display interface. The terminal device 101 executes various functions and data processing by running a stored computer program. The communication connection between the terminal device 101 and the scanning device 102 may be a wireless communication method or a wired communication connection.

[0023] The terminal device 101 includes but is not limited to mobile terminals and fixed terminals, for example, mobile terminals include but are not limited to smart phones, tablet computers, laptop computers, etc., and fixed terminals include but are not limited to desktop computers, etc. The terminal device 101 can also be a server or other device, which can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, but is not limited thereto.

[0024] It is worth noting that Figure 1 It is only a schematic diagram of an application scenario diagram provided by the embodiment of the present application. The system architecture and application scenario described in the embodiment of the present invention are to more clearly illustrate the technical solution of the embodiment of the present invention, and do not constitute a limitation on the technical solution provided by the embodiment of the present invention. It is known to those skilled in the art that with the evolution of the system architecture and the emergence of new application scenarios, the technical solution provided by the embodiment of the present invention is also applicable to similar technical problems.

[0025] Please refer to Figure 2 , an embodiment of the present application provides a control method for a scanning device, the method comprising step S201.

[0026] S201, create an independent working thread, make the independent working thread enter a loop calling process, and execute the following steps in each loop: obtain the state attributes of each control in the scanning control interface, determine the target control in the selected state based on each state attribute, determine the working parameters of the scanning device according to the attributes of the target control, generate control instructions based on the working parameters of the scanning device, and output the control instructions to the scanning device, wherein the state attribute is a selected state or an unselected state.

[0027] In this embodiment, an independent working thread is created, which is independent of the UI main thread of the main application program. The independent working thread has a loop calling function, and each loop calling operation is performed through the loop function of the independent working thread.

[0028] Exemplarily, in an independent working thread, a while loop task is constructed to make the independent working thread enter a loop calling process. The task steps executed in each loop are implemented through the while loop task.

[0029] Exemplarily, the user can control the scanning device by operating the three-dimensional scanning software deployed on the terminal device. The three-dimensional scanning software displays a scanning control interface on the terminal device so that the user can interact on the scanning control interface. The interaction mode can be that the user clicks on the controls on the interface, selects a check box, etc. on the scanning control interface to trigger the change of the state attribute of the control and is detected by the terminal device. Exemplarily, the controls in the scanning control interface can include a list control, a button control, a dialog box control, a picture box control, a check box control, a text box control, and a prompt box control.

[0030] Exemplarily, in each cycle, the state attributes of each control in the scanning control interface are read, and whether the control is selected is determined based on the read state attributes. If the state attribute is in a selected state, it indicates that the control is selected by the user, and the control is determined as a target control in a selected state. If the state attribute is in an unselected state, it indicates that the control is not selected by the user. Based on the selected target control, the attributes of the target control are obtained, and the working parameters of the scanning device are determined based on the attributes of the target control. A control instruction is generated based on the working parameters of the scanning device, and the control instruction is output to the scanning device, thereby realizing the control of the scanning device.

[0031] In one embodiment, the QCheckBox check box control is a commonly used control in the Qt framework. The control can complete the selected / unselected function. The isChecked() function can be used to determine whether the check box control is selected. When the function returns true, it indicates that the check box control is selected. When the function returns false, it indicates that the check box control is not selected.

[0032] For example, in the cyclic call in the independent work thread, a preset time period can be used for cyclic call, and the preset time period can be reasonably set according to actual business experience. The specific preset time period can be determined according to actual needs and is not limited here.

[0033] In this embodiment, an independent working thread is created, a cyclic task is executed in the independent working thread, the status attributes of each control in the scanning control interface are polled, the status attributes of each control are obtained, and then the target control in the selected state is determined, and the working parameters of the scanning device are determined according to the attributes of the target control to generate and output control instructions to the scanning device. This can solve the problem of freezing of the scanning control interface and the problem of command blocking of the scanning device, improve the operating efficiency of the terminal device, improve the scanning efficiency of the scanning device, and thus improve the user experience.

[0034] In one embodiment, Figure 3 As shown, the method also includes steps S301-S302.

[0035] S301, creating an independent working thread, making the independent working thread enter a loop calling process, and performing the following steps in each loop: obtaining the state attributes of each control in the scanning control interface, determining the target control in the selected state based on each state attribute, determining the working parameters of the scanning device according to the attributes of the target control, generating a control instruction based on the working parameters of the scanning device, and outputting the control instruction to the scanning device, wherein the state attribute is a selected state or an unselected state; S302, in response to response information returned by the scanning device, executing the next cycle after a preset time threshold, wherein the response information is information generated by the scanning device based on the control instruction.

[0036] The scanning device receives the control instruction sent by the terminal device, generates a response message based on the control instruction, and sends it to the terminal device. The terminal device receives the response message and continues to perform the next cycle operation after a preset time threshold. Exemplarily, the time threshold can be set to 200ms. The time threshold can also be set according to actual conditions.

[0037] In this embodiment, a control instruction is sent to the scanning device after one cycle, and after receiving the response information of the scanning device, the next cycle is continued after a certain time delay. This can prevent the scanning device from receiving a large number of control instructions to cause instruction blocking, further ensuring the instruction processing time of the scanning device and further improving the user experience.

[0038] In one embodiment, Figure 4As shown, the step of determining the target control in the selected state based on each state attribute includes S401-S403.

[0039] S401, obtaining the properties of the target control; S402, if the attribute of the target control is the first attribute value, determining that the target control is a low-precision scanning mode control; S403: If the attribute of the target control is a second attribute value, determine that the target control is a high-precision scanning mode control.

[0040] In this embodiment, the control in the selected state is determined to be the target control, and the property of the target control is obtained. Based on the property, it can be determined which control the target control is. For example, the property can be a control name, and the corresponding control can be determined based on the control name. If the property of the target control is a first property value, it is determined that the target control is a low-precision scanning mode control. If the property of the target control is a second property value, it is determined that the target control is a high-precision scanning mode control. Through the property value of the target control, it can be determined whether the target control is a low-precision scanning mode control or a high-precision scanning mode control.

[0041] In one embodiment, Figure 5 As shown, the step of determining the working parameters of the scanning device according to the target control includes S501-S503.

[0042] S501, in response to the target control being a low-precision scanning mode control, determining that the scanning mode of the scanning device is a low-precision scanning mode; S502, determining a corresponding first brightness control based on the low-precision scanning mode control, and acquiring a first brightness value corresponding to a trigger position of the first brightness control; S503, determining working parameters of an imaging module of a scanning device based on the low-precision scanning mode and the first brightness value, wherein the working parameters are at least one of the following: exposure time of a speckle laser, hardware analog gain, and hardware digital gain.

[0043] When it is determined that the target control is a low-precision scanning mode control, the scanning mode of the scanning device is determined to be a low-precision scanning mode, that is, the scanning mode selected by the user is a low-precision scanning mode, and the corresponding first brightness value is determined according to the trigger position of the first brightness control. Therefore, based on the low-precision scanning mode and the first brightness value, the working parameters of the imaging module of the scanning device are determined.

[0044] Exemplarily, different scanning modes and different brightness values ​​have different effects on the working parameters of the imaging module. For example, in the low-precision scanning mode, a brightness value of 0%-75% only affects the exposure time of each frame of the speckle laser, a brightness value of 75%-85% only affects the analog gain of the hardware, and a brightness value of 85%-100% only affects the digital gain of the hardware. Therefore, the working parameters of the imaging module such as exposure time, analog gain, and digital gain can be determined according to the first brightness value and the low-precision scanning mode.

[0045] Exemplarily, the first brightness control may be a sliding control, which includes a sliding bar and a sliding slider that can move on the sliding bar. The triggering mode of the first brightness control includes sliding triggering or clicking triggering. The triggering position may be the position information of the sliding end point corresponding to the sliding trigger, or the position information of the click position corresponding to the clicking trigger. Sliding triggering means: when it is detected that the user acts on the area where the first brightness control is located and there is sliding, it is determined that the first brightness control is detected to be triggered by sliding, for example, the user drags the sliding slider of the first brightness control with his hand. Click triggering means that when it is detected that the user clicks on a position in the area where the first brightness control is located, it is determined that the first brightness control is detected to be click triggered. For example, the user clicks the sliding slider of the first brightness control with his hand.

[0046] For example, in the low-precision scanning mode and the high-precision mode, the mapping relationship between the trigger position of the brightness control and the brightness value is different, that is, the low-precision scanning mode corresponds to one brightness control, and the high-precision mode corresponds to one brightness control. Therefore, when determining that it is a low-precision scanning mode control, it is necessary to determine the corresponding brightness control, that is, determine the first brightness control.

[0047] Exemplarily, there is a mapping relationship between the trigger position of the first brightness control and the brightness value. When the first brightness control is triggered, the brightness value that the user wants to adjust can be determined by acquiring the first brightness value corresponding to the trigger position of the first brightness control.

[0048] Exemplarily, the imaging module may include hardware devices for imaging or auxiliary imaging, such as a camera, a laser, or a fill light device. The working parameter may be one or a combination of multiple parameters of the exposure time of the speckle laser, the hardware analog gain, and the hardware digital gain. After adjusting the parameters of the imaging module based on the working parameters, the subsequent three-dimensional scanning function may be performed on the scanned object based on the adjusted working parameters.

[0049] In one embodiment, Figure 6 As shown, the step of determining the working parameters of the scanning device according to the target control includes S601-S603.

[0050] S601, in response to the target control being a high-precision scanning mode control, determining that the scanning mode of the scanning device is a high-precision scanning mode; S602, determining a corresponding second brightness control based on the high-precision scanning mode control, and obtaining a second brightness value corresponding to a trigger position of the second brightness control; S603, based on the high-precision scanning mode and the second brightness value, determining the working parameters of the imaging module of the scanning device, wherein the working parameters are at least one of the following: exposure time, hardware analog gain, and hardware digital gain.

[0051] When it is determined that the target control is a high-precision scanning mode control, the scanning mode of the scanning device is determined to be a high-precision scanning mode, that is, the scanning mode selected by the user is the high-precision scanning mode, and the corresponding second brightness value is determined according to the trigger position of the second brightness control. Therefore, based on the high-precision scanning mode and the second brightness value, the working parameters of the imaging module of the scanning device are determined.

[0052] Exemplarily, the second brightness control may be a sliding control, which includes a sliding bar and a sliding slider that can move on the sliding bar. The triggering mode of the second brightness control includes sliding triggering or clicking triggering. The triggering position may be the position information of the sliding end point corresponding to the sliding trigger, or the position information of the click position corresponding to the clicking trigger.

[0053] As described above, the brightness control in the low-precision scanning mode is different from the brightness control in the high-precision mode. Therefore, when the high-precision scanning mode control is determined, it is necessary to determine the corresponding brightness control, that is, determine the second brightness control.

[0054] Exemplarily, there is a mapping relationship between the trigger position of the second brightness control and the brightness value. When the second brightness control is triggered, the brightness value that the user wants to adjust can be determined by acquiring the second brightness value corresponding to the trigger position of the second brightness control.

[0055] The working parameter may be one or a combination of multiple parameters of exposure time, hardware analog gain, and hardware digital gain. After adjusting the parameters of the imaging module based on the working parameter, the subsequent three-dimensional scanning function can be performed on the scanned object based on the adjusted working parameter.

[0056] In one embodiment, the high-precision scanning mode supports three sub-modes, namely, the small-area speckle sub-mode, the infrared linear laser mode, and the blue linear laser mode. Figure 7 As shown, the step of determining the working parameters of the scanning device according to the target control includes S701-S704.

[0057] S701, in response to the target control being a high-precision scanning mode control, determining a first sub-control in a selected state among sub-controls under the high-precision scanning mode control; S702: If the attribute of the first sub-control is the third attribute value, determine that the scanning mode corresponding to the first sub-control is the small-format speckle sub-mode; S703, obtaining a second brightness value corresponding to the trigger position of the second brightness control; S704, determining working parameters of an imaging module of a scanning device based on the small-area speckle sub-pattern and the second brightness value, wherein the working parameters are at least one of the following: exposure time of a speckle laser, hardware analog gain, and hardware digital gain.

[0058] Exemplarily, the high-precision scanning mode supports three sub-modes: small-area speckle sub-mode, infrared linear laser mode, and blue linear laser mode. Only one of these three sub-modes can be selected. Therefore, the high-precision scanning mode control includes three sub-controls, each of which corresponds to a sub-mode, and the brightness control corresponding to the three sub-modes is the same control. When the target control is a high-precision scanning mode control, that is, the user has selected the high-precision scanning mode, it is necessary to further determine which of the above modes the selected high-precision mode is. By obtaining and determining the state attributes of each sub-control under the high-precision scanning mode control, the first sub-control in the selected state can be determined, and then the attribute value of the first sub-control can be determined. If the attribute of the first sub-control is the third attribute value, it is determined that the scanning mode corresponding to the first sub-control is the small-area speckle sub-mode. The second brightness value corresponding to the trigger position of the second brightness control is obtained, and the working parameters of the imaging module of the scanning device are determined based on the small-area speckle sub-mode and the second brightness value.

[0059] For example, in the small-format speckle sub-mode, 0%-75% of the brightness value only affects the exposure time of each frame of the speckle laser, 75%-85% of the brightness value only affects the analog gain of the hardware, and 85%-100% of the brightness value only affects the digital gain of the hardware. Therefore, the working parameters of the imaging module such as the exposure time of the speckle laser, the hardware analog gain, and the hardware digital gain can be determined according to the small-format speckle sub-mode and the second brightness value.

[0060] In one embodiment, Figure 8 As shown, the step of determining the working parameters of the scanning device according to the target control includes S801-S804.

[0061] S801, in response to the target control being a high-precision scanning mode control, determining a second sub-control in a selected state among sub-controls under the high-precision scanning mode control; S802, if the attribute of the second sub-control is the fourth attribute value, determine that the scanning mode corresponding to the second sub-control is the infrared laser sub-mode; S803, obtaining a second brightness value corresponding to the trigger position of the second brightness control; S804, determining working parameters of an imaging module of a scanning device based on the infrared linear laser sub-pattern and the second brightness value, wherein the working parameters are at least one of the following: exposure time of a speckle laser, exposure time of an infrared linear laser, hardware analog gain, and hardware digital gain.

[0062] When the target control is a high-precision scanning mode control, that is, the user has selected a high-precision scanning mode, it is necessary to further determine which of the above modes the selected high-precision mode is. By obtaining and determining the state attributes of each sub-control under the high-precision scanning mode control, the second sub-control in the selected state can be determined, and then the attribute value of the second sub-control can be determined. If the attribute of the first sub-control is the fourth attribute value, it is determined that the scanning mode corresponding to the second sub-control is an infrared laser sub-mode. The second brightness value corresponding to the trigger position of the second brightness control is obtained, and the working parameters of the imaging module of the scanning device are determined based on the infrared laser sub-mode and the second brightness value.

[0063] Exemplarily, in the infrared linear laser sub-mode, a brightness value of 0%-60% only affects the exposure time of each frame of the infrared linear laser, a brightness value of 60%-75% only affects the exposure time of each frame of the speckle laser, a brightness value of 75%-85% only affects the analog gain of the hardware, and a brightness value of 85%-100% only affects the digital gain of the hardware. Therefore, the exposure time of the speckle laser, the exposure time of the infrared linear laser, the hardware analog gain, the hardware digital gain and other working parameters of the imaging module can be determined according to the infrared linear laser sub-mode and the second brightness value.

[0064] In one embodiment, Fig. 9 As shown, the step of determining the working parameters of the scanning device according to the target control includes S901-S904.

[0065] S901, in response to the target control being a high-precision scanning mode control, determining a third sub-control in a selected state among sub-controls under the high-precision scanning mode control; S902, if the attribute of the third sub-control is the fifth attribute value, determine that the scanning mode corresponding to the second sub-control is a blue linear laser sub-mode; S903, obtaining a second brightness value corresponding to the trigger position of the second brightness control; S904, based on the blue linear laser sub-mode and the second brightness value, determine the working parameters of the imaging module of the scanning device, wherein the working parameters are at least one of the following: exposure time of the speckle laser, exposure time of the blue linear laser, hardware analog gain, and hardware digital gain.

[0066] When the target control is a high-precision scanning mode control, that is, the user has selected a high-precision scanning mode, it is necessary to further determine which of the above modes the selected high-precision mode is. By obtaining and determining the state attributes of each sub-control under the high-precision scanning mode control, the third sub-control in the selected state can be determined, and then the attribute value of the third sub-control can be determined. If the attribute of the third sub-control is the fifth attribute value, it is determined that the scanning mode corresponding to the third sub-control is a blue linear laser sub-mode. The second brightness value corresponding to the trigger position of the second brightness control is obtained, and based on the blue linear laser sub-mode and the second brightness value, the working parameters of the imaging module of the scanning device are determined.

[0067] Illustratively, in the blue linear laser sub-mode, 0%-60% of the brightness value only affects the exposure time of each frame of the blue linear laser, 60%-75% of the brightness value only affects the exposure time of each frame of the speckle laser, 75%-85% of the brightness value only affects the analog gain of the hardware, and 85%-100% of the brightness value only affects the digital gain of the hardware. Therefore, the exposure time of the speckle laser, the exposure time of the blue linear laser, the hardware analog gain, the hardware digital gain and other working parameters of the imaging module can be determined according to the blue linear laser sub-mode and the second brightness value.

[0068] Based on the same inventive concept, the embodiment of the present application also provides a control device for implementing the above-mentioned scanning device. The implementation solution provided by the device is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in the embodiment of the control device of the scanning device provided below can refer to the limitations of the control method of the scanning device above, and will not be repeated here.

[0069] like Fig.10 As shown, the present application provides a control device for a scanning device, the device comprising: The thread module 1001 is used to create an independent working thread and make the independent working thread enter a loop calling process; The loop execution module 1002 is used to execute the following steps in each loop: obtain the state attributes of each control in the scanning control interface, determine the target control in the selected state based on each state attribute, determine the working parameters of the scanning device according to the attributes of the target control, generate control instructions based on the working parameters of the scanning device, and output the control instructions to the scanning device, wherein the state attribute is a selected state or an unselected state.

[0070] In this embodiment, the thread module 1001 creates an independent working thread and executes a cyclic task in the independent working thread. The cyclic execution module 1002 polls the status attributes of each control in the scanning control interface, obtains the status attributes of each control, and then determines the target control in the selected state, and determines the working parameters of the scanning device according to the attributes of the target control to generate and output control instructions to the scanning device. This can solve the problem of freezing of the scanning control interface and the problem of command blocking of the scanning device, improve the operating efficiency of the terminal device, improve the scanning efficiency of the scanning device, and thus improve the user experience.

[0071] Furthermore, the loop execution module 1002 is specifically used for: In response to the response information returned by the scanning device, the next cycle is executed after a preset time threshold, wherein the response information is information generated by the scanning device based on the control instruction.

[0072] Furthermore, the loop execution module 1002 is specifically used for: Get the properties of the target control; If the attribute of the target control is the first attribute value, determining that the target control is a low-precision scanning mode control; If the property of the target control is the second property value, it is determined that the target control is a high-precision scanning mode control.

[0073] Furthermore, the loop execution module 1002 is specifically used for: In response to the target control being a low-precision scanning mode control, determining that the scanning mode of the scanning device is a low-precision scanning mode; Determine a corresponding first brightness control based on the low-precision scanning mode control, and obtain a first brightness value corresponding to a trigger position of the first brightness control; Based on the low-precision scanning mode and the first brightness value, working parameters of the imaging module of the scanning device are determined, wherein the working parameters are at least one of the following: exposure time of the speckle laser, hardware analog gain, and hardware digital gain.

[0074] Furthermore, the loop execution module 1002 is specifically used for: In response to the target control being a high-precision scanning mode control, determining that the scanning mode of the scanning device is a high-precision scanning mode; Determine a corresponding second brightness control based on the high-precision scanning mode control, and obtain a second brightness value corresponding to a trigger position of the second brightness control; Based on the high-precision scanning mode and the second brightness value, the working parameters of the imaging module of the scanning device are determined, wherein the working parameters are at least one of the following: exposure time, hardware analog gain, and hardware digital gain.

[0075] Furthermore, the loop execution module 1002 is specifically used for: In response to the target control being a high-precision scanning mode control, determining a first sub-control in a selected state among sub-controls under the high-precision scanning mode control; If the attribute of the first sub-control is the third attribute value, determining that the scanning mode corresponding to the first sub-control is the small-format speckle sub-mode; Obtaining a second brightness value corresponding to the trigger position of the second brightness control; Based on the small-area speckle sub-pattern and the second brightness value, working parameters of an imaging module of a scanning device are determined, wherein the working parameters are at least one of the following: exposure time of a speckle laser, hardware analog gain, and hardware digital gain.

[0076] Furthermore, the loop execution module 1002 is specifically used for: In response to the target control being a high-precision scanning mode control, determining a second sub-control in a selected state among the sub-controls under the high-precision scanning mode control; If the attribute of the second subcontrol is the fourth attribute value, determining that the scanning mode corresponding to the second subcontrol is the infrared laser submode; Obtaining a second brightness value corresponding to the trigger position of the second brightness control; Based on the infrared linear laser sub-mode and the second brightness value, the working parameters of the imaging module of the scanning device are determined, wherein the working parameters are at least one of the following: exposure time of the speckle laser, exposure time of the infrared linear laser, hardware analog gain, and hardware digital gain.

[0077] Furthermore, the loop execution module 1002 is specifically used for: In response to the target control being a high-precision scanning mode control, determining a third sub-control in a selected state among the sub-controls under the high-precision scanning mode control; If the attribute of the third subcontrol is the fifth attribute value, it is determined that the scanning mode corresponding to the third subcontrol is a blue linear laser submode; Obtaining a second brightness value corresponding to the trigger position of the second brightness control; Based on the blue linear laser sub-mode and the second brightness value, the working parameters of the imaging module of the scanning device are determined, wherein the working parameters are at least one of the following: exposure time of the speckle laser, exposure time of the blue linear laser, hardware analog gain, and hardware digital gain.

[0078] Furthermore, the thread module 1001 is specifically used for: In the independent working thread, construct a while loop task to make the independent working thread enter the loop calling process.

[0079] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned control methods for a scanning device are implemented.

[0080] Fig.11 It is a schematic diagram of the hardware structure of a computer device provided in an embodiment of the present application. Fig.11 The computer device shown includes: a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104. The processor 1101, the communication interface 1102 and the memory 1103 communicate with each other via the communication bus 1104. Fig.11 The connection method between the processor 1101, the communication interface 1102, and the memory 1103 shown is merely exemplary. During implementation, the processor 1101, the communication interface 1102, and the memory 1103 may also be connected to each other in communication with each other using other connection methods besides the communication bus 1104.

[0081] The memory 1103 can be used to store a computer program, which may include instructions and data to implement the steps of any of the above control methods for scanning devices. In an embodiment of the present application, the memory 1103 may be various types of storage media, such as random access memory (RAM), read only memory (ROM), non-volatile RAM (NVRAM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), flash memory, optical storage, and registers. The memory 1103 may include a hard disk and / or a memory.

[0082] The processor 1101 may be a general-purpose processor, which may be a processor that performs specific steps and / or operations by reading and executing a computer program (e.g., a computer program) stored in a memory (e.g., memory 1103). The general-purpose processor may use data stored in the memory (e.g., memory 1103) during the execution of the steps and / or operations. The general-purpose processor may be, for example, but not limited to, a central processing unit (CPU). In addition, the processor 1101 may also be a special-purpose processor, which may be a processor specially designed to perform specific steps and / or operations. The special-purpose processor may be, for example, but not limited to, an ASIC and an FPGA. In addition, the processor 1101 may also be a combination of multiple processors, such as a multi-core processor.

[0083] The communication interface 1102 may include an input / output (I / O) interface, a physical interface, and a logical interface for interconnecting devices within the network device, as well as an interface for interconnecting the network device with other devices (e.g., network devices). The communication network may be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication interface 1102 may be a module, a circuit, a transceiver, or any device capable of implementing communication.

[0084] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 1101 or an instruction in the form of software. The method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in the processor for execution. The software module can be located in a mature storage medium in the art such as a random access memory flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1103, and the processor 1101 reads the information in the memory 1103 and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.

[0085] Although the preferred embodiments of the present application have been disclosed for illustrative purposes, those skilled in the art will appreciate that various modifications, additions and substitutions are possible, without departing from the scope and spirit of the application as disclosed in the accompanying claims.

Claims

1. A method for controlling a scanning device, characterized in that: The method comprises: Create an independent working thread, and make the independent working thread enter a loop calling process, and perform the following steps in each loop: Obtain status attributes of each control in the scanning control interface, determine the target control in the selected state based on each status attribute, determine the working parameters of the scanning device according to the attributes of the target control, generate control instructions based on the working parameters of the scanning device, and output the control instructions to the scanning device, wherein the status attribute is a selected state or an unselected state.

2. The control method of the scanning device according to claim 1, characterized in that: The method further comprises: In response to the response information returned by the scanning device, the next cycle is executed after a preset time threshold, wherein the response information is information generated by the scanning device based on the control instruction.

3. The control method of the scanning device according to claim 1, characterized in that: The step of determining the target control in the selected state based on each state attribute includes: Get the properties of the target control; If the attribute of the target control is the first attribute value, determining that the target control is a low-precision scanning mode control; If the attribute of the target control is the second attribute value, it is determined that the target control is a high-precision scanning mode control.

4. The control method of the scanning device according to claim 3, characterized in that: in, The determining the working parameters of the scanning device according to the target control includes: In response to the target control being a low-precision scanning mode control, determining that the scanning mode of the scanning device is a low-precision scanning mode; Determine a corresponding first brightness control based on the low-precision scanning mode control, and obtain a first brightness value corresponding to a trigger position of the first brightness control; Based on the low-precision scanning mode and the first brightness value, the working parameters of the imaging module of the scanning device are determined, wherein the working parameters are at least one of the following: exposure time of the speckle laser, hardware analog gain, and hardware digital gain.

5. The control method of the scanning device according to claim 3, characterized in that: The determining the working parameters of the scanning device according to the target control includes: In response to the target control being a high-precision scanning mode control, determining that the scanning mode of the scanning device is a high-precision scanning mode; Determine a corresponding second brightness control based on the high-precision scanning mode control, and obtain a second brightness value corresponding to a trigger position of the second brightness control; Based on the high-precision scanning mode and the second brightness value, the working parameters of the imaging module of the scanning device are determined, wherein the working parameters are at least one of the following: exposure time, hardware analog gain, and hardware digital gain.

6. The control method of the scanning device according to claim 5, characterized in that: The determining the working parameters of the scanning device according to the target control includes: In response to the target control being a high-precision scanning mode control, determining a first sub-control in a selected state among sub-controls under the high-precision scanning mode control; If the attribute of the first subcontrol is the third attribute value, determining that the scanning mode corresponding to the first subcontrol is the small-format speckle submode; Obtaining a second brightness value corresponding to the trigger position of the second brightness control; Based on the small-area speckle sub-pattern and the second brightness value, the working parameters of the imaging module of the scanning device are determined, wherein the working parameters are at least one of the following: exposure time of the speckle laser, hardware analog gain, and hardware digital gain.

7. The control method of the scanning device according to claim 5, characterized in that: The determining the working parameters of the scanning device according to the target control includes: In response to the target control being a high-precision scanning mode control, determining a second sub-control in a selected state among the sub-controls under the high-precision scanning mode control; If the attribute of the second subcontrol is the fourth attribute value, determining that the scanning mode corresponding to the second subcontrol is the infrared laser submode; Obtaining a second brightness value corresponding to the trigger position of the second brightness control; Based on the infrared linear laser sub-mode and the second brightness value, the working parameters of the imaging module of the scanning device are determined, wherein the working parameters are at least one of the following: exposure time of the speckle laser, exposure time of the infrared linear laser, hardware analog gain, and hardware digital gain.

8. The control method of a scanning device according to claim 5, characterized in that: The determining the working parameters of the scanning device according to the target control includes: In response to the target control being a high-precision scanning mode control, determining a third sub-control in a selected state among the sub-controls under the high-precision scanning mode control; If the attribute of the third sub-control is the fifth attribute value, it is determined that the scanning mode corresponding to the third sub-control is a blue linear laser sub-mode; Obtaining a second brightness value corresponding to the trigger position of the second brightness control; Based on the blue linear laser sub-mode and the second brightness value, the operating parameters of the imaging module of the scanning device are determined, wherein the operating parameters are at least one of the following: exposure time of the speckle laser, exposure time of the blue linear laser, hardware analog gain, and hardware digital gain.

9. The control method of a scanning device according to claim 1, characterized in that: Creating an independent working thread and causing the independent working thread to enter a loop calling process includes: In the independent working thread, a while loop task is constructed to make the independent working thread enter a loop calling process.

10. A control device for a scanning device, characterized in that: The device comprises: A thread module, used for creating an independent working thread, and making the independent working thread enter a loop calling process; A loop execution module is used to perform the following steps in each loop: obtain the state attributes of each control in the scanning control interface, determine the target control in the selected state based on each state attribute, determine the working parameters of the scanning device according to the attributes of the target control, generate a control instruction based on the working parameters of the scanning device, and output the control instruction to the scanning device, wherein the state attribute is a selected state or an unselected state.

11. A computer device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps of the control method of the scanning device according to any one of claims 1 to 9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the control method of the scanning device according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Method of presenting a web page for accessibility browsing

    US20100199215A1