Equipment parameter positioning method, access method, system and equipment
By obtaining the auxiliary identification of the target parameters in the equipment parameter configuration page and generating a complete path, the problems of large calculations of equipment parameter positioning, slow speed and low accuracy in the prior art are solved, and the effect of fast and accurate parameter positioning and reducing maintenance costs are achieved.
Patent Information
- Application Number
- CN202510309110.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-06-17
AI Technical Summary
In the prior art, when positioning equipment parameters, the calculation amount is large, the positioning speed is slow, the accuracy is low, and the maintenance cost is high. Especially when the data volume is large and the data structure is complex, it leads to configuration errors and equipment crashes.
By receiving the target parameters selected by the user in the device parameter configuration page, obtaining its unique auxiliary identifier, and using the parent node search function to calculate each parent node, generating the complete path to access the target parameters in the back-end server, thereby achieving fast and accurate parameter positioning.
It effectively reduces the calculation amount of parameter positioning, improves positioning speed and accuracy, reduces maintenance costs, and avoids configuration errors and equipment crashes.
Smart Images

Figure CN120166041A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of web data processing, and in particular, to a method for locating device parameters, an access method, a system, and a device. Background Art
[0002] In the prior art, for the parameter configuration of a switch, most operations are performed on relevant parameters through a browser web page. Thereby, it is convenient and simple for users to configure the relevant configuration parameters of the switch, and the parameter data of the already configured switch device can be stored stably for a long time, so that the network of the switch device remains stable for a long time.
[0003] Generally, when a user configures the function parameters of a switch device, the number of parameters is small and the parameter data structure is simple. As Figure 1 shown, including a very small number of parameters. After the user configuration is completed, the backend server stores the configured parameter values. Since the parameter data is small, during the storage and subsequent access of the parameter values, based on the keywords, there is no need to perform a large amount of calculations to accurately locate the target parameter, so as to perform a series of operations such as adding, querying, modifying, and deleting the target parameter value.
[0004] However, with the expansion of the network scale, the number of parameter data to be configured in the switch is increasing, and the amount of parameter data is huge. For example Figure 2 shown, the data hierarchy is many and the data structure is complex. When storing and accessing the target parameter, the entire data structure is retrieved globally by keywords. Therefore, in the case of a large amount of data, the search time is long. The intuitive impact is that when the user configures the data, the time for the data to take effect will be relatively slow. At this time, the device consumes a large amount of resources to calculate the data configured by the user, which also causes the device to run slowly. In addition, if the keyword retrieval method is used, if the parameter values in different data hierarchies have the same name, it will be impossible to accurately determine which parameter the user is accessing, which will lead to inconsistency between the actually effective parameter data and the parameter data accessed by the user, resulting in configuration errors. Seriously, it may cause the device to restart, crash, etc. Finally, in order to accurately access the parameter data in the backend server, a huge maintenance cost also needs to be paid. Summary of the Invention
[0005] In view of this, the embodiments of this application provide a method for locating device parameters, an access method, a system, and a device, which can effectively solve the problems of large calculation amount, slow positioning speed, low accuracy, and large maintenance cost when locating the parameters of a device in the prior art, etc.
[0006] In a first aspect, the embodiments of this application provide a method for locating device parameters, including:
[0007] Receive a target parameter corresponding to a leaf node selected and configured by the user from a parameter control list in a tree structure on a device parameter configuration page;
[0008] According to the parameter identifier of the target parameter, obtain the auxiliary identifier uniquely corresponding to the target parameter; the uniqueness retention period of the auxiliary identifier is from when the target parameter is obtained by the back-end server to a preset end point;
[0009] According to the auxiliary identifier, use a preset parent node search function to calculate each parent node of the target parameter;
[0010] Generate a complete path for accessing the target parameter in the back-end server according to each parent node.
[0011] In some embodiments, before receiving the target parameter corresponding to a leaf node selected and configured by the user from a parameter control list in a tree structure on a device parameter configuration page, at least one of the following three items is further included:
[0012] The first item: Set the parameters corresponding to non-leaf nodes in the parameter control list of the tree structure to an unselectable state;
[0013] The second item: When an operation instruction for a non-leaf node is received, expand and display the parameters corresponding to each sub-node under the non-leaf node;
[0014] The third item: When an operation instruction for a non-leaf node is received, output a prompt message for clicking on a leaf node.
[0015] In some embodiments, the obtaining the auxiliary identifier uniquely corresponding to the target parameter according to the parameter identifier of the target parameter includes:
[0016] According to the parameter identifier of the target parameter, obtain the auxiliary identifier uniquely corresponding to the target parameter from the script function bound to the parameter control corresponding to the target parameter.
[0017] In some embodiments, the using a preset parent node search function to calculate each parent node of the target parameter according to the auxiliary identifier includes:
[0018] Input the auxiliary identifier into the parent node search function; through the parent node search function, traverse the parameter configuration file corresponding to the parameter control list of the tree structure according to the auxiliary identifier, and retrieve the parameter identifier and the corresponding level number of the target parameter, as well as retrieve the parameter identifiers and the corresponding level numbers of all parent nodes of the target parameter respectively;
[0019] Generating a complete path for accessing the target parameter in the backend server according to each of the parent nodes includes:
[0020] Sorting the parameter identifier corresponding to the target parameter and the parameter identifiers corresponding to all the parent nodes in ascending order of the number of levels, and generating the complete path of the target parameter.
[0021] In some embodiments, it further includes:
[0022] Using a preset auxiliary identifier adding function to read a parameter configuration file; the parameter configuration file includes parameter data of a tree structure corresponding to the parameter control list of the tree structure; furthermore, traversing each parameter in the parameter configuration file through the auxiliary identifier adding function, and adding a unique auxiliary identifier to each parameter that does not detect an auxiliary identifier.
[0023] Before receiving the target parameter corresponding to a leaf node selected by the user from the parameter control list of the tree structure on the device parameter configuration page, it further includes:
[0024] Receiving basic parameter configuration data obtained from the backend server;
[0025] If the data structure of the basic parameter configuration data is a non-tree structure, converting the basic parameter configuration data into the parameter data of the tree structure and saving it to the parameter configuration file;
[0026] Using a preset tool to render the parameter data in the parameter configuration file to the device parameter configuration page.
[0027] In some embodiments, if the data structure of the basic parameter configuration data is a non-tree structure, converting the basic parameter configuration data into the parameter data of the tree structure includes:
[0028] If the non-tree-structured basic parameter configuration data is identified by a preset level identifier, sending the non-tree-structured basic parameter configuration data to a format parsing and conversion function; furthermore, parsing the basic parameter configuration data by the format parsing and conversion function according to the level identifier to obtain the parent node object of each parameter and the level number of the parameter itself, and converting each parameter into the parameter data of the tree structure according to the parent node object and the level number of the parameter itself.
[0029] In a second aspect, an embodiment of the present application provides a method for accessing device parameter data, including:
[0030] Obtaining a complete path of a target parameter; the complete path is obtained by using a device parameter positioning method provided in the first aspect of the present application;
[0031] Determine the storage location of the target parameter in the backend server according to the complete path, and access the parameter configuration data corresponding to the target parameter according to the storage location.
[0032] In a third aspect, an embodiment of the present application provides a network management system, which includes: a front-end manager and a backend server; the front-end manager is used to provide a device parameter configuration page and receive parameter configuration data for a target parameter, and implement a device parameter positioning method provided in the first aspect of the present application to obtain the complete path of the target parameter, and send the parameter configuration data and the corresponding complete path to the backend server;
[0033] The backend server is used to implement a device parameter data access method provided in the second aspect of the present application to access the parameter configuration data corresponding to the target parameter stored therein.
[0034] In a fourth aspect, an embodiment of the present application provides a terminal device, which includes a processor and a memory, the memory stores a computer program, and the processor is used to execute the computer program to implement a device parameter positioning method provided in the first aspect of the present application.
[0035] The embodiments of the present application have the following beneficial effects:
[0036] In the present application, by receiving a target parameter corresponding to a leaf node selected and configured by a user from a parameter control list in a tree structure on a device parameter configuration page; obtaining a uniquely corresponding auxiliary identifier for the target parameter according to the parameter identifier of the target parameter; the uniqueness retention period of the auxiliary identifier is from when the backend server obtains the target parameter to a preset end point; calculating each parent node of the target parameter by using a preset parent node search function according to the auxiliary identifier; generating a complete path for accessing the target parameter in the backend server according to each parent node. In the present application, the parameter identifiers of each level of parent nodes can be obtained step by step according to the leaf node in the parameter control list, thereby obtaining a complete path for storing the target parameter corresponding to the leaf node in the backend server, and using this complete path to accurately locate the configuration data of the target parameter. Moreover, in the present application, the configuration data of the target parameter can be obtained according to the complete path without a large amount of calculation, which speeds up the positioning speed. The uniqueness retention period of the auxiliary identifier in the present application is short, which reduces the maintenance difficulty and thus reduces the maintenance cost. Therefore, the present application can effectively solve the problems of large calculation amount, slow positioning speed, low accuracy, and high maintenance cost in the prior art when positioning the parameters of a device. Description of the Drawings
[0037] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and thus should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0038] Figure 1 It shows a schematic structural diagram of a simple parameter data involved in the device parameter positioning method of the embodiments of the present application;
[0039] Figure 2 It shows a schematic structural diagram of a complex parameter data involved in the device parameter positioning method of the embodiments of the present application;
[0040] Figure 3 It shows a schematic structural diagram of a network management system of the embodiments of the present application;
[0041] Figure 4 It shows a flowchart of a device parameter positioning method of the embodiments of the present application;
[0042] Figure 5 It shows a flowchart of the preprocessing steps of the device parameter positioning method of the embodiments of the present application;
[0043] Figure 6 It shows a schematic structural diagram of the parameter data of the parameter configuration file in the device parameter positioning method of the embodiments of the present application;
[0044] Figure 7-1 It shows a partial flowchart of an example of the device parameter positioning method of the embodiments of the present application;
[0045] Figure 7-2 It shows another partial flowchart of an example of the device parameter positioning method of the embodiments of the present application;
[0046] Figure 8 It shows a flowchart of a device parameter data access method of the embodiments of the present application;
[0047] Figure 9 It shows a schematic structural diagram of a device parameter positioning device of the embodiments of the present application.
[0048] Main element symbol description:
[0049] 100 - Front - end manager; 110 - Device parameter configuration page; 200 - Back - end server; 910 - Data receiving module; 920 - Auxiliary identifier acquisition module; 930 - Parent node search module; 940 - Complete path determination module. Detailed implementation manners
[0050] 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. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments.
[0051] Generally, the components of the embodiments of the present application described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application claimed, but merely represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative efforts belong to the scope of protection of the present application.
[0052] Hereinafter, the terms "including", "having" and their cognates that can be used in various embodiments of the present application are only intended to represent a specific feature, number, step, operation, element, component or combination of the foregoing items, and should not be construed as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items. In addition, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0053] Unless otherwise defined, all terms (including technical terms and scientific terms) used here have the same meaning as commonly understood by those of ordinary skill in the art to which the various embodiments of the present application belong. The terms (such as those defined in a general-use dictionary) will be interpreted as having the same meaning as the contextual meaning in the relevant technical field and will not be interpreted as having an idealized meaning or being overly formal, unless clearly defined in the various embodiments of the present application.
[0054] The following will describe in detail some embodiments of the present application with reference to the accompanying drawings. Without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0055] Generally, the configuration parameter data of the switch device is small, and the data structure is simple when storing, and it is easy to locate the target parameter according to the keyword. When the configuration parameter data is huge, there are many data levels and the data structure is complex. When locating the parameter position according to the keyword again, a large amount of calculation is required, and it is also easy to locate incorrectly, resulting in chaotic storage of parameter values and network operation errors.
[0056] In this application, for data with complex data structures, a corresponding auxiliary identifier value is matched to each parameter within each level, and each auxiliary identifier value is unique. Thus, theoretically, only the value corresponding to the parameter needs to be saved. However, this requires permanently maintaining the uniqueness and immutability of the value corresponding to each parameter. As a result, data maintenance is difficult and the maintenance cost is high. Even if this difficulty can be overcome, it cannot meet the requirements of quickly and accurately locating data in the switch device. One has to traverse each level to find the target parameter, and each time a user accesses it, a traversal is required, which is very resource-consuming.
[0057] To solve the above problems, this application provides a device parameter positioning method, an access method, a system, and a device, which can effectively solve the problems of large computational amount, slow positioning speed, low accuracy, and high maintenance cost when positioning the parameters of a device in the prior art.
[0058] As Figure 3 shown, this application provides a schematic structural diagram of a network management system. Exemplarily, the network management system includes a front-end manager 100 and a back-end server 200; the front-end manager 100 is communicatively connected to the back-end server 200. The front-end manager 100 is used to provide a device parameter configuration page 110 and receive parameter configuration data for a target parameter, and implement a device parameter positioning method provided by this application to obtain the complete path of the target parameter, and send the parameter configuration data and the corresponding complete path to the back-end server 200.
[0059] The back-end server 200 is used to implement a device parameter data access method provided by this application to access the parameter configuration data corresponding to the target parameter stored therein. If the accessed data is unread, the accessed parameter configuration data also needs to be sent to the front-end manager 100.
[0060] It should be noted that the above front-end manager 100 may include, but is not limited to, a desktop computer, a tablet computer, a mobile handheld terminal, etc.
[0061] The following will illustrate the device parameter positioning method in conjunction with some specific embodiments.
[0062] Figure 4 A flowchart of the device parameter positioning method according to an embodiment of this application is shown. The device parameter positioning method is applicable to the front-end manager 100. Exemplarily, the device parameter positioning method includes the following steps:
[0063] S110, receive a target parameter corresponding to a leaf node selected and configured by the user from a parameter control list in a tree structure on the device parameter configuration page 110.
[0064] S120. Obtain the auxiliary identifier uniquely corresponding to the target parameter according to the parameter identifier of the target parameter. The uniqueness retention period of the auxiliary identifier is from the time when the target parameter is obtained from the backend server 200 to a preset end point. Exemplarily, the preset end point includes submitting the target parameter to the backend server 200 to complete the saving, or the user cuts out the device parameter configuration page 110.
[0065] S130. Calculate each parent node of the target parameter by using a preset parent node search function according to the auxiliary identifier.
[0066] S140. Generate a complete path for accessing the target parameter in the backend server 200 according to each parent node.
[0067] To improve the applicable scope, in one implementation, as Figure 5 shown, the device parameter positioning method of the embodiment of the present application further provides a preprocessing step. Specifically, before receiving the target parameter corresponding to a leaf node selected and configured by the user from the parameter control list of the tree structure in the device parameter configuration page 110, it further includes:
[0068] S101. Receive the basic parameter configuration data obtained from the backend server 200. Exemplarily, in response to the loading command of the target page, send a read data command for obtaining the basic parameter configuration data corresponding to the target page to the backend server 200. The backend server 200 parses the read data command and sends the corresponding basic parameter configuration data to the front-end manager 100.
[0069] Generally, the data format of the basic parameter configuration data given by the backend server 200 is in the format of a predefined multi-level tree structure. However, some device services are not convenient to process the stored data, and the basic parameter configuration data written according to a preset rule will be given.
[0070] S102. If the data structure of the basic parameter configuration data is a non-tree structure, convert the basic parameter configuration data into parameter data in a tree structure and save it to the parameter configuration file.
[0071] Specifically, parse the basic parameter configuration data written according to the preset rule, identify the hierarchical relationship, and convert it into parameter data in a tree structure.
[0072] It can be understood that if the data structure of the basic parameter configuration data is a tree structure, directly enter step S103 for rendering.
[0073] Exemplarily, the preset rule includes but is not limited to using a preset hierarchical identifier to identify the level. Further, if the data structure of the basic parameter configuration data is a non-tree structure, converting the basic parameter configuration data into parameter data in a tree structure includes:
[0074] If the basic parameter configuration data that is not in a tree structure is identified by a preset level identifier, the basic parameter configuration data that is not in a tree structure is sent to a format parsing and conversion function; furthermore, the format parsing and conversion function parses the basic parameter configuration data according to the level identifier to obtain the parent node object of each parameter and the level number of the parameter itself, and converts each parameter into parameter data in a tree structure according to the parent node object and the level number of the parameter itself.
[0075] S103, use a preset tool to render the parameter data in the parameter configuration file to the device parameter configuration page 110.
[0076] Exemplarily, the preset tool includes but is not limited to an Element plugin or a self-developed and encapsulated tree structure data generation logic plugin. Element is a desktop component library based on Vue2.0 for developers, designers, and product managers. If the Element plugin is used, the element Tree tree control component in the Element plugin is used to generate a control (collectively referred to as a parameter control) for each parameter in the parameter configuration file and render it to the device parameter configuration page 110.
[0077] For example, the parameter controls include, but are not limited to, buttons, sub-items in a list, etc. The parameter data in the form of a multi-level tree structure stored in the parameter configuration file, where the parameter identifiers and auxiliary parameters in the parameter configuration file are stored using a preset data structure, and one can be obtained from the other. For example, the parameter identifier can be obtained based on the auxiliary identifier. Exemplarily, the parameter data in the parameter configuration file includes multi-level data, and each level is set with a level label, the number of levels, and level data. The level labels include a parent node label and a child node label. In each parent node level, the first data type is used to store each parameter of this level, and the second data type is used to store each attribute included in the parameter. For example, an array data type is used to store the parameters of each level, and a dictionary is used to store each attribute and its value of the parameter. Among them, the parameter attributes include a parameter identifier and a parameter identifier keyword, an auxiliary identifier and an auxiliary identifier keyword, etc. For example, the parameter data corresponding to a parent node includes "children: [{title: leaf-5, value: “56”}, {title: leaf-6, value: “57”}]". Among them, "children" indicates that this parent-child node is not the root node. title is the parameter identifier keyword, "leaf-5" is the parameter identifier, value is the auxiliary identifier keyword, and "56" is the auxiliary identifier. For example, the parameter data corresponding to a leaf node includes "1: {title: “leaf-6”, value: “57”}", where "1" indicates that this leaf node is the second leaf node of its parent node. title is the parameter identifier keyword, "leaf-6" is the parameter identifier, value is the auxiliary identifier keyword, and "57" is the auxiliary identifier. Exemplarily, the parameter data in the parameter configuration file is specifically as Figure 6 shown, where "0" represents the first node within a level, and "1" represents the second node within a level.
[0078] The device parameter configuration page 110 obtained according to the parameter configuration file, as Figure 2 shown, displays a list of parameter controls in a tree structure on the device parameter configuration page 110. The list of parameter controls includes the parameter identifiers of each parameter, and each control is distinguished by the display of the parameter identifier.
[0079] Furthermore, after rendering the device parameter configuration page 110, before receiving the target parameter corresponding to a leaf node selected and configured by the user from the list of parameter controls in the tree structure on the device parameter configuration page 110, it also includes:
[0080] Setting the parameters corresponding to the non-leaf nodes in the list of parameter controls in the tree structure to an unselectable state.
[0081] Further, before receiving the target parameter corresponding to a leaf node selected and configured by the user from the parameter control list in the tree structure on the device parameter configuration page 110, it also includes: when receiving an operation instruction for a non-leaf node, expanding and displaying the parameters corresponding to each sub-node under the non-leaf node. When receiving an operation instruction for a non-leaf node, outputting a prompt message for clicking the leaf node.
[0082] In other words, the option containing sub-nodes in the parameter control list of the tree structure cannot be selected until the leaf nodes at all levels are selected. Just like a folder in a computer system, clicking on the folder will enter the interior of that folder level until the last-level file. In addition, when the selected parameter control is not the last level, the parameter control cannot be selected and the user is reminded to select a higher-level node.
[0083] In order to obtain the auxiliary identifier quickly and accurately, in one implementation, in step S120, according to the parameter identifier of the target parameter, obtaining the auxiliary identifier uniquely corresponding to the target parameter includes:
[0084] According to the parameter identifier of the target parameter, obtaining the auxiliary identifier uniquely corresponding to the target parameter from the script function bound to the parameter control corresponding to the target parameter. Among them, the parameter identifier includes but is not limited to parameter name, parameter number, etc. In the embodiment of the present application, after generating the parameter control list, it also includes binding a preset script function to each parameter control in the parameter control list; the script function includes preset operation events (such as click events) of the parameter control. When the preset operation event is triggered, the auxiliary identifier uniquely corresponding to the parameter control can be obtained from the script function. The auxiliary identifier includes but is not limited to digital encoding, character encoding.
[0085] In one implementation, in step S130, according to the auxiliary identifier, using the preset parent node search function to calculate each parent node of the target parameter includes:
[0086] Input the auxiliary identifier into the parent node search function; through the parent node search function, traverse the parameter configuration file (the data stored internally is in a tree structure) corresponding to the parameter control list of the tree structure according to the auxiliary identifier, and retrieve the parameter identifier corresponding to the target parameter and the corresponding level number, as well as retrieve the parameter identifiers corresponding to all the parent nodes of the target parameter and the corresponding level numbers respectively. It can be understood that the parameter configuration file includes the parameter identifier and the corresponding auxiliary identifier, and there is a corresponding relationship between the two. Since the auxiliary identifier remains unchanged throughout the uniqueness retention period, that is, the auxiliary identifier is unique within the parameter configuration file. Therefore, within the parent node search function, the parameter identifier corresponding to it can be retrieved according to the auxiliary identifier, and this parameter identifier is saved; since the data in the parameter configuration file is in a tree structure, after locating the parameter identifier, traverse up level by level from this node to obtain the parameter identifiers of each parent node corresponding to this parameter, and determine the level numbers of each parent node according to the traversed sequence numbers.
[0087] Generate a complete path for accessing the target parameter in the backend server 200 according to each parent node, including:
[0088] Sort the parameter identifier corresponding to the target parameter and the parameter identifiers corresponding to all the parent nodes respectively in ascending order of the level number and generate the complete path of the target parameter. For example, use the " / " symbol to separate the parameter identifiers of each level, and the final complete path is parent1 / parent1-0 / leaf-1 / leaf-31 / leaf-6. Among them, leaf-6 is the final parameter position.
[0089] In one embodiment, a preset auxiliary identifier adding function is used to read a parameter configuration file; the parameter configuration file includes parameter data in a tree structure corresponding to a list of parameter controls in a tree structure; furthermore, the auxiliary identifier adding function traverses each parameter in the parameter configuration file, and adds a unique auxiliary identifier to each parameter that does not detect an auxiliary identifier. Exemplarily, each parameter identifier is traversed, and it is detected whether the second data type where the parameter identifier is located includes an auxiliary identifier keyword, and whether there is a corresponding auxiliary identifier for the auxiliary identifier keyword. If there is an auxiliary identifier keyword and a corresponding auxiliary identifier, the next parameter identifier is retrieved until all parameters are traversed. If either the auxiliary identifier keyword or the corresponding auxiliary identifier does not exist, an auxiliary identifier keyword and a unique auxiliary identifier are added to the parameter identifier. Specifically, a pair of an auxiliary identifier keyword and a unique auxiliary identifier are added to the second data type where the parameter identifier is located, that is, added to the hierarchical data corresponding to the parameter identifier. For example, added to the dictionary data {title: "leaf-6"} to get {title: "leaf-6", value: "57"}. Naturally, the pair of the auxiliary identifier keyword and the unique auxiliary identifier are also added to its upper-level parent node.
[0090] In the prior art, if the auxiliary identifier is stored in the database of the backend server 200, it is necessary to keep the auxiliary identifier fixed and unique for a long time, and the subsequent update iteration and maintenance cost of the program in the backend server 200 are very high. Therefore, in this application, after loading the data, the auxiliary identifier adding function is used to add a unique identifier to each parameter, and the uniqueness of the auxiliary identifier is not maintained after saving the configuration or switching out of the configuration page, which can not only accurately locate the parameter but also reduce the maintenance cost.
[0091] The following uses a specific example to detail the device parameter positioning method of the embodiments of this application, as Figure 7-1 、 Figure 7-2 shown, including the following steps:
[0092] S310, the front-end manager 100 obtains basic parameter configuration data from the backend server 200.
[0093] S320, analyze the basic parameter configuration data. If the data format of the basic parameter configuration data is non-tree structure data, convert the data format of the basic parameter configuration data into a tree structure. If the data format of the basic parameter configuration data is tree structure data, directly enter step S330. The basic parameter configuration data is stored in the parameter configuration file.
[0094] S330, traverse each parameter in the basic parameter configuration data using a preset auxiliary identifier addition function, and add a unique auxiliary identifier to each parameter that has not detected the auxiliary identifier, obtaining parameter data where each parameter identifier carries the auxiliary identifier.
[0095] S340, use the element Tree tree control component in the Element plug-in to render the parameter data to the device parameter configuration page 110, so as to display a tree-structured parameter control list on the device parameter configuration page 110.
[0096] S341, bind a script function to each preset operation event of the parameter controls in the parameter control list. The script function includes the parameter identifier and the auxiliary identifier of the parameter corresponding to the node.
[0097] S342, set the parameters corresponding to the non-leaf nodes in the tree-structured parameter control list to the non-selectable state.
[0098] S350, in the case of receiving a parameter corresponding to a child node selected by the user from the tree-structured parameter control list on the device parameter configuration page 110, expand and display the parameters corresponding to each child node under the child node, and output a prompt message for clicking on the leaf node.
[0099] S360, receive the target parameter corresponding to a leaf node selected and configured by the user from the tree-structured parameter control list on the device parameter configuration page 110.
[0100] S370, trigger a preset operation event, and obtain the auxiliary identifier uniquely corresponding to the target parameter from the script function bound to the target parameter control according to the parameter identifier of the target parameter.
[0101] S380, use the parent node search function to traverse the parameter configuration file corresponding to the tree-structured parameter control list according to the auxiliary identifier, and retrieve the parameter identifier and the corresponding level number of the target parameter, as well as the parameter identifiers and the corresponding level numbers of all the parent nodes of the target parameter respectively.
[0102] S390, sort the parameter identifier corresponding to the target parameter and the parameter identifiers of all the parent nodes respectively in ascending order of the level number and generate the complete path of the target parameter.
[0103] The complete paths obtained by using the first parameter to identify leaf-6 and the second parameter to identify leaf-6 are "parent1 / parent1-0 / leaf-1 / leaf-31 / leaf-5 / leaf-6" and "parent1 / parent1-0 / leaf-1 / leaf-31 / leaf-6" respectively. Although the parameter identifiers are the same, the final complete paths are different. Based on their respective complete paths, the corresponding parameter data can be quickly and accurately located.
[0104] Exemplarily, the devices in this application include, but are not limited to, switch devices, etc. If it is a switch device, the complete path is the device location.
[0105] By providing the complete path of the storage location of device parameters in this application, the backend server 200 can quickly and accurately locate the storage location of the parameter data that the user wants to configure or save. Thereby, it can ensure that the saved parameter data can be stored permanently and stably. Moreover, in this application, a unique auxiliary identifier is dynamically assigned to each parameter when loading the parameter data. The device parameter server of this application can not save the auxiliary identifier, greatly reducing the maintenance cost.
[0106] Since the parameter names under different data levels may be the same, storing a single keyword name alone may cause errors during query. However, storing a complete path in this application will not result in mislocation. Because there will be no parameter data with the same name at the same level, that is, the parameter identifiers are different at the same level, and the auxiliary identifier in this application remains unique during the uniqueness retention period. Thus, the complete storage path obtained through this application will definitely not be repeated.
[0107] The complete storage path of the target parameter in this application facilitates storing and querying data in a specific format (such as an irregular tree data format) in the backend server 200, can quickly locate and query the target parameter configured by the user or find the target parameter data that the user needs to query within big data, and in subsequent parameter data storage maintenance, even if the auxiliary identifier value corresponding to the parameter changes, it does not affect the querying, configuration, etc. of the parameter.
[0108] As Figure 8 shown, this application also provides a method for accessing device parameter data. Exemplarily, it includes:
[0109] S210, obtaining the complete path of the target parameter; the complete path is obtained by using the device parameter positioning method of the embodiment of this application.
[0110] S220, determining the storage location of the target parameter in the backend server 200 according to the complete path, and accessing the parameter configuration data corresponding to the target parameter according to the storage location.
[0111] In this application, it is impossible to use the conventional method to click and save the selected parameter identifiers layer by layer from the root node to the leaf node of the parameter control list in the tree structure, and this method is rather cumbersome to operate, resulting in extremely poor user experience. Instead, in this application, according to the auxiliary identifier corresponding to the leaf node, the last selected parameter is searched from the last level through the parent node search function, and the upper-level parent parameter identifiers are stored layer by layer until the root node of the entire parameter data is queried. Then, the parameter identifiers at each level are combined into a complete data path. Then, when the user submits the data, this complete path is submitted to the backend server 200. According to the complete path in the backend server 200, it is possible to quickly and conveniently locate a parameter data that the user wants to configure.
[0112] Figure 9 FIG. shows a schematic structural diagram of a device parameter positioning device according to an embodiment of the present application. Exemplarily, the device parameter positioning device includes: a data receiving module 910, an auxiliary identifier obtaining module 920, a parent node searching module 930, and a complete path determining module 940.
[0113] The data receiving module 910 is configured to receive a target parameter corresponding to a leaf node selected and configured by the user from the parameter control list in the tree structure on the device parameter configuration page 110.
[0114] The auxiliary identifier obtaining module 920 is configured to obtain a unique auxiliary identifier corresponding to the target parameter according to the parameter identifier of the target parameter; the uniqueness retention period of the auxiliary identifier is from when the backend server 200 obtains the target parameter to a preset end point.
[0115] The parent node searching module 930 is configured to calculate each parent node of the target parameter according to the auxiliary identifier by using a preset parent node search function.
[0116] The complete path determining module 940 is configured to generate a complete path for accessing the target parameter in the backend server 200 according to each parent node.
[0117] It can be understood that the device in this embodiment corresponds to the device parameter positioning method in the above embodiment, and the optional items in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0118] The present application also provides a terminal device. Exemplarily, the terminal device includes a processor and a memory. Among them, the memory stores a computer program, and the processor runs the computer program to enable the terminal device to execute the above device parameter positioning method or the functions of each module in the above device parameter positioning device. Exemplarily, the terminal device is a front-end manager 100 for configuring and managing the parameters of the switch.
[0119] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including at least one of a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application.
[0120] The memory can be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. Among them, the memory is used to store a computer program, and after receiving an execution instruction, the processor can execute the computer program accordingly.
[0121] The present application also provides a computer-readable storage medium for storing the computer program used in the above terminal device. For example, the computer-readable storage medium can include, but is not limited to: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc that can store program codes.
[0122] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and structural diagrams in the drawings show the possible architectures, functions, and operations of the devices, methods, and computer program products according to multiple embodiments of this application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the blocks may occur in a different order than that marked in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the structural diagram and / or flowchart, as well as the combination of blocks in the structural diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0123] In addition, each functional module or unit in various embodiments of this application can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.
[0124] If the described function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application.
[0125] The above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed in this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application.
Claims
1. A device parameter positioning method, characterized in that: include: Receive a target parameter corresponding to a leaf node selected by a user from a parameter control list in a tree structure on a device parameter configuration page; According to the parameter identifier of the target parameter, an auxiliary identifier uniquely corresponding to the target parameter is obtained; the uniqueness of the auxiliary identifier is maintained from the time when the backend server obtains the target parameter to a preset end point; According to the auxiliary identifier, each parent node of the target parameter is calculated using a preset parent node search function; A complete path for accessing the target parameter in the backend server is generated according to each parent node.
2. The device parameter positioning method according to claim 1, characterized in that: The receiving user selects a target parameter corresponding to a leaf node of the configuration from the parameter control list of the tree structure in the device parameter configuration page, and at least one of the following three items is also included before: The first item: setting the parameters corresponding to the non-leaf nodes in the parameter control list of the tree structure to be unselectable; The second item: when receiving an operation instruction for a non-leaf node, expand and display the parameters corresponding to each sub-node under the non-leaf node; Item 3: When receiving an operation instruction for a non-leaf node, output a prompt message for clicking the leaf node.
3. The device parameter positioning method according to claim 1, characterized in that: The step of acquiring the auxiliary identifier uniquely corresponding to the target parameter according to the parameter identifier of the target parameter includes: According to the parameter identifier of the target parameter, an auxiliary identifier uniquely corresponding to the target parameter is obtained from a script function bound to a parameter control corresponding to the target parameter.
4. The device parameter positioning method according to claim 1, characterized in that: The step of calculating each parent node of the target parameter using a preset parent node search function according to the auxiliary identifier includes: The auxiliary identifier is input into the parent node search function; the parameter configuration file corresponding to the parameter control list of the tree structure is traversed according to the auxiliary identifier by the parent node search function, and the parameter identifier and the corresponding number of levels corresponding to the target parameter are retrieved, and the parameter identifiers and the corresponding numbers of levels respectively corresponding to all parent nodes of the target parameter are retrieved; The generating a complete path for accessing the target parameter in the backend server according to each parent node includes: The parameter identifiers corresponding to the target parameter and the parameter identifiers corresponding to all the parent nodes are sorted in order of the number of levels from small to large, and a complete path of the target parameter is generated.
5. The device parameter positioning method according to claim 1, characterized in that: Also includes: A preset auxiliary identifier adding function is used to read a parameter configuration file; the parameter configuration file includes parameter data of a tree structure corresponding to the parameter control list of the tree structure; further, each parameter in the parameter configuration file is traversed through the auxiliary identifier adding function, and a unique auxiliary identifier is added to each parameter for which no auxiliary identifier is detected.
6. The device parameter positioning method according to claim 1, characterized in that: The receiving user selects a target parameter corresponding to a leaf node of the configuration from a parameter control list of a tree structure in the device parameter configuration page, and the method also includes: Receive basic parameter configuration data obtained from the backend server; If the data structure of the basic parameter configuration data is a non-tree structure, converting the basic parameter configuration data into parameter data of the tree structure and saving the data into a parameter configuration file; The parameter data in the parameter configuration file is rendered to the device parameter configuration page using a preset tool.
7. The device parameter positioning method according to claim 6, characterized in that: If the data structure of the basic parameter configuration data is a non-tree structure, converting the basic parameter configuration data into parameter data of the tree structure includes: If the basic parameter configuration data of the non-tree structure is identified by a preset hierarchical identifier, the basic parameter configuration data of the non-tree structure is transmitted to a format parsing conversion function; then, the basic parameter configuration data is parsed by the format parsing conversion function according to the hierarchical identifier to obtain the parent node object of each parameter and the number of levels of the parameter itself, and each parameter is converted into parameter data of a tree structure according to the parent node object and the number of levels of the parameter itself.
8. A method for accessing device parameter data, characterized in that: include: Get the full path of the target parameter; The complete path is obtained by using the device parameter positioning method according to any one of claims 1 to 7; The storage location of the target parameter in the backend server is determined according to the complete path, and parameter configuration data corresponding to the target parameter is accessed according to the storage location.
9. A network management system, characterized in that: The system comprises: a front-end manager and a back-end server; the front-end manager is used to provide a device parameter configuration page and receive parameter configuration data for a target parameter, and implement the device parameter positioning method according to any one of claims 1 to 7 to obtain a complete path of the target parameter, and send the parameter configuration data and the corresponding complete path to the back-end server; The backend server is used to implement the device parameter data access method as described in claim 8 to access parameter configuration data corresponding to the target parameters stored therein.
10. A terminal device, characterized in that: The terminal device comprises a processor and a memory, the memory stores a computer program, and the processor is used to execute the computer program to implement the device parameter positioning method according to any one of claims 1 to 7.