External equipment service starting method, client and information acquisition method
By setting up a peripheral service client on the business terminal, monitoring the access of external devices and forming a peripheral service interface, the problem of low efficiency in obtaining external device information by the business terminal is solved, and faster and more accurate information collection is achieved.
Patent Information
- Application Number
- CN202410666999.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-09-10
AI Technical Summary
Business terminals are less efficient in obtaining information collected by external devices. Especially as the types of external devices increase, it takes longer to obtain information by polling and calling different interfaces.
By setting up the peripheral service client, the identification code is obtained when the external device is connected and uploaded to the business terminal to receive the driver package installation information and interface configuration information, forming a peripheral service interface for the business terminal to directly call to improve Information collection efficiency.
It significantly improves the efficiency of business terminals in obtaining external device information, avoids the time extension caused by polling calls, and improves the speed and accuracy of information collection.
Smart Images

Figure CN118626164A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to an external device service startup method and client, an information collection method, device, storage medium and computer program product. Background Art
[0002] When handling business, business terminals often need to collect user information through external devices for identity authentication. Only after the authentication is passed can the next step of business acceptance operation be carried out.
[0003] Since there are many types of external devices, the business terminal needs to call different interfaces to obtain information collected by different types of external devices. At present, when obtaining the collected information of external devices, the business terminal can call different interfaces in a polling manner to try to obtain the information collected by the external devices. However, as the types of external devices increase, the time it takes for the business terminal to try to obtain the information collected by the external devices by polling and calling different interfaces also becomes longer accordingly, and the efficiency of the business terminal in obtaining the information collected by the external devices is low. Summary of the invention
[0004] The main purpose of the present invention is to provide an external device service startup method and client, information collection method, device, storage medium and computer program product, aiming to solve the technical problem of low efficiency of the existing technology business terminal in obtaining information collected by the external device.
[0005] To achieve the above object, the present invention provides a method for starting an external device service, which is applied to an external device service client, and the method comprises:
[0006] When an external device is detected to be connected, obtaining an identification code of the external device;
[0007] Uploading the identification code of the external device to the service terminal, and receiving the driver package installation information and the interface configuration information of the external device returned by the service terminal;
[0008] A peripheral service interface of the external device is formed according to the driver package installation information and the interface configuration information of the external device.
[0009] Optionally, the interface configuration information includes an application program interface and configuration information;
[0010] The forming of the peripheral service interface of the external device according to the driver package installation information and the interface configuration information of the external device comprises:
[0011] Install the driver package according to the driver package installation information;
[0012] The application program interface is hooked onto the driver package according to the configuration information to form a peripheral service interface of the external device.
[0013] Optionally, the peripheral service interface is an interface based on the Hypertext Transfer Protocol.
[0014] In addition, to achieve the above purpose, the present invention also proposes an information collection method, which is applied to a service terminal, and the service terminal is installed with an external device service client that implements the above external device service startup method. The information collection method includes:
[0015] When receiving the identification code of the external device, acquiring the driver package installation information and the interface configuration information of the external device according to the identification code of the external device;
[0016] Transmitting the driver package installation information and the interface configuration information of the external device to the peripheral service client;
[0017] When an information collection request is received, the peripheral service interface formed by the peripheral service client is called to obtain the information collected by the external device.
[0018] Optionally, acquiring the driver package installation information and the interface configuration information of the external device according to the identification code of the external device includes:
[0019] Acquiring driver package installation information of the external device from the operating system of the service terminal according to the identification code of the external device;
[0020] The interface configuration information of the external device is obtained from a preset backend database according to the identification code of the external device, wherein the preset backend database stores identification codes of various types of external devices and interface configuration information corresponding to the identification codes.
[0021] Optionally, after the external device service interface formed by the external device service client is called to acquire the information collected by the external device when the information collection request is received, the method further includes:
[0022] Encrypting the information collected by the external device and transmitting it to the back end of the service terminal;
[0023] Decrypting the encrypted information at the back end;
[0024] Audit and verify the decrypted information.
[0025] Optionally, encrypting the information collected by the external device and transmitting it to the back end of the service terminal includes:
[0026] Encrypting the information collected by the external device and generating a check value based on the encrypted information;
[0027] Sending the encrypted information and the check value to the backend;
[0028] Decrypting the encrypted information at the back end includes:
[0029] When the back end verifies that the check value is true, the back end decrypts the encrypted information using a pre-stored secret key.
[0030] Optionally, after the decrypted information is audited and verified, the process further includes:
[0031] The information that has passed the audit verification is stored in the back-end database of the business system in the form of a character string, and the information that has passed the audit verification is backed up in the form of a file.
[0032] In addition, to achieve the above purpose, the present invention also proposes a peripheral service client, which includes an external device service startup program, and when the external device service startup program is executed, the steps of the external device service startup method are implemented.
[0033] In addition, to achieve the above objectives, the present invention also proposes an electronic device, which includes: a memory, a processor, and an information collection program stored in the memory and executable on the processor, wherein the information collection program is configured to implement the steps of the above information collection method.
[0034] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which an information collection program is stored, and when the information collection program is executed by a processor, the steps of the above-mentioned information collection method are implemented.
[0035] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer program product, which includes an information collection program, and when the information collection program is executed by a processor, the steps of the above-mentioned information collection method are implemented.
[0036] In the present invention, a peripheral service client is set up, and when the peripheral service client monitors the access of an external device, it obtains the identification code of the external device, and then uploads the identification code of the external device to the business terminal, receives the driver package installation information and the interface configuration information of the external device returned by the business terminal, and the peripheral service client forms a peripheral service interface of the external device according to the driver package installation information and the interface configuration information of the external device. That is to say, when the access of the external device is monitored, the peripheral service client will start the peripheral service interface of the external device through the external device service startup method. In this way, when the business terminal receives a collection request, it can directly call the started peripheral service interface to obtain the information collected by the external device. Compared with the method in which the business terminal tries to obtain the information collected by the external device by polling different interfaces when receiving the collection request, the information collection efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a schematic diagram of the structure of an electronic device in a hardware operating environment involved in an embodiment of the present invention;
[0038] Figure 2 A schematic diagram of a flow chart of an embodiment of a method for starting an external device according to the present invention;
[0039] Figure 3 This is a flow chart of the first embodiment of the information collection method of the present invention;
[0040] Figure 4 This is a flow chart of a second embodiment of the information collection method of the present invention;
[0041] Figure 5 A schematic diagram of implementing service authentication at the front end and back end of a service terminal of the present invention;
[0042] Figure 6 This is a schematic diagram of the operating system and business service of the business terminal of the present invention and the client starting the peripheral service interface.
[0043] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0045] At present, when the business system handles business that requires identity authentication, it initiates authentication business through the business front desk of the business terminal, and realizes authentication information collection by calling the authentication network interface; the authentication interface determines the type of information that needs to be collected, obtains the current business authentication level and authentication method, makes a judgment through the authentication center, and calls the corresponding collection interface; the collection interface searches for the collection device connected to the current business terminal through polling, and after confirming the collection device, calls the information collection interface provided by the device to collect authentication information; the collected authentication information and collection type are encrypted, and the encrypted content is transmitted to the paperless client; the paperless client calls a unified interface for prior audit, and the collection center adds watermarks to the ID card chip photo and on-site photo, and saves the certificate information and chip photo data flow information at the same time, and then calls the unified storage interface provided by the collection center to save data. After the collection side successfully collects the data, it notifies the authentication interface of the success of the collection, and the authentication interface calls the unified authentication interface provided by the authentication center for identity authentication. After the authentication is successful, the authentication interface is directly closed to enter the next step of business acceptance operation.
[0046] However, due to the large number of types of external devices, the business terminal needs to call different interfaces to obtain information collected by different types of external devices. At present, when obtaining the collected information of external devices, the business terminal calls different interfaces in a polling manner to try to obtain the information collected by the external devices. However, as the types of external devices increase, the time it takes for the business terminal to try to obtain the information collected by the external devices by polling and calling different interfaces also becomes longer accordingly, and the efficiency of the business terminal in obtaining the information collected by the external devices is low.
[0047] To this end, the present application provides a method for starting an external device service, which includes setting up an external device service client, and obtaining an identification code of the external device when the external device access is monitored. After that, the identification code of the external device is uploaded to the business terminal, and the driver package installation information and the interface configuration information of the external device returned by the business terminal are received. The peripheral service client forms a peripheral service interface of the external device based on the driver package installation information and the interface configuration information of the external device. That is to say, when the external device access is monitored, the peripheral service client will start the peripheral service interface of the external device through the external device service starting method. In this way, when the business terminal receives a collection request, it can directly call the started peripheral service interface to obtain the information collected by the external device. Compared with the method in which the business terminal tries to obtain the information collected by the external device by polling different interfaces when a collection request is received, the information collection efficiency can be improved.
[0048] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the structure of an electronic device of a hardware operating environment involved in an embodiment of the present invention.
[0049] like Figure 1 As shown, the electronic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0050] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0051] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a peripheral service client.
[0052] exist Figure 1 In the electronic device shown, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the electronic device of the present invention can be set in the electronic device, and the electronic device calls the external device service client stored in the memory 1005 through the processor 1001, and executes the external device service startup method and information collection method provided in the embodiment of the present invention.
[0053] The embodiment of the present invention provides a method for starting an external device service. Figure 2 , Figure 2 It is a flowchart of the first embodiment of the external device service startup method of the present invention.
[0054] In this embodiment, the external device service startup method includes the following steps:
[0055] Step S101: when an external device access is detected, an identification code of the external device is obtained.
[0056] In this embodiment, a peripheral service client is installed in the service terminal, and when the operating system of the service terminal is started, the peripheral service client is executed to implement the external device service startup method of this embodiment. After the peripheral service client detects the device access event pushed by the operating system kernel, it obtains the identification code ID of the connected external device by analyzing the event information.
[0057] It should be noted that the service terminal cannot directly obtain the identification code of the external device through the web page. Therefore, in this embodiment, a peripheral service client is set in the service terminal to obtain the identification code of the external device through the peripheral service client.
[0058] Step S102: Upload the identification code of the external device to the service terminal, and receive the driver package installation information and the interface configuration information of the external device returned by the service terminal.
[0059] After obtaining the identification code ID of the external device, the identification code ID of the external device is uploaded to the service terminal, and the service terminal searches for matching driver package installation information based on the local operating system kernel and CPU architecture, and returns the driver package installation information to the peripheral service client. After uploading the identification code ID of the external device to the service terminal, the service terminal searches for the interface configuration information of the external device according to the identification code ID of the external device, and returns it to the peripheral service client.
[0060] Realistically, the peripheral service client determines whether the driver package needs to be installed. If the driver package needs to be installed, it first checks the local driver package installation status. If the driver package has been installed and loaded, there is no need to obtain the driver package installation information from the business terminal. If the driver package is not installed, the identification code ID of the external device needs to be uploaded to the business terminal, and the business terminal searches for matching driver package installation information based on the local operating system kernel and CPU architecture, and returns the driver package installation information to the peripheral service client.
[0061] Step S103: forming a peripheral service interface of the external device according to the driver package installation information and the interface configuration information of the external device.
[0062] Realistically, the peripheral service interface may be an interface based on the Hypertext Transfer Protocol (HTTP) or an interface based on the Remote Procedure Call Protocol (RPC).
[0063] In this embodiment, the interface configuration information at least includes an application program interface and configuration information. After obtaining the driver package installation information of the external device and the interface configuration information of the external device, the driver package is installed in the service terminal according to the driver package installation information. After that, the application program interface is attached to the driver package according to the configuration information to form the peripheral service interface of the external device, and the peripheral service interface is started. That is to say, in this embodiment, when the external device access is monitored, the peripheral service client will start the peripheral service interface of the external device through the external device service startup method. In this way, when the service terminal receives a collection request, it can directly call the started peripheral service interface to obtain the information collected by the external device. Compared with the method in which the service terminal tries to obtain the information collected by the external device by polling different interfaces when receiving a collection request, the information collection efficiency can be improved.
[0064] The embodiment of the present invention provides an information collection method, referring to Figure 3 , Figure 3 This is a flow chart of the first embodiment of information collection according to the present invention.
[0065] In this embodiment, the information collection method includes the following steps:
[0066] Step S201: upon receiving the identification code of the external device, obtaining driver package installation information and interface configuration information of the external device according to the identification code of the external device.
[0067] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions and can be connected to external devices, such as a business terminal, a personal computer, or an electronic device capable of realizing the above functions. The following takes the business terminal as an example to illustrate this embodiment and the following embodiments.
[0068] When the service terminal receives the identification code of the external device, it obtains the driver package installation information of the external device from the operating system of the service terminal according to the identification code of the external device; and obtains the interface configuration information of the external device from the preset backend database according to the identification code of the external device.
[0069] Specifically, the preset backend database stores identification codes of various external devices and interface configuration information corresponding to the identification codes. After obtaining the identification code of the external device, the corresponding interface configuration information can be directly matched from the preset backend database according to the identification code of the external device.
[0070] In addition, the preset back-end database also stores homologous devices corresponding to various device identification codes and interface configuration information corresponding to the homologous devices. If the corresponding interface configuration information cannot be directly matched according to the identification code of the external device, the interface configuration information corresponding to the homologous device corresponding to the identification code of the external device can be used as the interface configuration information of the external device.
[0071] Step S202: Transmitting the driver package installation information and the interface configuration information of the external device to the peripheral service client.
[0072] After obtaining the driver package installation information and interface configuration information of the external device, the peripheral service client installs the driver package in the service terminal according to the driver package installation information. Then, the application program interface is attached to the driver package according to the configuration information to form the peripheral service interface of the external device, which is started.
[0073] Step S203: when receiving the information collection request, calling the peripheral service interface formed by the peripheral service client to obtain the information collected by the external device.
[0074] In this embodiment, when an external device access is monitored, the peripheral service client will start the peripheral service interface of the external device through the external device service startup method. In this way, when the business terminal receives a collection request, it can directly call the started peripheral service interface to obtain the information collected by the external device. Compared with the method in which the business terminal tries to obtain the information collected by the external device by polling and calling different interfaces when a collection request is received, the information collection efficiency can be improved.
[0075] The embodiment of the present invention provides an information collection method, referring to Figure 4 , Figure 4 This is a flow chart of the first embodiment of information collection according to the present invention.
[0076] In this embodiment, the information collection method includes the following steps:
[0077] Step S301: upon receiving the identification code of the external device, obtaining driver package installation information and interface configuration information of the external device according to the identification code of the external device.
[0078] Step S302: Transmitting the driver package installation information and the interface configuration information of the external device to the peripheral service client.
[0079] Step S303: when receiving the information collection request, calling the peripheral service interface formed by the peripheral service client to obtain the information collected by the external device.
[0080] The above steps S301 to S303 are the same as steps S201 to S203 in the above embodiment, and will not be described again in this embodiment to avoid repetition.
[0081] Step S304: encrypt the information collected by the external device and transmit it to the back end of the service terminal.
[0082] To prevent the information collected by external devices from being tampered with during transmission from the front end to the back end of the business terminal, the information collected by external devices needs to be encrypted at the front end of the business terminal before being transmitted to the back end of the business terminal.
[0083] At present, symmetric encryption algorithms or asymmetric encryption algorithms can be used to encrypt information collected by external devices. However, if the secret key is leaked in the above method, the information collected by the external device is still at risk of being tampered with during transmission. Based on this, in this embodiment, the information collected by the external device is encrypted, and a check value is generated based on the encrypted information; the encrypted information and the check value are sent to the back end; when the back end verifies that the check value is true, the encrypted information is decrypted using the pre-stored secret key.
[0084] That is to say, in this embodiment, not only the information collected by the external device is encrypted, but also a verification value is generated using the encrypted information. If the encrypted information is tampered with, the newly generated verification value based on the tampered information will also change. Therefore, the verification value can be verified to determine whether the encrypted information has been tampered with during the transmission process. Only information with a verified verification value can be decrypted and used, thereby improving the security of information transmission.
[0085] In one example, the information collected by the external device can be encrypted by a combination of symmetric encryption and asymmetric encryption. Message data can be encrypted asymmetrically, such as user information of an ID card, and picture data can be encrypted symmetrically.
[0086] The composition of the public key and private key of the asymmetric encryption algorithm (Rivest-Shamir-Adleman, RSA), as well as the formulas for the encryption process and decryption process can be seen in Table 1 below:
[0087] Table 1
[0088]
[0089] The symbol ^ represents the mathematical exponential operation; mod represents the modular operation, that is, taking the remainder after division. The specific algorithm steps are as follows:
[0090] (1) Select a pair of different, sufficiently large prime numbers p and q.
[0091] (2) Calculate n=p*q.
[0092] (3) Calculate f(n) = (p-1)*(q-1), and keep p and q strictly confidential so that no one knows.
[0093] (4) Find a number e that is relatively prime to f(n) as the public key exponent, and 1 <e<f(n)。
[0094] (5) Calculate the private key exponent d so that d satisfies (d*e) mod f(n) = 1
[0095] (6) Public key KU = (e, n), private key KR = (d, n).
[0096] (7) When encrypting, first transform the plaintext into an integer M from 0 to n-1. If the plaintext is long, it can be divided into appropriate groups and then exchanged. Let the ciphertext be C, then the encryption process is: C = M^e mod n.
[0097] (8) The decryption process is: M = C^d mod n.
[0098] In one example, a message digest algorithm (MD5) can be used to generate a check value based on the encrypted information. For example, if there are multiple encrypted messages, the order of the multiple encrypted messages is shuffled and the check value is generated using a hash algorithm. After the back end of the service terminal receives the multiple encrypted messages, a new check value is generated for the multiple encrypted messages using a hash algorithm. If the new check value is the same as the check value transmitted to the back end, it indicates that the encrypted information has not been tampered with. If the new check value is different from the check value transmitted to the back end, it indicates that the encrypted information has been tampered with during the process.
[0099] Step S305: decrypting the encrypted information at the back end.
[0100] The encrypted information received is decrypted using the pre-stored secret key at the back end of the service terminal.
[0101] Step S306: Audit and verify the decrypted information.
[0102] The decrypted information needs to be audited and verified to determine whether the collected information is the same as the pre-stored information. For example, if the collected information is an ID card photo, it is necessary to determine whether the collected ID card photo is the same as the pre-stored ID card photo.
[0103] Step S307: The information that has passed the audit verification is stored in the back-end database of the business system in the form of a character string, and the information that has passed the audit verification is backed up in the form of a file.
[0104] If the information after audit verification is stored only in the form of files, the files may be replaced during the subsequent business processing. Therefore, in this embodiment, the information that has passed the audit verification is stored in the form of a string in the back-end database of the business system. At the same time, the information after audit verification is backed up in the form of files. If the backed-up file is replaced, the file replacement can be discovered by comparing the data in the back-end database, thereby improving the security of information storage.
[0105] Combine the following Figure 5 Each module in the business terminal shown describes the business authentication process in detail:
[0106] In this embodiment, the business terminal includes a front end and a back end. The front end is provided with a business front desk, a paperless client and a peripheral service client, and the back end is provided with an intelligent audit and verification module and a content management platform.
[0107] (1) Business front desk
[0108] The authentication is initiated by the business front desk. The system calls the unified H5 page provided by the authentication center to display the authentication interface. The calling parameters are mainly mobile phone number, authentication serial number, menu number or marketing case number, etc.
[0109] The authentication interface obtains the authentication level and authentication method required for this business based on the authentication serial number information, menu number or marketing case number of the front desk. The authentication level and authentication method are provided by the authentication center, and the authentication level and authentication method configuration of the authentication center supports many-to-many flexible configuration. The authentication level of the menu and marketing case is configured by the original menu table and unified product configuration table, but only the authentication level dimension is retained. The authentication level is obtained here. If the user has not been authenticated before, an authentication work order will be generated first. If the user has been authenticated before, it is determined whether this business requires a higher level of authentication.
[0110] According to the current authentication rules (i.e. the above authentication level and authentication method), determine what kind of user information needs to be collected, and at the same time call the background interface to generate a collection work order, and the collection work order is associated with the authentication work order.
[0111] The unified collection page is called according to the collection content on the collection work order. The collection interface displays the collection functions, which may include ID card reading and high-speed scanner photography.
[0112] It is worth noting that the APP provided by another mobile terminal can be used to collect pages. The collection functions include ID card reading, camera ID photo taking, and camera face photo taking. Here, a unified interface address is provided, and the business terminal and another mobile terminal can transmit data through the unified interface address. The transmitted data content includes the collection serial number, document type, collection type, etc., and the transmitted data needs to be encrypted. When the business terminal interacts with another mobile terminal, a one-dimensional code (or two-dimensional code) can be provided for the mobile terminal's APP to scan. The mobile terminal's APP side parses the data and performs the next step. The transmitted data is consistent with the above, and the encryption method is also the same.
[0113] (2) Paperless client module
[0114] When the business front desk needs to obtain the collected information, the peripheral service interface provided by the peripheral service client is called. It should be noted that if there are multiple external devices, the peripheral service client provides multiple peripheral service interfaces, and the business front desk needs to call different peripheral service interfaces according to the content of the collected information. For example, when the business front desk needs to obtain a portrait, it needs to call the peripheral service interface of the external camera; when the business front desk needs to obtain a handwritten signature, it needs to call the peripheral service interface of the signature screen.
[0115] If relevant image data is collected, the relevant image data mainly includes chip photos and face photos. After the collected relevant image data is encrypted, the unified pre-audit interface provided by the backend is called for intelligent audit verification to verify the compliance of the photos. After the pre-audit interface returns the verification result, the paperless client displays the audit result at the collection front desk and prompts the next step.
[0116] The pre-audit interface is uniformly encapsulated, and the interface definition and audit capability are clarified with the big data side. Different prompt information is returned to the caller based on different error codes.
[0117] After the audit verification is passed, the successfully collected data will be saved by calling the unified storage interface provided by the collection sub-center in the form of a stream. The collected data includes certificate information, chip photos, on-site photos, certificate photos, and other information. Here, the collection side should establish a set of collection rules to perform corresponding collection verification for different types of collected data.
[0118] The data storage interface is uniformly encapsulated and provided to the peripheral system for calling. After the collected data is obtained from the interface, the chip photo, on-site photo, and other ID photos are watermarked, and the on-site photo and ID photo are uploaded to the unified directory of the content management platform, and the FILE_ID is saved in the table. The chip photo is no longer uploaded to the content management platform, but is directly saved in the back-end database table in the form of a BASE64-bit string. The size of the chip photo is about 3000 to 5000 characters. After the data is successfully saved, it is directly associated with the collection serial number for subsequent use. This method stores the original collected image data in files and databases respectively, effectively preventing file tampering. The original collected image data is stored in files and databases respectively, and the image data can be returned simultaneously in one request of the front-end page, reducing the number of times the front-end page visits the back-end and improving response time and business efficiency.
[0119] After the data collection is successful, the collection side needs to inform the authentication interface that the collection is successful, and the authentication side can proceed to the next step. When the collection page on the business front desk is closed, a successful collection mark is returned. On the paperless client side, since the two parties are at different operation levels, the authentication side provides a successful collection button, and the operator clicks it to query the collected data.
[0120] (3) Peripheral service client
[0121] In this proposal, the peripheral service client is installed on the business terminal. The peripheral service client senses the access of external devices, parses the device identification code, and uploads the device identification code (to the content management platform) to automatically determine whether the external device needs to install a driver. If installation is required, the device information is queried through the content management platform, the external device support library is obtained, and the service capability script is assembled according to the external device support library and the peripheral service interface. Then, it is sent to the peripheral service client, which automatically downloads the external device.
[0122] The built-in script engine of the external device service client starts the external device service according to the service capability interface script, and the external device cooperates with the business front desk to handle business.
[0123] Combine the following Figure 6 Describe the operating system and business services of the business terminal:
[0124] Operating system of business terminal: It is a computer operating system. The operating system kernel is responsible for handling hardware interactions and providing support software with a limited set of services for user programs.
[0125] The peripheral service client is a daemon process: A daemon process runs in the background of the business terminal and is not controlled by any terminal. It is started when the system is booted and runs until the system is shut down.
[0126] Business service: A computer software program responsible for handling a specific business or transaction.
[0127] Step 1.1 monitors whether an external device is connected. For example, monitor whether a USB device is connected. The daemon process is responsible for monitoring the USB connection event thrown by the Linux kernel to the user program and obtaining the event information.
[0128] Step 1.2 monitors the access of external devices and obtains the identification code of the external devices. The daemon obtains the identification code of the USB device through event information. The identification code includes the vendor ID (VID) and the product identification code (PID). The VID and PID of the USB device are stipulated in the USB specification. All USB devices have a vendor ID (VID) and a product identification code (PID). Each vendor's VID is unique, and the PID is used by the vendor to distinguish product models.
[0129] Step 1.3 Upload the identification code of the external device. The daemon process encrypts the VID, PID, current Linux operating system kernel, and CPU architecture encoding message of the USB device according to the agreed encryption method according to the interface specification provided by the business service, and uploads it to the business service provided by the business terminal through the http interface provided by the business terminal.
[0130] Step 1.4 searches for interface configuration information based on the identification code of the external device.
[0131] After receiving the http request, the business service of the business terminal decrypts the uploaded message, obtains the USB device VID and PID, and searches the interface configuration information of the external device in the back-end database of the business terminal through the VID and PID. Among them, the business service obtains the service category interface information through the device service category returned by the back-end database, and the business service obtains the external device support library download URL through the identification code of the external device, automatically creates the external device service capability script according to the service category interface definition and support library definition information, and creates a download URL in the temporary directory (the address can be used to download the external device service capability script). The business service splices the message according to the interface definition specification based on the device, driver installation information, external device service script URL, and external device support library URL returned by the database, and encrypts it according to the agreed encryption method, and returns it to the daemon process through the response body of the http protocol.
[0132] The operating system of the business terminal obtains the driver installation package information of the external device based on the USB device VID and PID. If the external device information with the driver uploaded is not found in the back-end database, the driver is obtained based on the homologous device analysis. The back-end of the business terminal calls the external device homologous device analysis method, obtains the USB chip manufacturer and model based on the VID and PID through the USB manufacturer support list provided by Linux officially, and obtains the driver installation information of this type of homologous device based on the classified homologous device information library.
[0133] Step 1.5 returns the interface configuration information of the external device.
[0134] The daemon process obtains the returned result through the http response body and decrypts it, parses the returned interface according to the interface definition, and obtains the interface configuration information. The interface configuration information includes the identification code of the external device, the driver information of the external device, the application program interface of the external device, and the configuration information of the external device, among which the configuration information of the external device includes the external device service script URL and the external device support library URL.
[0135] Step 1.6 sends the identification code of the external device to the operating system.
[0136] Step 1.7 The operating system returns the driver package installation information of the external device.
[0137] The daemon process calls the installation package query command in the operating system through the driver package name in the device driver information to check the driver installation status, and parses the (driver installation status) return string.
[0138] Step 1.8 analyzes the driver package installation information. The daemon first checks whether the driver has been installed through the driver installation status return string. If it has been installed, it compares whether the driver version returned by the current business service is consistent with the installed version. If the versions are consistent, it jumps to step 1.11 to authorize the device; if they are inconsistent, it calls the operating system installation package uninstall command to uninstall the currently installed version, and at the same time goes to step 1.9 and starts the uninstall monitoring thread to monitor the uninstall status.
[0139] Step 1.9: Get the driver package. The daemon process obtains the driver installation package download address according to the download list in the driver installation information through the device driver information returned by the business service, and starts the download thread to download the driver installation package; checks whether the same version of the dependency has been installed locally through the dependency package list in the installation information. If not, start the download thread to download the dependency package. After all download threads are finished, execute step 1.10.
[0140] Step 1.10 installs the driver package. Get the status of the uninstall monitoring thread in step 1.12. If the uninstallation is complete, install the dependent packages in the order of the dependent packages in the installation information. After the dependent packages are installed, install the device driver. After the device driver installation is complete, proceed to step 1.15. If the uninstallation thread is not completed, repeat this step.
[0141] Step 1.11 Device authorization. If the operating system is Linux, the daemon authorizes the current user to read and write device permissions based on the BUSNUM and DEVNUM of the external device through the ROOT permission. The execution command is as follows:
[0142] chmod-R+rw / dev / bus / usb / BUSNUM / DEVNUM
[0143] Step 1.12 obtains the application interface and configuration information according to the interface configuration information. Specifically, the interface configuration information includes the identification code of the external device, the driver information of the external device, the application interface of the external device, and the configuration information of the external device, wherein the configuration information of the external device includes the external device service script URL and the external device support library URL. Obtain the external device support library, download the external device support library from the server according to the external device support library URL parsed in step 1.10, and unzip and copy it to the corresponding storage directory of the client.
[0144] Step 1.13 mounts the application program interface on the installation package according to the configuration information. According to the identification code of the external device, the driver information of the external device, the application program interface of the external device and the configuration information of the external device parsed in step 1.12, the configuration information of the external device includes the external device service script URL and the external device support library URL. The external device service script URL downloads the external device service script from the server and pushes it to the client script engine. The client script engine receives the external device service script and executes the script according to the internal agreement. According to the http service instance parsed by the script engine, an http service instance is created, and the instance request is executed to execute the external device service script corresponding to the script engine.
[0145] Step 1.14 Enable the peripheral service interface.
[0146] In summary, the peripheral service client allows the client to pass the initial configuration as a daemon process and be executed when the operating system is started. The peripheral service client detects the device access event pushed by the operating system kernel, and checks the driver package information. If the driver needs to be installed, first check the local driver package installation status. If it has been installed, load the device driver; if it has not been installed, find the matching driver package based on the local operating system kernel and CPU architecture and download and install it; after the installation is completed, load the device driver; after loading the device driver, authorize the current user to read and write permissions.
[0147] The peripheral service client driver check is completed, and the external device support library and service capability script download address are parsed and automatically downloaded through the service capability description. After all downloads are completed, the service capability script is executed through the built-in script engine of the daemon process, and the external device service is started to provide external device access capabilities for the business system.
[0148] The business system operating environment is decoupled, providing the application system with a unified calling interface for external devices and local applications. The business system does not need to consider the terminal environment, hardware brand and model through the decoupling of the peripheral service client. When the business system accesses local external devices, it can directly call the service capabilities provided by the peripheral service client to access the external devices.
[0149] (4) Intelligent audit and verification module
[0150] In this proposal, a local binary verification face recognition method based on the Local Binary Patterns Histograms (LBPH) algorithm is introduced. The specific introduction is as follows:
[0151] 1. Load the data.
[0152] Using vector <mat>imgs and vector <int>Labels store the image data and the labels corresponding to the images respectively.
[0153] 2. Train the model.
[0154] 2.1 Initialization parameters.
[0155] (1) Initialize the sampling radius (radius=1), neighborhood size (neighbors=8), number of grids in width and height directions (gridx=8, griddy=8), and histogram distance threshold (threshold=DBL_MAX).
[0156] (2) Use labels to initialize the model label array _labels.
[0157] 2.2 Local Binary Patterns (LBP) encoding.
[0158] Calculate the LBP coded image LBPi of each image, the size is (w-2*radius,h-2*radius), and the calculation method of each pixel value is as follows:
[0159] (1) Calculate the pixel offset coordinates (dx, dy)n corresponding to the nth neighborhood of all pixel coordinates in sequence.
[0160] (2) Bilinear interpolation calculates the grayscale value gray(x,y)n and the encoding value lbp(x,y)n of the nth neighborhood of all pixel coordinates (x,y), and the values are as follows:
[0161] lbp(x,y)n=1,(grayx,yn≤gray(x,y)n)
[0162] lbp(x,y)n=0,(grayx,yn>gray(x,y)n)
[0163] (3) Calculate the LBP encoding values of all pixels as shown in the following formula (1).
[0164]
[0165] 2.3 Screen valid data.
[0166] According to the image texture analysis model, filtering out non-uniform pattern data can reduce the dimension and reduce the computational cost. According to the uniformity pattern definition: a pattern with a maximum of two bit changes; according to this definition, the already calculated LBP code set is filtered to filter out non-uniform pattern data to reduce the amount of computation.
[0167] The width of the histogram matrix HISTi corresponding to each LBPi image is 2neighbors = 256, and the height is gradx * grady
[0168] (1) Calculate the width and height of each grid.
[0169] The width w_grad = LBP.cols / gridx
[0170] The height h_grad = LBP.rows / gridy
[0171] (2) Statistically calculate the height of each value in the histogram within each grid according to the row order, and sequentially store the results in each row of HISTi; and normalize the histogram height, that is, divide all histogram heights by w_grad * h_grad. Convert HISTi to a 1-row and 1-column vector matrix in row-major order.
[0172] (3) Insert the histogram matrix HISTi of all face training images into the member variable _histograms, where the number of rows of _histograms is gradx * grady * 2neighbors, and the number of columns is N.
[0173] 3. Update the model.
[0174] First, set the updated model image data and the image corresponding label data; the update model algorithm is the same as the training model algorithm, and the only difference is that _labels and _histograms do not need to be cleared before training the model.
[0175] 4. Prediction.
[0176] Calculate the histogram matrix HISTq of the face image to be recognized according to the method in 3, calculate the distance between HISTq and the histograms _histogramsi of each image in the training model, record the label label_min corresponding to the histogram image with the minimum distance dis_min. If dis_min < threshold, the label corresponding to this face image is label_min, otherwise return -1. The method for calculating the distance between two histograms (opencv function compareHist) is shown in the following formula (2):
[0177]
[0178] Among them, are the histogram heights of the i-th histogram value j in the training model and the histogram height of the value j in the image to be matched respectively; len is the maximum value of the histogram.
[0179] (5) Content management platform
[0180] After obtaining the external device service category, the business service obtains the service category interface information through the device service category returned by the database, assembles the external device service capability script according to the external device support library and the peripheral service interface, and automatically creates the external device service capability script according to the service category interface definition and the support library definition information. The business site authentication collection information is stored in the content management platform.
[0181] In addition, an embodiment of the present invention further provides an external device service client, which includes an external device service startup program. When the external device service startup program is executed, the embodiment of the external device service startup method described above is implemented.
[0182] In addition, an embodiment of the present invention further provides a storage medium, on which an information collection program is stored, and when the information collection program is executed by a processor, any embodiment of the above-mentioned information collection method is implemented.
[0183] In addition, an embodiment of the present invention further provides a computer program product, which includes an information collection program. When the information collection program is executed by a processor, any embodiment of the above-mentioned information collection method is implemented.
[0184] The specific implementation methods of the computer program product of the present invention are basically the same as the above-mentioned information collection method embodiments, and will not be described in detail here.
[0185] It should be noted that, in this article, the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0186] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0187] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0188] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.< / int> < / mat>
Claims
1. A method for starting an external device service, characterized in that: Applied to a peripheral service client, the method comprises: When an external device is detected to be connected, obtaining an identification code of the external device; Uploading the identification code of the external device to the service terminal, and receiving the driver package installation information and the interface configuration information of the external device returned by the service terminal; A peripheral service interface of the external device is formed according to the driver package installation information and the interface configuration information of the external device.
2. The external device service startup method according to claim 1, characterized in that: The interface configuration information includes an application program interface and configuration information; The forming of the peripheral service interface of the external device according to the driver package installation information and the interface configuration information of the external device comprises: Installing the driver package on the service terminal according to the driver package installation information; The application program interface is hooked onto the driver package according to the configuration information to form a peripheral service interface of the external device.
3. The external device service startup method according to claim 1 or 2, characterized in that: The peripheral service interface is an interface based on the Hypertext Transfer Protocol.
4. An information collection method, characterized in that: Applied to a service terminal, the service terminal is equipped with a peripheral service client that implements the external device service startup method described in any one of claims 1 to 3 above, and the information collection method includes: When receiving the identification code of the external device, acquiring the driver package installation information and the interface configuration information of the external device according to the identification code of the external device; Transmitting the driver package installation information and the interface configuration information of the external device to the peripheral service client; When an information collection request is received, the peripheral service interface formed by the peripheral service client is called to obtain the information collected by the external device.
5. The information collection method according to claim 4, characterized in that: The acquiring the driver package installation information and the interface configuration information of the external device according to the identification code of the external device includes: Acquiring driver package installation information of the external device from the operating system of the service terminal according to the identification code of the external device; The interface configuration information of the external device is obtained from a preset backend database according to the identification code of the external device, wherein the preset backend database stores identification codes of various types of external devices and interface configuration information corresponding to the identification codes.
6. The information collection method according to claim 4, characterized in that: After the peripheral service interface formed by the peripheral service client is called to obtain the information collected by the external device in the case of receiving the information collection request, the method further includes: Encrypting the information collected by the external device and transmitting it to the back end of the service terminal; Decrypting the encrypted information at the back end; Audit and verify the decrypted information.
7. The information collection method according to claim 6, characterized in that: The step of encrypting the information collected by the external device and transmitting it to the back end of the service terminal includes: Encrypting the information collected by the external device and generating a check value based on the encrypted information; Sending the encrypted information and the check value to the backend; Decrypting the encrypted information at the back end includes: When the back end verifies that the check value is true, the back end decrypts the encrypted information using a pre-stored secret key.
8. The information collection method according to claim 6, characterized in that: After the decrypted information is audited and verified, the following steps are also included: The information that has passed the audit verification is stored in the back-end database of the business system in the form of a character string, and the information that has passed the audit verification is backed up in the form of a file.
9. A peripheral service client, characterized in that: The peripheral service client comprises an external device service startup program, and when the external device service startup program is executed, the steps of the external device service startup method according to any one of claims 1 to 3 are implemented.
10. An electronic device, characterized in that: The device comprises: a memory, a processor, and an information collection program stored in the memory and executable on the processor, wherein the information collection program is configured to implement the steps of the information collection method according to any one of claims 4 to 8.
11. A storage medium, characterized in that: The storage medium stores an information collection program, and when the information collection program is executed by the processor, the steps of the information collection method according to any one of claims 4 to 8 are implemented.
12. A computer program product, characterized in that The computer program product comprises an information collection program, and when the information collection program is executed by a processor, the steps of the information collection method according to any one of claims 4 to 8 are implemented.
