CN116126319A - Browser-based hardware terminal control method, system and device - Google Patents

Browser-based hardware terminal control method, system and device Download PDF

Info

Publication number
CN116126319A
CN116126319A CN202211646018.XA CN202211646018A CN116126319A CN 116126319 A CN116126319 A CN 116126319A CN 202211646018 A CN202211646018 A CN 202211646018A CN 116126319 A CN116126319 A CN 116126319A
Authority
CN
China
Prior art keywords
hardware
browser
terminal control
interaction
control method
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211646018.XA
Other languages
Chinese (zh)
Inventor
冯磊
刘大伟
李琪文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shensi Shandong Medical Information Technology Co ltd
Original Assignee
Shensi Shandong Medical Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shensi Shandong Medical Information Technology Co ltd filed Critical Shensi Shandong Medical Information Technology Co ltd
Priority to CN202211646018.XA priority Critical patent/CN116126319A/en
Publication of CN116126319A publication Critical patent/CN116126319A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a hardware terminal control method, a system and a device based on a browser, wherein the method comprises the following steps: executing websocket/http/socket service modes based on c++ language; creating an external interaction interface aiming at hardware functions; standard encapsulation of the same type of hardware interfaces is completed aiming at SDKs provided by different models or manufacturers; and testing whether service interaction is normal or not through js webpage program. According to the invention, different terminals can be controlled based on the browser, and corresponding calling instructions are provided for the outside, so that the interaction efficiency is effectively improved.

Description

