Scanning method, device and system
By building a communication connection between JavaScript programs and scan compatibility drivers in the client, the complexity and limitations of existing scanning methods are solved, and efficient and compatible scanning functions are achieved.
Patent Information
- Application Number
- CN202111603729.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-12-24
AI Technical Summary
The existing scanning methods have complex operation steps, low efficiency, and limited application scenarios, so they cannot be effectively used in multiple browsers and systems.
Run the scan application and scan compatibility driver in the client, and build a communication connection between JavaScript programs and scan compatibility drivers by adding a method library to achieve the scanning function.
Simplifies operational steps, improves scanning efficiency, enhances universal applicability and compatibility of scanning, and improves scanning safety and reliability.
Smart Images

Figure CN114327945B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular, to a scanning method, device, and system. Background Art
[0002] Scanning is conducive to the storage of paper materials (such as bills, vouchers, contracts, etc.) and other materials. Scanning usually requires a scanner and a client.
[0003] In the prior art, the commonly used scanning method includes: establishing communication between the client and the scanner, controlling the scanner to scan the object to be scanned (such as a voucher, etc.), obtaining the scanning result (such as an electronic version of the scanned voucher), and storing the scanning result on the client's local disk, and then transmitting the scanning result to the server through the local disk directory.
[0004] However, the above method requires a separate scan outside the system and then uploads the scan into the system's business process, which results in complicated operation steps and low efficiency. Summary of the invention
[0005] The embodiments of the present disclosure provide a scanning method, device and system to solve the problem of low scanning efficiency.
[0006] In a first aspect, an embodiment of the present disclosure provides a scanning method, which is applied to a client, wherein a scanning application and a scanning compatibility driver are running in the client, and the method includes:
[0007] Adding a method library in the system to be scanned of the client, wherein the method library is determined based on the scanning compatibility driver;
[0008] According to the method library and the scanning application, a communication connection is established between a JavaScript program and the scanning compatibility driver, wherein the JavaScript program is a programming language program running on the client and used to implement a scanning function;
[0009] The scanner is controlled to scan the object to be scanned according to the communication connection, and a scanning result obtained by the scanner from scanning the object to be scanned is obtained.
[0010] In some embodiments, building a communication connection between a JavaScript program and the scan compatibility driver according to the method library and the scan application includes:
[0011] Deploy the scanning library of the scanning compatibility driver in the scanning application, and obtain an application program interface that provides services externally based on the scanning library, the scanning application, and the scanning compatibility driver package;
[0012] A communication connection between the JavaScript program and the scan compatibility driver is established according to the application program interface.
[0013] In some embodiments, the application program interface for providing external services is obtained by encapsulating the scanning library, the scanning application, and the scanning compatibility driver, including:
[0014] Acquire the interaction information between the scanning application and the scanning compatibility driver, and acquire the scanning attribute information of the scanning compatibility driver;
[0015] The application program interface is obtained according to the interaction information, the scanning attribute information, and the scanning library encapsulation.
[0016] In some embodiments, establishing a communication connection between the JavaScript program and the scan compatibility driver according to the application program interface includes:
[0017] Establishing a connection between the scanning application and the method library according to the application program interface;
[0018] The JavaScript program is used to control the communication between the scanning application and the scanning compatibility driver.
[0019] In some embodiments, establishing a connection between the scanning application and the method library according to the application program interface includes:
[0020] Building a software development kit in the JavaScript program, and building an http connection between the scanning application and the method library according to the software development kit;
[0021] And, using the JavaScript program to control the communication between the scanning application and the scanning compatibility driver, including:
[0022] The JavaScript program is used to call the object to be scanned to control the communication between the scanning application and the scanning compatibility driver.
[0023] In some embodiments, controlling the scanner to scan the object to be scanned according to the communication connection includes:
[0024] Acquiring a scanning source including the scanner according to the communication connection;
[0025] In response to the selection operation of the scanner, the scanning configuration parameters corresponding to the scanner are called, and the scanner is controlled to scan the object to be scanned according to the scanning configuration parameters.
[0026] In a second aspect, an embodiment of the present disclosure provides a scanning device, which is applied to a client, wherein a scanning application and a scanning compatibility driver program are running in the client, and the device includes:
[0027] an adding unit, configured to add a method library to the system to be scanned in the client, wherein the method library is determined based on the scanning compatibility driver program;
[0028] A construction unit, configured to construct a communication connection between a JavaScript program and the scanning compatibility driver according to the method library and the scanning application, wherein the JavaScript program is a programming language program that runs on the client and is used to implement a scanning function;
[0029] A control unit, configured to control the scanner to scan an object to be scanned according to the communication connection;
[0030] The acquisition unit is used to acquire a scanning result obtained by the scanner scanning the object to be scanned.
[0031] In some embodiments, the building block comprises:
[0032] A deployment subunit, configured to deploy a scan library of the scan compatibility driver in the scan application;
[0033] A packaging subunit, used for packaging an application program interface that provides external services according to the scanning library, the scanning application program, and the scanning compatibility driver program;
[0034] A construction subunit is used to construct a communication connection between the JavaScript program and the scan compatibility driver according to the application program interface.
[0035] In some embodiments, the packaging subunit includes:
[0036] an acquisition module, configured to acquire interaction information between the scanning application and the scanning compatibility driver, and acquire scanning attribute information of the scanning compatibility driver;
[0037] The encapsulation module is used to encapsulate the application program interface according to the interaction information, the scanning attribute information, and the scanning library.
[0038] In some embodiments, the construction subunit comprises:
[0039] An establishing module, used for establishing a connection between the scanning application and the method library according to the application program interface;
[0040] A control module is used to control the communication between the scanning application and the scanning compatibility driver program using the JavaScript program.
[0041] In some embodiments, the establishment module is used to build a software development kit in the JavaScript program, and to build an http connection between the scanning application and the method library according to the software development kit;
[0042] Furthermore, the control module is used to use the JavaScript program to call the object to be scanned to control the communication between the scanning application and the scanning compatibility driver.
[0043] In some embodiments, the control unit comprises:
[0044] an acquisition subunit, configured to acquire a scanning source including the scanner according to the communication connection;
[0045] A calling subunit, configured to call scanning configuration parameters corresponding to the scanner in response to a selection operation on the scanner;
[0046] The control subunit is used to control the scanner to scan the object to be scanned according to the scanning configuration parameters.
[0047] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a memory, a processor;
[0048] Memory; Memory for storing instructions executable by the processor;
[0049] The processor is configured to execute the method as described in the first aspect.
[0050] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.
[0051] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.
[0052] In a sixth aspect, an embodiment of the present disclosure provides a scanning system, including an electronic device and a scanner, wherein the electronic device includes the scanning device as described in the second aspect, and the scanning device runs on a client.
[0053] The scanning method, device and system provided by the embodiments of the present disclosure are applied to a client, and a scanning application and a scanning compatibility driver are running in the client. The method comprises: adding a method library in the system to be scanned of the client, wherein the method library is determined based on the scanning compatibility driver, and building a communication connection between a JavaScript program and the scanning compatibility driver according to the method library and the scanning application, wherein the JavaScript program is a programming language program running on the client and used to implement the scanning function, and controlling the scanner to scan the object to be scanned according to the communication connection, and obtaining the scanning result obtained by the scanner from scanning the object to be scanned, thereby avoiding the disadvantages of the complexity of scanning in related technologies, improving the efficiency of scanning, and avoiding the disadvantages of limited application scenarios, improving the universal applicability and compatibility of scanning, and improving the technical effect of improving the security and reliability of scanning. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0055] Figure 1 A schematic diagram of an application scenario to which the scanning method according to an embodiment of the present disclosure can be applied;
[0056] Figure 2 is a schematic diagram of a scanning method according to an embodiment of the present disclosure;
[0057] Figure 3 is a schematic diagram of a scanning method according to another embodiment of the present disclosure;
[0058] Figure 4 is a schematic diagram of a scanning device according to an embodiment of the present disclosure;
[0059] Figure 5 is a schematic diagram of a scanning device according to another embodiment of the present disclosure;
[0060] Figure 6 A block diagram of an electronic device according to the scanning method disclosed herein.
[0061] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0062] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0063] The scanning method of this embodiment can be applied to Figure 1 The application scenario shown in Figure 1 In the application scenario shown:
[0064] Communication can be established between the desktop computer 101 and the scanner 102 , and the user can control the scanner 102 to scan the object to be scanned (such as a voucher, etc.) through the desktop computer 101 to obtain a scanning result (such as an electronic version of the scanned voucher).
[0065] It should be understood that Figure 1 It is only used to exemplarily illustrate the application scenarios to which the scanning method of this embodiment can be applied, and should not be understood as a limitation on the application scenarios of the scanning method of this embodiment.
[0066] For example, in other embodiments, the desktop computer may also be a notebook computer, or a user device such as a mobile phone.
[0067] In the related art, scanning can be achieved in the following ways:
[0068] Method 1: The desktop computer 101 can store the scan result in the local disk of the desktop computer 101, and then transmit the scan result to the server (which can be a local server or a cloud server) through the local disk directory, such as entering the world wide web (web, also known as the World Wide Web) business system through the desktop computer 101, and finding the local disk directory through the control set in the web business system (such as the "upload button") to upload the scan result to the server.
[0069] Method 2: The desktop computer 101 uses the plug-in program (such as ActiveX control) of the IE browser to link the scanner 102, scans the object to be scanned to a specific directory (pre-configured directory) of the local disk, and then uses the file system object (File System Object, FSO) of ActiveX to find the scan result of the object to be scanned in the specific directory, and converts its format, such as converting it into a format based on 64 printable characters to represent binary data (Base64) and uploading it to the server.
[0070] However, the scanning process of the above method 1 is complicated. First, the scanning must be done separately from the web business system, and then the scanning must be done in the business process of the web business system. This is undoubtedly inefficient.
[0071] Using the above method 2 to implement scanning, because ActiveX is a unique object of the IE browser, the scanning business can only be operated in the IE browser, and because the current mainstream web framework runs better on browsers with Chrome and Firefox as the core, limiting the business functions to the IE browser will lead to a poor user experience. At the same time, the setting of enabling the ActiveX control of the IE browser is cumbersome and will also reduce the security level of the IE browser.
[0072] In order to avoid at least one of the above-mentioned technical problems, the inventors of the present disclosure, through creative labor, have obtained the inventive concept of the present disclosure: a scanning application (Scan App) and a scanning compatibility driver (Technology Without An Interesting Name, TWAIN) are respectively installed on the client, and a connection is established between the JavaScript program and the scanning application, so as to control the communication between the scanning application and the scanning compatibility driver through the JavaScript program, thereby realizing scanning.
[0073] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0074] See also Figure 2 , Figure 2 The figure is a schematic diagram of a scanning method according to an embodiment of the present disclosure, wherein the scanning method is applied to a client, and a scanning application and a scanning compatibility driver are running in the client.
[0075] like Figure 2 As shown, the method includes:
[0076] S201: Add a method library (scanner.js) to the client's system to be scanned.
[0077] The method library is determined based on the scanning compatibility driver, and includes: scanning methods, methods for setting scanning parameters, methods for displaying scanning results, methods for communication, and the like.
[0078] Exemplarily, the execution subject of this embodiment may be a scanning device, which may be a client, specifically a computer, a server, a terminal device, a processor, a chip, etc., which is not limited in this embodiment.
[0079] For example, when the scanning method of this embodiment is applied to Figure 1 In the application scenario shown in FIG. 1 , the scanning device may be as follows: Figure 1 Desktop computer shown.
[0080] From the above description, it can be known that the system to be scanned may be a web service system.
[0081] S202: Building a communication connection between the JavaScript program and the scan compatibility driver program based on the method library and the scan application.
[0082] The JavaScript program is a programming language program that runs on the client and is used to implement the scanning function.
[0083] The TWAIN protocol is a communication standard between software and image input devices such as digital cameras and scanners.
[0084] In the related art, a scanner is an electronic device (such as Figure 1 The desktop computer shown in the figure, etc.) directly uses JavaScript program to access and call the scan compatibility driver. Due to the security factors of the script itself, it is not allowed to directly access local resources. In this embodiment, a communication connection is established between the JavaScript program and the scan compatibility driver so that the scanner can be indirectly called based on the JavaScript program to achieve scanning.
[0085] That is to say, in this embodiment, by building a communication connection between the JavaScript program and the scan compatibility driver, the operation steps are simplified, and scanning and uploading are directly performed in the web business system. At the same time, it is no longer limited to the IE browser and its cumbersome setting operations, and it also avoids lowering the security level of the IE browser. While improving the compatibility of the IE browser, it also makes the operation of business personnel simpler and the business process more integrated.
[0086] S203: Controlling the scanner to scan the object to be scanned according to the communication connection, and obtaining a scanning result obtained by the scanner from scanning the object to be scanned.
[0087] Based on the above analysis, it can be known that an embodiment of the present disclosure provides a scanning method, which is applied to a client, and a scanning application and a scanning compatibility driver are running in the client. The method includes: adding a method library in the system to be scanned of the client, wherein the method library is determined based on the scanning compatibility driver, and building a communication connection between a JavaScript program and the scanning compatibility driver according to the method library and the scanning application, wherein the JavaScript program is a programming language program running on the client and used to implement the scanning function, and controls the scanner to scan the object to be scanned according to the communication connection, and obtains the scanning result obtained by the scanner when scanning the object to be scanned. In this embodiment, the following is introduced: running a scanning application and a scanning compatibility driver in the client, and building a communication connection between the JavaScript program and the scanning compatibility driver based on the scanning library and the scanning application by adding a scanning library, so as to "build a bridge" between the JavaScript program and the scanning compatibility driver, thereby realizing indirect calling of the scanner based on the JavaScript program, and then realizing the technical feature of scanning, avoiding the disadvantages of the complexity of scanning in related technologies, improving the efficiency of scanning, and avoiding the disadvantages of limited application scenarios, improving the universal applicability and compatibility of scanning, and improving the technical effect of security and reliability of scanning.
[0088] See also Figure 3 , Figure 3 is a schematic diagram of a scanning method according to another embodiment of the present disclosure.
[0089] like Figure 3 As shown, the method includes:
[0090] S301: Install a scanning application in the client.
[0091] It can be understood that regarding the technical features of this embodiment that are the same as those of the above-mentioned embodiments, this embodiment will not be repeated.
[0092] Exemplarily, this step can be understood as: in response to the user's click (such as double-clicking) operation on the scanning application icon (ScanApp.exe) and corresponding guidance operations (such as guidance operations from "Next" to "Finish"), completing the installation of the scanning application.
[0093] In other embodiments, a small program (Java applet) can be used to replace the scanning application.
[0094] S302: Install a scan compatibility driver in the client.
[0095] For example, in combination with Figure 1The application scenario shown is to start a desktop computer, which can specifically be to start the Windows operating system of the desktop computer, insert the driver CD of the scanning compatibility driver into the CD drive of the desktop computer, and the installation program will automatically start and output the corresponding configuration items on the output interface of the desktop computer. In response to the user's selection operation (such as a single click operation) for the setting item, the installation of the scanning compatibility driver in the client is completed.
[0096] S303: Add a method library to the system to be scanned on the client.
[0097] Among them, the method library is determined based on scanning the compatibility driver.
[0098] Combined with the above analysis, it can be known that the system to be scanned can be a web system. In this embodiment, in order to enable readers to have a deeper understanding of the implementation principle of the present disclosure, this embodiment takes the web system as the system to be scanned as an example to exemplarily illustrate the implementation principle of the present disclosure.
[0099] In this embodiment, by introducing a method library into the web system of the client, the JavaScript program can obtain the object to be scanned, thereby realizing the scanning of the object to be scanned.
[0100] There are different ways to add method libraries to a web system, for example:
[0101] Method 1: Download the method library on the client and add the method library to the web system through the entry text of the system to be scanned.
[0102] For example, in combination with Figure 1 In the application scenario shown, the method library can be downloaded in a desktop computer, and the web system includes an entry text, and the method library is introduced into the web system through the entry text.
[0103] For example, if the entry file is index.html, then the entry file index.html starts with <script src="scanner.js">的方式将方法库引入至web系统中。
[0104] 方法2:基于JavaScript程序的运行环境内置的软件包管理器(npm,node packagemanagement)在客户端安装方法库,并将方法库引入至待扫描系统。
[0105] 例如,以import"scanner.js"的方式将方法库引入至系统中。
[0106] S304:在扫描应用程序中部署扫描兼容性驱动程序的扫描库,并根据扫描库、扫描应用程序、以及扫描兼容性驱动程序封装得到对外提供服务的应用程序接口。
[0107] 应用程序接口(Application Programming Interface,API)是指,操作系统或应用软件留给程序的调用接口,程序通过调用应用程序接口从而使操作系统或应用软件去执行一些命令和动作。
[0108] 其中,本实施例对操作系统不做限定,例如,操作系统可以为Windows。且本实施例对浏览器也不做限定,例如,可以支持Chrome浏览器、Firefox浏览器、Edge浏览器、IE浏览器、360浏览器、以及百度浏览器等,此处不再一一列举。
[0109] 在一些实施例中,S304可以包括如下步骤:
[0110] 第一步骤:获取根据扫描应用程序与扫描兼容性驱动程序之间的交互信息,并获取扫描兼容性驱动程序的扫描属性信息。
[0111] 第二步骤:根据交互信息、扫描属性信息、以及扫描库封装得到应用程序接口。
[0112] 例如,在客户端安装了扫描应用程序之后,该扫描应用程序可自动静默部署基于扫描兼容性驱动程序的扫描库(该扫描库中包括与扫描相关的信息),并对扫描兼容性驱动程序底层的交互行为(即交互信息)、属性设置(即扫描属性信息)进行封装,从而得到应用程序接口。
[0113] 其中,应用程序接口的数量可以为一个,也可以为多个,本实施例不做限定。应用程序接口可以通过引入方法库暴露的待扫描对象进行调用,从而实现扫描。
[0114] 在本实施例中,通过结合交互信息、扫描属性信息、以及扫描库封装得到应用程序接口,可以使得应用程序接口具有较高的调用性能,从而实现扫描的可靠性的技术效果。
[0115] S305:根据应用程序接口构建JavaScript程序与扫描兼容性驱动程序之间的通信连接。
[0116] 值得说明的是,在本实施例中,通过在扫描应用程序中部署扫描兼容性驱动程序的扫描库,并封装得到应用程序接口,以基于该应用程序接口作为JavaScript程序与扫描兼容性驱动程序之间的通信的"桥梁”,从而实现扫描的便捷性,提高扫描的效率的技术效果。
[0117] 在一些实施例中,S305可以包括如下步骤:
[0118] 第一步骤:根据应用程序接口建立扫描应用程序和方法库之间的连接。
[0119] 示例性的,在JavaScript程序中构建软件开发工具包,并根据软件开发工具包构建扫描应用程序和方法库之间的http连接。
[0120] 软件开发工具包(Software Development Kit,SDK),一般是软件工程师特定的软件包、软件框架、硬件平台、操作系统等建立应用软件时的开发工具集合。本公开实施例中的软件开发工具包是指一个虚拟的程序包,其中包含一份做好的软件功能,其暴露的一些接口可以和外界联通。
[0121] 第二步骤:采用JavaScript程序控制扫描应用程序与扫描兼容性驱动程序之间的通信。
[0122] 示例性的,采用JavaScript程序调用待扫描对象,以控制扫描应用程序与扫描兼容性驱动程序之间的通信。
[0123] 例如,当首次访问集成了扫描控件的web网页时,在JavaScript程序中构建软件开发工具包的方法将自动初始化,即以http方式与扫描应用程序建立连接,连接成功后,就可以通过JavaScript程序调用待扫描(scanner)对象的方法控制扫描应用程序与扫描兼容性驱动程序之间的通信了,并可以调用应用程序接口来获取传输图像的数据,即传输待扫描对象的图像的数据。
[0124] 在本实施例中,通过构建软件开发工具包,以构建http连接,从而实现基于JavaScript程序控制扫描应用程序与扫描兼容性驱动程序之间的通信,进而实现扫描,以提高扫描效率,避免繁琐步骤的技术效果。
[0125] S306:根据通信连接控制扫描仪对待扫描对象进行扫描,并获取扫描仪对待扫描对象进行扫描得到的扫描结果。
[0126] 在一些实施例中,根据通信连接控制扫描仪对待扫描对象进行扫描,可以包括如下步骤:
[0127] 第一步骤:根据通信连接获取包括扫描仪的扫描源。
[0128] 第二步骤:响应于对扫描仪的选中操作,调用与扫描仪对应的扫描配置参数,并根据扫描配置参数控制扫描仪对待扫描对象进行扫描。
[0129] 例如,在扫描的准备阶段:列出扫描源,并确认扫描初始化工作是否成功,若是,则进入扫描阶段。
[0130] 在扫描阶段:传递扫描配置项(即扫描配置参数,如被用户选中的用于执行扫描操作的扫描源,又如扫描输出设置,还如扫描数据即扫描结果的存储方式等),并通过扫描配置项执行扫描,当扫描结束后执行回调。
[0131] 在一些实施例中,在扫描结束后,用户可以通过控件"上一步"自定义函数””以获取扫描完成的状态,如果扫描发生错误,则可以通过客户端的输出界面输出提示错误信息。
[0132] 在一些实施例中,在扫描结束后,可以获取扫描结果,在基于预设存储方式的基础上对扫描结果进行格式处理,并对格式处理后的扫描结果进行存储。
[0133] 在一些实施例中,结合上述分析可知,可以设置扫描结果的展示的方式。相应的,可以将扫描结果放入JavaScript程序中的DOM标签中展示,也可以创建DOM标签承载扫描图像器,以便对扫描结果进行展示,本实施例不做限定。
[0134] 在一些实施例中,在扫描结束,得到扫描结果之后,可以将扫描结果上传至与台式电脑通信连接的服务器,以便对扫描结果进行归档。
[0135] 在一些实施例中,用户可以通过浏览器(浏览器的类型不做限定)进入web系统的扫描业务界面,操作相应的按钮控件,完成扫描流程。
[0136] 根据本公开实施例的另一个方面,本公开实施例还提供了一种扫描装置,应用于客户端,所述客户端中运行有扫描应用程序和扫描兼容性驱动程序。
[0137] 请参阅图4,图4为根据本公开一个实施例的扫描装置的示意图。
[0138] 如图4所示,扫描装置400包括:
[0139] 添加单元401,用于在所述客户端的待扫描系统中添加方法库,其中,所述方法库是基于所述扫描兼容性驱动程序确定的。
[0140] 构建单元402,用于根据所述方法库和所述扫描应用程序,构建JavaScript程序与所述扫描兼容性驱动程序之间的通信连接,其中,所述JavaScript程序为运行于所述客户端,且用于实现扫描功能的编程语言程序。
[0141] 控制单元403,用于根据所述通信连接控制所述扫描仪对待扫描对象进行扫描。
[0142] 获取单元404,用于获取所述扫描仪对所述待扫描对象进行扫描得到的扫描结果。
[0143] 请参阅图5,图5为根据本公开另一实施例的扫描装置的示意图。
[0144] 如图5所示,扫描装置500包括:
[0145] 添加单元501,用于在所述客户端的待扫描系统中添加方法库,其中,所述方法库是基于所述扫描兼容性驱动程序确定的。
[0146] 构建单元502,用于根据所述方法库和所述扫描应用程序,构建JavaScript程序与所述扫描兼容性驱动程序之间的通信连接,其中,所述JavaScript程序为运行于所述客户端,且用于实现扫描功能的编程语言程序。
[0147] 结合图5可知,在一些实施例中,构建单元502,包括:
[0148] 部署子单元5021,用于在所述扫描应用程序中部署所述扫描兼容性驱动程序的扫描库。
[0149] 封装子单元5022,用于根据所述扫描库、所述扫描应用程序、以及所述扫描兼容性驱动程序封装得到对外提供服务的应用程序接口。
[0150] 在一些实施例中,封装子单元5022,包括:
[0151] 获取模块,用于获取根据所述扫描应用程序与所述扫描兼容性驱动程序之间的交互信息,并获取所述扫描兼容性驱动程序的扫描属性信息。
[0152] 封装模块,用于根据所述交互信息、所述扫描属性信息、以及所述扫描库封装得到所述应用程序接口。
[0153] 构建子单元5023,用于根据所述应用程序接口构建JavaScript程序与所述扫描兼容性驱动程序之间的通信连接。
[0154] 在一些实施例中,构建子单元5023,包括:
[0155] 建立模块,用于根据所述应用程序接口建立所述扫描应用程序和所述方法库之间的连接;
[0156] 控制模块,用于采用所述JavaScript程序控制所述扫描应用程序与所述扫描兼容性驱动程序之间的通信。
[0157] 在一些实施例中,所述建立模块用于,在所述JavaScript程序中构建软件开发工具包,并根据所述软件开发工具包构建所述扫描应用程序和所述方法库之间的http连接;
[0158] 以及,所述控制模块用于,采用所述JavaScript程序调用所述待扫描对象,以控制所述扫描应用程序与所述扫描兼容性驱动程序之间的通信。
[0159] 控制单元503,用于根据所述通信连接控制所述扫描仪对待扫描对象进行扫描。
[0160] 结合图5可知,在一些实施例中,所述控制单元503,包括:
[0161] 获取子单元5031,用于根据所述通信连接获取包括所述扫描仪的扫描源。
[0162] 调用子单元5032,用于响应于对所述扫描仪的选中操作,调用与所述扫描仪对应的扫描配置参数。
[0163] 控制子单元5033,用于根据所述扫描配置参数控制所述扫描仪对待扫描对象进行扫描。
[0164] 获取单元504,用于获取所述扫描仪对所述待扫描对象进行扫描得到的扫描结果。
[0165] 根据本公开实施例的另一个方面,本公开实施例还提供了一种扫描系统,该系统包括:电子设备和和扫描仪,其中,电子设备中包括如上任一实施例所述的扫描装置,如包括图4或图5所示的扫描装置,该扫描装置运行于电子设备的客户端。
[0166] 关于本实施例的扫描系统的实现原理,可以参见上述实施例,此处不再赘述。
[0167] 根据本公开的实施例,本公开还提供了一种电子设备和一种可读存储介质。
[0168] 根据本公开的实施例,本公开还提供了一种计算机程序产品,程序产品包括:计算机程序,计算机程序存储在可读存储介质中,电子设备的至少一个处理器可以从可读存储介质读取计算机程序,至少一个处理器执行计算机程序使得电子设备执行上述任一实施例提供的方案。
[0169] 如图6所示,是根据本公开实施例的扫描方法的电子设备的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和 / 或者要求的本公开的实现。
[0170] 如图6所示,该电子设备包括:一个或多个处理器601、存储器602,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入 / 输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和 / 或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图6中以一个处理器601为例。
[0171] 存储器602即为本公开所提供的非瞬时计算机可读存储介质。其中,所述存储器存储有可由至少一个处理器执行的指令,以使所述至少一个处理器执行本公开所提供的扫描方法。本公开的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本公开所提供的扫描方法。
[0172] 存储器602作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本公开实施例中的扫描方法对应的程序指令 / 模块。处理器601通过运行存储在存储器602中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的扫描方法。
[0173] 存储器602可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据扫描方法的电子设备的使用所创建的数据等。此外,存储器602可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器602可选包括相对于处理器601远程设置的存储器,这些远程存储器可以通过网络连接至扫描方法的电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
[0174] 扫描方法的电子设备还可以包括:输入装置603和输出装置604。处理器601、存储器602、输入装置603和输出装置604可以通过总线或者其他方式连接,图6中以通过总线连接为例。
[0175] 输入装置603可接收输入的数字或字符信息,以及产生与扫描方法的电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置604可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。该显示设备可以包括但不限于,液晶显示器(LCD)、发光二极管(LED)显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。
[0176] 此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、专用ASIC(专用集成电路)、计算机硬件、固件、软件、和 / 或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和 / 或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。
[0177] 这些计算程序(也称作程序、软件、软件应用、或者代码)包括可编程处理器的机器指令,并且可以利用高级过程和 / 或面向对象的编程语言、和 / 或汇编 / 机器语言来实施这些计算程序。如本文使用的,术语"机器可读介质”和"计算机可读介质”指的是用于将机器指令和 / 或数据提供给可编程处理器的任何计算机程序产品、设备、和 / 或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语"机器可读信号”指的是用于将机器指令和 / 或数据提供给可编程处理器的任何信号。
[0178] 为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。
[0179] 可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。
[0180] 计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。
[0181] 本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求书指出。
[0182] 应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求书来限制。< / script>
Claims
1. A scanning method, applied to a client, wherein a scanning application and a scanning compatibility driver are running on the client, the method comprising: Adding a method library in the system to be scanned of the client, wherein the method library is determined based on the scanning compatibility driver; According to the method library and the scanning application, a communication connection is established between a JavaScript program and the scanning compatibility driver, wherein the JavaScript program is a programming language program running on the client and used to implement a scanning function; Controlling the scanner to scan the object to be scanned according to the communication connection, and obtaining a scanning result obtained by the scanner scanning the object to be scanned; According to the method library and the scanning application, a communication connection between the JavaScript program and the scanning compatibility driver is established, including: Deploy the scanning library of the scanning compatibility driver in the scanning application, and obtain an application program interface that provides services externally based on the scanning library, the scanning application, and the scanning compatibility driver package; Establishing a connection between the scanning application and the method library according to the application program interface; The JavaScript program is used to control the communication between the scanning application and the scanning compatibility driver.
2. The method according to claim 1, wherein: The application program interface for providing external services is obtained by encapsulating the scanning library, the scanning application program, and the scanning compatibility driver program, including: Acquire the interaction information between the scanning application and the scanning compatibility driver, and acquire the scanning attribute information of the scanning compatibility driver; The application program interface is obtained according to the interaction information, the scanning attribute information, and the scanning library encapsulation.
3. The method according to claim 1, wherein: Establishing a connection between the scanning application and the method library according to the application program interface includes: Building a software development kit in the JavaScript program, and building an http connection between the scanning application and the method library according to the software development kit; And, using the JavaScript program to control the communication between the scanning application and the scanning compatibility driver, including: The JavaScript program is used to call the object to be scanned to control the communication between the scanning application and the scanning compatibility driver.
4. The method according to any one of claims 1 to 3, wherein: Controlling the scanner to scan the object to be scanned according to the communication connection includes: Acquiring a scanning source including the scanner according to the communication connection; In response to the selection operation of the scanner, the scanning configuration parameters corresponding to the scanner are called, and the scanner is controlled to scan the object to be scanned according to the scanning configuration parameters.
5. A scanning device, applied to a client, wherein a scanning application and a scanning compatibility driver program are running in the client, and the device comprises: an adding unit, configured to add a method library to the system to be scanned in the client, wherein the method library is determined based on the scanning compatibility driver program; A construction unit, configured to construct a communication connection between a JavaScript program and the scanning compatibility driver according to the method library and the scanning application, wherein the JavaScript program is a programming language program that runs on the client and is used to implement a scanning function; A control unit, configured to control the scanner to scan the object to be scanned according to the communication connection; An acquisition unit, configured to acquire a scanning result obtained by the scanner scanning the object to be scanned; The construction unit comprises: A deployment subunit, configured to deploy a scan library of the scan compatibility driver in the scan application; A packaging subunit, used for packaging an application program interface that provides external services according to the scanning library, the scanning application program, and the scanning compatibility driver program; A construction subunit, configured to construct a communication connection between the JavaScript program and the scan compatibility driver according to the application program interface; The construction subunit comprises: An establishing module, used for establishing a connection between the scanning application and the method library according to the application program interface; A control module is used to control the communication between the scanning application and the scanning compatibility driver program using the JavaScript program.
6. An electronic device comprising: Memory, processor; Memory; a memory for storing instructions executable by the processor; The processor is configured to execute the method as claimed in any one of claims 1 to 4.
7. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are used to implement the method according to any one of claims 1 to 4 when executed by a processor.
8. A scanning system, comprising an electronic device and a scanner, wherein: The electronic device comprises the scanning device as claimed in claim 5, and the scanning device runs on a client.
Citation Information
Patent Citations
File scanning and automatic unloading method based on Twain protocol
CN103179216A
Image acquisition device virtualization for remote computing
US11165888B1