Disclosure of Invention
Therefore, a method for integrating the unified data of the domestic external device in the trusted environment needs to be provided to solve the problems of poor flexibility and low security of the existing adaptation scheme, and the specific technical scheme is as follows:
a method for integrating the unified data of the domestic external equipment in the environment of letter creation includes the following steps:
building local middleware, wherein different interfaces are packaged in the local middleware, and the different interfaces comprise one or more of the following: the system comprises a plug-in calling interface, a local API function calling interface and an automation program calling interface;
the local service system is adapted to the external hardware via said different interface,
or
And the local business system calls an automation program through the different interfaces.
Furthermore, the local middleware uses a Web Socket to communicate, and a Socket local service container is arranged in the local middleware.
Further, the "local service system is adapted to the external hardware through the different interfaces", further comprising the steps of:
responding to the plug-in calling instruction, generating a security checking token for the connection session of each plug-in, checking the contents in the token by the called plug-in or the called service, and if the checking is passed, successfully calling the corresponding plug-in.
Further, a plug-in manager is provided in the local middleware, and the plug-in manager includes one or more functions: loading plug-ins, registering plug-ins, and unloading plug-ins.
Further, the "building local middleware" further includes the steps of:
packaging part of third-party preset resources into an integration channel of a popup window or an embedded window applet of an independent process in the local middleware, wherein the third-party preset resources comprise one or more of the following: an automation program module and a DLL dynamic link library.
In order to solve the technical problem, the storage device is further provided, and the specific technical scheme is as follows:
a storage device having stored therein a set of instructions for performing: building local middleware, wherein different interfaces are packaged in the local middleware, and the different interfaces comprise one or more of the following: the system comprises a plug-in calling interface, a local API function calling interface and an automation program calling interface;
the local service system is adapted to the external hardware via said different interface,
or
And the local business system calls an automation program through the different interfaces.
Furthermore, the local middleware uses a Web Socket to communicate, and a Socket local service container is arranged in the local middleware.
Further, the set of instructions is further for performing: the local service system is adapted with external hardware through the different interfaces, and the method further comprises the following steps:
responding to the plug-in calling instruction, generating a security checking token for the connection session of each plug-in, checking the contents in the token by the called plug-in or the called service, and if the checking is passed, successfully calling the corresponding plug-in.
Further, a plug-in manager is provided in the local middleware, and the plug-in manager includes one or more functions: loading plug-ins, registering plug-ins, and unloading plug-ins.
Further, the set of instructions is further for performing: the method for building the local middleware further comprises the following steps:
packaging part of third-party preset resources into an integration channel of a popup window or an embedded window applet of an independent process in the local middleware, wherein the third-party preset resources comprise one or more of the following: an automation program module and a DLL dynamic link library.
The invention has the beneficial effects that: by constructing a local middleware, different interfaces are encapsulated in the local middleware, and the different interfaces comprise one or more of the following: the system comprises a plug-in calling interface, a local API function calling interface and an automation program calling interface; the local service system is adapted with external hardware through the different interfaces, or the local service system calls an automation program through the different interfaces. The local middleware is used as an intermediate bridge, so that data communication and integrated adaptation can be realized by the local service system, the external hardware, the local service system and various automatic programs through the local middleware, the requirement of unified data integration of different external devices in different trusted environments is met, adaptation integrated development is not required to be carried out on different devices in different environments, and the flexibility is greatly improved.
Detailed Description
To explain technical contents, structural features, and objects and effects of the technical solutions in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
Referring to fig. 1 to fig. 3, in the present embodiment, a method for unified data integration of domestic external devices in a trusted environment can be applied to a storage device, which includes but is not limited to: personal computers, servers, general purpose computers, special purpose computers, network devices, embedded devices, programmable devices, and the like. The method comprises the following specific steps:
step S101: building local middleware, wherein different interfaces are packaged in the local middleware, and the different interfaces comprise one or more of the following: the system comprises a plug-in calling interface, a local API function calling interface and an automation program calling interface.
Step S102: the local service system is adapted with external hardware through the different interfaces, or the local service system calls an automation program through the different interfaces.
With reference to fig. 2, in this embodiment, the local middleware includes the unified data integration framework and JS SDK shown in fig. 2. As shown in fig. 2, a user can access the local business system through a browser, and then the user can adapt to external hardware or interact with different automation programs through local middleware. The core technical idea of the scheme is as follows: different interfaces are packaged into a local middleware which can be used as an intermediate bridge, the front-end JS script can be used for controlling various external devices connected with a local computer without obstacles, calling API functions of a local system or various installed component functions, a DLL dynamic link library, an NPAPI plug-in and an automation program are supported, an integration interface irrelevant to a front-end development language is provided, the integration and butt joint of the information system can be completed by the webpage front end only needing to call a Web Socket service interface by using the JS SDK, the unified integration of the information system and the external devices is realized, and complex information creating environments such as related chips, operating systems, middleware and the like do not need to be considered. And the plug-in calling interface in the local middleware is expandable, and different expansions can be carried out according to actual application scenes.
It should be noted that, for external hardware, it needs an external device manufacturer to develop driving research and development of related hardware devices for different trusted environments, adapt to different chips and operating systems, and provide different SDKs to meet adaptation work in different environments.
In this embodiment, the local middleware uses a Web Socket to perform communication, and a Socket local service container is disposed in the local middleware. The method specifically comprises the following steps: the unified data integration framework adopts a Web Socket technology as a communication basis of a local middleware, a Socket local service container is constructed, a bridge for providing data exchange between a browser and local hardware or an automation program is provided, an extensible plug-in framework is provided, data communication of a local hardware dynamic link library is realized by secondarily developing an SDK package interface, a JSON format is adopted for data exchange, the data exchange format can be deployed locally and operated in a system service form, and the data exchange framework also supports the operation in a common desktop program form, as shown in figure 3.
Further, the "building local middleware" further includes the steps of: packaging part of third-party preset resources into an integration channel of a popup window or an embedded window applet of an independent process in the local middleware, wherein the third-party preset resources comprise one or more of the following: an automation program module and a DLL dynamic link library. The method specifically comprises the following steps: customizing and developing corresponding integrated plug-ins aiming at SDKs provided by devices and models of different manufacturers, and developing a small packaging program of a local hardware driving module through an interface to realize the operation and control of various local hardware devices such as card readers, printers, scanners, high-speed shooting instruments, U shields and the like in a webpage; the method comprises the steps of packaging functions of local API functions (such as certificate acquisition, file reading and writing, uploading and downloading and the like) into small programs for calling by a webpage end; meanwhile, an integrated channel for encapsulating a mature DLL and an automation program module into a pop-up window or an embedded window applet of an independent process is provided, the problem that the integrated channel cannot run compatibly in browsers of high versions such as Chrome, Edge, Firefox and the like is solved, and specific service scenes mainly comprise the following three types:
1) and aiming at a component interface in the windowless applet, when a certain applet service is requested in the browser, the integrated service calls a method Load of the interface and transmits the method Load into the component, so that the two-way communication with the client connection from the browser can be completed through the interface.
2) Aiming at a component interface of a Web Socket server side established in a small program needing a popup window or an embedded window, when a browser requests a small program service, the small program process is started by the service in a mode of transmitting command line parameters, an ISocketproxy instance object is established in the small program process, a monitoring service of a specified port is established, the monitoring information of a current plug-in is returned to the connection of the request plug-in by the service, and then a monitoring service connected to an Exe plug-in is newly established, so that the client side connection from the browser is realized to carry out two-way communication.
3) And aiming at providing an interface for connecting COM controls in an IE browser, and solving the problem of compatibility use in low-version IE.
Furthermore, by combining the capability of external equipment, the equipment matching and offline processing services are developed, for example, external equipment SDK resources such as an attachment uploading integration printer, a scanner, a second-generation certificate recognition and reading instrument, a high-speed shooting instrument and the like are added, and the plug-in extension capability service is increased.
Further, the "local service system is adapted to the external hardware through the different interfaces", further comprising the steps of: responding to the plug-in calling instruction, generating a security checking token for the connection session of each plug-in, checking the contents in the token by the called plug-in or the called service, and if the checking is passed, successfully calling the corresponding plug-in. The calling safety and the data confidentiality are realized.
Furthermore, the unified data integration framework encapsulates the JS SDK packet and provides the JS SDK packet for the service system to call, and the service system can perform data interaction and integration of external equipment through a unified data integration interface. The steps of the integration are as follows,
1) whether the local middleware is installed or not is detected, whether the control is installed or not is judged by acquiring the version information of the middleware, if the control is not installed, a message is prompted and then the control is turned to a downloading interface, and the specific interaction mode is as follows:
connection address: ws:// xxx. communid ═ timestamp } & flag ═ flag }
Inputting parameters: { "req": url _ Version "," rid ": timestamp", "para": "}
And (5) returning JSON result parameters, and judging through the obtained result.
2) And connecting and initializing the plug-in service, automatically starting the plug-in process through the URL, returning the current interception port of the plug-in process by the middleware, and requesting to connect the URL to finish the operation.
3) And establishing connection, calling the equipment capability by combining the relevant protocols of equipment communication, and returning the result to the service end.
4) And closing the connection.
By constructing a local middleware, different interfaces are encapsulated in the local middleware, and the different interfaces comprise one or more of the following: the system comprises a plug-in calling interface, a local API function calling interface and an automation program calling interface; the local service system is adapted with external hardware through the different interfaces, or the local service system calls an automation program through the different interfaces. The local middleware is used as an intermediate bridge, so that data communication and integrated adaptation can be realized by the local service system, the external hardware, the local service system and various automatic programs through the local middleware, the requirement of unified data integration of different external devices in different trusted environments is met, adaptation integrated development is not required to be carried out on different devices in different environments, and the flexibility is greatly improved.
Referring to fig. 2 to 4, in the present embodiment, an embodiment of a memory device 400 is as follows:
a storage device 400 having stored therein a set of instructions for performing: building local middleware, wherein different interfaces are packaged in the local middleware, and the different interfaces comprise one or more of the following: the system comprises a plug-in calling interface, a local API function calling interface and an automation program calling interface; the local service system is adapted with external hardware through the different interfaces, or the local service system calls an automation program through the different interfaces.
With reference to fig. 2, in this embodiment, the local middleware includes the unified data integration framework and JS SDK shown in fig. 2. As shown in fig. 2, a user can access the local business system through a browser, and then the user can adapt to external hardware or interact with different automation programs through local middleware. The core technical idea of the scheme is as follows: different interfaces are packaged into a local middleware which can be used as an intermediate bridge, the front-end JS script can be used for controlling various external devices connected with a local computer without obstacles, calling API functions of a local system or various installed component functions, a DLL dynamic link library, an NPAPI plug-in and an automation program are supported, an integration interface irrelevant to a front-end development language is provided, the integration and butt joint of the information system can be completed by the webpage front end only needing to call a Web Socket service interface by using the JS SDK, the unified integration of the information system and the external devices is realized, and complex information creating environments such as related chips, operating systems, middleware and the like do not need to be considered. And the plug-in calling interface in the local middleware is expandable, and different expansions can be carried out according to actual application scenes.
It should be noted that, for external hardware, it needs an external device manufacturer to develop driving research and development of related hardware devices for different trusted environments, adapt to different chips and operating systems, and provide different SDKs to meet adaptation work in different environments.
Furthermore, the local middleware uses a Web Socket to communicate, and a Socket local service container is arranged in the local middleware. The method specifically comprises the following steps: the unified data integration framework adopts a Web Socket technology as a communication basis of a local middleware, a Socket local service container is constructed, a bridge for providing data exchange between a browser and local hardware or an automation program is provided, an extensible plug-in framework is provided, data communication of a local hardware dynamic link library is realized by secondarily developing an SDK package interface, a JSON format is adopted for data exchange, the data exchange format can be deployed locally and operated in a system service form, and the data exchange framework also supports the operation in a common desktop program form, as shown in figure 3.
Further, the set of instructions is further for performing: the method for building the local middleware further comprises the following steps: packaging part of third-party preset resources into an integration channel of a popup window or an embedded window applet of an independent process in the local middleware, wherein the third-party preset resources comprise one or more of the following: an automation program module and a DLL dynamic link library. The method specifically comprises the following steps: customizing and developing corresponding integrated plug-ins aiming at SDKs provided by devices and models of different manufacturers, and developing a small packaging program of a local hardware driving module through an interface to realize the operation and control of various local hardware devices such as card readers, printers, scanners, high-speed shooting instruments, U shields and the like in a webpage; the method comprises the steps of packaging functions of local API functions (such as certificate acquisition, file reading and writing, uploading and downloading and the like) into small programs for calling by a webpage end; meanwhile, an integrated channel for encapsulating a mature DLL and an automation program module into a pop-up window or an embedded window applet of an independent process is provided, the problem that the integrated channel cannot run compatibly in browsers of high versions such as Chrome, Edge, Firefox and the like is solved, and specific service scenes mainly comprise the following three types:
1) and aiming at a component interface in the windowless applet, when a certain applet service is requested in the browser, the integrated service calls a method Load of the interface and transmits the method Load into the component, so that the two-way communication with the client connection from the browser can be completed through the interface.
2) Aiming at a component interface of a Web Socket server side established in a small program needing a popup window or an embedded window, when a browser requests a small program service, the small program process is started by the service in a mode of transmitting command line parameters, an ISocketproxy instance object is established in the small program process, a monitoring service of a specified port is established, the monitoring information of a current plug-in is returned to the connection of the request plug-in by the service, and then a monitoring service connected to an Exe plug-in is newly established, so that the client side connection from the browser is realized to carry out two-way communication.
3) And aiming at providing an interface for connecting COM controls in an IE browser, and solving the problem of compatibility use in low-version IE.
Furthermore, by combining the capability of external equipment, the equipment matching and offline processing services are developed, for example, external equipment SDK resources such as an attachment uploading integration printer, a scanner, a second-generation certificate recognition and reading instrument, a high-speed shooting instrument and the like are added, and the plug-in extension capability service is increased.
Further, the set of instructions is further for performing: the local service system is adapted with external hardware through the different interfaces, and the method further comprises the following steps: responding to the plug-in calling instruction, generating a security checking token for the connection session of each plug-in, checking the contents in the token by the called plug-in or the called service, and if the checking is passed, successfully calling the corresponding plug-in. The calling safety and the data confidentiality are realized.
Further, a plug-in manager is provided in the local middleware, and the plug-in manager includes one or more functions: loading plug-ins, registering plug-ins, and unloading plug-ins.
Furthermore, the unified data integration framework encapsulates the JS SDK packet and provides the JS SDK packet for the service system to call, and the service system can perform data interaction and integration of external equipment through a unified data integration interface. The steps of the integration are as follows,
1) whether the local middleware is installed or not is detected, whether the control is installed or not is judged by acquiring the version information of the middleware, if the control is not installed, a message is prompted and then the control is turned to a downloading interface, and the specific interaction mode is as follows:
connection address: ws:// xxx. communid ═ timestamp } & flag ═ flag }
Inputting parameters: { "req": url _ Version "," rid ": timestamp", "para": "}
And (5) returning JSON result parameters, and judging through the obtained result.
2) And connecting and initializing the plug-in service, automatically starting the plug-in process through the URL, returning the current interception port of the plug-in process by the middleware, and requesting to connect the URL to finish the operation.
3) And establishing connection, calling the equipment capability by combining the relevant protocols of equipment communication, and returning the result to the service end.
4) And closing the connection.
By executing the set of instructions on the storage device 400: building local middleware, wherein different interfaces are packaged in the local middleware, and the different interfaces comprise one or more of the following: the system comprises a plug-in calling interface, a local API function calling interface and an automation program calling interface; the local service system is adapted with external hardware through the different interfaces, or the local service system calls an automation program through the different interfaces. The local middleware is used as an intermediate bridge, so that data communication and integrated adaptation can be realized by the local service system, the external hardware, the local service system and various automatic programs through the local middleware, the requirement of unified data integration of different external devices in different trusted environments is met, adaptation integrated development is not required to be carried out on different devices in different environments, and the flexibility is greatly improved.
It should be noted that, although the above embodiments have been described herein, the invention is not limited thereto. Therefore, based on the innovative concepts of the present invention, the technical solutions of the present invention can be directly or indirectly applied to other related technical fields by making changes and modifications to the embodiments described herein, or by using equivalent structures or equivalent processes performed in the content of the present specification and the attached drawings, which are included in the scope of the present invention.