CN113938380B - Dynamic adapting method for network equipment interface - Google Patents

Dynamic adapting method for network equipment interface Download PDF

Info

Publication number
CN113938380B
CN113938380B CN202111176382.XA CN202111176382A CN113938380B CN 113938380 B CN113938380 B CN 113938380B CN 202111176382 A CN202111176382 A CN 202111176382A CN 113938380 B CN113938380 B CN 113938380B
Authority
CN
China
Prior art keywords
network
parameter
controller
template
port
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.)
Active
Application number
CN202111176382.XA
Other languages
Chinese (zh)
Other versions
CN113938380A (en
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.)
Beijing Tiandihexing Technology Co Ltd
Original Assignee
Beijing Tiandihexing 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 Beijing Tiandihexing Technology Co Ltd filed Critical Beijing Tiandihexing Technology Co Ltd
Priority to CN202111176382.XA priority Critical patent/CN113938380B/en
Publication of CN113938380A publication Critical patent/CN113938380A/en
Application granted granted Critical
Publication of CN113938380B publication Critical patent/CN113938380B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • 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
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Abstract

The invention discloses a network device and an interface dynamic adapting method thereof, which comprises the following steps: step 1: firstly, loading an element set document; step 2: generating a main entry file in a root directory, and then creating a template according to the function requirement, wherein the template is provided with an independent controller; step 3: finding out all element sets in the controller, and obtaining current state data of all network cards through communication with the middleware; step 4: extracting the state data of all network cards from the total sequence independent; step 5: judging which type of data application corresponds to according to the returned model; step 6: then according to the type and the number of the network ports; step 7: and finally, adjusting the size of the wide and high pixels of the product panel according to the number of the net openings. The invention realizes clearer logic, strong readability, definite team development division, easy control and full utilization of reusable codes; the common module is abstracted, the maintainability is strong, and the hardware model of different types can be compatible.

Description

