CN116578356A - Calling method and device of OCX object and electronic equipment - Google Patents
Calling method and device of OCX object and electronic equipment Download PDFInfo
- Publication number
- CN116578356A CN116578356A CN202310411999.8A CN202310411999A CN116578356A CN 116578356 A CN116578356 A CN 116578356A CN 202310411999 A CN202310411999 A CN 202310411999A CN 116578356 A CN116578356 A CN 116578356A
- Authority
- CN
- China
- Prior art keywords
- local
- ocx
- electron
- port service
- server environment
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 63
- 238000004590 computer program Methods 0.000 claims description 5
- 238000009434 installation Methods 0.000 claims description 5
- 238000004891 communication Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 4
- 238000012546 transfer Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 230000002093 peripheral effect Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- VYZAMTAEIAYCRO-UHFFFAOYSA-N Chromium Chemical compound [Cr] VYZAMTAEIAYCRO-UHFFFAOYSA-N 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45562—Creating, deleting, cloning virtual machine instances
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The application provides a calling method and device of an OCX object and electronic equipment, wherein the method comprises the following steps: creating a local websocket port service in a local server environment based on an Electron; creating a local http port service in a local server environment based on an Electron; receiving a hardware request sent by a Web page based on a local http port service based on an Electron, and analyzing the hardware request to obtain hardware instruction information; transmitting the hardware instruction information to an OCX page through a local websocket port service based on an Electron so as to read the hardware instruction information based on the OCX page; and acquiring a reading result of the OCX page on the hardware instruction information based on the Electron, and transmitting the reading result to the Web page based on the local http port service. The application can solve the technical problem that the OCX object class expansion assembly cannot be simply and efficiently used in the prior art.
Description
Technical Field
The present application relates to the field of network communications technologies, and in particular, to a method and an apparatus for calling an OCX object, and an electronic device.
Background
With the rapid development of the internet of things, a plurality of hardware peripherals of the internet of things can exchange and communicate information with the internet or a carrier Windows system operated by the hardware peripherals of the internet of things through information sensing equipment according to a contracted protocol.
The OCX object class extension component is used as a portable executable file and is commonly used in the scenario that a peripheral device exchanges data with a Windows system. In Web software, it can be used on an IE browser by the ActiveX technology of Object tags. However, this technique has many limitations because microsoft stops supporting the IE browser. Therefore, how to simply and efficiently use OCX object class extension components in modern Web software becomes a research-worthy problem.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a method, a device and an electronic device for calling an OCX object, so as to solve the technical problem that the OCX object class extension component cannot be simply and efficiently used in the prior art.
In order to achieve the above object, the present application provides a method for calling an OCX object, including:
creating a local websocket port service in a local server environment based on an Electron;
creating a local http port service in the local server environment based on the Electron;
receiving a hardware request sent by a Web page based on the local http port service based on the Electron, and analyzing the hardware request to obtain hardware instruction information;
transmitting the hardware instruction information to an OCX page through the local websocket port service based on the Electron so as to read the hardware instruction information based on the OCX page;
and acquiring a reading result of the OCX page to the hardware instruction information based on the Electron, and transmitting the reading result to the Web page based on the local http port service.
Further, the calling method of the OCX object further comprises the following steps:
before the local websocket port service is created, a local server environment is built, and a plug-in for creating the local websocket port service is installed in the local server environment.
Further, the building a local server environment includes:
and building a local server environment based on the browser engine running environment node. Js embedded in the Electron.
Further, the creating a local websocket port service in a local server environment based on an Electron includes:
based on the listen method of the express plugin and the ws method of the express-ws plugin in the Electron, the local websocket port service is created in the local server environment.
Further, the creating a local http port service in the local server environment based on the Electron includes:
based on the listen method and the post method of the express plugin in the Electron, a local http port service is created in the local server environment.
Further, the reading the hardware instruction information based on the OCX page includes:
and reading the hardware instruction information based on a dynamic link library of the ActiveX control of the OCX page.
The application also provides a calling device of the OCX object, which comprises:
a first service creation module for creating a local websocket port service in a local server environment based on an Electron;
a second service creation module for creating a local http port service in the local server environment based on the Electron;
the first sending module is used for receiving a hardware request sent by the Web page based on the local http port service based on the Electron, and analyzing the hardware request to obtain hardware instruction information;
the second sending module is used for sending the hardware instruction information to an OCX page through the local websocket port service based on the Electron so as to read the hardware instruction information based on the OCX page;
and the acquisition module is used for acquiring a reading result of the OCX page on the hardware instruction information based on the Electron and transmitting the reading result to the Web page based on the local http port service.
Further, the calling device of the OCX object further includes:
and the plug-in installation module is used for building a local server environment before the local websocket port service is created, and installing a plug-in for creating the local websocket port service in the local server environment.
The application also provides an electronic device comprising a memory and a processor, wherein,
the memory is used for storing programs;
the processor is coupled to the memory and is configured to execute the program stored in the memory to implement the steps in the OCX object calling method according to any one of the claims.
The present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of invoking an OCX object as described in any one of the above.
The beneficial effects of the implementation mode are that: according to the method and the device for calling the OCX object and the electronic equipment, the local websocket port service and the local http port service are created in the local server environment through the Electron; receiving a hardware request sent by a Web page based on the local http port service based on the Electron, and analyzing the hardware request to obtain hardware instruction information; transmitting the hardware instruction information to an OCX page through the local websocket port service based on the Electron so as to read the hardware instruction information based on the OCX page; and acquiring a reading result of the OCX page to the hardware instruction information based on the Electron, and transmitting the reading result to the Web page based on the local http port service. According to the application, the OCX control is called based on the local communication method of the Electron, so that the implementation details of an IE browser and a hardware module dynamic link library are effectively isolated, a Web software developer can pay more attention to service logic per se, and the technical threshold of hardware module calling is reduced. The electronic is taken as a framework for constructing a desktop application program by using JavaScript, HTML and CSS, the capability of constructing websocket full duplex communication locally can be provided, the communication mechanism of the OCX object type expansion assembly is upgraded and expanded into an http hypertext transfer protocol which is the most basic of Web software, the application range of the OCX object type expansion assembly is greatly improved, and the learning cost of Web software developers is reduced, so that the OCX object type expansion assembly is simply and efficiently used.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart illustrating an embodiment of a method for calling an OCX object according to the present application;
FIG. 2 is a flowchart illustrating another embodiment of a method for calling an OCX object according to the present application;
FIG. 3 is a schematic diagram illustrating an embodiment of an OCX object calling device according to the present application;
fig. 4 is a schematic structural diagram of an embodiment of an electronic device according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the description of the embodiments of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or modules is not necessarily limited to those steps or modules that are expressly listed or inherent to such process, method, article, or device.
The naming or numbering of the steps in the embodiments of the present application does not mean that the steps in the method flow must be executed according to the time/logic sequence indicated by the naming or numbering, and the named or numbered flow steps may change the execution order according to the technical purpose to be achieved, so long as the same or similar technical effects can be achieved.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
Before describing the related embodiments, related terms will be explained as follows:
OCX: an object class extension component (Object Linking and Embedding Control Extension); is one type of executable file, but may not be directly executed.
Electron: is to build a cross-platform desktop application framework using JavaScript, HTML and CSS.
websocket: is a protocol that performs full duplex communication over a single TCP ((Transmission Control Protocol, transmission control protocol)) connection.
http: the hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP) is a simple request-response protocol that typically runs on top of TCP.
The application provides a calling method and device of an OCX object and electronic equipment, and the calling method and device and the electronic equipment are respectively described below.
As shown in FIG. 1, the application provides a calling method of an OCX object, which comprises the following steps:
step 110, creating a local websocket port service in a local server environment based on an Electron.
It can be appreciated that the local websocket port service is the local websocket-9000 port service: ws://127.0.0.1:9000 for messaging between electrons and OCX pages.
Step 120, creating a local http port service in the local server environment based on the Electron.
It can be appreciated that the local http port service, i.e. the local http-9010 port service http: and/127.0.0.1:9010 for message communication between the Electron and the Web page.
And 130, receiving a hardware request sent by the Web page based on the local http port service based on the Electron, and analyzing the hardware request to obtain hardware instruction information.
It can be understood that taking an identity card reader as an example, when the Web page needs to use hardware capability, the hardware module id and the instruction are packaged into an http request, namely the hardware request, and the http request is sent to an Electron through a local http-9010 port service.
And 140, transmitting the hardware instruction information to an OCX page through the local websocket port service based on the Electron so as to read the hardware instruction information based on the OCX page.
It can be understood that when the electronic receives the http request of the Web page, the electronic analyzes the module id and the instruction, stores the instruction information on the computer, and sends the instruction information to the OCX page through the local websocket-9000 port service.
And step 150, acquiring a reading result of the hardware instruction information by the OCX page based on the Electron, and transmitting the reading result to the Web page based on the local http port service.
It can be understood that the OCX page obtains the result, sends the read result information to the Electron through the local websocket-9000 port service, and when the Electron receives the websocket request of the OCX page, stores the read result information to the computer, and then returns the read result information to the Web page through the local http-9010 port service.
In some embodiments, the method for calling an OCX object further includes:
before the local websocket port service is created, a local server environment is built, and a plug-in for creating the local websocket port service is installed in the local server environment.
It will be appreciated that the local server environment is built under the windows operating system, the msi installation package of node. Js is installed, and the msi installation package of version 6.9.4 is self-contained npm (the nodejs plug-in manager, using npm to install the express plug-in and express-ws plug-in.
In some embodiments, the building a local server environment includes:
and building a local server environment based on the browser engine running environment node. Js embedded in the Electron.
It can be understood that the JavaScript running environment node.js, node.js embedded by the Electron and based on the Chrome V8 engine is used as a JavaScript running environment, and provides basic JavaScript parsing and executing functions and some built-in APIs (Application Process Interface, application program interfaces) for building a local server environment.
The V8 engine of Chrome is the JavaScript engine with the strongest performance at present, and node.JS is developed based on the V8 engine, so that the node.JS has better performance.
In some embodiments, the creating a local websocket port service in a local server environment based on an Electron includes:
based on the listen method of the express plugin and the ws method of the express-ws plugin in the Electron, the local websocket port service is created in the local server environment.
It will be appreciated that the listen method of the express plug-in binds itself to the designated host and port to bind and snoop any connections. If the port is undefined or 0, the operating system will assign an arbitrary unused port that is primarily used for automation tasks such as testing.
The ws method of the express-ws plugin is a websocket instance, and the instance can monitor a message sending event (message event) from a client, and can take data sent by a browser through the websocket by monitoring the message sending event.
In some embodiments, the creating a local http port service in the local server environment based on the Electron comprises:
based on the listen method and the post method of the express plugin in the Electron, a local http port service is created in the local server environment.
It will be appreciated that the listen method and the post method are self-contained APIs in the express plug-in that can be invoked directly.
In some embodiments, the reading the hardware instruction information based on the OCX page includes:
and reading the hardware instruction information based on a dynamic link library of the ActiveX control of the OCX page.
It will be appreciated that an ActiveX control is a program object that can be reused on applications and computers in a network. Updates can be more easily applied to individual modules using a dynamic link library without affecting other parts of the program. A dynamic link library file is a non-executable binary program file that allows programs to share code and other resources necessary to perform a particular task.
The dynamic link library is helpful to save the memory, the dynamic link library file is not contained in the executable file when compiled, only is loaded into the memory when called, and can be unloaded (the occupied memory is cleared) after the use is completed, and the calling method is a display calling mode.
In other embodiments, the flow of the method for calling the OCX object provided by the present application is shown in fig. 2.
In summary, according to the method for calling the OCX object provided by the application, the local websocket port service and the local http port service are created in the local server environment by the Electron; receiving a hardware request sent by a Web page based on the local http port service based on the Electron, and analyzing the hardware request to obtain hardware instruction information; transmitting the hardware instruction information to an OCX page through the local websocket port service based on the Electron so as to read the hardware instruction information based on the OCX page; and acquiring a reading result of the OCX page to the hardware instruction information based on the Electron, and transmitting the reading result to the Web page based on the local http port service. According to the application, the OCX control is called based on the local communication method of the Electron, so that the implementation details of an IE browser and a hardware module dynamic link library are effectively isolated, a Web software developer can pay more attention to service logic per se, and the technical threshold of hardware module calling is reduced. The electronic is taken as a framework for constructing a desktop application program by using JavaScript, HTML and CSS, the capability of constructing websocket full duplex communication locally can be provided, the communication mechanism of the OCX object type expansion assembly is upgraded and expanded into an http hypertext transfer protocol which is the most basic of Web software, the application range of the OCX object type expansion assembly is greatly improved, and the learning cost of Web software developers is reduced, so that the OCX object type expansion assembly is simply and efficiently used.
As shown in fig. 3, the present application further provides an OCX object calling device 300, including:
a first service creation module 310 for creating a local websocket port service in a local server environment based on an Electron;
a second service creation module 320, configured to create a local http port service in the local server environment based on the Electron;
a first sending module 330, configured to receive, based on the Electron, a hardware request sent by a Web page based on the local http port service, and parse the hardware request to obtain hardware instruction information;
a second sending module 340, configured to send, based on the Electron, the hardware instruction information to an OCX page through the local websocket port service, so as to read the hardware instruction information based on the OCX page;
and the acquiring module 350 is configured to acquire a read result of the OCX page on the hardware instruction information based on the Electron, and transmit the read result to the Web page based on the local http port service.
In some embodiments, the calling device of the OCX object further includes:
and the plug-in installation module is used for building a local server environment before the local websocket port service is created, and installing a plug-in for creating the local websocket port service in the local server environment.
The technical solution described in the embodiments of the method for calling an OCX object may be implemented by the device for calling an OCX object provided in the foregoing embodiments, and the specific implementation principle of each module or unit may refer to the corresponding content in the embodiments of the method for calling an OCX object, which is not described herein again.
As shown in fig. 4, the present application further provides an electronic device 400 accordingly. The electronic device 400 comprises a processor 401, a memory 402 and a display 403. Fig. 4 shows only some of the components of the electronic device 400, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead.
The memory 402 may be an internal storage unit of the electronic device 400 in some embodiments, such as a hard disk or memory of the electronic device 400. The memory 402 may also be an external storage device of the electronic device 400 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the electronic device 400.
Further, the memory 402 may also include both internal storage units and external storage devices of the electronic device 400. The memory 402 is used for storing application software and various types of data for installing the electronic device 400.
The processor 401 may in some embodiments be a central processing unit (Central Processing Unit, CPU), microprocessor or other data processing chip for executing program code or processing data stored in the memory 402, such as the calling method of the OCX object in the present application.
The display 403 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like in some embodiments. The display 403 is used for displaying information at the electronic device 400 and for displaying a visual user interface. The components 401-403 of the electronic device 400 communicate with each other via a system bus.
In some embodiments of the present application, when the processor 401 executes a calling program of an OCX object in the memory 402, the following steps may be implemented:
creating a local websocket port service in a local server environment based on an Electron;
creating a local http port service in the local server environment based on the Electron;
receiving a hardware request sent by a Web page based on the local http port service based on the Electron, and analyzing the hardware request to obtain hardware instruction information;
transmitting the hardware instruction information to an OCX page through the local websocket port service based on the Electron so as to read the hardware instruction information based on the OCX page;
and acquiring a reading result of the OCX page to the hardware instruction information based on the Electron, and transmitting the reading result to the Web page based on the local http port service.
It should be understood that: the processor 401 may also perform other functions in addition to the above functions when executing the calling program of the OCX object in the memory 402, see in particular the description of the corresponding method embodiments above.
Further, the type of the electronic device 400 is not particularly limited, and the electronic device 400 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (personal digitalassistant, PDA), a wearable device, a laptop (laptop), etc. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices that carry IOS, android, microsoft or other operating systems. The portable electronic device described above may also be other portable electronic devices, such as a laptop computer (laptop) or the like having a touch-sensitive surface, e.g. a touch panel. It should also be appreciated that in other embodiments of the application, electronic device 400 may not be a portable electronic device, but rather a desktop computer having a touch-sensitive surface (e.g., a touch panel).
In yet another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform a method of calling an OCX object provided by the above methods, the method comprising:
creating a local websocket port service in a local server environment based on an Electron;
creating a local http port service in the local server environment based on the Electron;
receiving a hardware request sent by a Web page based on the local http port service based on the Electron, and analyzing the hardware request to obtain hardware instruction information;
transmitting the hardware instruction information to an OCX page through the local websocket port service based on the Electron so as to read the hardware instruction information based on the OCX page;
and acquiring a reading result of the OCX page to the hardware instruction information based on the Electron, and transmitting the reading result to the Web page based on the local http port service.
Those skilled in the art will appreciate that all or part of the flow of the methods of the embodiments described above may be accomplished by way of a computer program that instructs associated hardware, and that the program may be stored in a computer readable storage medium. The computer readable storage medium is a magnetic disk, an optical disk, a read-only memory or a random access memory.
The above describes in detail the method, the device and the electronic equipment for calling the OCX object provided by the present application, and specific examples are applied to describe the principle and the implementation of the present application, and the description of the above examples is only used to help understand the method and the core idea of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, the present description should not be construed as limiting the present application.
Claims (10)
1. A method for calling an OCX object, comprising:
creating a local websocket port service in a local server environment based on an Electron;
creating a local http port service in the local server environment based on the Electron;
receiving a hardware request sent by a Web page based on the local http port service based on the Electron, and analyzing the hardware request to obtain hardware instruction information;
transmitting the hardware instruction information to an OCX page through the local websocket port service based on the Electron so as to read the hardware instruction information based on the OCX page;
and acquiring a reading result of the OCX page to the hardware instruction information based on the Electron, and transmitting the reading result to the Web page based on the local http port service.
2. The OCX object invocation method of claim 1, further comprising:
before the local websocket port service is created, a local server environment is built, and a plug-in for creating the local websocket port service is installed in the local server environment.
3. The method for calling an OCX object of claim 2, wherein the building a local server environment comprises:
and building a local server environment based on the browser engine running environment node. Js embedded in the Electron.
4. The OCX object invocation method of claim 1, wherein the creating a local websocket port service in a local server environment based on an Electron comprises:
based on the listen method of the express plugin and the ws method of the express-ws plugin in the Electron, the local websocket port service is created in the local server environment.
5. The method of claim 1, wherein creating a local http port service in the local server environment based on the Electron comprises:
based on the listen method and the post method of the express plugin in the Electron, a local http port service is created in the local server environment.
6. The method according to any one of claims 1 to 5, wherein the reading the hardware instruction information based on the OCX page includes:
and reading the hardware instruction information based on a dynamic link library of the ActiveX control of the OCX page.
7. An OCX object calling device, comprising:
a first service creation module for creating a local websocket port service in a local server environment based on an Electron;
a second service creation module for creating a local http port service in the local server environment based on the Electron;
the first sending module is used for receiving a hardware request sent by the Web page based on the local http port service based on the Electron, and analyzing the hardware request to obtain hardware instruction information;
the second sending module is used for sending the hardware instruction information to an OCX page through the local websocket port service based on the Electron so as to read the hardware instruction information based on the OCX page;
and the acquisition module is used for acquiring a reading result of the OCX page on the hardware instruction information based on the Electron and transmitting the reading result to the Web page based on the local http port service.
8. The OCX object calling apparatus of claim 7, further comprising:
and the plug-in installation module is used for building a local server environment before the local websocket port service is created, and installing a plug-in for creating the local websocket port service in the local server environment.
9. An electronic device comprising a memory and a processor, wherein,
the memory is used for storing programs;
the processor, coupled to the memory, is configured to execute the program stored in the memory to implement the steps in the OCX object calling method according to any one of claims 1 to 6.
10. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements a calling method of an OCX object according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310411999.8A CN116578356A (en) | 2023-04-14 | 2023-04-14 | Calling method and device of OCX object and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310411999.8A CN116578356A (en) | 2023-04-14 | 2023-04-14 | Calling method and device of OCX object and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116578356A true CN116578356A (en) | 2023-08-11 |
Family
ID=87542317
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310411999.8A Pending CN116578356A (en) | 2023-04-14 | 2023-04-14 | Calling method and device of OCX object and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116578356A (en) |
-
2023
- 2023-04-14 CN CN202310411999.8A patent/CN116578356A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8239490B2 (en) | Exposing resource capabilities to web applications | |
US8966508B2 (en) | Method for executing hybrid web application and apparatus therefor | |
US11042387B2 (en) | Deploying cross-platform applications on mobile devices with native and web components | |
US8832690B1 (en) | Multi-threaded virtual machine processing on a web page | |
CN110365724B (en) | Task processing method and device and electronic equipment | |
CN110704783A (en) | Interaction method and device of H5 page and native APP based on custom protocol | |
CN109800370A (en) | Display methods, device, computer equipment and the storage medium of Webpage | |
CN110069308A (en) | The page starts method, apparatus, electronic equipment and storage medium | |
CN107450946B (en) | Chrome webpage and terminal software communication method, equipment and storage medium | |
CN114006885A (en) | Data acquisition method and device based on intelligent equipment and electronic equipment | |
CN113176907A (en) | Interface data calling method and device, computer system and readable storage medium | |
CN111158777B (en) | Component calling method, device and computer readable storage medium | |
US20130139185A1 (en) | Intercepting and tracing interface routine transactions | |
US20110321022A1 (en) | Code generation through metadata programming for mobile devices and web platforms to ease access to web services | |
US20190087221A1 (en) | Thread processor and thread processing method | |
US8347070B1 (en) | System and methods for sharing platform data with an ACPI module of a computer system | |
CN116578356A (en) | Calling method and device of OCX object and electronic equipment | |
CN116051031A (en) | Project scheduling system, medium and electronic equipment | |
CN116248526A (en) | Method and device for deploying container platform and electronic equipment | |
CN111596896B (en) | Interface calling method, device, equipment and medium adapting to different languages | |
CN116302847B (en) | Dynamic acquisition method and device of abnormal information, computer equipment and medium | |
EP4191407A1 (en) | Method and device for generating and registering ui service package and loading ui service | |
CN101324900A (en) | Method, device and system for opening graphics user interface | |
CN114237771A (en) | Application program modular operation method, device, equipment and storage medium | |
CN117827495A (en) | Rights and interests state updating method, device, equipment and 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 |