Browser-based hardware terminal control method, system and device
Technical Field
The invention relates to the technical field of computers, in particular to a hardware terminal control method, a system and a device based on a browser.
Background
The software suitable for the b/s architecture is basically developed based on ie when the hardware is called, because the mode provided by the hardware manufacturer on a terminal calling interface is basically two, namely a dynamic library mode and an ocx control mode.
The implementation process of the dynamic library mode mainly comprises the following steps: firstly, a node. Js development environment is required to be built, and loading, calling and docking of the dynamic libraries of all terminals are carried out based on a node-ffi module of the node. Js; at this time, corresponding function call service interfaces or message formats are provided for the functions of the respective terminals; and then setting up a server of http or websocket for carrying out data receiving and transmitting operation with the B/S architecture software on the browser. If a plurality of third party manufacturers need to dock the terminals, the interface docking of all the terminals can be completed only by docking the service interfaces provided by the nodes.
The implementation process of the ocx control mainly comprises the following steps: different terminal manufacturers provide corresponding ocx controls for third-party software manufacturers to use; if the third party software manufacturer uses more hardware, multiple ocx component interfaces need to be docked, and meanwhile, the docking is developed according to different interface modes. At this time, all the developed software of the B/S architecture can only run on ie; if multiple third party vendors need to interface with these terminals, development is based on the ocx components of the respective terminals.
Therefore, the B/S architecture software for hardware call under windows basically uses the ocx control and can only run under ie, but as ie is abandoned on the win10, the related B/S architecture software cannot be used under ie, so partial software developers call a dynamic library of a hardware terminal to drive hardware by using a node.js mode, the node.js needs to install a dependent environment on each machine, the operation mode is complicated, the method is only suitable for own software after development is finished, and the problem that the hardware is difficult to call is similar to other software.
Disclosure of Invention
Aiming at the problems in the prior art, the invention aims to provide a hardware terminal control method, a system and a device based on a browser, which can control different terminals based on the browser and simultaneously provide corresponding calling instructions to the outside.
The invention aims to achieve the aim, and the aim is achieved by the following technical scheme:
a hardware terminal control method based on a browser comprises the following steps:
executing websocket/http/socket service modes based on c++ language;
creating an external interaction interface aiming at hardware functions;
standard encapsulation of the same type of hardware interfaces is completed aiming at SDKs provided by different models or manufacturers;
and testing whether service interaction is normal or not through js webpage program.
Further, the executing the websocket/http/socket service mode based on the c++ language includes: receiving a data request sent by a client;
analyzing and processing the data;
distributing the corresponding data to the corresponding hardware functional layer for execution;
and after the execution is finished, returning an execution result to the client.
Further, the client specifically includes: B/S architecture software running on the browser.
Further, the creating the external interaction interface for the hardware function includes:
in the data sent by the client, a method name parameter and a device model parameter are specified for the data, so that the data are forwarded to a specific hardware functional layer for execution after being analyzed by the server.
Further, the hardware functions include:
the card reader provides a card reading function;
a printing function provided by the printer and a printer status detection function.
Further, the standard packaging of the same kind of hardware interfaces is completed for SDKs provided by different models or manufacturers, including:
developing a basic interaction standard layer to unify hardware functions, and realizing interaction logic by a hardware function layer; and finding out corresponding hardware equipment to execute corresponding functions by reading the hardware types and the operation method names.
Further, the testing whether the service interaction is normal through the js webpage program includes:
through js webpage program, the connection of the server is carried out, if the connection is successful, the normal state is returned, and if the connection is failed, the error is directly reported;
after the connection is established successfully, executing control operation of the corresponding hardware through interaction of packet messages of the corresponding hardware, and sending an operation result;
and judging whether the interaction of the equipment is normal or not according to the operation result.
Correspondingly, the invention also discloses a hardware terminal control system based on the browser, which comprises: the service function module is used for executing a websocket/http/socket service mode based on a c++ language;
the interface creation module is used for creating an external interaction interface aiming at the hardware function;
the interface packaging module is used for completing standardized packaging of the same type of hardware interfaces aiming at SDKs provided by different models or manufacturers;
and the testing module is used for testing whether service interaction is normal or not through the js webpage program.
Correspondingly, the invention also discloses a hardware terminal control device based on the browser, which comprises:
a memory for storing a computer program;
a processor for implementing the browser-based hardware terminal control method steps of any one of the above when executing the computer program.
Compared with the prior art, the invention has the beneficial effects that: the invention provides a browser-based hardware terminal control method, a browser-based hardware terminal control system and a browser-based hardware terminal control device, which are used for solving the control of hardware terminals under different browsers by realizing a service communication mode based on a c++ language. The invention can improve the interaction efficiency and the deployment efficiency at the same time. Meanwhile, the method is based on the advantages of the c++ language and excellent in cross-platform application.
It can be seen that the present invention has outstanding substantial features and significant advances over the prior art, as well as the benefits of its implementation.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method of an embodiment of the present invention.
Fig. 2 is a system configuration diagram of an embodiment of the present invention.
In the figure, 1 is a service function module; 2, creating a module for the interface; 3 is an interface packaging module; and 4, a test module.
Detailed Description
The following describes specific embodiments of the present invention with reference to the drawings.
The hardware terminal control method based on the browser shown in fig. 1 comprises the following steps:
s1: and executing websocket/http/socket service modes based on c++ language.
Specifically, firstly, receiving a data request sent by a client, and analyzing and processing the data; then distributing the corresponding data to the corresponding hardware functional layer for execution; and after the execution is finished, returning an execution result to the client.
As an example, this step completes the websocket/http/socket server function based on the c++ language, and is used to receive the data request sent by the client (i.e. the B/S architecture software running on the browser). By data parsing. And distributing the corresponding data to the corresponding hardware functional layer for execution, and returning an execution result to the client after the execution is finished.
S2: an external interaction interface is created for the hardware function.
Specifically, in the data sent by the client, a method name parameter and a device model parameter are specified for the data, so that the data is analyzed by the server and then forwarded to a specific hardware functional layer for execution.
The method relates to various hardware, such as a card reader, and can externally provide card reading functions (such as identity card reading, social security card reading, regional diagnosis and treatment card reading and the like); a printer that can externally provide printing and printer status detection (cartridge status, carton status, etc.); for example, the functions of the hardware can be provided for the external features. In order to package the uniformity of the interactive data, relevant parameters such as method names, equipment models and the like are specified in the data sent by the client side, and are forwarded to a specific hardware functional layer for execution after being analyzed by the server side.
S3: and finishing standardized encapsulation of the same type of hardware interfaces aiming at SDKs provided by different models or manufacturers.
Firstly, developing a basic interaction standard layer to unify hardware functions, and realizing interaction logic by the hardware function layer. Then, the corresponding hardware equipment is found out to execute the corresponding function by reading the hardware type and the operation method name.
By way of example, the different hardware involved in the present method is broadly divided into: card readers, printers, card issuers, banknote issuers, bar code scanners and the like, but terminal equipment suppliers exist in the same type of hardware, and the external provided upper computers SDK are inconsistent, so that in order to ensure the standardization of upper-layer interaction, standardized packaging work of the same type of hardware interfaces needs to be completed aiming at SDKs provided by different models or manufacturers. Taking a card reader as an example, aiming at the characteristics of the card reader, all types of card readers comprise the following basic upper computer interfaces: opening the equipment, closing the equipment, allowing card entering, card moving, card powering-up, powering-down, card communication and the like, but the interface names of different manufacturers are not uniform in access parameters. Therefore, standardized adaptation needs to be completed for the basic interface, and the devices of different manufacturers are packaged once according to the uniform interface name. The step is mainly to complete the development of the basic interaction standard layer. The purpose is to realize unification of card reading functions, complex and changeable interaction logic is realized by a card reading function layer, and card readers of different types only need to complete a basic standard interface layer. The corresponding equipment can be found to execute the corresponding function through the card reader type and the card type transmitted by the upper layer and the operation method name. Thus, the problem that corresponding card reading functions are required to be developed for all card readers of different types is avoided.
S4: and testing whether service interaction is normal or not through js webpage program.
Firstly, connecting a server through js webpage program, returning to normal if the connection is successful, and directly reporting errors if the connection is failed; after the connection is established successfully, executing control operation of the corresponding hardware through interaction of packet messages of the corresponding hardware, and sending an operation result; and finally, judging whether the equipment interaction is normal or not according to the operation result.
Correspondingly, as shown in fig. 2, the invention also discloses a hardware terminal control system based on the browser, which comprises: a service function module 1, an interface creation module 2, an interface encapsulation module 3 and a test module 4.
The service function module 1 is used for executing websocket/http/socket service modes based on c++ language.
The interface creation module 2 is configured to create an external interaction interface for the hardware function.
And the interface packaging module 3 is used for completing standardized packaging of the same type of hardware interfaces aiming at SDKs provided by different models or manufacturers.
And the test module 4 is used for testing whether service interaction is normal or not through the js webpage program.
Correspondingly, the invention also discloses a hardware terminal control device based on the browser, which comprises:
a memory for storing a computer program;
a processor for implementing the browser-based hardware terminal control method steps of any one of the above when executing the computer program.
It will be apparent to those skilled in the art that the techniques of embodiments of the present invention may be implemented in software plus a necessary general purpose hardware platform. Based on such understanding, the technical solution in the embodiments of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium such as a U-disc, a mobile hard disc, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk or an optical disk, etc. various media capable of storing program codes, including several instructions for causing a computer terminal (which may be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the method described in the embodiments of the present invention. The same or similar parts between the various embodiments in this specification are referred to each other. In particular, for the terminal embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference should be made to the description in the method embodiment for relevant points.
In the several embodiments provided by the present invention, it should be understood that the disclosed systems, and methods may be implemented in other ways. For example, the system embodiments described above are merely illustrative, e.g., the division of the elements is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, system or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each module may exist alone physically, or two or more modules may be integrated in one unit.
Similarly, each processing unit in the embodiments of the present invention may be integrated in one functional module, or each processing unit may exist physically, or two or more processing units may be integrated in one functional module.
The invention will be further described with reference to the accompanying drawings and specific embodiments. It is to be understood that these examples are illustrative of the present invention and are not intended to limit the scope of the present invention. Further, it will be understood that various changes or modifications may be made by those skilled in the art after reading the teachings of the invention, and such equivalents are intended to fall within the scope of the invention as defined herein.

Claims (9)

1. The hardware terminal control method based on the browser is characterized by comprising the following steps of:
executing websocket/http/socket service modes based on c++ language;
creating an external interaction interface aiming at hardware functions;
standard encapsulation of the same type of hardware interfaces is completed aiming at SDKs provided by different models or manufacturers;
and testing whether service interaction is normal or not through js webpage program.
2. The browser-based hardware terminal control method according to claim 1, wherein the executing the websocket/http/socket service mode based on the c++ language includes:
receiving a data request sent by a client;
analyzing and processing the data;
distributing the corresponding data to the corresponding hardware functional layer for execution;
and after the execution is finished, returning an execution result to the client.
3. The browser-based hardware terminal control method according to claim 2, wherein the client specifically comprises: B/S architecture software running on the browser.
4. The browser-based hardware terminal control method of claim 2, wherein creating an external interaction interface for a hardware function comprises:
in the data sent by the client, a method name parameter and a device model parameter are specified for the data, so that the data are forwarded to a specific hardware functional layer for execution after being analyzed by the server.
5. The browser-based hardware terminal control method of claim 1, wherein the hardware functions include:
the card reader provides a card reading function;
a printing function provided by the printer and a printer status detection function.
6. The browser-based hardware terminal control method according to claim 1, wherein the standardized packaging of the same kind of hardware interfaces is completed for SDKs provided by different models or vendors, comprising: developing a basic interaction standard layer to unify hardware functions, and realizing interaction logic by a hardware function layer; and finding out corresponding hardware equipment to execute corresponding functions by reading the hardware types and the operation method names.
7. The browser-based hardware terminal control method of claim 1, wherein the testing whether service interaction is normal through js web programs comprises:
through js webpage program, the connection of the server is carried out, if the connection is successful, the normal state is returned, and if the connection is failed, the error is directly reported;
after the connection is established successfully, executing control operation of the corresponding hardware through interaction of packet messages of the corresponding hardware, and sending an operation result;
and judging whether the interaction of the equipment is normal or not according to the operation result.
8. A browser-based hardware terminal control system, comprising:
the service function module is used for executing a websocket/http/socket service mode based on a c++ language;
the interface creation module is used for creating an external interaction interface aiming at the hardware function;
the interface packaging module is used for completing standardized packaging of the same type of hardware interfaces aiming at SDKs provided by different models or manufacturers;
and the testing module is used for testing whether service interaction is normal or not through the js webpage program.
9. A browser-based hardware terminal control device, comprising:
a memory for storing a computer program;
a processor for implementing the browser based hardware terminal control method steps of any one of claims 1 to 7 when executing the computer program.
CN202211646018.XA 2022-12-20 2022-12-20 Browser-based hardware terminal control method, system and device Pending CN116126319A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211646018.XA CN116126319A (en) 2022-12-20 2022-12-20 Browser-based hardware terminal control method, system and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211646018.XA CN116126319A (en) 2022-12-20 2022-12-20 Browser-based hardware terminal control method, system and device

Publications (1)

Publication Number Publication Date
CN116126319A true CN116126319A (en) 2023-05-16

Family

ID=86305559

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211646018.XA Pending CN116126319A (en) 2022-12-20 2022-12-20 Browser-based hardware terminal control method, system and device

Country Status (1)

Country Link
CN (1) CN116126319A (en)

Similar Documents

Publication Publication Date Title
WO2022016847A1 (en) Automatic test method and device applied to cloud platform
CN111212142A (en) Service processing method, integrated open docking platform and computer storage medium
CN112905459A (en) Service interface testing method and device, electronic equipment and storage medium
CN115658042A (en) Hybrid application component type development method, system, device and storage medium
CN114895935A (en) Method and device for flashing vehicle ECU, electronic equipment and storage medium
CN112699034B (en) Virtual login user construction method, device, equipment and storage medium
CN110737428B (en) Hidl-based universal interface design method, device, terminal and readable storage medium
CN116126319A (en) Browser-based hardware terminal control method, system and device
CN116627669A (en) Method, device, equipment and medium for adapting API (application program interface) by heterogeneous cooperation
CN113938527B (en) Extension processing method of API gateway, computing device and storage medium
CN111459819B (en) Software testing method and device, electronic equipment and computer readable medium
CN115237755A (en) Protocol-based check algorithm library calling method and calling equipment
CN111722846B (en) Method and equipment for customizing CIM (common information model) interface compatible with multiple OEM (original equipment manufacturer) products
CN114003500A (en) Software testing method and device
CN115237457A (en) AI application operation method and related product
CN114281706B (en) Model evaluation method, system and storage medium
US7702764B1 (en) System and method for testing network protocols
CN116233282B (en) Method and system for analyzing application layer data of signal safety communication protocol
CN114510298B (en) Intelligent engine access and call method and related platform, device, equipment and medium
CN112015478B (en) Kernel loading method, server, device, computer device and storage medium
CN110766886B (en) Driving device, method for driving card reader to realize card service and self-service payment system
CN112114857B (en) Front-end service management method, front-end server and website server
CN115994098B (en) Analysis method and system for software operation abnormality based on artificial intelligence
CN112051999B (en) Configurable download file generation method and device
CN111338820B (en) Operation method, client and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination