Equipment driving method and device and electronic equipment

Through the mapping relationship between the functional class module and the functional submodule of the client application, the device category is identified and the corresponding terminal devices are driven, which solves the problem of inconsistent hardware device interface standards, and realizes the driver calls of edge devices and the satisfaction of user needs.

CN119536850APending Publication Date: 2025-02-28SHANGHAI GEWU ZHIYUAN NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311102898.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-29
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In the prior art, the interface standards of hardware devices are inconsistent, resulting in the inability to adapt to the upper-level functions of the network system on cloud warehouses or cloud quality inspection platforms, the inability to drive edge hardware devices, and the inability to meet user needs.

Method used

Through the client application, the mapping relationship between the functional class module and the functional submodule is used to identify the device category and drive the corresponding terminal device. The client receives call parameters, including device identification, device category and driver instructions, searches for the target functional submodule through the host process and function modules, and finally sends driver instructions to the device by the functional submodule.

Benefits of technology

It realizes unified driving of different hardware devices, solves the device compatibility problem, meets the user's call needs in cloud warehouses or cloud quality inspection agencies, and realizes driver calls to edge devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536850A_ABST
    Figure CN119536850A_ABST
Patent Text Reader

Abstract

The invention discloses an equipment driving method and device and electronic equipment, the equipment driving method and device are applied to a client side, the equipment driving device comprises a function class module, the function class module comprises at least one function sub-module, the function class module is used for identifying the equipment class, the function sub-module is used for driving specific terminal equipment, and the method comprises the steps that calling parameters are received, the calling parameters comprise a device identifier, a device category and a driving instruction; searching a target function class module matched with the equipment class in the at least one function class module according to the equipment class and a preset first mapping relationship, searching a target function sub-module in the at least one function sub-module according to the equipment identifier and a second mapping relationship by utilizing the target function class module, and sending the target function sub-module to the equipment class module; and sending a driving instruction to the target equipment through the target function sub-module to drive the target equipment to execute a task corresponding to the driving instruction. According to the method, the target terminal equipment is called, the equipment compatibility problem is solved, and the equipment calling requirement of a user in a cloud warehouse or a cloud quality inspection mechanism is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of driving technology, and in particular to a device driving method, a device and an electronic device. Background Art

[0002] In network application scenarios such as cloud warehouses and cloud quality inspection, it is necessary to monitor the logistics of warehouses in real time through the network, or to display the quality, appearance, and appearance of items. Therefore, the hardware devices that need to be driven have also become rich and diverse. For example, the picture display requires cameras or lens modules to take pictures or record, and the weight of the displayed items requires equipment such as balances or electronic scales.

[0003] At present, when various hardware devices are connected, the interface standards are inconsistent and the parameters of the hardware devices are incompatible, resulting in the hardware devices in cloud warehouses and cloud quality inspection agencies being unable to adapt to the upper-level functions of the network system, and even unable to drive edge hardware devices, and unable to meet the user needs of cloud warehouses and cloud quality inspections. Summary of the invention

[0004] In order to solve the technical problems of inconsistent interface standards of different devices or inability to access existing cloud warehouses or cloud quality inspection platforms, the present invention provides a device driving method, apparatus and electronic device. Specifically, the following technical solutions are disclosed:

[0005] In a first aspect, an embodiment of the present invention provides a device driving method, which uses a client, the client includes at least one function class module, each of the function class modules includes at least one function sub-module, and each function class module is used to identify a device category of a device, each of the function sub-module is used to drive a terminal device under its device category, and each of the function sub-modules drives a different terminal device, and the device driving method includes:

[0006] Receive calling parameters, wherein the calling parameters include: a device identification, a device category and a driving instruction of a target device;

[0007] According to the device category and a preset first mapping relationship, searching for a target function class module matching the first device category in at least one function class module, wherein the first mapping relationship is a relationship between the device category driven by the client and each function class module;

[0008] Using the target function class module, searching for the target function submodule in at least one function submodule according to the device identifier and the second mapping relationship, wherein the second mapping relationship is the relationship between each function submodule under the target function class module and different device identifiers;

[0009] The target function submodule sends a driving instruction to the target device, and the driving instruction is used to drive the target device to execute the task corresponding to the driving instruction.

[0010] In combination with the first aspect, in a possible implementation, searching for a target functional sub-module in at least one functional sub-module based on the device identification and the second mapping relationship includes: searching for a functional sub-module that matches the device identification in at least one functional sub-module based on the device identification as the target functional sub-module.

[0011] In combination with the first aspect, in another possible implementation method, the client also includes a host process, and before receiving the call parameters sent by the host process, it also includes: starting the host process; scanning the program directory of the host process to obtain at least one functional class module; loading at least one functional class module according to the interface specification, and establishing a first mapping relationship after loading.

