CN115442301A - Routing configuration tree generation method, routing method and device based on routing configuration tree and electronic equipment - Google Patents

Routing configuration tree generation method, routing method and device based on routing configuration tree and electronic equipment Download PDF

Info

Publication number
CN115442301A
CN115442301A CN202211103013.2A CN202211103013A CN115442301A CN 115442301 A CN115442301 A CN 115442301A CN 202211103013 A CN202211103013 A CN 202211103013A CN 115442301 A CN115442301 A CN 115442301A
Authority
CN
China
Prior art keywords
routing
node
configuration
value
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211103013.2A
Other languages
Chinese (zh)
Inventor
林聪�
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhen'ai Information Technology Hainan Co ltd
Original Assignee
Zhen'ai Information Technology Hainan Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhen'ai Information Technology Hainan Co ltd filed Critical Zhen'ai Information Technology Hainan Co ltd
Priority to CN202211103013.2A priority Critical patent/CN115442301A/en
Publication of CN115442301A publication Critical patent/CN115442301A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/48Routing tree calculation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/14Routing performance; Theoretical aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to a routing configuration tree generation method, a routing method and device based on the routing configuration tree and electronic equipment. The method for generating the routing configuration tree comprises the following steps: receiving a routing configuration tree generation instruction, wherein the routing configuration tree generation instruction comprises the following steps: the routing configuration data array and the dimension priority array, wherein the routing configuration array comprises at least one routing configuration tuple, and the routing configuration tuple comprises at least one routing value and one configuration value; constructing a root node root of a routing configuration tree based on a routing configuration tree generation instruction; and traversing at least one routing configuration tuple of the routing configuration data array to construct child nodes of the root node of the routing configuration tree, and generating the routing configuration tree. The application also provides a routing method based on the routing configuration tree, and the embodiment of the application carries out routing configuration and configuration rule storage by constructing the routing configuration tree, thereby being beneficial to reducing the storage space of the configuration codes and improving the traceability and the expansibility of the channel configuration codes.

Description

Routing configuration tree generation method, routing method and device based on routing configuration tree and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a routing configuration tree generation method, a routing method and apparatus based on a routing configuration tree, and an electronic device.
Background
With the development of computer network technology and internet technology, the appearance of short message platforms is a great revolution in the technical field of short messages, changes the traditional mode of manually sending short messages in groups, and greatly reduces the time required by short message group sending and the consumed human resources.
The short message platform is based on three operators of China telecom, china Unicom and China Mobile, directly provides uplink and downlink short message interface resources of the whole national network, integrates customer management, group management, sending record management and account management, and realizes the platform for sending short messages with customer/designated numbers in batch and sending short messages by user.
Therefore, the short message platform generally needs to access a plurality of short message sending channels, needs to set different services according to service requirements to select different short message channels, and selects a short message channel according to a set routing rule when the service sends a short message.
At present, the configuration of short message channels is implemented in a one-to-one configuration manner, assuming that a service party value field is { service 1, service 2, and service 3}, a flow code value field is { verification code, marketing short message }, and configuration items are { service party, flow, channel }, so that the number of the value fields is 3 and the number of the flow is 2, so that 3 × 2=6 configuration rules are generated, which are { service 1, verification code, channel 1}, { service 2, verification code, channel 1}, { service 1, marketing short message, channel 2}, { service 2, marketing short message, channel 2}, { service 3, short message, and channel 2, respectively, that is, the verification code type short message needs to go through channel 1, the short message type short message needs to go through channel 2, but, in a one-to-configuration manner, all possible situations need to be configured, the increase of configuration types and increase of dimensions, a large amount of configuration space is occupied, and a large amount of configuration space is configured, a redundant configuration exists, a large amount of configuration rules is needed, a configuration rules cannot be configured in a high-configuration, and a configuration failure of a high-configuration range is needed, and a high-configuration value cannot be reconfigured, and a value is needed to be reconfigured again, and a high-configuration failure is needed to be increased when a configuration range is needed.
Therefore, a traceable and highly scalable channel configuration method is needed in the current sms platform.
Disclosure of Invention
The embodiment of the application provides a routing configuration tree generation method, a routing method and device based on the routing configuration tree and electronic equipment, which are used for reducing a configuration code storage space and improving the traceability and the expansibility of a channel configuration code.
In a first aspect, an embodiment of the present application provides a method for generating a routing configuration tree, including:
receiving a routing configuration tree generation instruction, wherein the routing configuration tree generation instruction comprises: a routing configuration data array and a dimension priority array, wherein the routing configuration array comprises at least one routing configuration tuple comprising at least one routing value and one configuration value;
constructing a root node root of a routing configuration tree based on the routing configuration tree generation instruction;
and traversing the at least one routing configuration tuple of the routing configuration data array to construct a child node of the root node of the routing configuration tree, and generating the routing configuration tree.
In one embodiment, the traversing the at least one routing configuration tuple of the routing configuration data array to construct a child node of the root node of the routing configuration tree comprises: aiming at any one routing configuration tuple, constructing a father node currParent of the routing configuration tuple, and enabling the father node currParent to be equal to a root node root of the routing configuration tree; traversing the dimension priority array to extract the routing value of the routing configuration tuple and execute routing child node construction and parent node updating operation to obtain at least one routing child node and an updated parent node currParent corresponding to the routing configuration tuple; and extracting the configuration value of the routing configuration tuple to generate a routing configuration tree node, and adding the configuration tree node into the updated father node currParent.
In one embodiment, the traversing the dimension priority array to extract the routing value of the routing configuration tuple performs routing child node construction and parent node update operations, including: s1, setting a variable i, performing initialization on the variable i to enable i =0, wherein i is an integer, and performing S2; s2, obtaining the ith priority value y of the dimension priority array, wherein y is an integer and is greater than or equal to 0, and executing the step S3; s3, extracting the yth routing value in the routing configuration tuple as the current routing value, and executing the step S4; s4, judging whether a child node exists in the father node currParent or not, if so, executing a step S5, and if not, executing a step S6; s5, constructing a default node default, adding the default node default into the father node currParent to obtain a new father node currParent, updating the father node currParent into the new father node currParent, and executing the step S6; s6, obtaining at least one child node of the father node currParent, traversing the at least one child node, judging whether a child node equal to the current routing value exists in the at least one child node, if so, executing a step S7, and if not, executing a step S8; s7, updating the father node currParent into the child node equal to the current routing value, enabling i = i +1, and executing the step S2; s8, if no child node equal to the current routing value exists in the child nodes, constructing a routing child node corresponding to the current routing value, adding the routing child node into the father node currParent, updating the father node currParent into a routing child node corresponding to the current routing value, and making i = i +1, and executing the step S2.
In a second aspect, an embodiment of the present application provides a routing method based on a routing configuration tree, including:
s41, receiving a routing configuration instruction, wherein the routing configuration instruction comprises: data to be routed;
s42, processing the data to be routed based on a preset dimension priority array to generate a routing array, wherein the routing array comprises at least one routing data;
s43, acquiring a preset routing configuration tree, generating a first routing sub-node list based on a root node of the routing configuration tree, and acquiring a first threshold corresponding to the first routing sub-node list;
s44, setting a first node index i, and initializing the first node index to enable i =0;
s45, setting a current routing node as an ith first routing sub-node, executing routing judgment operation based on the current routing node and the routing array, receiving a first return value, judging whether the first return value is a null value, if so, executing a step S46, and if not, executing a step S47;
s46, updating the first node index i to enable i = i +1, updating the current routing node based on the first node index i, setting a routing data index j, initializing the routing data index j =0, and executing the routing judgment operation based on the current routing node, the routing data index j and the routing data;
s47, if the first return value is a non-null value, determining that the first return value is the routing configuration of the data to be routed.
In one embodiment, the performing the route judgment operation based on the current routing node, the routing data index j and the routing data includes: s51, judging whether the current routing node contains a configuration child node, if so, executing a step S52, otherwise, executing a step S53; s52, acquiring the configuration value of the configuration child node as the first return value to return; s53, setting current data as jth routing data of the routing array, judging whether a routing value of the current routing node is equal to the current data or whether the current routing node is a default node default, if the routing value is not equal to the current data and the current routing node is not the default node default, executing S54, and if the routing value is equal to the current data or the current routing node is the default node default, executing S55; s54, returning a null value as the first return value; s55, updating the routing index j to enable j = j +1, updating the current data based on the routing index j, acquiring a second routing sub-node list corresponding to the current routing node and a second threshold corresponding to the second routing sub-node list, and executing a step S56; s56, acquiring a second node index x, updating the current routing node to be the xth second routing sub-node of the second routing sub-node list, and executing the step S57; s57, executing the route judgment operation based on the current route node, the route data index j and the route data, receiving a second return value, judging whether the second return value is a null value, and if not, executing the step S58; and S58, if the second return value is a non-null value, returning the routing value of the current routing node as the first return value.
In one embodiment, the method further comprises the following steps: s61, if the second return value is null, updating the second node index to make x = x +1, and executing step S62; s62, judging whether the second node index x is larger than or equal to the second threshold value; s63, if the second node index x is larger than or equal to the second threshold value, returning a null value as the first return value; and S64, if the second node index x is smaller than the second threshold value, executing the step S56.
In one embodiment, before the setting the current routing node as the ith first routing sub-node, the method further includes: judging whether the first node index i is larger than the first threshold value; if the first node index i is larger than or equal to the first threshold value, terminating the route configuration operation of the route data; and if the first node index i is smaller than or equal to the first threshold value, taking the current routing node, the routing index j and the routing array as input parameters of the routing judgment operation.
In a third aspect, an embodiment of the present application provides an apparatus for generating a routing configuration tree, including:
a receiving unit, configured to receive a routing configuration tree generation instruction, where the routing configuration tree generation instruction includes: a routing configuration data array and a dimension priority array, wherein the routing configuration array comprises at least one routing configuration tuple comprising at least one routing value and one configuration value;
a constructing unit, configured to construct a root node root of the routing configuration tree based on the routing configuration tree generation instruction;
and the generating unit is used for traversing the at least one routing configuration tuple of the routing configuration data array to construct child nodes of the root node of the routing configuration tree and generate the routing configuration tree.
In a fourth aspect, an embodiment of the present application provides a routing apparatus based on a routing configuration tree, including:
a receiving unit, configured to receive a routing configuration instruction, where the routing configuration instruction includes: data to be routed;
the generating unit is used for processing the data to be routed based on a preset dimension priority array to generate a routing array, and the routing array comprises at least one routing data;
the device comprises an acquisition unit, a processing unit and a control unit, wherein the acquisition unit is used for acquiring a preset routing configuration tree, generating a first routing child node list based on a root node of the routing configuration tree, and acquiring a first threshold corresponding to the first routing child node list;
the device comprises a setting unit, a first node index i, and a second node index i =0, wherein the first node index i is initialized;
a judging unit, configured to set a current routing node as an ith first routing sub-node, perform a routing judgment operation based on the current routing node and the routing array, receive a first return value, and judge whether the first return value is a null value;
a recursion unit, configured to update the first node index i to make i = i +1 when the first return value is a null value, update the current routing node based on the first node index i, set a routing data index j, initialize the routing data index j =0, and execute the routing judgment operation based on the current routing node, the routing data index j, and the routing data;
and the determining unit is used for determining the first return value as the routing configuration of the data to be routed when the first return value is a non-null value.
In a fifth aspect, embodiments of the present application provide an electronic device, which includes a processor, a memory, a communication interface, and one or more programs, which are stored in the memory and configured to be executed by the processor, the programs including instructions for performing some or all of the steps described in the method according to the first aspect of the embodiments of the present application.
As can be seen, in the present application, the present application provides a method for generating a routing configuration tree, which receives a routing configuration tree generation instruction, where the routing configuration tree generation instruction includes: a routing configuration data array and a dimension priority array, wherein the routing configuration array comprises at least one routing configuration tuple comprising at least one routing value and one configuration value; then constructing a root node root of the routing configuration tree based on the routing configuration tree generation instruction; and finally, traversing the at least one routing configuration tuple of the routing configuration data array to construct child nodes of the root node of the routing configuration tree, and generating the routing configuration tree. The routing configuration can be stored in a tree form, and the number of configuration rules is reduced, so that the configuration storage space is reduced; meanwhile, a routing method based on a routing configuration tree is provided, S41, a routing configuration instruction is received, where the routing configuration instruction includes: data to be routed; s42, processing the data to be routed based on a preset dimension priority array to generate a routing array, wherein the routing array comprises at least one routing data; s43, acquiring a preset routing configuration tree, generating a first routing child node list based on a root node of the routing configuration tree, and acquiring a first threshold corresponding to the first routing child node list; s44, setting a first node index i, and initializing the first node index to enable i =0; s45, setting a current routing node as an ith first routing sub-node, executing routing judgment operation based on the current routing node and the routing array, receiving a first return value, judging whether the first return value is a null value, if so, executing a step S46, and if not, executing a step S47; s47, updating the first node index i to make i = i +1, updating the current routing node based on the first node index i, setting a routing data index j, initializing the routing data index j =0, and executing the routing judgment operation based on the current routing node, the routing data index j, and the routing data; s48, if the first return value is a non-null value, determining that the first return value is the routing configuration of the data to be routed. So, carry out route configuration through constructing the configuration tree, can be convenient for backtrack through tree node, when route configuration rule increases, only need carry out the construction of child node at corresponding tree node and can increase route rule, be favorable to improving route configuration's expansibility.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a method for generating a routing configuration tree according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a method for constructing a child node according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a routing configuration tree according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a routing method based on a routing configuration tree according to the present application;
fig. 5 is a schematic flowchart of a method for determining a route according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a device for generating a routing configuration tree according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a routing apparatus based on a routing configuration tree according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device 800 according to an embodiment of the present application.
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 some, not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of the invention and in the accompanying drawings are used for distinguishing between different elements and not for describing a particular sequential order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, result, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Hereinafter, some terms in the present application are explained so as to be easily understood by those skilled in the art.
Electronic devices may include a variety of handheld devices, vehicle-mounted devices, wearable devices (e.g., smartwatches, smartbands, pedometers, etc.), computing devices or other processing devices communicatively connected to wireless modems, as well as various forms of User Equipment (UE), mobile Stations (MS), terminal Equipment (terminal device), and so forth having wireless communication capabilities. For convenience of description, the above-mentioned devices are collectively referred to as electronic devices.
Referring to fig. 1, fig. 1 is a schematic flow chart of a method for generating a routing configuration tree according to an embodiment of the present application, and the method is applied to an electronic device such as a computer for example, and includes the following steps:
step 101, receiving a routing configuration tree generation instruction, wherein the routing configuration tree generation instruction includes: a routing configuration data array and a dimension priority array, wherein the routing configuration array comprises at least one routing configuration tuple comprising at least one routing value and one configuration value;
102, constructing a root node root of a routing configuration tree based on the routing configuration tree generation instruction;
step 103, traversing the at least one routing configuration tuple of the routing configuration data array to construct a child node of the root node of the routing configuration tree, and generating the routing configuration tree.
Optionally, the traversing the at least one routing configuration tuple of the routing configuration data array to construct a child node of the root node of the routing configuration tree includes: aiming at any one routing configuration tuple, constructing a father node currParent of the routing configuration tuple, and enabling the father node currParent to be equal to a root node root of the routing configuration tree; traversing the dimension priority array to extract the routing value of the routing configuration tuple and execute routing child node construction and father node updating operation to obtain at least one routing child node and updated father node currParent corresponding to the routing configuration tuple; and extracting the configuration value of the routing configuration tuple to generate a routing configuration tree node, and adding the configuration tree node into the updated father node currParent.
The routing configuration tuples can be represented by tuple, and each routing configuration tuple can be represented as tuple (Dim 1, dim2, …, dimN, outi), where DimN is a value of an nth dimension of the configuration tuple, and outi refers to a configuration value of an ith configuration tuple.
The dimension priority array may be represented by an array dimport [ ], where the dimension priority array is used to store a value index corresponding to each dimension in a routing configuration tuple, that is, the dimension priority array stores N data, each dimension corresponds to one dimension of the configuration tree, and a value of each dimension is the value index of the routing configuration tuple in the nth dimension, for example, dimport [0] =3, and then a routing value corresponding to Dim3 in each routing configuration tuple is a value of the first dimension of the configuration tree.
Optionally, the traversing the dimension priority array to extract the route value of the route configuration tuple and execute route child node construction and parent node update operations, as shown in fig. 2, fig. 2 is a schematic flow diagram of a child node construction method provided in an embodiment of the present application, and the method includes the following steps:
s201, setting a variable i, initializing the variable i to enable i =0, wherein i is an integer, and executing a step S202;
s202, acquiring the ith priority value y of the dimension priority array, wherein y is an integer and is greater than or equal to 0, and executing the step S203;
s203, extracting the yth routing value in the routing configuration tuple as the current routing value, and executing the step S204;
s204, judging whether a child node exists in the parent node currParent or not, if so, executing a step S205, and if not, executing a step S206;
s205, establishing a default node default, adding the default node default into the father node currParent to obtain a new father node currParent, updating the father node currParent into the new father node currParent, and executing the step S206;
s206, obtaining at least one child node of the father node currParent, traversing the at least one child node, judging whether a child node equal to the current routing value exists in the at least one child node, if so, executing the step S207, and if not, executing the step S208;
s207, updating the parent node currParent to the child node equal to the current routing value, and executing step S202 with i = i + 1;
s208, if there is no child node in the child nodes equal to the current routing value, constructing a routing child node corresponding to the current routing value, adding the routing child node to the parent node currParent, updating the parent node currParent to the routing child node corresponding to the current routing value, and making i = i +1, and executing step S202.
Explaining the above steps with an actual example, starting from the first routing configuration tuple data [0] of the routing configuration data array, regarding the routing configuration data array data [ ], keeping the current routing configuration tuple data [0] = tuple (Dim 1, dim2, …, dimN, out), the tuple contains N-dimensional data Dim1-DimN and a configuration value out, and obtaining a dimension priority array dimsrorted [ ], wherein the dimension priority array comprises N-dimensional data, initializing the current parent node current as the root node root, setting a variable i, initializing the variable i to make i =0, obtaining the first data dimoutput [ i ] of the dimension priority array, i.e. the value y corresponding to the dimsrorted [0], assuming y =1, extracting y =1 th data from the routing configuration tuple as the current routing value, i.e. the current routing value as Dim1, obtaining the current node current parent node current as the root value y, and judging whether there is at least one parent node in the current node, and judging whether there is at least one child node in the current node, if there is a parent node, and whether there is at least one child node; if no child node exists, a default node default is constructed, the default node default is added into a parent node currParent to obtain a new parent node currParent including the default node defaults, the current parent node currParent is updated to be a new parent node currParent, then at least one child node of the current parent node currParent is obtained, whether a child node equal to Dim1 exists in at least one child node or not is judged, if yes, the current parent node currParent is directly updated to be a child node equal to Dim1, if the parent node currParent only includes the default node default or does not exist a child node equal to Dim1, a routing child node corresponding to Dim1 is constructed, a routing child node corresponding to Dim1 is added into the current parent node currParent node, the current parent node currParent node is updated to be a routing child node corresponding to Dim1, i +1=0 = 1=, a priority child node corresponding to Dim1 is obtained, a routing child node corresponding to [ msi ] =1 is obtained, and a routing tree branch configuration is completed until [ msm ] > 1 is completed, and a routing tree configuration is completed, and a loop is completed. Thus, the routing configuration data array data [ ]istraversed, the above-mentioned loop is executed for each routing configuration tuple, and a routing configuration tree is generated, the routing configuration tree is shown in fig. 3, fig. 3 is a structural schematic diagram of a routing configuration tree provided in the embodiment of the present application, where root is a root node, V is a routing child node, default is a default node, and out is a configuration node.
Referring to fig. 4, fig. 4 is a schematic flowchart of a routing method based on a routing configuration tree according to the present application, and the method is applied to the terminal in fig. 1 as an example for explanation, and includes the following steps:
step 401, receiving a routing configuration instruction, where the routing configuration instruction includes: data to be routed;
step 402, processing the data to be routed based on a preset dimension priority array to generate a routing array, wherein the routing array comprises at least one routing data;
the processing the data to be routed based on a preset dimension priority array to generate a routing array comprises the following steps: the method comprises the steps of constructing a current array, initializing the current array to be a null array, setting the current value to be a first dimension priority value in a dimension priority array, extracting a routing value corresponding to the current value from routing data and adding the routing value into the routing array, namely, position parameters of the routing value in the routing data correspond to the current value, updating the current array, updating the current value to be a next dimension priority value, and executing the loop until the traversal of the dimension priority array is finished to obtain the routing array.
Step 403, acquiring a preset routing configuration tree, generating a first routing child node list based on a root node of the routing configuration tree, and acquiring a first threshold corresponding to the first routing child node list;
the first threshold is the sum of the numbers of the first routing child nodes and the default nodes default contained in the first routing child node list.
Wherein generating a first list of routing children based on a root node of the routing configuration tree comprises: all routing child nodes and default nodes default of the root nodes of the routing configuration tree are obtained, a first routing child node list is generated based on all the routing child nodes and the default nodes default, and the default nodes default are arranged at the tail end of the first routing child node list.
Step 404, setting a first node index i, and initializing the first node index to enable i =0;
step 405, setting a current routing node as an ith first routing sub-node, performing routing judgment operation based on the current routing node and the routing array, receiving a first return value, judging whether the first return value is a null value, if so, executing step 406, and if not, executing step 407;
optionally, before the setting the current routing node as the ith first routing sub-node, the method further includes: judging whether the first node index i is larger than the first threshold value; if the first node index i is larger than or equal to the first threshold value, terminating the route configuration operation of the route data; and if the first node index i is smaller than or equal to the first threshold value, taking the current routing node, the routing index j and the routing array as input parameters of the routing judgment operation.
Step 406, updating the first node index i to make i = i +1, updating the current routing node based on the first node index i, setting a routing data index j, initializing the routing data index j =0, and executing the routing judgment operation based on the current routing node, the routing data index j, and the routing data;
in one possible example, the route determination operation is denoted as visit0 (currNode, tuple, currdidmx), where currNode denotes the current routing node, tuple is the routing data, and currdidmx is the routing data index j.
Step 407, if the first return value is a non-null value, determining that the first return value is the routing configuration of the data to be routed.
Optionally, the route determining operation is executed based on the current routing node, the routing data index j, and the routing data, as shown in fig. 5, fig. 5 is a schematic flow diagram of a method for determining a route according to an embodiment of the present invention, and includes the following steps:
step 501, judging whether the current routing node contains a configuration child node, if so, executing step 502, and if not, executing step 503;
step 502, obtaining the configuration value of the configuration child node as the first return value to return;
step 503, setting the current data as the jth routing data of the routing array, determining whether the routing value of the current routing node is equal to the current data or whether the current routing node is a default node default, if the routing value is not equal to the current data and the current routing node is not the default node default, executing step 504, and if the routing value is equal to the current data or the current routing node is the default node default, executing step 505;
and when the routing value of the current routing node is equal to the current data or the current routing node is a default node default, determining that the current data is hit with the current routing node or the default node default.
Step 504, returning a null value as the first return value;
step 505, updating the routing index j to enable j = j +1, updating the current data based on the routing index j, obtaining a second routing sub-node list corresponding to the current routing node and a second threshold corresponding to the second routing sub-node list, and executing step 506;
the first threshold is the sum of the numbers of the first routing child nodes and the default nodes default included in the second routing child node list.
Step 506, obtaining a second node index x, updating the current routing node as the xth second routing child node of the second routing child node list, and executing step 507;
wherein the initial value of the second node index x is 0.
Step 507, executing the route judgment operation based on the current routing node, the routing data index j and the routing data, receiving a second return value, judging whether the second return value is a null value, if not, executing step 508;
step 508, if the second return value is a non-null value, returning the routing value of the current routing node as the first return value;
step 509, if the second return value is null, updating the second node index to make x = x +1, and executing step 510;
step 510, determining whether the second node index x is greater than or equal to the second threshold; if the second node index x is greater than or equal to the second threshold, returning a null value as the first return value; if the second node index x is smaller than the second threshold, go to step 506.
It can be seen that, in the routing judgment operation method provided in the embodiment of the present application, routing data is input into a configuration tree for routing judgment in a recursive manner, routing configuration is extracted, for a child node of each dimension, a routing child node is first matched, and when there is no child node equal to current data in the routing child node, a default node default is hit, where the default node default in each dimension is equivalent to a complement of the routing child node in the dimension, and it is ensured that each routing data can hit the node to ensure that a routing loop obtains a configuration value.
Thus, based on the generation method of the routing configuration tree and the routing method based on the routing configuration tree provided by the embodiment of the present application, the full coverage of the configuration space is realized by generating the routing configuration tree, assuming that in a fixed n-dimensional configuration space, for any dimension, the set of the dimension is assumed to be a, the actually covered set range is a ', and in the case of not performing any specific configuration, the set of the routing nodes is an empty set, and the default node default represents that the complement of the set of routing nodes is also the complement of the empty set, i.e., the full set of the current dimension is a, i.e., the covered range is also equal to a', so that in the case of not performing any specific configuration, the routing configuration tree provided by the present application can realize the full coverage of the configuration space; when any configuration item is added, for any dimension, the routing node set B and the default node default are included, and at this time, the default node default is a complement of the routing node set B, so that the sum of the routing node set B and the default node default is equal to the set a of the dimension, and similarly, the sum of the coverage of the routing node set B and the coverage of the default node default is also equal to a', so that any configuration is added, the routing configuration tree provided by the present application can still realize full coverage of the configuration space, and therefore the routing configuration tree provided by the embodiment of the present application can realize full coverage of the routing configuration content.
Further, assume that the i-dimensional set a is { a1, a2, …, ai }, and the j-dimensional set B is { B1, B2, …, bj }, where the following mapping relationship exists between the set a and the set B: (1) For any one a ∈ A, there is one and only one B ∈ B, so that f (a) = B; (2) For any one B e B, there is no requirement that a e a be present such that f (a) = B; (3) For any a ∈ A, c ∈ a, a ≠ c, there may be B ∈ B, so that f (c) = B. Based on the mapping relation, a set B 'with the mapping relation with the set A can be obtained, and the mapping relation between the set A and the set B' meets the following conditions: (1) For any one a e a, there is one and only one B ' e B ', such that f (a) = B '; (2) For any B ' e B ', there is at least one a e A, so that f (a) = B '. Therefore, based on the set a and the set B ', a set of equivalence classes Q, Q = { Q1, Q2, …, qk } may be generated, the number of the set of equivalence classes is the same as the value range number k of the set B', and is the minimum number of configuration items that need to be configured, where any one Qi = { < ax, bi >, < ay, bi >, … } may be further converted into the form of Qi = { < ax, ay, … }, bi >, and thus based on the simplest configuration of the set a and the set B: in the paradigm design of the database, { < ax, bi >, < ay, bi >, … } is still required to be developed for each < Qi ', bi > to be stored separately, so that in the present application, the maximum set in Qi' is represented by default, the number of configuration rule pieces is reduced, the purpose of saving the storage space of the configuration amount is achieved, and when the routing configuration rule is increased, a new routing sub-node is added in the corresponding dimension, so as to improve the scalability of routing configuration.
To sum up, in the present application, an embodiment of the present application provides a method for generating a routing configuration tree, which receives a routing configuration tree generation instruction, where the routing configuration tree generation instruction includes: a routing configuration data array and a dimension priority array, wherein the routing configuration array comprises at least one routing configuration tuple comprising at least one routing value and one configuration value; then constructing a root node root of the routing configuration tree based on the routing configuration tree generation instruction; and finally, traversing the at least one routing configuration tuple of the routing configuration data array to construct a child node of the root node of the routing configuration tree, and generating the routing configuration tree. The routing configuration can be stored in a tree form, and the number of configuration rules is reduced, so that the configuration storage space is reduced; meanwhile, a routing method based on a routing configuration tree is provided, S41, a routing configuration instruction is received, where the routing configuration instruction includes: data to be routed; s42, processing the data to be routed based on a preset dimension priority array to generate a routing array, wherein the routing array comprises at least one routing data; s43, acquiring a preset routing configuration tree, generating a first routing child node list based on a root node of the routing configuration tree, and acquiring a first threshold corresponding to the first routing child node list; s44, setting a first node index i, and initializing the first node index to enable i =0; s45, setting a current routing node as an ith first routing sub-node, executing routing judgment operation based on the current routing node and the routing array, receiving a first return value, judging whether the first return value is a null value, if so, executing a step S46, and if not, executing a step S47; s47, updating the first node index i to make i = i +1, updating the current routing node based on the first node index i, setting a routing data index j, initializing the routing data index j =0, and executing the routing judgment operation based on the current routing node, the routing data index j, and the routing data; s48, if the first return value is a non-null value, determining that the first return value is the routing configuration of the data to be routed. So, carry out route configuration through constructing the configuration tree, can be convenient for backtrack through tree node, when route configuration rule increases, only need carry out the construction of child node at corresponding tree node and can increase route rule, be favorable to improving route configuration's expansibility.
It should be understood that although the various steps in the flow diagrams of fig. 1-5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1-5 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In an embodiment, as shown in fig. 6, fig. 6 is a schematic structural diagram of a routing configuration tree generating apparatus provided in an embodiment of the present application, and includes a receiving unit 601, a constructing unit 602, and a generating unit 603, where:
a receiving unit 601, configured to receive a routing configuration tree generation instruction, where the routing configuration tree generation instruction includes: a routing configuration data array and a dimension priority array, wherein the routing configuration array comprises at least one routing configuration tuple comprising at least one routing value and one configuration value;
a constructing unit 602, configured to construct a root node root of the routing configuration tree based on the routing configuration tree generating instruction;
a generating unit 603, configured to traverse the at least one routing configuration tuple of the routing configuration data array to construct a child node of the root node of the routing configuration tree, and generate the routing configuration tree.
In a possible example, in respect of the traversing the at least one routing configuration tuple of the routing configuration data array to construct a child node of the root node of the routing configuration tree, the generating unit 603 is specifically configured to: aiming at any one routing configuration tuple, constructing a father node currParent of the routing configuration tuple, and enabling the father node currParent to be equal to a root node root of the routing configuration tree; traversing the dimension priority array to extract the routing value of the routing configuration tuple and execute routing child node construction and father node updating operation to obtain at least one routing child node and updated father node currParent corresponding to the routing configuration tuple; and extracting the configuration value of the routing configuration tuple to generate a routing configuration tree node, and adding the configuration tree node into the updated father node currParent.
In a possible example, in terms of performing routing child node construction and parent node update operations by traversing the dimension priority array to extract the routing values of the routing configuration tuple, the generating unit 603 is specifically configured to: s1, setting a variable i, performing initialization on the variable i to enable i =0, wherein i is an integer, and performing S2; s2, obtaining the ith priority value y of the dimension priority array, wherein y is an integer and is greater than or equal to 0, and executing the step S3; s3, extracting the yth routing value in the routing configuration tuple as the current routing value, and executing the step S4; s4, judging whether a child node exists in the father node currParent or not, if so, executing a step S5, and if not, executing a step S6; s5, establishing a default node default, adding the default node default to the father node currParent to obtain a new father node currParent, updating the father node currParent to the new father node currParent, and executing the step S6; s6, obtaining at least one child node of the father node currParent, traversing the at least one child node, judging whether a child node equal to the current routing value exists in the at least one child node, if so, executing a step S7, and if not, executing a step S8; s7, updating the father node currParent into the child node equal to the current routing value; s8, if no child node equal to the current routing value exists in the child nodes, constructing a routing child node corresponding to the current routing value, adding the routing child node into the father node currParent, updating the father node currParent into a routing child node corresponding to the current routing value, and making i = i +1, and executing the step S2.
In an embodiment, as shown in fig. 7, fig. 7 is a schematic structural diagram of a routing apparatus based on a routing configuration tree according to an embodiment of the present application, and includes a receiving unit 701, a generating unit 702, an obtaining unit 703, a setting unit 704, a determining unit 705, a recursion unit 706, and a determining unit 707, where:
a receiving unit 701, configured to receive a routing configuration instruction, where the routing configuration instruction includes: data to be routed;
a generating unit 702, configured to process the data to be routed based on a preset dimension priority array to generate a routing array, where the routing array includes at least one routing data;
an obtaining unit 703 is configured to obtain a preset routing configuration tree, generate a first routing child node list based on a root node of the routing configuration tree, and obtain a first threshold corresponding to the first routing child node list;
a setting unit 704, configured to set a first node index i, and initialize the first node index so that i =0;
a determining unit 705, configured to set a current routing node as an ith first routing sub-node, perform a routing determination operation based on the current routing node and the routing array, receive a first return value, and determine whether the first return value is a null value;
a recursion unit 706, configured to update the first node index i to make i = i +1 when the first return value is a null value, update the current routing node based on the first node index i, set a routing data index j, initialize the routing data index j =0, and execute the routing judgment operation based on the current routing node, the routing data index j, and the routing data;
a determining unit 707, configured to determine, when the first return value is a non-null value, that the first return value is a routing configuration of the data to be routed.
In a possible example, in terms of the performing the route determining operation based on the current routing node, the routing data index j and the routing data, the recursion unit 706 is specifically configured to: s51, judging whether the current routing node contains a configuration sub-node, if so, executing a step S52, otherwise, executing a step S53; s52, acquiring the configuration value of the configuration child node as the first return value to return; s53, setting current data as jth routing data of the routing array, judging whether a routing value of the current routing node is equal to the current data or whether the current routing node is a default node default, if the routing value is not equal to the current data and the current routing node is not the default node default, executing S54, and if the routing value is equal to the current data or the current routing node is the default node default, executing S55; s54, returning a null value as the first return value; s55, updating the routing index j to enable j = j +1, updating the current data based on the routing index j, acquiring a second routing sub-node list corresponding to the current routing node and a second threshold corresponding to the second routing sub-node list, and executing the step S56; s56, acquiring a second node index x, updating the current routing node to be the xth second routing child node of the second routing child node list, and executing the step S57; s57, executing the route judgment operation based on the current route node, the route data index j and the route data, receiving a second return value, judging whether the second return value is a null value, and if not, executing S58; and S58, if the second return value is a non-null value, returning the routing value of the current routing node as the first return value.
In a possible example, the recursion unit 706 is further configured to: s61, if the second return value is a null value, updating the second node index to enable x = x +1, and executing a step S62; s62, judging whether the second node index x is larger than or equal to the second threshold value; s63, if the index x of the second node is larger than or equal to the second threshold value, returning a null value as the first return value; and S64, if the second node index x is smaller than the second threshold value, executing the step S56.
In a possible example, before the setting the current routing node as the ith first routing sub-node, the determining unit 706 is further configured to: judging whether the first node index i is larger than the first threshold value; if the first node index i is larger than or equal to the first threshold value, terminating the route configuration operation of the route data; and if the first node index i is smaller than or equal to the first threshold value, taking the current routing node, the routing index j and the routing array as input parameters of the routing judgment operation.
The modules in the above-mentioned generating device of the routing configuration tree and the routing device based on the routing configuration tree can be wholly or partially implemented by software, hardware and their combination. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an electronic device 800 according to an embodiment of the present disclosure, and as shown in the figure, the electronic device 800 includes an application processor 810, a memory 820, a communication interface 530, and one or more programs 821, where the one or more programs 821 are stored in the memory 820 and configured to be executed by the application processor 810.
The one or more programs 821 include instructions for performing the steps of:
receiving a routing configuration tree generation instruction, wherein the routing configuration tree generation instruction comprises: a routing configuration data array and a dimension priority array, wherein the routing configuration array comprises at least one routing configuration tuple comprising at least one routing value and one configuration value;
constructing a root node root of a routing configuration tree based on the routing configuration tree generation instruction;
and traversing the at least one routing configuration tuple of the routing configuration data array to construct child nodes of the root node of the routing configuration tree, and generating the routing configuration tree.
The one or more programs 821 further for executing the instructions of:
s41, receiving a routing configuration instruction, wherein the routing configuration instruction comprises: data to be routed;
s42, processing the data to be routed based on a preset dimension priority array to generate a routing array, wherein the routing array comprises at least one routing data;
s43, acquiring a preset routing configuration tree, generating a first routing child node list based on a root node of the routing configuration tree, and acquiring a first threshold corresponding to the first routing child node list;
s44, setting a first node index i, and initializing the first node index to enable the index i =0;
s45, setting a current routing node as an ith first routing sub-node, executing routing judgment operation based on the current routing node and the routing array, receiving a first return value, judging whether the first return value is a null value, if so, executing a step S46, and if not, executing a step S47;
s46, updating the first node index i to enable i = i +1, updating the current routing node based on the first node index i, setting a routing data index j, initializing the routing data index j =0, and executing the routing judgment operation based on the current routing node, the routing data index j and the routing data;
s47, if the first return value is a non-null value, determining that the first return value is the routing configuration of the data to be routed.
The execution process of the above steps can refer to the descriptions in fig. 1 to fig. 5, and is not repeated again.
In the embodiment of the present application, the electronic device may be divided into the functional units according to the method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one control unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that, in the embodiment of the present application, the division of the unit is schematic, and is only one logic function division, and when the actual implementation is realized, another division manner may be provided.
Embodiments of the present application also provide a computer storage medium, where the computer storage medium stores a computer program for electronic data exchange, the computer program enabling a computer to execute part or all of the steps of any one of the methods described in the above method embodiments, and the computer includes an electronic device.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising an electronic device.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts 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 units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps of the methods of the above embodiments may be implemented by a program, which is stored in a computer-readable memory, the memory including: flash Memory disks, read-Only memories (ROMs), random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, the specific implementation manner and the application scope may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method for generating a routing configuration tree, comprising:
receiving a routing configuration tree generation instruction, wherein the routing configuration tree generation instruction comprises: a routing configuration data array and a dimension priority array, wherein the routing configuration array comprises at least one routing configuration tuple comprising at least one routing value and one configuration value;
constructing a root node root of a routing configuration tree based on the routing configuration tree generation instruction;
and traversing the at least one routing configuration tuple of the routing configuration data array to construct a child node of the root node of the routing configuration tree, and generating the routing configuration tree.
2. The method of claim 1, wherein traversing the at least one routing configuration tuple of the routing configuration data array to construct a child node of the root node of the routing configuration tree comprises:
aiming at any one routing configuration tuple, constructing a father node currParent of the routing configuration tuple, and enabling the father node currParent to be equal to a root node root of the routing configuration tree;
traversing the dimension priority array to extract the routing value of the routing configuration tuple and execute routing child node construction and father node updating operation to obtain at least one routing child node and updated father node currParent corresponding to the routing configuration tuple;
and extracting the configuration value of the routing configuration tuple to generate a routing configuration tree node, and adding the configuration tree node into the updated father node currParent.
3. The method of claim 2, wherein traversing the dimension priority array to extract the route values of the route configuration tuple performs route child construction and parent update operations comprising:
s1, setting a variable i, initializing the variable i to enable i =0, wherein i is an integer, and executing a step S2;
s2, obtaining the ith priority value y of the dimension priority array, wherein y is an integer and is greater than or equal to 0, and executing the step S3;
s3, extracting the yth routing value in the routing configuration tuple as the current routing value, and executing the step S4;
s4, judging whether a child node exists in the father node currParent or not, if so, executing a step S5, and if not, executing a step S6;
s5, establishing a default node default, adding the default node default to the father node currParent to obtain a new father node currParent, updating the father node currParent to the new father node currParent, and executing the step S6;
s6, obtaining at least one child node of the father node currParent, traversing the at least one child node, judging whether a child node equal to the current routing value exists in the at least one child node, if so, executing a step S7, and if not, executing a step S8;
s7, updating the father node currParent into the child node equal to the current routing value, enabling i = i +1, and executing the step S2;
s8, if no child node equal to the current routing value exists in the child nodes, constructing a routing child node corresponding to the current routing value, adding the routing child node into the father node currParent, updating the father node currParent into a routing child node corresponding to the current routing value, and making i = i +1, and executing the step S2.
4. A routing method based on a routing configuration tree is characterized by comprising the following steps:
s41, receiving a routing configuration instruction, wherein the routing configuration instruction comprises: data to be routed;
s42, processing the data to be routed based on a preset dimension priority array to generate a routing array, wherein the routing array comprises at least one routing data;
s43, acquiring a preset routing configuration tree, generating a first routing child node list based on a root node of the routing configuration tree, and acquiring a first threshold corresponding to the first routing child node list;
s44, setting a first node index i, and initializing the first node index to enable i =0;
s45, setting a current routing node as an ith first routing sub-node, executing routing judgment operation based on the current routing node and the routing array, receiving a first return value, judging whether the first return value is a null value, if so, executing a step S46, and if not, executing a step S47;
s46, updating the first node index i to enable i = i +1, updating the current routing node based on the first node index i, setting a routing data index j, initializing the routing data index j =0, and executing the routing judgment operation based on the current routing node, the routing data index j and the routing data;
s47, if the first return value is a non-null value, determining that the first return value is the routing configuration of the data to be routed.
5. The method of claim 4, wherein performing the routing decision operation based on the current routing node, the routing data index j, and the routing data comprises:
s51, judging whether the current routing node contains a configuration child node, if so, executing a step S52, otherwise, executing a step S53;
s52, acquiring the configuration value of the configuration child node as the first return value to return;
s53, setting current data as jth routing data of the routing array, judging whether a routing value of the current routing node is equal to the current data or whether the current routing node is a default node default, if the routing value is not equal to the current data and the current routing node is not the default node default, executing S54, and if the routing value is equal to the current data or the current routing node is the default node default, executing S55;
s54, returning a null value as the first return value;
s55, updating the routing index j to enable j = j +1, updating the current data based on the routing index j, acquiring a second routing sub-node list corresponding to the current routing node and a second threshold corresponding to the second routing sub-node list, and executing the step S56;
s56, acquiring a second node index x, updating the current routing node to be the xth second routing sub-node of the second routing sub-node list, and executing the step S57;
s57, executing the route judgment operation based on the current route node, the route data index j and the route data, receiving a second return value, judging whether the second return value is a null value, and if not, executing the step S58;
and S58, if the second return value is a non-null value, returning the routing value of the current routing node as the first return value.
6. The method of claim 5, further comprising:
s61, if the second return value is null, updating the second node index to make x = x +1, and executing step S62;
s62, judging whether the second node index x is larger than or equal to the second threshold value;
s63, if the second node index x is larger than or equal to the second threshold value, returning a null value as the first return value;
and S64, if the second node index x is smaller than the second threshold value, executing the step S56.
7. The method according to claim 4, wherein before said setting the current routing node as the ith first routing sub-node, further comprising:
judging whether the first node index i is larger than the first threshold value;
if the first node index i is larger than or equal to the first threshold value, terminating the route configuration operation of the route data;
and if the first node index i is smaller than or equal to the first threshold value, taking the current routing node, the routing index j and the routing array as input parameters of the routing judgment operation.
8. An apparatus for generating a routing configuration tree, comprising:
a receiving unit, configured to receive a routing configuration tree generation instruction, where the routing configuration tree generation instruction includes: a routing configuration data array and a dimension priority array, wherein the routing configuration array comprises at least one routing configuration tuple comprising at least one routing value and one configuration value;
a constructing unit, configured to construct a root node root of the routing configuration tree based on the routing configuration tree generation instruction;
and the generating unit is used for traversing the at least one routing configuration tuple of the routing configuration data array to construct a child node of the root node of the routing configuration tree and generate the routing configuration tree.
9. A routing apparatus based on a routing configuration tree, comprising:
a receiving unit, configured to receive a routing configuration instruction, where the routing configuration instruction includes: data to be routed;
the generating unit is used for processing the data to be routed based on a preset dimension priority array to generate a routing array, and the routing array comprises at least one routing data;
the device comprises an acquisition unit, a first routing unit and a second routing unit, wherein the acquisition unit is used for acquiring a preset routing configuration tree, generating a first routing child node list based on a root node of the routing configuration tree, and acquiring a first threshold corresponding to the first routing child node list;
the device comprises a setting unit, a first node index i, and a second node index i =0, wherein the first node index i is initialized;
a judging unit, configured to set a current routing node as an ith first routing sub-node, perform a routing judgment operation based on the current routing node and the routing array, receive a first return value, and judge whether the first return value is a null value;
a recursion unit, configured to update the first node index i to make i = i +1 when the first return value is a null value, update the current routing node based on the first node index i, set a routing data index j, initialize the routing data index j =0, and execute the routing judgment operation based on the current routing node, the routing data index j, and the routing data;
and the determining unit is used for determining the first return value as the routing configuration of the data to be routed when the first return value is a non-null value.
10. An electronic device comprising a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-3, 4-7.
CN202211103013.2A 2022-09-09 2022-09-09 Routing configuration tree generation method, routing method and device based on routing configuration tree and electronic equipment Pending CN115442301A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211103013.2A CN115442301A (en) 2022-09-09 2022-09-09 Routing configuration tree generation method, routing method and device based on routing configuration tree and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211103013.2A CN115442301A (en) 2022-09-09 2022-09-09 Routing configuration tree generation method, routing method and device based on routing configuration tree and electronic equipment

Publications (1)

Publication Number Publication Date
CN115442301A true CN115442301A (en) 2022-12-06

Family

ID=84247808

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211103013.2A Pending CN115442301A (en) 2022-09-09 2022-09-09 Routing configuration tree generation method, routing method and device based on routing configuration tree and electronic equipment

Country Status (1)

Country Link
CN (1) CN115442301A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101459569A (en) * 2008-12-12 2009-06-17 华为技术有限公司 Method, apparatus for establishing route index tree and method, apparatus for searching route index tree
CN102437963A (en) * 2011-12-31 2012-05-02 华为技术有限公司 Routing creation method and router
CN102571599A (en) * 2012-02-08 2012-07-11 福建三元达通讯股份有限公司 Rapid storage method of routing table entry
CN108965141A (en) * 2018-09-18 2018-12-07 深圳市风云实业有限公司 A kind of calculation method and device of Multi-path route tree
CN113328950A (en) * 2021-05-25 2021-08-31 桂林电子科技大学 SDN routing system construction method based on tree structure
CN114780800A (en) * 2022-04-25 2022-07-22 京东城市(北京)数字科技有限公司 Multilink routing management method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101459569A (en) * 2008-12-12 2009-06-17 华为技术有限公司 Method, apparatus for establishing route index tree and method, apparatus for searching route index tree
CN102437963A (en) * 2011-12-31 2012-05-02 华为技术有限公司 Routing creation method and router
CN102571599A (en) * 2012-02-08 2012-07-11 福建三元达通讯股份有限公司 Rapid storage method of routing table entry
CN108965141A (en) * 2018-09-18 2018-12-07 深圳市风云实业有限公司 A kind of calculation method and device of Multi-path route tree
CN113328950A (en) * 2021-05-25 2021-08-31 桂林电子科技大学 SDN routing system construction method based on tree structure
CN114780800A (en) * 2022-04-25 2022-07-22 京东城市(北京)数字科技有限公司 Multilink routing management method and device

Similar Documents

Publication Publication Date Title
CN101981898B (en) Method, apparatus and system for social networking
US9110884B2 (en) Message publishing and subscribing method and apparatus
CN101009928B (en) A fuzzy logic scheduler for the radio resource management
Moscholios et al. Performance metrics of a multirate resource sharing teletraffic model with finite sources under the threshold and bandwidth reservation policies
CN111061678B (en) Service data processing method, device, computer equipment and storage medium
CN111177182A (en) Data query method and device, storage medium and electronic equipment
CN110502611B (en) Character string retrieval method and device
CN115442301A (en) Routing configuration tree generation method, routing method and device based on routing configuration tree and electronic equipment
CN107479972A (en) Resource allocation method and Related product
KR20210066114A (en) PROXY, METHOD FOR INTERWORKING BETWEEN HETEROGENEOUS IoT DEVICE AND IoT FLATFORM AND SYSTEM THE PROXY
CN101516086B (en) Service matching method for mobile communication
CN110347413A (en) Software configuration information update method and device
CN113347268B (en) Networking method and device based on distributed network, storage medium and computer equipment
CN113439418A (en) Method, system, terminal and storage medium for changing resource state
CN110248354A (en) A kind of data processing method and its application based on dynamic configuration
CN113194477B (en) Intelligent equipment networking method and device, electronic equipment and storage medium
CN114866970A (en) Policy control method, system and related equipment
CN114298431A (en) Network path selection method, device, equipment and storage medium
CN110825358A (en) Multi-level system configuration service design method based on preorder priority matching rule
CN111385110A (en) Network management method and device
CN111865640A (en) Network architecture description method and device
CN113590348B (en) Parameter transmission method, device, equipment and medium based on tree structure
CN117097616B (en) Method, device, electronic equipment and computer storage medium for checking network configuration
CN107171845A (en) Based on modular information processing method
EP4351094A1 (en) Method and apparatus for allocating address, method and apparatus for determining node, and storage medium

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