Dynamic adapting method for network equipment interface
Technical Field
The present invention relates to the field of network device interface adaptation technologies, and in particular, to a network device and an interface dynamic adaptation method thereof.
Background
The network equipment is configured with one or more network cards, and the equipment network card communication schematic illustration is usually displayed in real time in the equipment preassembly system and is used for displaying information such as network IP, gateway information, interface name flow and the like, but a plurality of products can relate to hardware configuration of one system for adapting to different models and a plurality of specifications, so that the problem that the product system cannot adapt to different types of hardware and is mainly reflected in a network port display area can occur, and the phenomenon of network port disorder can be caused when the system switches one product type.
However, in the prior art, an independent static dom template is allocated for each model, a complete element sequence is defined in a javascript controller file, the marked sequence is bound to the dom structure, and the service requirement of display is adjusted according to the difference of acquired data, so that each customized static template is required to be different, and series of problems such as disordered distribution occur.
Disclosure of Invention
1. Technical problem to be solved
The invention aims to solve the problems that each customized static template is required to be different and the distribution is disordered in the prior art, and provides network equipment and an interface dynamic adaptation method thereof.
2. Technical proposal
In order to achieve the above purpose, the present invention adopts the following technical scheme:
a network device and its interface dynamic adapting method, including the following steps:
step 1: firstly, loading an element set document;
step 2: generating a main entry file in a root directory, and then creating a template according to the function requirement, wherein the template is provided with an independent controller;
step 3: finding out all element sets in the controller, and obtaining current state data of all network cards through communication with the middleware;
step 4: extracting the data of the network cards according to the state data of all the network cards, wherein the data is independent of the total sequence, defining the data types of different hardware models, and injecting the returned data of the different hardware models into the defined types;
step 5: judging which type of data application corresponds to according to the returned model;
step 6: then judging which model the expansion card slot is according to the type and the number of the network ports;
step 7: finally, the size of the wide and high pixels of the product panel is adjusted according to the number of the net openings, so that the product panel is suitable for the panel area of the homepage.
Preferably, in the step 1, a jquery operation element object is adopted, and a compiling environment script configuration is defined.
Preferably, the main portal file in said step 2 will be created by html.
Preferably, in the step 3, jquery is used to find all element sets.
Preferably, in the step 5, the management port and the extension port are respectively defined as agl0 and ext under the mgmtinfo object attribute without depending on the master module to operate separately.
Preferably, the mgmtinfo object attributes are respectively: parameter eth represents the network port name, parameter IP network port binding IP address, parameter IP6 represents the network port binding IPV6 address, parameter mac represents the network port mac address, parameter mask represents the network port binding sub-net mask and parameter state represents the network port state.
Preferably, in the step 6, all the network ports in the whole expansion card slot are traversed, and corresponding network card icons are respectively applied.
3. Advantageous effects
Compared with the prior art, the invention has the advantages that:
(1) In the invention, an html static module is firstly established to independently store a DOM set, an element set template and a controller are separated, the independent editing operation is realized, an element set sequence is established in a root directory, different network ports are bound on corresponding sequences, requirements are defined in a controller file, the same grouping elements are extracted from the DOM set, different classes are defined, then the data classification of the product model is obtained through ajax, different classes are applied to each product, and the compiling operation is realized.
(2) In the invention, the realization logic is clearer, the readability is strong, the team development division is clear, the control is easy, and the code can be reused; the common module is abstracted, the maintainability is strong, and the hardware model of different types can be compatible.
Drawings
Fig. 1 is a schematic diagram of a multi-port module adapting execution step in a network device and an interface dynamic adapting method thereof according to the present invention;
fig. 2 is a diagram of a network port adaptation model of a network device and an interface dynamic adaptation method thereof according to the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments.
Example 1:
referring to fig. 1-2, a network device and an interface dynamic adaptation method thereof, comprising the steps of:
step 1: firstly, loading an element set document, and adopting jquery operation element objects to define compiling environment script configuration;
step 2: generating a main entry file in a root directory, wherein the file is created by html, and then creating a template according to the function requirement, wherein the template is provided with an independent controller;
step 3: finding out all element sets by using jquery in a controller, and obtaining current state data of all network cards through communication with middleware;
step 4: extracting the classification according to the state data, defining data categories of different hardware models independent of the existence of the total sequence, and injecting returned data of the different hardware models into the defined categories;
step 5: according to the returned model, judging which class corresponds to the data application, and independently running without depending on a main module, wherein a management port and an expansion port are respectively defined as agl0 and ext under the mgmtinfo object attribute, and the attributes of the management port and the expansion port are respectively as follows:
1. parameter eth: representing the name of the network port;
2. parameter IP: binding an IP address by the network port;
3. parameter IP6: the internet access binds the IPV6 address;
4. parameter mac: a portal mac address;
5. parameter mask: the network port binds the subnet mask;
6. parameter state: a network port state;
in the invention, under the expansion port object attribute slotinfo, the pluggable expansion network card set of the current equipment is respectively represented, the expansion board is respectively represented, and multiple types of network port integration can exist in the expansion board: a. four electric ports, b. four electric ports + four optical ports, c. eight electric ports etc., we take one of the net ports as an example, and have the following properties respectively:
1. parameter content: is of an array type, and comprises an IP address, a mac address and a gateway of the network port;
2. parameter num: the expansion board card comprises a plurality of network ports;
3. parameter online: indicating whether the current network port is online or not;
4. parameter slot: the arrangement sequence of the network ports in the current card inserting and dialing mode;
step 6: judging which type of the expansion card slot is according to the type and the number of the network ports, traversing all network ports in the whole expansion card slot, and respectively applying corresponding network card icons;
step 7: and then the size of the wide and high pixels of the product panel is adjusted according to the number of the net openings, so that the product panel is suitable for the panel area of the homepage.
In the invention, an html static module is firstly established to independently store a DOM set, an element set template and a controller are separated, the independent editing operation is realized, an element set sequence is established in a root directory, different network ports are bound on corresponding sequences, requirements are defined in a controller file, the same grouping elements are extracted from the DOM set, different classes are defined, then the data classification of the product model is obtained through ajax, different classes are applied to each product, and the compiling operation is realized.
In the invention, the realization logic is clearer, the readability is strong, the team development division is clear, the control is easy, and the code can be reused; the common module is abstracted, the maintainability is strong, and the hardware model of different types can be compatible.
The foregoing is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art, who is within the scope of the present invention, should make equivalent substitutions or modifications according to the technical scheme of the present invention and the inventive concept thereof, and should be covered by the scope of the present invention.