[0012] Optionally, the interface specification is the websocket protocol interface specification.

[0013] In combination with the first aspect, in another possible implementation method, the client also includes a core daemon process, which starts the host process, including: determining whether there is a process with the same process name as the host process in the currently running process; if so, closing the running host process, finding the host process file, and starting the host process file; if not, finding and starting the host process file.

[0014] In combination with the first aspect, in yet another possible implementation manner, the method further includes: determining a functional sub-module in each of the functional class modules, and loading each functional sub-module.

[0015] Furthermore, the functional sub-modules in each of the functional class modules are determined, including: polling each functional sub-module, calling the export function, and obtaining the virtual function returned after the export function is called; judging whether the content in the virtual function is the same as the category of the current functional class module; if the same, determining that the current functional sub-module is a functional sub-module in the current functional class module.

[0016] In combination with the first aspect, in yet another possible implementation, the at least one functional module includes a camera module, a serial port module, and a software management module;

[0017] Sending a driving instruction to a target device through a target function submodule to drive the target device to execute a task corresponding to the driving instruction includes:

[0018] When the target function module is a camera module, a first driving instruction is sent to the camera through the target function submodule, and the first driving instruction is used to drive the camera to take a photo or record a video;

[0019] When the target functional module is a serial port module, a second driving instruction is sent to the balance through the target functional submodule, and the first driving instruction is used to drive the balance to perform a measurement operation;

[0020] When the target function module is a software management module, a third driving instruction is sent to the operating system through the target function submodule, and the third driving instruction is used to start the management function of the software.

[0021] In combination with the first aspect, in another possible implementation, the method also includes: after starting the core daemon process, obtaining configuration information from the cloud; judging whether it is necessary to update the at least one functional class module and / or the at least one functional sub-module on the client based on the configuration information, and if so, using the configuration information to update the at least one functional class module and / or the at least one functional sub-module.

[0022] In a second aspect, an embodiment of the present invention provides a device driver, the device comprising:

[0023] A receiving unit, used for receiving calling parameters, wherein the calling parameters include: a device identification, a device category and a driving instruction of a target device;

[0024] A first search unit, configured to search for a target functional class module matching the device category in the at least one functional class module according to the device category and a preset first mapping relationship, wherein the first mapping relationship is a relationship between the device category supported by the apparatus and each functional class module;

[0025] A second search unit is used to use the target function class module to search for a target function submodule in the at least one function submodule according to the device identifier and the second mapping relationship, wherein the second mapping relationship is a relationship between each function submodule under the target function submodule and different device identifiers;

[0026] A sending unit is used to send the driving instruction to the target device through the target functional submodule to drive the target device to execute the task corresponding to the driving instruction.

[0027] In a third aspect, the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected, the memory storing computer program instructions, and the processor executing the device driving method in the above-mentioned first aspect or any corresponding implementation method thereof by executing the computer program instructions.

[0028] In addition, the present invention also provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the device driving method in the above-mentioned first aspect or any corresponding implementation method thereof.

[0029] The device driving method, device and electronic device provided by the present invention provide access standards to the outside through the host process when the device is connected, and send the calling parameters input by the user, such as the device name, device category and driving instructions, to the target function class module to be driven. The target function class module then finds the target function submodule of the specific device that can be driven according to these calling parameters, and finally the target function submodule sends the driving instructions to the terminal device connected to it to realize the call of the target terminal device. This method solves the device compatibility problem, realizes the driver call of the edge device, and meets the calling needs of users in the cloud warehouse or cloud quality inspection agency. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0031] Figure 1 It is an architecture diagram of a cloud quality inspection service scenario provided by an embodiment of the present invention;

[0032] Figure 2 This is a driver structure block diagram of a client provided by an embodiment of the present invention;

[0033] Figure 3 is a flow chart of a device driving method provided by an embodiment of the present invention;

[0034] Figure 4 is a signaling flow chart of a device driving method provided by an embodiment of the present invention;

[0035] Figure 5 This is a flow chart of loading various functional modules provided by an embodiment of the present invention;

[0036] Figure 6 is another flow chart for loading various functional modules provided by an embodiment of the present invention;

[0037] Figure 7 is a structural block diagram of a device driving apparatus provided by an embodiment of the present invention;

[0038] Figure 8 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0040] First, the application scenarios of the technical solutions provided by the embodiments of the present invention are introduced.

[0041] The technical solution of the embodiment of the present invention is applied to a network service system of a cloud warehouse or cloud quality inspection agency. The network service system can provide services such as live display, weighing, quality inspection, warehousing and logistics monitoring for certain items to meet the user's cloud online real-time monitoring and display needs.

[0042] See also Figure 1 , is an architecture diagram of a cloud quality inspection service scenario provided by an embodiment of the present invention, the scenario includes: a client 10, a camera 20, a scale 30 and a keyboard 40. The client 10 is connected to other devices via USB cables, for example, the client 10 is connected to the camera 20 via USB cable 1, to the scale 30 via USB cable 2, and to the keyboard 40 via USB cable 3.

[0043] The client 10 may be a WMS (Warehouse Management System) or a terminal device. Specifically, the terminal device includes but is not limited to a smart terminal, a laptop, a tablet computer, a personal computer (PC), a personal digital assistant (PDA), a foldable terminal, a user equipment (UE), etc. The embodiments of the present application do not limit the specific device form of the terminal device. In addition, the above-mentioned various terminal devices are equipped with Android, Windows system, etc.

[0044] The camera 20 has a shooting function, and can shoot, record, etc. the items to be displayed or monitored. The camera 20 includes but is not limited to a camera, a lens module, or a camera module. The balance 30 has a weighing function, and can be used to measure the weight of an object. Optionally, the balance 30 can be a small electronic scale, a weight scale, etc. The keyboard 40 is an input device, which is connected to the terminal device 10 via a USB cable 3 and is used to input instructions to the terminal device 10.

[0045] It should be noted that the camera 20 , the scale 30 and the keyboard 40 mentioned above can be collectively referred to as another terminal device relative to the client 10 .

[0046] It should be understood that the number of each device in the above system can be one or more, such as multiple computers, notebooks, two or more cameras, balances, etc., and this embodiment does not limit this. In addition, the above system or platform architecture may also include other hardware devices, such as display screens, smart screens, speakers, microphones, etc.

[0047] Due to the incompatibility of interface functions between the client 10 and other hardware devices in the above platform architecture, or different hardware devices, such as cameras, balance devices, etc., have different hardware access standards, these terminal devices cannot quickly access the network service system / platform, resulting in the inability to drive various hardware devices to complete corresponding functions.

[0048] In order to solve this technical problem, the technical solution provided in this embodiment takes the client as the starting point and provides functions such as automatic software upgrade, automatic daemon sub-process, pluggable plug-in interface, etc. for different hardware devices. These functions are abstracted into different devices and a unified interface is provided to the outside world, thereby improving the compatibility between different hardware devices, meeting user needs, and improving user experience.

[0049] The technical solution of the embodiment of the present invention is described in detail below.

[0050] See also Figure 2 , is a driver structure block diagram of a client provided by this embodiment of the invention. The client is configured with a Windows operating system, including the following functional modules:

[0051] (1) A core daemon process, which is used to perform daemon operations on different processes according to one or more pre-set configuration items.

[0052] The core daemon process is the RunningService.exe process, which is a system process defined by the Windows operating system and is described as a service and controller application. Its main function is to run and end system services.

[0053] (2) A host process is used to load at least one functional module of the lower layer, automatically establish a WebSocket server, and provide an interface in a unified format to the outside world.

[0054] Among them, the WebSocket server is a TCP application that is responsible for listening to any port on the server that follows a specific protocol. Since the host process can provide a unified format interface to enable the plugging and unplugging of different hardware devices / plug-ins, the process is also called a pluggable plug-in host process.

[0055] Optionally, the pluggable plug-in host process is DeviceZombie.exe.

[0056] (3) At least one functional class module, each of which is responsible for identifying the device category of a device, and is connected to one or more functional sub-modules and calls one or more functional sub-modules. In addition, each functional class module can also provide a unified interface to the host process.

[0057] like Figure 2 As shown, at least one functional class module of a client includes: a camera class module (CameraHome.dll), a serial port class module (comhome.dll), a software management class module (SoftManager Home.dll) and a computer environment monitoring class module (HardwareMonitor_Home.dll), etc.

[0058] Among them, the camera module is used to provide and connect to the camera submodule, such as Figure 2 In the , it is responsible for calling two camera function submodules, namely: Camera submodule 1 (CameraX.dll) and Camera submodule 2 (USB Camera.dll). These two camera submodules are responsible for driving camera devices of different brands / models / names. For example, Camera submodule 1 is responsible for driving Camera 1, such as a webcam; Camera submodule 2 is responsible for driving Camera 2, such as a SLR camera, etc.

[0059] (4) At least one functional submodule, used to drive a specific terminal device and control the terminal device to perform corresponding actions according to the caller's instructions.

[0060] The terminal device includes the camera 20, the scale 30 and the keyboard 40, etc., and may also include other devices or unit modules, such as a software module in an operating system, etc., which is not limited in this embodiment.

[0061] In such Figure 2 In the example of , the at least one functional sub-module includes: a camera sub-module, a serial port sub-module, a software management sub-module, and a computer environment monitoring sub-module, etc.

