CN114217822A - Method for developing HMI framework installation package and hot updating method based on HMI framework - Google Patents

Method for developing HMI framework installation package and hot updating method based on HMI framework Download PDF

Info

Publication number
CN114217822A
CN114217822A CN202111372573.3A CN202111372573A CN114217822A CN 114217822 A CN114217822 A CN 114217822A CN 202111372573 A CN202111372573 A CN 202111372573A CN 114217822 A CN114217822 A CN 114217822A
Authority
CN
China
Prior art keywords
code
main
electron
package
hmi
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
CN202111372573.3A
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.)
Zhejiang Supcon Technology Co Ltd
Original Assignee
Zhejiang Supcon 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 Zhejiang Supcon Technology Co Ltd filed Critical Zhejiang Supcon Technology Co Ltd
Priority to CN202111372573.3A priority Critical patent/CN114217822A/en
Publication of CN114217822A publication Critical patent/CN114217822A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to a method for developing an HMI frame installation package and a thermal updating method based on an HMI frame, wherein the method for developing the HMI frame installation package comprises the following steps: the method comprises the following steps of sequentially installing node.js, npm packages of electron and npm packages of electron-builder; creating an initialization project of the desktop application program by cloning an example warehouse electron-quick-start, creating main.js under a root directory of the project, and adding a main configuration item in a package.json file corresponding to the desktop application program; wherein the value of the main configuration item is the path of the main.js file; js file is used for running in node.js environment integrated by the electron to control the life cycle of the whole application program and manage the rendering process; and executing the packaging command to generate an installation package.

Description

Method for developing HMI framework installation package and hot updating method based on HMI framework
Technical Field
The invention relates to the technical field of industrial monitoring software, in particular to a method for developing an HMI (human machine interface) frame installation package and a hot updating method based on an HMI frame.
Background
The WEB system based on the browser has a plurality of defects in hot key shielding, multi-screen monitoring and panel top setting, and cannot well meet the industrial monitoring application scene. The existing industrial monitoring software in the industry, such as SCADA monitoring software, is traditional desktop end software developed based on C/C + + language, and the traditional software has the following disadvantages: the method does not have the cross-platform capability, different software versions must be compiled aiming at different operating systems, and certain redundancy is brought to development and edition issuing work. The system does not have WEB side access capability and can only be used as stand-alone software.
Disclosure of Invention
Technical problem to be solved
In view of the above disadvantages and shortcomings of the prior art, the present invention provides a method for developing an HMI framework installation package and a method for hot-update based on an HMI framework, which solves the problem that different software versions must be compiled for different operating systems without cross-platform capability, and a certain degree of redundancy is brought to development and publishing. Does not have WEB end access capability and can only be used as stand-alone software.
(II) technical scheme
In order to achieve the purpose, the invention adopts the main technical scheme that:
in a first aspect, an embodiment of the present invention provides a method for developing an HMI framework installation package,
s1, sequentially installing node. js, npm package of electron and npm package of electron-builder;
s2, creating an initialization project of the desktop application program by cloning an example warehouse electron-quick-start, creating main.js under a root directory of the project, and adding a main configuration item in a package.json file corresponding to the desktop application program;
wherein the value of the main configuration item is the path of the main.js file;
the main.js file is used for running in a node.js environment integrated by an electron to control the life cycle of the whole application program and manage a rendering process;
and S3, executing the packaging command to generate an installation package.
Preferably, the main.js file includes: a preset first code;
the first code is code for enabling starting and/or closing of an application.
Preferably, the main.js file further includes: a preset second code;
the second code is code that implements creating a window.
Preferably, the main.js file further includes: a preset third code;
the third code is code for realizing multi-screen display and rendering process communication.
Preferably, the main.js file further includes: a preset fourth code;
the fourth code is a code for associating the main.js file with the IP of the pre-designated website through the webbreference parameter of createWindow in the electron.
Preferably, the first and second liquid crystal materials are,
the packed command is a packed command which is added below a script configuration item in package json of npm package of electronic-builder in advance and can install the package in a corresponding format on a target platform.
Preferably, between S2 and S3, further comprising:
npm package of node-gyp, Visual Studio Build Tools, and Python software were installed.
Preferably, between S2 and S3, further comprising: npm bags for ffi-napi were installed.
In another aspect, the present embodiment further provides a thermal update method based on an HMI framework, including:
a1, an electron in the HMI frame judges whether the pre-appointed website updates resources in real time through the IP of the associated pre-appointed website;
the resource is the content displayed by the page of the pre-designated website or a pre-designated module in the website;
if so, acquiring a new resource, rendering according to the new resource and displaying a corresponding rendering result;
the HMI framework is generated by installing a cross-platform HMI framework installation package developed by the method;
and A2, if not, acquiring the existing resources in the pre-specified website through the cache, rendering according to the existing resources, and displaying the corresponding rendering result.
(III) advantageous effects
The invention has the beneficial effects that: according to the method for developing the HMI framework installation package, due to the fact that an initialization project of a desktop application program is created by cloning an example warehouse electron-quick-start, a mail.js is created under a root directory of the project, and a mail configuration item is added to a package.json file corresponding to the desktop application program; the main.js file is used for running in a node.js environment integrated by an electron to control the life cycle of the whole application program and manage the rendering process, and compared with the prior art, the main.js file can be used as a running carrier by the electron, and a set of service codes can run on Windows and Linux platforms. Different software packages do not need to be developed for adapting to different operating systems, so that additional development work is reduced, and the product development efficiency is improved. The method has the capability of Web end access, and overcomes the defect that the traditional desktop end software can only be used in a local machine and cannot be remotely accessed and used.
According to the thermal updating method based on the HMI framework, the HMI framework generated by installing the developed cross-platform HMI framework installation package is adopted, so if the content of the monitoring end is updated, related codes constructed by the electron do not need to be modified, and only the related website IP needs to be subjected to thermal updating of the content, for example; and a new diagnosis module is added, and only the front-end and back-end resources of the diagnosis module need to be issued to the IP, so that the HMI framework can automatically identify that an available service is added. The client does not need to be uninstalled and reinstalled on the site. The latest content can be seen only by opening the client again.
Drawings
FIG. 1 is a flow chart of a method of developing HMI framework installation packages of the present invention;
FIG. 2 is a schematic diagram of a method for developing an HMI framework installation package according to a second embodiment of the invention;
FIG. 3 is a flowchart of a thermal update method based on HMI framework of the present invention;
FIG. 4 is a schematic diagram of a thermal update method based on an HMI framework according to an embodiment of the present invention.
Detailed Description
For the purpose of better explaining the present invention and to facilitate understanding, the present invention will be described in detail by way of specific embodiments with reference to the accompanying drawings.
In order to better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
The existing industrial monitoring software, such as SCADA monitoring software, is traditional desktop end software developed based on C/C + + language, and the traditional software has the following defects: the method does not have the cross-platform capability, different software versions must be compiled aiming at different operating systems, and certain redundancy is brought to development and edition issuing work. The system does not have WEB side access capability and can only be used as stand-alone software. In an embodiment, electron is a cross-platform desktop application built using HTML, CSS, JavaScript.
Example one
In order to solve the native disadvantages of the conventional monitoring software, achieve the enhancement of product usability and development convenience, referring to fig. 1, the embodiment provides a method for developing an HMI framework installation package, including:
and S1, sequentially installing node. js, npm package of electron and npm package of electron-builder.
S2, creating an initialization item of the desktop application by cloning the example repository electron-quick-start, creating main.js under the root directory of the item, and adding a main configuration item in the package.json file corresponding to the desktop application.
Wherein the value of the main configuration item is the path of the main.js file.
The main.js file is used for running in a node.js environment integrated by the electron to control the life cycle of the whole application program and manage the rendering process.
And S3, executing the packaging command to generate an installation package.
In practical application of this embodiment, the main.js file includes: a predetermined first code.
The first code is code for enabling starting and/or closing of an application.
In practical application of this embodiment, the main.js file further includes: a second code that is preset.
The second code is code that implements creating a window.
In practical application of this embodiment, the main.js file further includes: a predetermined third code.
The third code is code for realizing multi-screen display and rendering process communication.
In practical application of this embodiment, the main.js file further includes: a preset fourth code.
The fourth code is a code for associating the main.js file with the IP of the pre-designated website through the webbreference parameter of createWindow in the electron.
In practical application of this embodiment, the packed command is a packed command that is added below a script configuration item in package json of npm package of electronic-builder in advance and is capable of installing a package in a corresponding format on a target platform.
In practical application of the present embodiment, between S2 and S3, the following is further included:
npm package of node-gyp, Visual Studio Build Tools, and Python software were installed.
In practical application of the present embodiment, between S2 and S3, the following is further included: npm bags for ffi-napi were installed.
The invention realizes the high-performance HMI system which supports cross-operating environment (browser end, desktop end) and cross-platform (Windows \ kylin OS \ macOS), meets the requirement of monitoring industrial application scene of the new generation, can multiplex WEB service codes at multiple ends and can be applied to fusion site project.
Example two
Referring to fig. 2, the present embodiment provides a method for developing an HMI framework installation package, including:
js is installed as an execution environment for generating the entire installation package.
In this embodiment, the latest LTS version is downloaded and installed, and the LTS version is a long-term stable version of node.
Then, install npm package for electron, create a folder, initialize a npm package item with "npm init" command, install electron package with "npm install-save-dev electron" command, then add script configuration item in package. Install npm package of electron-builder, then add the command "electron-builder" as a packed command under the scripts configuration item in package.
Secondly, a main.js file is created under the project root directory, and a main configuration item is added to the package.json file, with the value of the path of the main.js file.
The file controls an electron main process, runs in a node.js environment integrated by the electron, and is responsible for controlling the life cycle of the whole application and managing the rendering process. The content in the main file is the specific implementation mode and API use, such as starting and closing application operation, creating window operation, realizing multi-screen display and rendering process communication, and performing some custom processing in the application running life cycle.
Js file, the published website IP is associated through the webbreference parameter of createWindow of electron, so the orientation of electron is: the content of the remote link is displayed as a container, and the capability which is not possessed by WEB (multi-screen, shielding hot key and the like in the content) is added by combining a plug-in developed by c + + and the like, so that the separation of the constructed program logic and the service display logic is realized.
When a c + + plug-in processing tool needs to be installed for extending the function of an electron application, the change of the operating system configuration is realized through c + + codes (a node-gyp npm packet and an ffi-napi npm packet node-gyp need to be installed as a node.js c/c + + extended compiling tool, the operation of the packet depends on Visual Studio Build Tools and Python, so that the two software also need to be installed. And finally, operating a packaging command 'electron-builder' to generate an installation package.
And when the c + + plug-in processing tool does not need to be installed, finally, the packing command 'electron-builder' is run to generate an installation package.
On the other hand, referring to fig. 2 and 3, the present embodiment further provides a thermal update method based on an HMI frame, including:
a1, an electron in the HMI frame judges whether the pre-appointed website updates resources in real time through the IP of the associated pre-appointed website.
The resource is the content displayed by the page of the pre-designated website or a pre-designated module in the website.
And if so, acquiring a new resource, rendering according to the new resource and displaying a corresponding rendering result.
The HMI framework is generated by installing a cross-platform HMI framework installation package developed by any one of the above methods for developing an HMI framework installation package.
And A2, if not, acquiring the existing resources in the pre-specified website through the cache, rendering according to the existing resources, and displaying the corresponding rendering result.
In this embodiment, since the front and back ends of the WEB site adopt the micro service architecture, if the content of the monitoring end is updated, it is not necessary to modify the related code constructed by the electron, and it is only necessary to perform hot update of the content on the associated site IP, for example; and a new diagnosis module is added, and only the front-end and back-end resources of the diagnosis module need to be issued to the IP, so that the HMI framework can automatically identify that an available service is added. The client does not need to be uninstalled and reinstalled on the site. The latest content can be seen only by opening the client again.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the terms first, second, third and the like are for convenience only and do not denote any order. These words are to be understood as part of the name of the component.
Furthermore, it should be noted that in the description of the present specification, the description of the term "one embodiment", "some embodiments", "examples", "specific examples" or "some examples", etc., means that a specific feature, structure, material or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, the claims should be construed to include preferred embodiments and all changes and modifications that fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit or scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention should also include such modifications and variations.

Claims (9)

1. A method of developing HMI framework installation packages,
s1, sequentially installing node. js, npm package of electron and npm package of electron-builder;
s2, creating an initialization project of the desktop application program by cloning an example warehouse electron-quick-start, creating main.js under a root directory of the project, and adding a main configuration item in a package.json file corresponding to the desktop application program;
wherein the value of the main configuration item is the path of the main.js file;
the main.js file is used for running in a node.js environment integrated by an electron to control the life cycle of the whole application program and manage a rendering process;
and S3, executing the packaging command to generate an installation package.
2. The method according to claim 1, wherein the main.js file comprises: a preset first code;
the first code is code for enabling starting and/or closing of an application.
3. The method according to claim 2, wherein said main.js file further comprises: a preset second code;
the second code is code that implements creating a window.
4. A method according to claim 3, wherein said main.js file further comprises: a preset third code;
the third code is code for realizing multi-screen display and rendering process communication.
5. The method according to claim 4, wherein said main.js file further comprises: a preset fourth code;
the fourth code is a code for associating the main.js file with the IP of the pre-designated website through the webbreference parameter of createWindow in the electron.
6. The method of claim 5,
the packed command is a packed command which is added below a script configuration item in package json of npm package of electronic-builder in advance and can install the package in a corresponding format on a target platform.
7. The method of claim 6, further comprising, between S2 and S3:
npm package of node-gyp, Visual Studio Build Tools, and Python software were installed.
8. The method of claim 7, further comprising, between S2 and S3: npm bags for ffi-napi were installed.
9. An HMI framework based thermal update method, comprising:
a1, an electron in the HMI frame judges whether the pre-appointed website updates resources in real time through the IP of the associated pre-appointed website;
the resource is the content displayed by the page of the pre-designated website or a pre-designated module in the website;
if so, acquiring a new resource, rendering according to the new resource and displaying a corresponding rendering result;
the HMI framework is installed from a cross-platform HMI framework installation package developed by the method of any of claims 1-8 above;
and A2, if not, acquiring the existing resources in the pre-specified website through the cache, rendering according to the existing resources, and displaying the corresponding rendering result.
CN202111372573.3A 2021-11-18 2021-11-18 Method for developing HMI framework installation package and hot updating method based on HMI framework Pending CN114217822A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111372573.3A CN114217822A (en) 2021-11-18 2021-11-18 Method for developing HMI framework installation package and hot updating method based on HMI framework

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111372573.3A CN114217822A (en) 2021-11-18 2021-11-18 Method for developing HMI framework installation package and hot updating method based on HMI framework

Publications (1)

Publication Number Publication Date
CN114217822A true CN114217822A (en) 2022-03-22

Family

ID=80697536

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111372573.3A Pending CN114217822A (en) 2021-11-18 2021-11-18 Method for developing HMI framework installation package and hot updating method based on HMI framework

Country Status (1)

Country Link
CN (1) CN114217822A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117539521A (en) * 2024-01-10 2024-02-09 中航国际金网(北京)科技有限公司 Application program upgrading method and device, nonvolatile storage medium and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117539521A (en) * 2024-01-10 2024-02-09 中航国际金网(北京)科技有限公司 Application program upgrading method and device, nonvolatile storage medium and electronic equipment
CN117539521B (en) * 2024-01-10 2024-05-07 中航国际金网(北京)科技有限公司 Application program upgrading method and device, nonvolatile storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
US9965259B2 (en) System for translating diverse programming languages
US9384005B2 (en) Systems and methods for dynamic configuration of client-side development environments through use of application servers
US20080189638A1 (en) Bridging human machine interface technologies in a process automation and information management environment
US9471704B2 (en) Shared script files in multi-tab browser
US8032232B2 (en) Natively retaining project documentation in a controller
CN110806868B (en) Single-page building and loading method
US8407598B2 (en) Dynamic web control generation facilitator
US10372112B2 (en) System and method for legacy level 1 controller virtualization
CN103744680A (en) Method and device for business process processing
CN110389755B (en) Code processing method and device, electronic equipment and computer readable storage medium
CN110457044B (en) Haxe application compiling method and device and electronic equipment
CN112286504A (en) Method for realizing development and loading of small program based on Reactnative in mobile APP
US20120151321A1 (en) System for Generating Websites for Products with an Embedded Processor
US8095571B2 (en) Partitioning modeling platform data
CN114217822A (en) Method for developing HMI framework installation package and hot updating method based on HMI framework
CN116974620A (en) Application program generation method, operation method and corresponding device
US20130125093A1 (en) Generating object-oriented programming language code from a multi-domain dynamic simulation model
CN110851123A (en) WebGIS power grid visualization framework construction method, system and device based on SpringMVC
KR102138421B1 (en) Cross platform system and operation method for supporting multi thread
CN115964019A (en) Information fusion component specification method and system suitable for industrial scene
CN113268239A (en) Desktop application view construction method, device, equipment and storage medium
CN107077484B (en) Generating a web browser view of an application
CN115686462A (en) React-Native based engineering architecture method and system
CN114527979A (en) Method and system for generating multi-end form interactive page
WO2022019784A1 (en) Assigning computing resources to execution of evaluators for image animation

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