CN106844753B - Method and device for constructing network element tree component - Google Patents

Method and device for constructing network element tree component Download PDF

Info

Publication number
CN106844753B
CN106844753B CN201710084125.0A CN201710084125A CN106844753B CN 106844753 B CN106844753 B CN 106844753B CN 201710084125 A CN201710084125 A CN 201710084125A CN 106844753 B CN106844753 B CN 106844753B
Authority
CN
China
Prior art keywords
network element
level
element tree
tree
request
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
CN201710084125.0A
Other languages
Chinese (zh)
Other versions
CN106844753A (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 Tianyuan Creative Technology Ltd
Original Assignee
Beijing Tianyuan Creative Technology 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 Tianyuan Creative Technology Ltd filed Critical Beijing Tianyuan Creative Technology Ltd
Priority to CN201710084125.0A priority Critical patent/CN106844753B/en
Publication of CN106844753A publication Critical patent/CN106844753A/en
Application granted granted Critical
Publication of CN106844753B publication Critical patent/CN106844753B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques

Abstract

The invention provides a method and a device for constructing a network element tree component, and relates to the field of communication network optimization. Wherein the method comprises the following steps: caching the configuration information, the network element data and the dependency relationship among the network elements by using a database Redis; asynchronously initializing a network element tree by using a zTree plug-in to request a back-end service provided by Java, marking the type of each level of the network element tree, and asynchronously loading child nodes according to the type of the next level of the network element tree; and initiating a search request to a back-end service provided by Java by utilizing a search engine Solr so as to enable the back-end service to return a search result, wherein the search request comprises a search keyword, a network element tree level, a filter parameter and an initialization mode. The invention can support the high-efficiency initialization of the network element data with the magnitude of millions, can also quickly return the network element result searched by the user, and has convenient maintenance and strong expandability.

Description

Method and device for constructing network element tree component
Technical Field
The present invention relates to the field of communication network optimization, and in particular, to a method and an apparatus for constructing a net element tree component.
Background
With the rapid development of communication networks, the network structure is more and more complex, and the network elements are more and more in types and number as the main analysis objects for optimizing the communication networks. The traditional network element tree has single initialization dimension, and the situations of slow initialization and even false death of an interface often occur under the condition of more network elements; under the condition that a user does not expand a node, a correct network element analysis object sometimes cannot be obtained; when a user searches for a network element, the user cannot quickly return a search result and the like. Because these problems seriously affect the user experience, it is very important to construct an efficient, flexible and stable net element tree component for network optimization analysis of users.
Disclosure of Invention
The invention aims to provide a method and a device for constructing a network element tree component. The method solves the technical problems that: how to realize the high-efficient initialization of the network element data and quickly return the network element result searched by the user.
To achieve the above object, the present invention provides a method of constructing a net element tree component. The method comprises the following steps:
caching the configuration information, the network element data and the dependency relationship among the network elements by using a database Redis;
asynchronously initializing a network element tree by using a zTree plug-in to request a back-end service provided by Java, marking the type of each level of the network element tree, and asynchronously loading child nodes according to the type of the next level of the network element tree;
and initiating a search request to a back-end service provided by Java by utilizing a search engine Solr so as to enable the back-end service to return a search result, wherein the search request comprises a search keyword, a network element tree level, a filter parameter and an initialization mode.
Optionally, the caching the configuration information, the network element data, and the affiliation between network elements using a database Redis that:
caching configuration information and network element information by using a Hash data structure in the Redis;
and caching the affiliations among the configuration information, the configuration information and the network elements by using a List data structure in the Redis.
Optionally, the method further comprises:
and clearing the Data cached in the Hash Data structure and the List Data structure in the Redis at a preset time by using a timing task provided by a Spring Data Redis framework, and re-caching new Data in the Hash Data structure and the List Data structure.
Optionally, the asynchronously initializing the net element tree by using the zTree plug-in to request the backend service provided by Java, marking a type of each level of the net element tree, and asynchronously loading child nodes according to a type of a next level of the net element tree includes:
using a zTree plug-in to send a request for acquiring a first-level node of a network element tree to a back-end service provided by Java, wherein the request comprises a network element tree level, provinces, cities, manufacturers and an initialization mode;
the back-end service finds a corresponding service class according to the network element tree level in the request, then takes out data of a first level node from the Redis according to the service class, filters the data according to the request, and marks the type of the level node;
and the back-end service marks the type of the next level node according to the initialization mode transmitted in the request, and assembles the filtered data into a Json format required by the zTree plug-in unit for returning.
Optionally, the method further comprises:
when a user expands a non-leaf node, if the node under the non-leaf node is not initialized, a zTree plug-in is used for sending a first request to a back-end service provided by Java, wherein the first request comprises a network element tree level, an initialization mode, a number of a clicked node, a next-level type identifier and a network element filtering parameter;
the back-end service finds a corresponding service class according to the network element tree level, takes out the node data of the level from the Redis according to the level type identification, and filters according to the network element filtering parameter to obtain filtered data;
and the back-end service marks the type of the next level node according to the initialization mode in the first request, and assembles the filtered data into a Json format required by the zTree plug-in unit for returning.
Optionally, the initiating a search request to a backend service provided by Java by using a search engine Solr to make the backend service return a search result includes:
after receiving the search request, the back-end service calls an API (application programming interface) of the Solr to transmit a search keyword, a network element tree level, a filter parameter and an initialization mode in the search request, and searches a network element number and a network element name according to the search keyword, the network element tree level, the filter parameter and the initialization mode;
and taking out corresponding network element attribution information from the Redis according to the network element number and the network element name, and returning and presenting the network element attribution information.
Optionally, the method further comprises:
when returning to the selected nodes of the network element tree, designing each level in the network element tree as a set object, traversing each selected node, and adding the node number into the object of the corresponding level set;
and returning the set object of each level, the initialized level of the network element tree and the initialized filtering parameters in a JSON data format.
Optionally, the method further comprises:
the back-end service determines the network element type to be returned finally according to the network element level in the returned JSON format object;
and the back-end service takes out the network elements according to the data in the hierarchical set and the relationship of the finally returned network element types, and filters the network elements according to the filtering condition to finally obtain a specific analysis network element object.
Optionally, the method further comprises:
the network element tree component supports flat laying and drop-down network element selection, and the drop-down network element tree component is realized by adopting a combo component of an extended Easy UI.
Correspondingly, the invention also provides a device for constructing the network element tree component. The device comprises:
the cache unit is used for caching the configuration information, the network element data and the subordination relation among the network elements by using a database Redis;
the asynchronous initialization unit is used for asynchronously initializing the network element tree by using a zTree plug-in to request a back-end service provided by Java, marking the type of each level of the network element tree, and asynchronously loading child nodes according to the type of the next level of the network element tree;
the search unit is used for initiating a search request to the backend service provided by the Java by using a search engine Solr so as to enable the backend service to return a search result, wherein the search request comprises a search keyword, a network element tree level, a filter parameter and an initialization mode.
According to the technical scheme, the configuration information, the network element data and the affiliation among the network elements are cached by using a database Redis; the zTree plug-in is used for requesting the back-end service provided by Java to carry out asynchronous initialization of the network element tree, the type of each level of the network element tree is marked, and the sub-nodes are loaded asynchronously according to the type of the next level of the network element tree; and then, a search engine Solr is utilized to initiate a search request to the back-end service provided by Java so that the back-end service returns a search result, wherein the search request comprises a search keyword, a network element tree level, a filter parameter and an initialization mode, and therefore not only can the network element data be efficiently initialized, but also the network element result searched by a user can be quickly returned.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from these without inventive effort.
Fig. 1 is a flowchart of a method for constructing a net element tree component according to an embodiment of the present invention;
fig. 2 is a schematic diagram of initializing a cell-level network element tree according to network element types according to an embodiment of the present invention;
fig. 3 is a schematic diagram of initializing a cell-level network element tree by administrative district according to an embodiment of the present invention;
fig. 4 is a schematic diagram of initializing a cell-level network element tree by branch according to an embodiment of the present invention;
fig. 5 is a schematic diagram of initializing a cell-level network element tree according to a scenario according to an embodiment of the present invention;
fig. 6 is a schematic diagram of initializing a cell-level network element tree according to indoor and outdoor according to an embodiment of the present invention;
fig. 7 is a schematic diagram of initializing a cell-level net element tree according to environment types according to an embodiment of the present invention;
fig. 8 is a schematic diagram of initializing a cell-level network element tree in network element groups according to an embodiment of the present invention;
fig. 9 is a schematic diagram of cell search by means of a branch office initialization according to an embodiment of the present invention;
fig. 10 is a schematic diagram of cell search according to a scenario initialization manner according to an embodiment of the present invention;
fig. 11 is a diagram illustrating network element selection according to an embodiment of the present invention;
fig. 12 is a schematic diagram of a tiled element net-tree component provided by an embodiment of the invention;
fig. 13 is a diagram of a drop-down net element tree component provided by an embodiment of the present invention;
fig. 14 is a schematic structural diagram of an apparatus for constructing a net element tree component according to an embodiment of the present invention;
fig. 15 is a schematic structural diagram of an apparatus for constructing a net element tree component according to yet another embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a method for constructing a net element tree component according to an embodiment of the present invention. As shown in fig. 1, a method for constructing a net element tree component according to an embodiment of the present invention includes:
in step S101, the configuration information, the network element data and the affiliations between network elements are cached using a database Redis.
Specifically, the steps include: caching configuration information and network element information by using a Hash data structure in the Redis; and caching the affiliations among the configuration information, the configuration information and the network elements by using a List data structure in the Redis.
In particular embodiments, Redis is an open-source, key-value storage-based, high-performance in-memory database that supports multiple data structures. In order to realize efficient initialization and network element loading, the subordination relation between configuration information such as provinces, cities, administrative districts, manufacturers and the like, network element data and network elements is cached in advance. The method comprises the steps of caching configuration information and network element information by using a Hash Data structure in Redis, using an object type and a serial number thereof as keys, using the object information as value, for example, caching a province configuration record, wherein the key is 'service: 101', 101 is a province serial number, and the value is a Map object, respectively recording key information such as the serial number and the name of the province, and caching the record by using a redisplate.
The List data structure in Redis used to cache the relationship between the configuration information, the configuration information and the network element, and the network element, at this time, the object relationship identifier and the parent object number of the subordinate object are used as key, the number of the subordinate object is used as value, for example, which cells are under one eNodeb are cached, the key is "eNodeb-cell:101.25369" (101.25369 is eNodeb number), all cell information is traversed, if the subordinate eNodeb is 101.25369, the value is set as the number of the cell, and the cell number is added into the set by using redisplaces.
In order to quickly reflect the network element change information and not influence the daily use of a user, the existing cache is cleared and re-cached every morning by using a timing task provided by a Spring framework. Preferably, the method further comprises: and clearing the data cached in the Hash data structure and the List data structure in the Redis at a preset time by using a timing task provided by a Spring DataRedis framework, and re-caching new data in the Hash data structure and the List data structure.
Next, in step S102, asynchronously initializing the net element tree by using the zTree plug-in to request the backend service provided by Java, marking the type of each level of the net element tree, and asynchronously loading child nodes according to the type of the next level of the net element tree.
Specifically, the steps include: using a zTree plug-in to send a request for acquiring a first-level node of a network element tree to a back-end service provided by Java, wherein the request comprises a network element tree level, provinces, cities, manufacturers and an initialization mode; the back-end service finds a corresponding service class according to the network element tree level in the request, then takes out data of a first level node from the Redis according to the service class, filters the data according to the request, and marks the type of the level node; and the back-end service marks the type of the next level node according to the initialization mode transmitted in the request, and assembles the filtered data into a Json format required by the zTree plug-in unit for returning.
Wherein, the zTree plug-in is a multifunctional tree plug-in realized based on jQuery. The method has excellent performance and flexible configuration, provides various event response callbacks, and supports Ajax asynchronous loading node data. In a specific embodiment, the net element tree component supports multiple initialization modes, as shown in fig. 2-8. Fig. 2 is a diagram for initializing a cell-level network element tree by network element type, fig. 3 is a diagram for initializing a cell-level network element tree by administrative district, fig. 4 is a diagram for initializing a cell-level network element tree by branch, fig. 5 is a diagram for initializing a cell-level network element tree by scene, fig. 6 is a diagram for initializing a cell-level network element tree by indoor and outdoor, fig. 7 is a diagram for initializing a cell-level network element tree by environment type, and fig. 8 is a diagram for initializing a cell-level network element tree by network element group. During initialization, a zTree firstly requests a Java back-end service to obtain a first level node of a network element tree, parameters such as network element tree levels, provinces, cities, manufacturers and initialization modes are transmitted, after the server receives the request, a corresponding service class is found through the network element tree level parameters, the first level node data (generally provinces or cities) is taken out from a Redis cache and filtered according to the transmitted parameters, node level types (provinces or cities) are marked, meanwhile, next level node types are marked according to the transmitted initialization modes, and the data are assembled into JSON format data required by the zTree to be returned.
Preferably, the method further comprises: when a user expands a non-leaf node, if the node under the non-leaf node is not initialized, a zTree plug-in is used for sending a first request to a back-end service provided by Java, wherein the first request comprises a network element tree level, an initialization mode, a number of a clicked node, a next-level type identifier and a network element filtering parameter; the back-end service finds a corresponding service class according to the network element tree level, takes out the node data of the level from the Redis according to the level type identification, and filters according to the network element filtering parameter to obtain filtered data; and the back-end service marks the type of the next level node according to the initialization mode in the first request, and assembles the filtered data into a Json format required by the zTree plug-in unit for returning.
In a specific implementation mode, when a user expands a non-leaf node, if a lower node of the non-leaf node is not initialized, a zTree sends a request and transmits a network element tree level, an initialization mode, a number of a click node, a next-level type identifier and network element filtering parameters, a back end finds a corresponding service class according to the transmitted network element tree level, takes out node data of the level from a Redis cache according to the level type identifier, filters the node data according to filtering conditions, marks the next-level node type according to the transmitted initialization mode, and assembles the obtained data into JSON format data required by the zTree to return the JSON format data. The current level type and the next level type are marked in the returned node information every time, and if no leaf child node exists below the node (namely, the set data cached by taking the node number as the key is empty), the node is set as a leaf node, otherwise, the node is a non-leaf node.
Finally, in step S103, a search request is initiated to the backend service provided by Java by using the search engine Solr, so that the backend service returns a search result.
The search request comprises search keywords, a network element tree level, filter parameters and an initialization mode. Solr is a high performance, Lucene-based full text search server. Meanwhile, the method is expanded, a query language richer than Lucene is provided, configurability and expandability are realized, the query performance is optimized, a perfect function management interface is provided, and the method is a very excellent full-text search engine. Specifically, the steps include: after receiving the search request, the back-end service calls an API (application programming interface) of the Solr to transmit a search keyword, a network element tree level, a filter parameter and an initialization mode in the search request, and searches a network element number and a network element name according to the search keyword, the network element tree level, the filter parameter and the initialization mode; and taking out corresponding network element attribution information from the Redis according to the network element number and the network element name, and returning and presenting the network element attribution information.
In a specific implementation mode, the network element information is stored in a database, when a user searches for a network element, if the user searches directly from the database, the efficiency is low because the data volume of the small-granularity network element is large, the network element information to be searched can be indexed on a search server by means of Solr, and a search result is quickly returned by means of a Solr search engine. Using Solr to synchronize network element data in the database at regular time every day, when a user searches on a network element tree, a front end initiates a request to a background service and transmits a search keyword, a network element tree level, a filtering parameter and an initialization mode, the background service calls Solr API and transmits the received keyword, the network element tree level and the filtering parameter to obtain key information such as a searched network element number, a searched name and the like, if the search result is configured to be displayed according to the hierarchical tree form of the initialization mode, a program traverses the searched network element number, network element attribution information is taken out from a Redis cache according to the network element number, tree structure data is built layer by layer from bottom to top according to the initialization mode and is returned to be displayed, as shown in figures 9 and 10, otherwise, the search result is directly packaged into a JOSN format and is displayed on the search tree of a network element component.
Preferably, the method further comprises: when returning to the selected nodes of the network element tree, designing each level in the network element tree as a set object, traversing each selected node, and adding the node number into the object of the corresponding level set; and returning the set object of each level, the initialized level of the network element tree and the initialized filtering parameters in a JSON data format. Therefore, errors caused by directly using the node number as an analysis object can be avoided.
The network element tree is an asynchronous tree, and some hierarchies may be non-network element nodes (such as information of province, city, manufacturer, and the like) or network element nodes that the user does not expand to an initialization level (such as the network element tree initialized to the cell level, but the user only expands to the eNodeb hierarchy) and the analysis object is selected, so that it may be incorrect if the node number selected by the user is directly used as the analysis object.
Designing each level of a network element tree as a set object, traversing each selected node, if the node is a first level node, directly adding the node number into the corresponding level set object (according to the level type of the node), if the father node of the node is in a selected state, ignoring the node number, otherwise, adding the node number into the corresponding level set object. And then returning the set object of each level, the initialized level of the network element tree and the initialized filtering parameters in a JSON data format. As shown in fig. 11, the selected network element returns a JSON format number:
{ "neLevel": L00805"," selection type ": byVendor", "provice": in the form of "city": in the form of "district": in the form of "sublist": in the form of { "city Id": in the form of "city": in the form of "Hangzhou", "id": in the form of "1", "name": in the form of "Hua ]," coverType ": in the form of" CoverType ": in the form of" covery ": in the form of" scene ": in the form of" city ": in the form of" environment ": in the form of" city ": in the form
In practical applications, the method further comprises: the back-end service determines the network element type to be returned finally according to the network element level in the returned JSON format object; and the back-end service takes out the network elements according to the data in the hierarchical set and the relationship of the finally returned network element types, and filters the network elements according to the filtering condition to finally obtain a specific analysis network element object.
Specifically, according to the analysis object with the JSON format obtained by the method, the background provides a general service for taking out a specific network element object from the Redis and returning the specific network element object according to the transmitted JSON format object. Firstly, determining the net element type to be returned finally according to the net element level in the JSON format data, then taking out the net element according to the data in each level set and the relationship of the net element type to be returned finally, and filtering according to the filtering condition to finally obtain a specific analysis net element object.
Preferably, the method further comprises: the network element tree component supports flat laying and drop-down network element selection, and the drop-down network element tree component is realized by adopting a combo component of an extended Easy UI. Therefore, the network element can be selected in a flat-laying and pull-down mode.
In a specific embodiment, the net element tree component supports both flat and drop down selection of net elements, as shown in fig. 12 and 13, the drop down net element tree component is implemented using a combo component of the extended easy ui that displays an editable text box and drop down panel on a page. And through expansion, placing the tiled network element tree in a pull-down panel, adding a determining button and a canceling button, hiding the pull-down panel when the determining button is clicked, setting the JOSN format data of the network element selected by the network element tree as a selected value of the pull-down box, and displaying the object name in a text box in a comma separated mode.
In the embodiment, the configuration information, the network element data and the affiliation among the network elements are cached by using a database Redis; the zTree plug-in is used for requesting the back-end service provided by Java to carry out asynchronous initialization of the network element tree, the type of each level of the network element tree is marked, and the sub-nodes are loaded asynchronously according to the type of the next level of the network element tree; and then, a search engine Solr is utilized to initiate a search request to the back-end service provided by Java so that the back-end service returns a search result, wherein the search request comprises a search keyword, a network element tree level, a filter parameter and an initialization mode, and therefore not only can the network element data be efficiently initialized, but also the network element result searched by a user can be quickly returned.
Furthermore, the method provided by the embodiment of the invention is based on communication network element data, supports the initialization of network element trees of each level by transmitting parameters such as provinces, cities, manufacturers, network types, network element levels and the like, provides various initialization modes (such as according to administrative regions, according to branches, according to indoor and outdoor, according to scene types, according to environment types and the like) aiming at network elements (such as cells) with small granularity, simultaneously supports a user to search for the network elements according to key information such as network element names, network element numbers and the like, returns the selected network elements in a JSON format, and supports the horizontal laying and pull-down selection of the network elements. The method provided by the embodiment of the invention can support the high-efficiency initialization of the network element data of million orders of magnitude, a user can select the network element with multiple dimensions, can select any hierarchy without expanding the network element tree node and obtain an analysis network element object, can quickly return the network element searching result of the user and support the display of the searching result according to the hierarchical tree form of the initialization mode, and has convenient maintenance and strong expandability.
The core point of the embodiment of the invention is based on communication network element data, and network element tree components are constructed by using technologies such as Java, Redis, Solr, easy UI, zTree and the like or plug-ins. Wherein, Java provides back-end service, and each network element level corresponds to a service class; the Redis is used for caching configuration information of provinces, cities, administrative districts, manufacturers and the like, network element data and the dependency relationship among network elements; solr provides network element search service; and the easy UI and the zTree are used for constructing the network element tree component at the front end.
For simplicity of explanation, the method embodiments are described as a series of acts or combinations, but those skilled in the art will appreciate that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently with other steps in accordance with the embodiments of the invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Fig. 14 is a schematic structural diagram of an apparatus for constructing a net element tree component according to an embodiment of the present invention. As shown in fig. 14, the apparatus for constructing a net element tree component according to an embodiment of the present invention includes a caching unit 201, an asynchronous initialization unit 202, and a searching unit 203, where:
a caching unit 201, configured to cache the configuration information, the network element data, and the dependency relationship between the network elements using a database Redis;
an asynchronous initialization unit 202, configured to perform asynchronous initialization on a network element tree by using a zTree plug-in to request a backend service provided by Java, mark a type of each level of the network element tree, and perform asynchronous loading on child nodes according to a type of a next level of the network element tree;
the search unit 203 is configured to initiate a search request to a backend service provided by Java by using a search engine Solr, so that the backend service returns a search result, where the search request includes a search keyword, a network element tree level, a filter parameter, and an initialization manner.
The apparatus for constructing a net element tree component provided in this embodiment is applicable to the method for constructing a net element tree component corresponding to the above embodiment, and is not described herein again.
In the apparatus for constructing a network element tree component provided in this embodiment, the caching unit 201 uses the database Redis to cache the configuration information, the network element data, and the dependency relationship between the network elements; the asynchronous initialization unit 202 asynchronously initializes the net element tree by requesting a backend service provided by Java using a zTree plug-in, marks the type of each level of the net element tree, and asynchronously loads child nodes according to the type of the next level of the net element tree; the search unit 203 initiates a search request to the backend service provided by Java by using the search engine Solr, so that the backend service returns a search result, where the search request includes a search keyword, a network element tree level, a filter parameter, and an initialization mode, and thus, not only can efficient initialization of network element data be achieved, but also a network element result searched by a user can be quickly returned.
Fig. 15 is a schematic structural diagram of an apparatus for constructing a net element tree component according to yet another embodiment of the present invention. As shown in fig. 15, the apparatus for constructing a net element tree component includes: a processor (processor)301, a memory (memory)302, and a communication bus 303;
wherein, the processor 301 and the memory 302 complete the communication with each other through the communication bus 303;
the processor 301 is configured to call program instructions in the memory 302 to perform the methods provided by the above-mentioned method embodiments, including: caching the configuration information, the network element data and the dependency relationship among the network elements by using a database Redis; asynchronously initializing a network element tree by using a zTree plug-in to request a back-end service provided by Java, marking the type of each level of the network element tree, and asynchronously loading child nodes according to the type of the next level of the network element tree; and initiating a search request to a back-end service provided by Java by utilizing a search engine Solr so as to enable the back-end service to return a search result, wherein the search request comprises a search keyword, a network element tree level, a filter parameter and an initialization mode.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, comprising: caching the configuration information, the network element data and the dependency relationship among the network elements by using a database Redis; asynchronously initializing a network element tree by using a zTree plug-in to request a back-end service provided by Java, marking the type of each level of the network element tree, and asynchronously loading child nodes according to the type of the next level of the network element tree; and initiating a search request to a back-end service provided by Java by utilizing a search engine Solr so as to enable the back-end service to return a search result, wherein the search request comprises a search keyword, a network element tree level, a filter parameter and an initialization mode.
The present embodiments provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the methods provided by the above method embodiments, for example, including: caching the configuration information, the network element data and the dependency relationship among the network elements by using a database Redis; asynchronously initializing a network element tree by using a zTree plug-in to request a back-end service provided by Java, marking the type of each level of the network element tree, and asynchronously loading child nodes according to the type of the next level of the network element tree; and initiating a search request to a back-end service provided by Java by utilizing a search engine Solr so as to enable the back-end service to return a search result, wherein the search request comprises a search keyword, a network element tree level, a filter parameter and an initialization mode.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The above-described embodiments of the apparatus for constructing a net element tree component and the like are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the embodiments of the present invention, and are not limited thereto; although embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (9)

1. A method of constructing a net element tree component, the method comprising:
using a database Redis to cache the configuration information, the network element data and the dependency relationship between the network elements, specifically, the step includes: caching configuration information and network element information by using a Hash data structure in the Redis; caching the affiliations among the configuration information, the configuration information and the network elements by using a List data structure in the Redis;
asynchronously initializing a network element tree by using a zTree plug-in to request a back-end service provided by Java, marking the type of each level of the network element tree, and asynchronously loading child nodes according to the type of the next level of the network element tree;
and initiating a search request to a back-end service provided by Java by utilizing a search engine Solr so as to enable the back-end service to return a search result, wherein the search request comprises a search keyword, a network element tree level, a filter parameter and an initialization mode.
2. The method of constructing a net element tree component of claim 1, wherein the method further comprises:
and clearing the Data cached in the Hash Data structure and the List Data structure in the Redis at a preset time by using a timing task provided by a Spring Data Redis framework, and re-caching new Data in the Hash Data structure and the List Data structure.
3. The method of claim 1, wherein asynchronously initializing the net element tree using a zTree plug-in to request a Java-provided backend service, marking a type of each level of the net element tree, and asynchronously loading child nodes according to a type of a next level of the net element tree comprises:
using a zTree plug-in to send a request for acquiring a first-level node of a network element tree to a back-end service provided by Java, wherein the request comprises a network element tree level, provinces, cities, manufacturers and an initialization mode;
the back-end service finds a corresponding service class according to the network element tree level in the request, then takes out data of a first level node from the Redis according to the service class, filters the data according to the request, and marks the type of the level node;
and the back-end service marks the type of the next level node according to the initialization mode transmitted in the request, and assembles the filtered data into a Json format required by the zTree plug-in unit for returning.
4. The method of constructing a net element tree component of claim 3, wherein the method further comprises:
when a user expands a non-leaf node, if the node under the non-leaf node is not initialized, a zTree plug-in is used for sending a first request to a back-end service provided by Java, wherein the first request comprises a network element tree level, an initialization mode, a number of a clicked node, a next-level type identifier and a network element filtering parameter;
the back-end service finds a corresponding service class according to the network element tree level, takes out the node data of the level from the Redis according to the level type identification, and filters according to the network element filtering parameter to obtain filtered data;
and the back-end service marks the type of the next level node according to the initialization mode in the first request, and assembles the filtered data into a Json format required by the zTree plug-in unit for returning.
5. The method for constructing net element tree components according to claim 1, wherein the initiating a search request to a Java provided backend service by using a search engine Solr to make the backend service return a search result comprises:
after receiving the search request, the back-end service calls an API (application programming interface) of the Solr to transmit a search keyword, a network element tree level, a filter parameter and an initialization mode in the search request, and searches a network element number and a network element name according to the search keyword, the network element tree level, the filter parameter and the initialization mode;
and taking out corresponding network element attribution information from the Redis according to the network element number and the network element name, and returning and presenting the network element attribution information.
6. The method of constructing a net element tree component of claim 1, wherein the method further comprises:
when returning to the selected nodes of the network element tree, designing each level in the network element tree as a set object, traversing each selected node, and adding the node number into the object of the corresponding level set;
and returning the set object of each level, the initialized level of the network element tree and the initialized filtering parameters in a JSON data format.
7. The method of constructing a net element tree component according to claim 6, wherein the method further comprises:
the back-end service determines the network element type to be returned finally according to the network element level in the returned JSON format object;
and the back-end service takes out the network elements according to the data in the hierarchical set and the relationship of the finally returned network element types, and filters the network elements according to the filtering condition to finally obtain a specific analysis network element object.
8. The method of constructing a net element tree component of claim 1, wherein the method further comprises:
the network element tree component supports flat laying and drop-down network element selection, and the drop-down network element tree component is realized by adopting a combo component of an extended Easy UI.
9. An apparatus for constructing a net element tree component, the apparatus comprising:
a caching unit, configured to cache configuration information, network element data, and a dependency relationship between network elements using a database Redis, where the caching unit is specifically configured to: caching configuration information and network element information by using a Hash data structure in the Redis; caching the affiliations among the configuration information, the configuration information and the network elements by using a List data structure in the Redis;
the asynchronous initialization unit is used for asynchronously initializing the network element tree by using a zTree plug-in to request a back-end service provided by Java, marking the type of each level of the network element tree, and asynchronously loading child nodes according to the type of the next level of the network element tree;
the search unit is used for initiating a search request to the backend service provided by the Java by using a search engine Solr so as to enable the backend service to return a search result, wherein the search request comprises a search keyword, a network element tree level, a filter parameter and an initialization mode.
CN201710084125.0A 2017-02-16 2017-02-16 Method and device for constructing network element tree component Active CN106844753B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710084125.0A CN106844753B (en) 2017-02-16 2017-02-16 Method and device for constructing network element tree component

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710084125.0A CN106844753B (en) 2017-02-16 2017-02-16 Method and device for constructing network element tree component

Publications (2)

Publication Number Publication Date
CN106844753A CN106844753A (en) 2017-06-13
CN106844753B true CN106844753B (en) 2019-12-20

Family

ID=59129062

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710084125.0A Active CN106844753B (en) 2017-02-16 2017-02-16 Method and device for constructing network element tree component

Country Status (1)

Country Link
CN (1) CN106844753B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391691A (en) * 2017-07-26 2017-11-24 成都科来软件有限公司 The filter method of data in a kind of network analysis
CN109408699B (en) * 2018-09-14 2022-02-08 厦门天锐科技股份有限公司 Method for realizing rapid retrieval of tree nodes by synchronous cache zTree
CN111866135A (en) * 2020-07-20 2020-10-30 百度在线网络技术(北京)有限公司 Message display control method and device for electronic equipment, electronic equipment and readable medium
CN112671569B (en) * 2020-12-16 2022-09-30 牙木科技股份有限公司 Network management method and system based on configuration classification
CN113836212B (en) * 2021-09-27 2023-09-08 易保网络技术(上海)有限公司 Method for automatically generating Json data by database data, readable medium and electronic equipment
CN115185426A (en) * 2022-06-28 2022-10-14 统信软件技术有限公司 Data processing method and device of tree control and computing equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571420A (en) * 2011-12-20 2012-07-11 深圳市同洲视讯传媒有限公司 Method and system for network element data management
CN104618455A (en) * 2015-01-12 2015-05-13 北京中交兴路车联网科技有限公司 General cache system and method
CN105808638A (en) * 2016-02-23 2016-07-27 平安科技(深圳)有限公司 Data processing method and system
CN105893031A (en) * 2016-03-28 2016-08-24 广州华多网络科技有限公司 Cache operation implementation method, calling method of business layer method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571420A (en) * 2011-12-20 2012-07-11 深圳市同洲视讯传媒有限公司 Method and system for network element data management
CN104618455A (en) * 2015-01-12 2015-05-13 北京中交兴路车联网科技有限公司 General cache system and method
CN105808638A (en) * 2016-02-23 2016-07-27 平安科技(深圳)有限公司 Data processing method and system
CN105893031A (en) * 2016-03-28 2016-08-24 广州华多网络科技有限公司 Cache operation implementation method, calling method of business layer method and device

Also Published As

Publication number Publication date
CN106844753A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
CN106844753B (en) Method and device for constructing network element tree component
CN106484877B (en) A kind of document retrieval system based on HDFS
CN104160394B (en) Scalable analysis platform for semi-structured data
CN107077691B (en) Age-based policy for determining database cache hits
US9317557B2 (en) Answering relational database queries using graph exploration
US7933916B2 (en) Querying nonSQL data stores with a SQL-style language
JP5613951B2 (en) Method for aggressive information push notification and server therefor
CN103678494A (en) Method and device for client side and server side data synchronization
JP5823037B2 (en) Index construction method, search method, search device, and search system
US20110302148A1 (en) System and Method for Indexing Food Providers and Use of the Index in Search Engines
US9229979B2 (en) Optimizing parallel queries using interesting distributions
CN106407303A (en) Data storage method and apparatus, and data query method and apparatus
US10282466B2 (en) Machine processing of search query based on grammar rules
CN109669925B (en) Management method and device of unstructured data
RU2632414C2 (en) Method of hierarchical data structure forming, method of data search using hierarchical data structure, server and permanent machine-readable media
US10642530B2 (en) Global occupancy aggregator for global garbage collection scheduling
CN103177094A (en) Cleaning method of data of internet of things
US20170169027A1 (en) Determining a Display Order for Values in a Multi-Value Field of an Application Card
CN110807028B (en) Method, apparatus and computer program product for managing a storage system
US11487707B2 (en) Efficient file path indexing for a content repository
Shangguan et al. Big spatial data processing with Apache Spark
EP2972970B1 (en) Locale-based sorting on mobile devices
CN106649800A (en) Solr-based Chinese search method
WO2017000592A1 (en) Data processing method, apparatus and system
US8527478B1 (en) Handling bulk and incremental updates while maintaining consistency

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