[0062] Among them, the serial port class module is used to connect to the serial port submodule (Comhome.dll), and the serial port submodule (Comhome.dll) can directly drive the balance device; the software management class module is used to call the software management submodule (SoftManager.dll), and the software management submodule (SoftManager.dll) can be a functional module on the computer for managing software, such as a software master, a management software, etc. The computer environment monitoring class module is used to call the computer environment detection submodule (HardWare Monitor_Home.dll). Optionally, the computer environment detection submodule includes but is not limited to some security guards, or some scanning software, etc.

[0063] Optionally, the camera submodule 1 is used to dock with camera 1, and the camera submodule 2 is used to dock with camera 2. The at least one functional module docks with one or more multifunctional submodules, so that each submodule executes the user's (or caller's) instructions and controls the hardware to complete corresponding operations.

[0064] (4) An upgrade process, which is used to automatically detect update information and upgrade files / software in the list. Optionally, a client upgrade process is clientUpgrade Program.exe.

[0065] In addition, the above Figure 2 The driver structure framework shown may also include other guarded process modules, which may be used for other processes in charge of the business layer, and this embodiment does not impose any limitation on this.

[0066] The method provided in this embodiment is described in detail below.

[0067] See also Figure 3 , is a device driving method provided in this embodiment, which can be applied to a client, and the client can be as follows Figure 1 The client 10 shown in the figure includes a host process, at least one functional module and at least one functional submodule, etc. Specifically, the client structure can refer to the aforementioned Figure 2 The structural framework shown.

[0068] The device driving method comprises the following steps:

[0069] Step S101: receiving calling parameters, wherein the calling parameters include: device identification, device type and driving instructions of the target device.

[0070] Among them, the calling parameters can be generated by a series of instructions entered by the caller / user on the client. For example, the caller (user) needs to call a certain hardware device, such as calling camera 1 to perform a photo operation. In the configured calling parameters, the device identifier of the target device is camera 1, the device category is camera class camera, and the driving instruction can be to drive camera 1 to take a photo of the object in the current picture.

[0071] In addition, the device identification of the target device includes but is not limited to the device name, device ID or device brand, model, etc.

[0072] The device category is used to indicate the device category to which the target device belongs. For example, for camera 1, its device category is camera category; for a balance, its device category is serial port category; and for a certain management software, its device category may be software management category.

[0073] Step S102: searching for a target functional module matching the device category in at least one functional module according to the device category and a preset first mapping relationship.

[0074] The first mapping relationship is the relationship between the device category supported by the client and each functional module. The first mapping relationship can be generated when the system is started and loaded.

[0075] The device categories supported by the client include but are not limited to the aforementioned camera category, serial port category, management software category, and other predefined device categories. Figure 2 The at least one functional class module shown includes a camera class module (Camera Home.dll), a serial port class module (comhome.dll), a software management class module (SoftManagerHome.dll) and a computer environment monitoring class module (HardwareMonitor_Home.dll).

[0076] The first mapping relationship includes at least one of the following relationships:

[0077] The mapping relationship between the camera class module (Camera Home.dll) and the camera;

[0078] The mapping relationship between the serial port class module (comhome.dll) and the balance;

[0079] The mapping relationship between the software management class module (SoftManager Home.dll) and software management;

[0080] The mapping relationship between the computer environment monitoring module (HardwareMonitor_Home.dll) and the environment monitoring software.

[0081] It should be understood that if other terminal devices are also included, such as microphones, speakers and other devices, the first mapping relationship may also include, for example, a mapping relationship between a serial port class module (comhome.dll) and a speaker / microphone.

[0082] The above step S102 specifically includes: if the first device category is camera, then searching the function class module associated with the "camera" category in the aforementioned first mapping relationship is "camera class module (Camera Home.dll)", and then determining that the first function class module is the camera class module (Camera Home.dll).

[0083] Step S103: using the target functional class module, searching for a target functional submodule in the at least one functional submodule according to the device identification and the second mapping relationship.

[0084] The second mapping relationship is the relationship between each functional submodule under the target functional module and different device identifiers. For example, for a camera module, it includes camera submodule 1 and camera submodule 2, wherein camera submodule 1 can drive a camera and camera submodule 2 can drive a SLR camera, then the second mapping relationship includes: camera submodule 1-camera; camera submodule 2-SLR camera.

[0085] Specifically, the target function class module is used to search for a function submodule matching the device identifier in at least one function submodule as the target function submodule.

[0086] For example, the camera class module (Camera Home.dll) searches for a camera submodule whose device name is "Camera 1" in the two camera function subclass modules it includes. After searching, it is determined that the function submodule having a second mapping relationship with Camera 1 is Camera submodule 1, that is, it is determined that the target function submodule is Camera submodule 1.

[0087] In this example, camera submodule 1 is a cameraX.dll module, which can be used to drive cameraX (camera X); camera submodule 2 is a USBCamera.dll module, which can be used to drive USBCamera.