Claims (6)

1. A method for dynamically adapting a network device interface, comprising the steps of:
step 1: firstly, loading an element set document;
step 2: generating a main entry file in a root directory, and then creating a template according to the function requirement, wherein the template is provided with an independent controller; firstly, establishing an html static module to independently store a DOM set, separating an element set template from a controller, establishing an element set sequence in a root directory, binding different net openings on the corresponding sequence, defining requirements in a controller file, extracting the same grouping elements from the DOM set, and defining different classes;
step 3: finding out all element sets in the controller, and obtaining current state data of all network cards through communication with the middleware;
step 4: extracting classification according to the state data of all network cards, defining data categories of different hardware models, and injecting returned data of different hardware models into the defined categories;
step 5: judging which type of data application corresponds to according to the returned model;
step 6: judging which model of the expansion card slot is according to the type and the number of the network ports; traversing all network ports in the whole expansion card slot, and respectively applying corresponding network card icons;
step 7: finally, the size of the wide and high pixels of the product panel is adjusted according to the number of the net openings, so that the product panel is suitable for the panel area of the homepage.
2. The method according to claim 1, wherein the jquery operation element object is adopted in the step 1, and a compiling environment script configuration is defined.
3. The method according to claim 1, wherein the main entry file in step 2 is created by html.
4. The method according to claim 1, wherein the step 3 uses jquery to find all element sets.
5. The method according to claim 1, wherein in step 5, independent operation of the master module is not required, and the management port and the extension port are respectively defined as agl0 and ext under the mgmtinfo object attribute.
6. The method for dynamically adapting a network device interface according to claim 5, wherein the mgmtinfo object attributes are: parameter eth represents the network port name, parameter IP network port binding IP address, parameter IP6 represents the network port binding IPV6 address, parameter mac represents the network port mac address, parameter mask represents the network port binding sub-net mask and parameter state represents the network port state.
CN202111176382.XA 2021-10-09 2021-10-09 Dynamic adapting method for network equipment interface Active CN113938380B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111176382.XA CN113938380B (en) 2021-10-09 2021-10-09 Dynamic adapting method for network equipment interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111176382.XA CN113938380B (en) 2021-10-09 2021-10-09 Dynamic adapting method for network equipment interface

Publications (2)

Publication Number Publication Date
CN113938380A CN113938380A (en) 2022-01-14
CN113938380B true CN113938380B (en) 2024-03-29

Family

ID=79278346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111176382.XA Active CN113938380B (en) 2021-10-09 2021-10-09 Dynamic adapting method for network equipment interface

Country Status (1)

Country Link
CN (1) CN113938380B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101273349A (en) * 2005-09-30 2008-09-24 微软公司 Template based management of services
US7873908B1 (en) * 2003-09-30 2011-01-18 Cisco Technology, Inc. Method and apparatus for generating consistent user interfaces
US8191038B1 (en) * 2007-10-09 2012-05-29 Google Inc. Using a templating language to produce a host language factory for a safe subset of a templated language
CN106130185A (en) * 2016-07-18 2016-11-16 中国南方电网有限责任公司 A kind of monitoring system of electric substation modeling method based on status monitoring information
CN106302747A (en) * 2016-08-17 2017-01-04 北京乐美无限科技有限公司 A kind of business cloud platform of Internet WEB front-end exploitation
CN107179753A (en) * 2016-03-10 2017-09-19 霍尼韦尔国际公司 Automation control system point configuration from director demon file
CN109426497A (en) * 2017-08-18 2019-03-05 北京国双科技有限公司 Data embedding method, device, system and storage medium
CN110674441A (en) * 2019-09-02 2020-01-10 中国平安财产保险股份有限公司 Page template configuration control method and device, computer equipment and storage medium
CN112579086A (en) * 2020-12-24 2021-03-30 四川长虹电器股份有限公司 Template construction method adaptive to multi-platform front-end View

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7519970B2 (en) * 2003-09-29 2009-04-14 International Business Machines Corporation Methods, systems and computer program products for creating user interface to applications using generic user interface templates
US9256219B2 (en) * 2009-08-11 2016-02-09 Fisher-Rosemount Systems, Inc. System configuration using templates
US20150193090A1 (en) * 2014-01-06 2015-07-09 Ford Global Technologies, Llc Method and system for application category user interface templates
US11295074B2 (en) * 2016-12-21 2022-04-05 Open Text Corporation Systems and methods for conversion of web content into reusable templates and components

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7873908B1 (en) * 2003-09-30 2011-01-18 Cisco Technology, Inc. Method and apparatus for generating consistent user interfaces
CN101273349A (en) * 2005-09-30 2008-09-24 微软公司 Template based management of services
US8191038B1 (en) * 2007-10-09 2012-05-29 Google Inc. Using a templating language to produce a host language factory for a safe subset of a templated language
CN107179753A (en) * 2016-03-10 2017-09-19 霍尼韦尔国际公司 Automation control system point configuration from director demon file
CN106130185A (en) * 2016-07-18 2016-11-16 中国南方电网有限责任公司 A kind of monitoring system of electric substation modeling method based on status monitoring information
CN106302747A (en) * 2016-08-17 2017-01-04 北京乐美无限科技有限公司 A kind of business cloud platform of Internet WEB front-end exploitation
CN109426497A (en) * 2017-08-18 2019-03-05 北京国双科技有限公司 Data embedding method, device, system and storage medium
CN110674441A (en) * 2019-09-02 2020-01-10 中国平安财产保险股份有限公司 Page template configuration control method and device, computer equipment and storage medium
CN112579086A (en) * 2020-12-24 2021-03-30 四川长虹电器股份有限公司 Template construction method adaptive to multi-platform front-end View

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A Direct Web Page Templates Detection Method;Su-bin Xie;《2011 International Conference on Internet Technology and Applications》;全文 *
基于HTML5移动应用框架的研究及应用;连允庆;《万方》;全文 *
基于模板引擎Smarty的信息管理系统设计;冯兴利;徐墨;锁志海;;《现代电子技术》(18);全文 *

Also Published As

Publication number Publication date
CN113938380A (en) 2022-01-14

Similar Documents

Publication Publication Date Title
CN108279932B (en) Method and device for dynamically configuring user interface of mobile terminal
CN103401909B (en) Data interactive method based on BS and system, client and server
CN102163206B (en) Method and system for loading pages
CN112114784A (en) Single-Spa-based front-end micro-service system
CN106339226A (en) Webpage page display method and page display plug-in
CN107809383A (en) A kind of map paths method and device based on MVC
CN106202006A (en) Document generating method and device
CN106156306A (en) A kind of template rendering intent and device
CN103491066A (en) Method, system, server side equipment and client side equipment for page displaying
CN107357952A (en) A kind of network automatic assembling and three-dimensional interaction method and system
CN110502732A (en) A kind of rule generating method of discount coupon, device and server
CN109144619A (en) Icon font information processing method, apparatus and system
CN107341027A (en) The generation method and generating means of user interface
CN103647775A (en) Method and apparatus for registration in webpage
CN107357810A (en) A kind of method and system for being used to export special topic landing page
CN113938380B (en) Dynamic adapting method for network equipment interface
CN105574114A (en) On-line plotting method based on telecom resource management standard control library
CN107040818B (en) Layout analytic hierarchy process method and system for Android TV
CN106598829A (en) Webpage automation test method and apparatus
CN107179931A (en) Installation kit packaging method, apparatus and system
CN112269562A (en) Tenant isolation method and terminal in modular product
CN115526160A (en) Rich text processing method, device and equipment and storage medium
CN105338104A (en) Business request responding method, analysis method and analysis system
CN113505054B (en) Network data static test system and test method for unmanned aerial vehicle control station
CN103473376A (en) Data processing method and client ends

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
GR01 Patent grant
GR01 Patent grant