[go: up one dir, main page]

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
port
controller
network device
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 Tiandi Hexing 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

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 Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明公开了一种网络设备及其接口动态适配方法,包括以下步骤:步骤1:首先加载元素集文档;步骤2:在根目录生成主入口文件,然后根据功能需求创建模板,模板有独立的控制器;步骤3:在控制器里找出所有的元素合集,通过与中间件通信获取到所有网卡的当前状态数据;步骤4:然后根据所有网卡的状态数据抽离出分类独立于总序列存在中;步骤5:再根据返回型号判断出是何种数据应用对应的类;步骤6:然后根据包含网口类型及数量;步骤7:最后根据网口数量调整产品面板的宽高像素大小。本发明实现逻辑更清晰、可读性强,团队开发分工明确,容易控制,充分利用可以重用代码;抽象出可公用的模块,可维护性强,可兼容不同类型的硬件型号。

The present invention discloses a network device and a method for dynamically adapting its interface, comprising the following steps: step 1: first load an element set document; step 2: generate a main entry file in the root directory, and then create a template according to functional requirements, wherein the template has an independent controller; step 3: find all element collections in the controller, and obtain the current status data of all network cards by communicating with the middleware; step 4: then extract the classification independent of the total sequence according to the status data of all network cards; step 5: then determine the class corresponding to the data application according to the returned model; step 6: then according to the type and number of network ports included; step 7: finally adjust the width and height pixel size of the product panel according to the number of network ports. The present invention realizes clearer logic and strong readability, and the team has clear division of labor in development, is easy to control, and makes full use of reusable code; abstracts a publicly available module, has strong maintainability, and is compatible with different types of hardware models.

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.一种网络设备接口动态适配方法,其特征在于,包括以下步骤:1. A method for dynamic adaptation of network device interfaces, characterized by comprising the following steps: 步骤1:首先加载元素集文档;Step 1: First load the element set document; 步骤2:在根目录生成主入口文件, 然后根据功能需求创建模板,模板有独立的控制器;首先建立一个html静态模块单独存放DOM集合,分离元素集模板与控制器,在根目录建立一个元素集序列,将不同的网口绑定在相应的序列上,需求定义在控制器文件里面,在DOM集抽离出相同分组元素,并加以定义不同的类;Step 2: Generate the main entry file in the root directory, and then create a template according to the functional requirements. The template has an independent controller; first create an html static module to store the DOM collection separately, separate the element set template and controller, and create an element in the root directory Set sequence, bind different network ports to the corresponding sequence, the requirements are defined in the controller file, extract the same grouping elements from the DOM set, and define different classes; 步骤3:在控制器里找出所有的元素合集,通过与中间件通信获取到所有网卡的当前状态数据;Step 3: Find all element collections in the controller and obtain the current status data of all network cards through communication with the middleware; 步骤4:然后根据所有网卡的状态数据抽离出分类,定义不同硬件型号数据类别,将不同硬件型号返回的数据注入定义的类别中;Step 4: Then extract the classification according to the status data of all network cards, define the data categories of different hardware models, and inject the data returned by different hardware models into the defined categories; 步骤5:再根据返回型号判断出是何种数据应用对应的类;Step 5: Determine what kind of data application the corresponding class is based on the returned model; 步骤6:然后根据包含网口类型及数量,判断扩展卡槽是哪种型号;遍历整个扩展卡槽内所有网口,分别应用对应的网卡图标;Step 6: Then determine which model the expansion card slot is based on the type and number of network ports included; traverse all the network ports in the entire expansion card slot and apply the corresponding network card icons respectively; 步骤7:最后根据网口数量调整产品面板的宽高像素大小,使其适应主页的面板区域。Step 7: Finally, adjust the width and height pixel size of the product panel according to the number of network ports to make it fit the panel area of the homepage. 2.根据权利要求1所述的一种网络设备接口动态适配方法,其特征在于,所述步骤1中采用jquery操作元素对象,定义好编译环境脚本配置。2. A method for dynamic adaptation of network device interfaces according to claim 1, characterized in that in step 1, jquery is used to operate element objects to define the compilation environment script configuration. 3.根据权利要求1所述的一种网络设备接口动态适配方法,其特征在于,所述步骤2中主入口文件由html创建。3. A method for dynamic adaptation of network device interfaces according to claim 1, characterized in that in step 2, the main entry file is created by html. 4.根据权利要求1所述的一种网络设备接口动态适配方法,其特征在于,所述步骤3中使用jquery找出所有的元素合集。4. A method for dynamic adaptation of network device interfaces according to claim 1, characterized in that in step 3, jquery is used to find a collection of all elements. 5.根据权利要求1所述的一种网络设备接口动态适配方法,其特征在于,所述步骤5中不需要依赖主模块单独运行,管理口和扩展口分别放在mgmtinfo对象属性下分别定义为agl0和ext。5. A network device interface dynamic adaptation method according to claim 1, characterized in that in step 5, there is no need to rely on the main module to run alone, and the management port and the expansion port are respectively placed under the mgmtinfo object attribute and defined separately. for agl0 and ext. 6.根据权利要求5所述的一种网络设备接口动态适配方法,其特征在于,所述mgmtinfo对象属性分别有:参数eth代表网口名称、参数IP网口绑定IP地址、参数IP6代表网口绑定IPV6地址、参数mac代表网口mac地址、参数mask代表该网口绑定子网掩码和参数state代表网口状态。6. A network device interface dynamic adaptation method according to claim 5, characterized in that the mgmtinfo object attributes respectively include: parameter eth represents the network port name, parameter IP network port binding IP address, parameter IP6 represents The network port is bound to the IPV6 address, the parameter mac represents the mac address of the network port, the parameter mask represents the subnet mask bound to the network port, and the parameter state represents the status of the network port.
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 service management
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
WO2018119120A1 (en) * 2016-12-21 2018-06-28 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 service management
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
CN106294816B (en) Page information processing method and device
CN102789382B (en) For the system and method that list generates and runs
CN106339226B (en) A kind of methods of exhibiting and page presentation device of Webpage
CN106843828A (en) interface display, loading method and device
CN106484383A (en) page rendering method, device and equipment
CN106919406A (en) A kind of desktop application component issue, update method and device
CN103618773B (en) Display method, device and system for thermodynamic diagrams
CN111581565B (en) Page style configuration method, system, medium and equipment
CN105094775A (en) Webpage generation method and apparatus
CN109144619A (en) Icon font information processing method, apparatus and system
CN106846431B (en) A Unified Web Graphics Rendering System Supporting Multiple Representations
US8704852B2 (en) Methods for generating one or more composite image maps and systems thereof
CN107341027A (en) The generation method and generating means of user interface
CN105912328B (en) Display methods, device and the web system of the web system page
CN106156306A (en) A kind of template rendering intent and device
CN105989068A (en) Hypertext markup language (HTML) based mobile application generating method and device
CN113938380B (en) Dynamic adapting method for network equipment interface
CN105933154A (en) Management method of cloud calculation resources
CN119583347B (en) A Visualization and Arrangement System and Method for Urban Rail Cloud Simulation Test Resources
CN110502560A (en) A kind of method and server of Database Connection Parameters encapsulation
CN107040818B (en) Layout analytic hierarchy process method and system for Android TV
CN110348438A (en) A kind of picture character identifying method, device and electronic equipment based on artificial nerve network model
CN105574114A (en) On-line plotting method based on telecom resource management standard control library
US20180196928A1 (en) Network visualization for access controls

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
CP03 Change of name, title or address

Address after: 100193 No. 10, Xibeiwang East Road, Haidian District, Beijing East Zone, Building 7 101, from the 2nd to the 6th floor

Patentee after: Beijing Tiandi Hexing Technology Co., Ltd.

Country or region after: China

Address before: 100000 Beijing City, Haidian District, No. 8 Dongbeiwang West Road, Zhongguancun Software Park, Building 8, 3rd Floor, Room 316

Patentee before: BEIJING TIANDIHEXING TECHNOLOGY Co.,Ltd.

Country or region before: China

CP03 Change of name, title or address