[0088] Step S104: sending a driving instruction to the target device through the target function submodule to drive the target device to execute a task corresponding to the driving instruction.

[0089] The driving instruction can be generated by the above step S101, and transmitted to the target function sub-module through the host process and the target function class module. After receiving the driving instruction, the target function sub-module drives the corresponding device to start and execute the cloud warehouse inspection operation, and returns the operation result to the client.

[0090] Specifically, when the target function module is a camera module, the first driving instruction is sent to the camera through the target function submodule, and the first driving instruction is used to drive the camera to take photos or videos. In this example, the camera submodule 1 drives the camera cameraX to take photos of the objects in the current picture, and transmits the photos back to the client to realize the driving and control of the camera cameraX.

[0091] Alternatively, when the target functional module is a serial port module, a second driving instruction is sent to the balance through the target functional submodule, and the first driving instruction is used to drive the balance to perform a measurement operation.

[0092] Alternatively, when the target functional module is a software management module, a third driving instruction is sent to the operating system through the target functional submodule, and the third driving instruction is used to start the management function of the software.

[0093] The method provided in this embodiment provides access standards to the outside through a unified host process when a device is connected, and sends the calling parameters input by the user, such as the device name, device category and driving instructions, to the target function class module to be driven. The target function class module then finds the target function sub-module of the specific drivable device based on these calling parameters, and finally the target function sub-module sends the driving instructions to the terminal device to which it is connected, so as to realize the call to the target terminal device. This method solves the device compatibility problem, realizes the driver call to the edge device, and meets the calling needs of users in the cloud warehouse or cloud quality inspection agency.

[0094] See also Figure 4 , is a signaling flow chart of a device driving method provided based on the above embodiment, the method comprising:

[0095] After the client is started, the core daemon module (RunningService.exe) starts the host process.

[0096] Step S101: When receiving a click operation from the caller on the client, the custom software (eg, WMS storage client) is used to send the call parameters to the host process through a preset port.

[0097] The specific process refers to step S101 of the aforementioned embodiment, which will not be described again here.

[0098] Step S102-1: The host process receives the call parameter, and searches for the target functional module in the pre-configured first mapping relationship according to the device category in the call parameter. For the specific search process, refer to the description of step S102 in the above embodiment.

[0099] The calling parameters include driving instructions, and the driving instructions are used to drive the target device to perform warehouse inspection operations, such as taking pictures, weighing, scanning monitoring and the like.

[0100] Step S102-2: The host process sends the device identification and driving instructions to the target functional module.

[0101] Step S103: after receiving the target functional class module, the target functional submodule is determined in at least one functional submodule according to the device identification, and there is a second mapping relationship between the target functional submodule and the device identification of the target device.

[0102] For example, the camera class module (camera Home.dll) searches the second mapping relationship for the function submodule camera submodule 1 (camera X.dll) according to the device name camera X. For the specific search process, refer to the description of step S103 in the above embodiment.

[0103] Step S104: the target function class module sends a driving instruction to the target function submodule, wherein the driving instruction includes an action instruction and a device identifier, such as a USB identifier, USB1, and the like.

[0104] Step S105: After receiving the driving instruction, the target functional submodule drives the target device to perform a corresponding operation.

[0105] Step S106: The target function submodule returns the result of the target device execution to the target function class module, and the target function class module returns the execution result to the host process, and finally feeds back to the caller / user, and displays the execution result on the client's display interface, such as taking a photo, measuring the weight with a balance, and monitoring the software operation status after the management software is started.

[0106] Optionally, in some embodiments, before the above step S101, receiving the call parameters sent by the host process, the method also includes: starting the host process; scanning the program directory of the host process to obtain at least one functional class module; loading the at least one functional class module according to the interface specification, and establishing the first mapping relationship after loading.

[0107] The interface specification is a websocket protocol interface specification, under which a websocket server is used to monitor and load at least one functional module.

[0108] See also Figure 5 As shown in the figure, the core daemon process starts the host process. When the core daemon process is installed, it first gets the opportunity to run, registers itself as a service, and runs with SYSTEM privileges. Specifically:

[0109] Step S201: After the host process is started, traverse the dll files in the same directory, that is, scan the dll module files (such as functional modules) in the directory (first-level directory) where the program is located.

[0110] Step S202: The host process loads according to the interface specification, and loads at least one functional class module, including the aforementioned camera class module (Camera Home.dll), serial port class module (comhome.dll), software management class module (SoftManager Home.dll), etc.

[0111] Step S203: After loading, after obtaining the device category (or device category name), a cache route is established between each device category and each functional module, which is equivalent to establishing at least one first mapping relationship.

[0112] The cache route includes a mapping relationship between a target functional module and a device category of a target device.

[0113] Furthermore, if Figure 6 As shown, in the above process of starting the host process, the Runningservice.exe thread is pulled up, and according to at least one pre-set configuration item, such as the runsetting.int content, the maintenance thread is established through built-in parameters, including: path, file name process, and for each process (thread 1 to thread N), a closing operation is first performed to close the same process name to avoid legacy processes, and then the startup operation is performed with the configured permissions, such as monitoring and guarding through the process handle to start the host process.

[0114] Among them, the threads 1 to N include a host process. Taking the host process as an example, the startup process specifically includes:

[0115] Step 1: Determine whether there is a process with the same process name as the host process (DeviceZombie) among the currently running processes;

[0116] Step 2: If yes (the same process name exists), then the running host process DeviceZombie.exe is closed, and the host process DeviceZombie.exe file is found, and the host process DeviceZombie.exe file is started.

[0117] Step 3: If no (does not exist), find and start the host process DeviceZombie.exe file, and then start the host process.

[0118] After startup, the host process DeviceZombie.exe is monitored. If the host process is detected to have ended, the program jumps to the above-mentioned "step 1" to continue to start and monitor the host process.

[0119] Furthermore, one implementation method is to establish a WebSocket server and monitor the host process through the WebSocket server. Specifically, the caller sends a WebSocket message with a fixed format, and then issues instructions to each functional module according to the cache route established in the above step S203 according to the device category, and loads each functional module. Among them, the host process is monitored through the preset port (such as port 17888) of the WebSocket server, and the above steps S101 to S104 are executed.

[0120] In addition, the above step S202 further includes: determining the functional sub-modules in each of the functional class modules, and loading each of the functional sub-modules.

[0121] Specifically, one implementation method is: poll each of the functional submodules, call the export function, and obtain the virtual function returned after the export function is called, for example, when a functional class module is called through the export function, a class information will be returned; determine whether the class information contains the virtual function of the class, that is, determine whether the content in the virtual function is the same as the category identified by the current functional class module. If the same, it is determined that the current functional submodule is a functional submodule in the current functional class module. If not the same, it is determined that it is not a functional submodule contained in the current functional class module.

[0122] The called export function is the CreateInstance export function, and the class information returned by calling the CreateInstance export function is the object address, that is, the address of the functional class module.

[0123] Furthermore, if the virtual function of the class is included, it is determined whether the string (i.e., the device category) returned by the virtual function of the class is empty. If it is not empty, it is determined whether it is the same type as the current class loader (such as the camera class module). If it is the same, it is determined that the current functional submodule is a submodule of the current functional class module; for example, it is determined that the camera submodule 1 (cameraX.dll) is a submodule of the camera class module (Camera Home.dll). Similarly, the functional submodules corresponding to other functional class modules are also found according to this method. After polling all functional class modules, the host process writes all device categories and object addresses (each functional class module) supported by the client into the map mapping table to generate the first mapping relationship.

[0124] In this embodiment, the host process is loaded by starting the core daemon process, and scanning of at least one functional module in the directory where the host process program is located is started, thereby establishing a mapping relationship between each functional module and the device category, and providing access standards to the outside world in a unified manner through the host process, such as using port 17888 to load each functional module, thereby realizing the call of each functional sub-module at the lower level.

[0125] When the system starts, this method dynamically loads the terminal device connected to the current machine through a pluggable host process. After the terminal device module is inserted, it can be connected to the cloud warehouse and cloud quality inspection system. In addition, after the terminal device is connected, the core daemon process RunningService is used to guard the hardware device process, ensuring that the device process can be quickly reset in the event of abnormal operation.

[0126] In another embodiment, the method further includes: upgrading the process. Specifically, the method includes: after starting the core daemon process, obtaining configuration information from the cloud, detecting the updated configuration in the cloud, judging whether it is necessary to update the at least one functional module and / or at least one functional submodule on the client according to the configuration information, and if so, that is, it is detected that an update is required, then using the configuration information to update the at least one functional module and / or the at least one functional submodule.

[0127] Specifically, the core daemon is started at a preset time, such as every 30 minutes (configurable), and after startup, the cloud update configuration is detected. If it is found that an update is required, the update action is executed.

[0128] When the update is completed, since the window cannot be displayed under SYSTEM privileges, a pop-up window is displayed in a privilege-reducing manner, asking the user whether a restart is required. After the user selects, the window is passed back to the process under SYSTEM privileges through the pipeline. If the user selects "yes", the core daemon process is reset, and then all processes in the entire driver are reset.

[0129] Optionally, the above results also include other guarded processes, which are started and guarded by the core daemon process and are determined by the client's business layer and actual scenarios, and this embodiment does not limit this.

[0130] In the present embodiment, a device driver is also provided, which is used to implement the above-mentioned embodiment and optional implementation mode, and the descriptions that have been made are not repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0131] like Figure 7 As shown, the device driver comprises: a receiving unit 710, a first searching unit 720, a second searching unit 730 and a sending unit 740. In addition, the device driver may also comprise other more or fewer units and modules.

[0132] Specifically, the receiving unit 710 is used to receive calling parameters, wherein the calling parameters include: a device identification, a device category and a driving instruction of a target device.

[0133] The first search unit 720 is used to search for a target function class module matching the device category in the at least one function class module according to the device category and a preset first mapping relationship, wherein the first mapping relationship is the relationship between the device category supported by the apparatus and each function class module.

[0134] The second search unit 730 is used to use the target function class module to search for the target function submodule in at least one function submodule according to the device identifier and the second mapping relationship, wherein the second mapping relationship is the relationship between each function submodule under the target function class module and different device identifiers.

[0135] The sending unit 740 is used to send the driving instruction to the target device through the target functional submodule to drive the target device to execute the task corresponding to the driving instruction.

[0136] Optionally, in a specific implementation, the second searching unit 730 is specifically configured to search, according to the device identification, in the at least one functional submodule for a functional submodule that matches the device identification as the target functional submodule.

[0137] Optionally, in another specific embodiment, the above device further includes a processing unit. Figure 7Not shown, the processing unit is used to start the host process, scan the program directory of the host process, obtain the at least one functional class module; and load the at least one functional class module according to the interface specification to establish the first mapping relationship.

[0138] Optionally, in another specific embodiment, the above-mentioned device also includes a core guard unit, which is used to determine whether there is a process with the same process name as the host process in the currently running process; if so, the running host process is closed, and the host process file is found and started; if not, the host process file is found and started.

[0139] Optionally, in another specific implementation, the above-mentioned processing unit is also used to poll each of the functional sub-modules; call the export function and obtain the virtual function returned after the export function is called; determine whether the content in the virtual function is the same as the category recognized by the current functional class module; if the same, determine that the current functional sub-module is a functional sub-module in the current functional class module.

[0140] Optionally, the above device further includes an updating unit, Figure 7 Not shown in the figure, the updating unit is an upgrading process module (ClientUpgrade Program.exe).

[0141] The receiving unit 710 is further configured to obtain configuration information from the cloud; the processing unit is further configured to determine whether it is necessary to update the at least one functional module and / or the at least one functional submodule on the client according to the configuration information. The updating unit is configured to update the at least one functional module and / or the at least one functional submodule using the configuration information.

[0142] It should be noted that the functions of the receiving unit 710, the first search unit 720, the second search unit 730 and the sending unit 740 can be implemented as follows: Figure 2 The core daemon process, host process, at least one functional class module and at least one functional sub-module are implemented as shown.

[0143] The device provided in this embodiment has the following beneficial effects:

[0144] First, when the device is connected, the host process module uniformly provides access standards to the outside world, and sends the calling parameters entered by the user, such as device name, device category and driving instructions, to the target function class module to be driven. The target function class module then finds the target function sub-module of the specific drivable device based on these calling parameters. Finally, the target function sub-module sends the driving instructions to the terminal device to which it is connected, realizes the call to the target terminal device, and meets the user's calling needs in the cloud warehouse or cloud quality inspection agency.

[0145] Second, when the system starts, the host process dynamically loads the device connected to the current machine. After the device module is inserted, it can be connected to the cloud warehouse, cloud quality inspection agency and other system environments.

[0146] Third, after the device is connected, the core daemon process is used to protect the device process, ensuring that the device process can be quickly reset in the event of abnormal operation.

[0147] It should be understood that the device driver in this embodiment is presented in the form of a functional module, where the module refers to an ASIC circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0148] The embodiment of the present invention also provides an electronic device having the above Figure 7 The device driving apparatus shown, wherein the electronic device may be the client of the aforementioned embodiment.

[0149] See also Figure 8 , Figure 8 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present application, such as Figure 8 As shown, the electronic device includes: one or more processors 110, memory 120, and a communication interface 130 for connecting various components, including a high-speed interface and a low-speed interface. The various components communicate with each other using different buses and can be installed on a common motherboard or installed in other ways as needed.

[0150] The processor 110 may be a central processing unit, a network processor or a combination thereof. The processor 110 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general array logic or any combination thereof. The memory 120 stores instructions executable by at least one processor 110 so that the at least one processor 110 executes the device driving method shown in the above embodiment.

[0151] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0152] The memory 120 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 120 may also include a combination of the above types of memory.

[0153] In addition, the communication interface 130 of the electronic device is used to communicate with other devices or communication networks.

[0154] In this embodiment, the electronic device may be a terminal device, such as a PC, a notebook computer, a mobile phone terminal, etc.

[0155] In addition, the present application also provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment of the device driving method provided in the present application. The storage medium may be a disk, an optical disk, a read-only storage memory ROM or a random access memory RAM, etc.

[0156] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0157] The computer program product includes one or more computer instructions. When the computer loads and executes the computer program, the process or function described in the above embodiments of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device.

[0158] The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one network device, computer, server or data center to another device, computer or server via wired or wireless means.

[0159] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for an embodiment of a device interconnection apparatus, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.

[0160] Those skilled in the art can clearly understand that the technology in the embodiments of the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application or some parts of the embodiments.

[0161] In addition, in the description of the present application, unless otherwise specified, "plurality" refers to two or more than two. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the difference.

[0162] Although the embodiments of the present application are described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A device driving method, characterized in that: The method applies a client, the client includes at least one function class module, each of the function class modules includes at least one function sub-module, and each of the function class modules is used to identify a device category of a device, each of the function sub-modules is used to drive a terminal device under the device category to which it belongs, and each of the function sub-modules drives a different terminal device, and the method includes: Receive calling parameters, wherein the calling parameters include: a device identification, a device category and a driving instruction of a target device; According to the device category and a preset first mapping relationship, searching for a target function class module matching the device category in the at least one function class module, wherein the first mapping relationship is a relationship between the device category supported by the client and each function class module; Using the target function class module, searching for a target function submodule in the at least one function submodule according to the device identifier and the second mapping relationship, wherein the second mapping relationship is a relationship between each function submodule under the target function class module and different device identifiers; The driving instruction is sent to the target device through the target function submodule to drive the target device to execute the task corresponding to the driving instruction.

2. The method according to claim 1, characterized in that Searching for a target functional submodule in the at least one functional submodule according to the device identifier and the second mapping relationship includes: According to the device identification, a functional submodule matching the device identification is searched in the at least one functional submodule as the target functional submodule.

3. The method according to claim 1, characterized in that The client also includes a host process, and before receiving the call parameter, it also includes: Starting the host process; Scan the program directory of the host process to obtain the at least one functional module; The at least one functional class module is loaded according to the interface specification to establish the first mapping relationship, wherein the interface specification is a websocket protocol interface specification.

4. The method according to claim 3, characterized in that The client also includes a core daemon process, and starting the host process includes: Determine whether there is a process with the same process name as the host process among the currently running processes; If yes, then close the running host process, find the host process file, and start the host process file; If not, then the host process file is found and started.

5. The method according to claim 3, characterized in that: The method further comprises: determining a functional submodule in each of the functional class modules, and loading each of the functional submodules; The determining of the functional submodules in each functional class module comprises: Polling each of the functional submodules; Calling the export function and obtaining the virtual function returned after the export function is called; Determine whether the content in the virtual function is the same as the category identified by the current functional class module; If they are the same, it is determined that the current functional sub-module is a functional sub-module in the current functional class module.

6. The method according to any one of claims 1 to 5, characterized in that: The at least one functional module includes a camera module, a serial port module and a software management module; Sending the driving instruction to the target device through the target function submodule to drive the target device to perform the task corresponding to the driving instruction includes: When the target function module is a camera module, a first driving instruction is sent to the camera through the target function submodule, wherein the first driving instruction is used to drive the camera to take a photo or record a video; When the target functional module is a serial port module, a second driving instruction is sent to the balance through the target functional submodule, wherein the first driving instruction is used to drive the balance to perform a measurement operation; When the target function module is a software management module, a third driving instruction is sent to the operating system through the target function submodule, and the third driving instruction is used to start the management function of the software.

7. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Get configuration information from the cloud; Determining whether it is necessary to update the at least one functional module and / or the at least one functional sub-module on the client according to the configuration information; If yes, the at least one functional module and / or the at least one functional sub-module is updated using the configuration information.

8. A device driving apparatus, characterized in that: The device comprises: A receiving unit, used for receiving calling parameters, wherein the calling parameters include: a device identification, a device category and a driving instruction of a target device; A first search unit, configured to search for a target functional class module matching the device category in at least one functional class module according to the device category and a preset first mapping relationship, wherein the first mapping relationship is a relationship between the device category supported by the apparatus and each functional class module; A second search unit is used to use the target function class module to search for a target function submodule in the at least one function submodule according to the device identifier and the second mapping relationship, wherein the second mapping relationship is a relationship between each function submodule under the target function class module and different device identifiers; A sending unit is used to send the driving instruction to the target device through the target functional submodule to drive the target device to execute the task corresponding to the driving instruction.

9. An electronic device, characterized in that: comprising a memory and a processor, wherein the memory and the processor are connected; The memory stores computer program instructions; When the computer program instructions are executed by the processor, the device driving method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer readable storage medium has computer instructions stored thereon; The computer instructions are used to enable a computer to execute the device driving method according to any one of claims 1 to 7.