CN117956017A - Method for providing service data and related device - Google Patents

Method for providing service data and related device Download PDF

Info

Publication number
CN117956017A
CN117956017A CN202211280804.2A CN202211280804A CN117956017A CN 117956017 A CN117956017 A CN 117956017A CN 202211280804 A CN202211280804 A CN 202211280804A CN 117956017 A CN117956017 A CN 117956017A
Authority
CN
China
Prior art keywords
target
service
configuration data
data
restoration
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
CN202211280804.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.)
Ruijie Networks Co Ltd
Original Assignee
Ruijie Networks 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 Ruijie Networks Co Ltd filed Critical Ruijie Networks Co Ltd
Priority to CN202211280804.2A priority Critical patent/CN117956017A/en
Publication of CN117956017A publication Critical patent/CN117956017A/en
Pending legal-status Critical Current

Links

Abstract

The application discloses a method for providing service data and a related device, and relates to the technical field of communication. In the application, the SDN controller queries a target service template corresponding to the service based on a preset service template set, further acquires target configuration data of target equipment through an acquisition path stored in the target service template, queries a target restoration strategy corresponding to the service based on a preset restoration strategy set, further converts the target configuration data into target service data, and finally returns the target service data to a service requester. By adopting the mode, the SDN controller predefines the service template set, so that the SDN controller of a single manufacturer can be abutted to equipment of different manufacturers, the acquisition efficiency of configuration data is improved, and in addition, a universal data conversion method is provided for a user in the SDN controller, so that the rapid conversion from the configuration data to the service data is realized.

Description

Method for providing service data and related device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for providing service data.
Background
As an emerging network revolution concept, software defined networks (english: software Defined Network, abbreviated SDN) have a tremendous increase in scale, functionality, control and flexibility over traditional networks. The SDN controller can completely replace a deployment model of a traditional network, and unified management of all network devices is realized through southbound interface protocols such as Openflow, network configuration protocol (English: network Configuration, abbreviated as NETCONF) and the like, so that quick deployment, resource integration, unified planning and on-demand calling are realized.
SDN controllers based on Model-driven service abstraction layer (English: model-DRIVEN SERVICE Abstraction Layer, abbreviated as MD-SAL) architecture read configuration data of equipment through NETCONF channels and convert the equipment configuration data into visualized service data to be displayed to users. NETCONF is used as a standard southbound passing protocol, a language abstract network element device model and an interactive interface are modeled through YANG (English: yet Another Next Generation, abbreviated as YANG), in a multi-manufacturer user scene, YANG model definitions of different manufacturer devices are different, if the reading of the device network element models of different manufacturers is to be realized, a plurality of sets of controllers need to be introduced, and the following three problems mainly exist:
1) The new service is slow to be online and has high cost.
The service is coupled with the manufacturer, the service requirement depends on the development of equipment manufacturers, the function test and the system integration depend on the equipment manufacturers, depend on the version development and integration of all manufacturers, and lead to slow online of new service of users; users need to interface with different manufacturer teams at the same time, the communication cost is high, and the later maintenance cost is also increased.
2) The linkage of the multi-manufacturer equipment is difficult.
The controller does not have multi-manufacturer intercommunication capability, so that users have limitation in service design, network design is bound with manufacturers, and network openness is poor. Meanwhile, the controllers of different manufacturers have different processing modes for key services such as data consistency, equipment alarm and the like, so that users need to realize multiple sets of realization, and the workload is increased.
3) The conversion efficiency of the service data is low.
When the business relates to equipment of different manufacturers, the business data query needs to be cooperated with the cross-controller and cross-module requests, and meanwhile, due to the difference of equipment configuration structures of different manufacturers, unified data conversion and data integration are needed, so that the efficiency of converting configuration data into business data is low.
Aiming at the three problems, the main solutions at present are as follows:
And (3) manually adapting YANG models of other manufacturers.
The developer manually converts YANG files of other manufacturers through the NETCONF channel of the controller, firstly converts the YANG files into YANG structures supported by the controller, and secondly writes a script language to adaptively develop the YANG files, so that conversion from a YANG model of a friend to a service model is realized, and further service data required by executing a service are provided.
When the method 1 is adopted, as all types of equipment of all large manufacturers are required to be adapted, namely, different adapting codes are required to be written by equipment of different manufacturers, the adapting workload is large, huge code quantity can be generated, and the development cost and the maintenance cost are high; meanwhile, aiming at the online of the new service, a developer needs to modify the adaptation code to enable the controller to be re-adapted to all the devices, so that the efficiency of converting the device configuration data into the service data is low, and the online period of the new service is long.
Method 2, introduce netcon f capability of other vendors as plug-in to the controller.
By integrating the netcon f core capabilities of other vendors as a plug-in, a single controller is enabled to adapt to multiple vendor devices by being centrally installed on one controller.
When the method 2 is adopted, the plug-in solution is not independent of manufacturers, and the controller needs to be in butt joint with NETCONF modules of other manufacturers, so that development cost and communication cost are greatly increased; meanwhile, the positioning of the problems and the maintenance of the plug-ins also need to depend on other manufacturers, so that the problem response is slow.
In view of this, a new method for providing service data needs to be proposed to improve the efficiency of acquiring service data.
Disclosure of Invention
The application provides a method and a related device for providing service data, which are used for improving the acquisition efficiency of the service data.
In a first aspect, an embodiment of the present application provides a method for providing service data, where the method includes:
Receiving a service data query request sent by a service requester, wherein the service data query request carries target description information of target equipment and a target type identifier of target service;
Based on the target description information and the target type identifier, acquiring a corresponding target service template and a target restoration strategy in a preset service template set and a preset restoration strategy set; each service template is respectively associated with the description information of one device and the type identifier of one service, each restoration strategy is respectively associated with the description information of one device and the type identifier of one service, each service template stores the acquisition path of each configuration data required by the corresponding service in the corresponding device, and each restoration strategy is used for converting each configuration data of the corresponding service into service data required by executing the service;
Acquiring each target configuration data of the target service in the target equipment based on a target acquisition path recorded in the target service template, and converting each target configuration data into corresponding target service data based on a target restoration strategy;
And returning the target service data to the service requester.
In a second aspect, an embodiment of the present application further provides an apparatus for providing service data, where the apparatus includes:
the receiving module is used for receiving a service data query request sent by a service requester, wherein the service data query request carries target description information of target equipment and a target type identifier of target service;
The matching module is used for obtaining a corresponding target service template and a target restoration strategy in a preset service template set and a preset restoration strategy set based on the target description information and the target type identifier; each service template is respectively associated with the description information of one device and the type identifier of one service, each restoration strategy is respectively associated with the description information of one device and the type identifier of one service, each service template stores the acquisition path of each configuration data required by the corresponding service in the corresponding device, and each restoration strategy is used for converting each configuration data of the corresponding service into service data required by executing the service;
The acquisition module is used for acquiring each target configuration data of the target service in the target equipment based on the target acquisition path recorded in the target service template and converting each target configuration data into corresponding target service data based on a target restoration strategy;
and the return module is used for returning the target service data to the service requester.
Optionally, before receiving the service data query request sent by the service requester, the receiving module is further configured to:
Generating corresponding service templates for the designated services respectively, and generating a service template set based on the obtained service templates, wherein each service template is generated by adopting the following modes:
In response to a first configuration operation, determining a device associated with a service, wherein each device is provided with configuration data for realizing the service;
based on the service type of a service, obtaining the dependency relationship between the acquisition path corresponding to each configuration data and each configuration data; the dependency represents the acquisition sequence among the configuration data;
based on the dependency relationship among the configuration data, sequentially storing the acquired paths corresponding to the configuration data to form a path list;
Based on the path list, the description information of a device and the type identifier of a service, a corresponding service template is generated.
Optionally, each restoration policy is configured to convert the configuration data into service data based on an actual service scenario, and each restoration policy is a preconfigured restoration policy or a custom restoration policy; the method comprises the steps that each defined restoration strategy is divided into a plurality of custom strategy sets, and each custom strategy set is associated with the description information of one device and the type identifier of one service;
The matching module is specifically configured to, based on the target description information and the target type identifier, obtain a corresponding target restoration policy in a preset restoration policy set:
If the pre-configuration restoration strategy is obtained based on the target description information and the target type identifier, the pre-configuration restoration strategy is used as a target restoration strategy;
If the self-defined strategy set is obtained based on the target description information and the target type identification in a matching way, selecting a self-defined restoration strategy from the self-defined strategy set as a target restoration strategy.
Optionally, when selecting a custom restoration policy from the custom policy set as the target restoration policy, the matching module performs any one of the following operations:
randomly selecting a custom restoration strategy from the custom strategy set to serve as a target restoration strategy;
Selecting a custom restoration strategy with the priority meeting the preset priority condition from the custom strategy set as a target restoration strategy;
And selecting a user-defined restoration strategy with the use frequency meeting the preset frequency condition from the user-defined strategy set as a target restoration strategy.
Optionally, when each target configuration data of the target service is acquired in the target device based on the target acquisition path recorded in the target service template, the acquisition module is configured to:
Based on a path list recorded in the target service template, sequentially reading target acquisition paths corresponding to each target configuration data, wherein each time one target acquisition path is read, the following operations are executed:
calling a preset configuration channel, and acquiring target configuration data of a target service pointed by a current acquisition path from target equipment; if the target configuration data of the target service pointed by the current acquisition path does not exist in the target device, setting the value of the target configuration data of the target service pointed by the current acquisition path to be null, and storing the acquired target configuration data in a configuration buffer area;
And acquiring each target configuration data of the target service in the configuration buffer area.
Optionally, when each target configuration data is converted into corresponding target service data based on the target restoration policy, the obtaining module is further configured to:
And if the target configuration data with the null value exists in the target configuration data, deleting the target business data converted from the target configuration data with the null value.
Optionally, the target description information of the target device includes any one of the following:
The manufacturer of the target device;
The manufacturer and the equipment model of the target equipment;
the manufacturer of the target device, the device model and the software version.
In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method according to any one of the first aspects when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method according to any of the first aspects.
In a fifth aspect, embodiments of the present application provide a computer program product which, when invoked by a computer, causes the computer to perform the method according to the first aspect.
In the embodiment of the application, after receiving a service data query request sent by a service requester, an SDN controller queries a target service template corresponding to a service based on a preset service template set, and then acquires target configuration data of target equipment through an acquisition path stored in the target service template, and on the other hand, queries a target restoration strategy corresponding to the service based on a preset restoration strategy set, and then converts the target configuration data into target service data, and finally returns the target service data to the service requester.
In this way, the SDN controller stores the acquisition path of the configuration data required by the service in the corresponding device by predefining the service template, so as to acquire the device configuration data, so that the SDN controller of a single manufacturer can interface with devices of different manufacturers, the query of the configuration data is not required to be executed across the controllers, the query efficiency of the configuration data is improved, in addition, a universal data conversion method is provided for the user in the SDN controller, and the configuration data is stored in a restoration policy, so that the rapid conversion of the configuration data to the service data is realized, meanwhile, the SDN controller supports the user-defined restoration policy, the customization requirement of the user to the special service is solved, the service template and the restoration policy can be realized only by a small number of codes, and the development and maintenance cost of the SDN controller is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it will be apparent that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art. In the drawings:
FIG. 1 is a schematic diagram of a system architecture according to an embodiment of the present application;
FIG. 2 is a detailed flowchart of providing service data under a system architecture according to an embodiment of the present application;
FIG. 3 is a detailed flowchart diagram of providing service data under a system architecture according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating steps for providing service data in a specific application scenario in an embodiment of the present application;
fig. 5 is a logic schematic diagram of providing service data in a specific application scenario in an embodiment of the present application;
fig. 6 is a schematic structural diagram of an apparatus for providing service data according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the technical solutions of the present application, but not all embodiments. All other embodiments, based on the embodiments described in the present document, which can be obtained by a person skilled in the art without any creative effort, are within the scope of protection of the technical solutions of the present application.
Some of the concepts involved in the embodiments of the present application are described below.
(1) Software defined network (english: software Defined Network, abbreviated SDN) controller: the SDN controller is the core of the whole software defined network and is a bridge for connecting the bottom layer switching equipment and the upper layer application program. On the one hand, the SDN controller can uniformly monitor and control the bottom forwarding equipment, and perform link discovery, topology management, flow table issuing and other actions through the southbound protocols such as OpenFlow and the like. On the other hand, the controller can provide standard northbound interfaces for upper-layer applications, and the upper-layer applications can effectively schedule and configure resources of the bottom-layer network through the interfaces so as to realize automatic and flexible management and control of the network.
(2) Network configuration protocol (english: network Configuration Protocol, abbreviated as netcon): netcon is an extensible markup language (Extensible Markup Language, XML) based network configuration and management protocol that uses a simple remote procedure call (Remote Procedure Call, RPC) based mechanism to enable communication between clients and servers. The client may be a script or an application running on a network manager, and the server is a typical network device, where the network manager issues, modifies, deletes the configuration of the remote device through the netcon protocol.
(3) YANG model: the YANG model defines a hierarchical structure of data, which can be used for NETCONF-based operations, including operation configuration data and status data, remote procedure calls and notifications, and can fully describe all data sent between NETCONF clients and servers.
(4) Yacng node: four main types of data nodes of the YANG model, including leaf nodes (leaf), list nodes (list), leaf-list nodes (leaf-list) and container nodes (container), are tree-shaped structures, which are a tree of innumerable leaves, lists, leaf lists, and containers that describe the entire device.
The preferred embodiments of the present application will be described in detail with reference to the accompanying drawings.
Referring to fig. 1, in the embodiment of the present application, three main parts are included in a service requester 100, an SDN controller 101, and a target device 102, where the service requester 100 sends a service data query request to the SDN controller 101, and carries description information of the target device 102 and a type identifier of a target service in the service data query request, the SDN controller 101 receives the service data query request, searches a corresponding target service template and a target restoration policy according to the description information of the target device 102 and the type identifier of the target service carried by the service data query request, stores an acquisition path of configuration data required by the target service in the target device 102 in the service template, and the SDN controller 101 sequentially acquires the target configuration data through the acquisition path, and finally, the SDN controller 101 converts the target configuration data into service data required by executing the target service through the target restoration policy and returns the service data to the service requester 100.
Based on the above system architecture, referring to fig. 2, in the embodiment of the present application, a detailed flow of acquiring service data from a target device and providing the service data to a service requester by an SDN controller is as follows:
Step 201: and receiving a service data query request sent by a service requester, wherein the service data query request carries target description information of target equipment and a target type identifier of target service.
Specifically, in the embodiment of the present application, before executing step 201, a relevant developer generates corresponding service templates for each specified service, and generates a service template set based on each obtained service template, where a generating manner of each service template is shown in fig. 3:
step 2011: in response to a first configuration operation, a device associated with a service is determined, and configuration data for implementing the service is provided on the device.
For example, assuming that the service a is to obtain the routing information of the switch 1 for the data packet m, the device associated with the service a is the switch 1, and each configuration data for implementing the service a, that is, the routing information of the switch 1 for forwarding the data packet m, such as a destination, a next hop and a forwarding interface, is set on the switch 1.
Alternatively, a service may be associated with a plurality of target devices, for example, a service a may be a plurality of switches such as the acquisition switch 2, the switch 3, and the switch 4, and in the embodiment of the present application, a service is associated with a target device for example, for routing information of the data packet m.
Step 2012: based on the service type of a service, obtaining the dependency relationship between the acquisition path corresponding to each configuration data and each configuration data.
Specifically, in the embodiment of the present application, the dependency represents the acquisition order between the configuration data.
For example, if the developer classifies the service a as the route forwarding type, the dependency relationship between the configuration data of the switch 1 is: destination-next hop-forwarding interface, i.e. firstly obtain destination, secondly obtain next hop, and finally obtain forwarding interface.
TABLE 1
Service name Service type Associating target devices Configuration data dependencies
Service a Type a Switch 1 Destination-next hop-forwarding interface
Service b Type b Device 2 Configuration data b1→configuration data b2
Service c Type c Device 3 Configuration data c1, configuration data c2
For another example, referring to table 1, the service type of the service b is type b, the associated target device is device 2, and the required dependency relationship between the configuration data is: configuration data b1→configuration data b2; in particular, the service type of the service c is type c, the associated target device is device 3, no dependency relationship exists between the required configuration data, and the service c can acquire the configuration data c1 and the configuration data c2 through the corresponding acquisition paths respectively.
Further, the acquisition path of each configuration data is not complete.
In one aspect, when the acquisition of one configuration data is independent of other configuration data, its acquisition path needs to be completed by the service input that the service requester provides while sending the service data query request.
On the other hand, when the acquisition of one configuration data depends on other configuration data, the acquisition path thereof needs to be completed by the dependent configuration data.
For example, when the service b acquires the configuration data b1, the corresponding acquisition path is perfected by the input information of the service b, and when the service b acquires the configuration data b1 through the perfected acquisition path, the configuration data b1 is used for perfecting the acquisition path of the configuration data b2, so as to acquire the configuration data b2.
Specifically, when the acquisition path of the configuration data b2 is completed, the return value obtained by the acquisition path of the configuration data b1 may be directly filled into the acquisition path of the configuration data b2, or the return value obtained by the acquisition path of the configuration data b1 may be partially filled into the acquisition path of the configuration data b2, and the specific manner of completion depends on the form of the acquisition path of the configuration data b2 and the return value when the configuration data b1 is acquired, which is not limited herein.
Step 2013: and storing the acquired paths corresponding to the configuration data in sequence based on the dependency relationship among the configuration data to form a path list.
Specifically, each acquisition path of each configuration data corresponds to an acquisition path name, and query identifiers and dependency identifiers are also stored in the acquisition paths corresponding to each configuration data, wherein the query identifiers are the configuration data names corresponding to the acquisition paths, and the dependency identifiers are the configuration data names on which the acquisition paths depend.
TABLE 2
For example, referring to table 2, the path name of the configuration data b1 required for the service b is path_b1, the query is identified as b1, the path name of the configuration data b2 is path_b2, the query is identified as b2, the configuration data b1 is obtained independent of other configuration data and depends on the input information of the service b, the dependency in the path_b1 is identified as input, the configuration data b2 is obtained dependent on the configuration data b1, the dependency in the path_b2 is identified as b1, and the developer stores the path_b1 in the path_b2 according to the dependency relationship to form the path list.
Step 2014: based on the path list, the description information of a device and the type identifier of a service, a corresponding service template is generated.
Specifically, in the embodiment of the application, a developer stores and defines the path list as a corresponding service template, and stores description information of the service template and target equipment corresponding to the service, and service type association corresponding to the service, so as to search the service template later, and further, a service data structure representing the corresponding target structure when the configuration data is restored to service data is stored in the service template.
For example, the developer defines a path list formed by the path_b1 and the path_b2 as a service template B corresponding to the service B, and stores description information of the service template B and the device B and service type association of the service B.
Optionally, in an embodiment of the present application, the target description information of the target device includes any one of the following:
The manufacturer of the target device;
The manufacturer and the equipment model of the target equipment;
the manufacturer of the target device, the device model and the software version.
TABLE 3 Table 3
See, for example, table 3: the device description information is: in a plurality of devices corresponding to the manufacturer 1+the device model 1+the software version 1, if the service type is the route information acquisition, the service template corresponding to the service is a service template A, and if the service type is the type B, the service template corresponding to the service is a service template B; similarly, the device description information is: in one or more devices corresponding to the manufacturer 2+device model 2+software version 2, the service type is type C, and the service template corresponding to the service is service template C.
Based on the step 2014, by defining the service templates, the acquiring paths of the configuration data required by the service in the corresponding devices are saved, and the service template set formed by each service template is maintained by the SDN controller, so that the SDN controllers of the single manufacturer can interface with the devices of different manufacturers, and the query efficiency of the configuration data is improved.
Step 202: based on the target description information and the target type identifier, a corresponding target service template and a target restoration strategy are obtained in a preset service template set and a preset restoration strategy set.
Specifically, in the embodiment of the present application, each service template is associated with description information of a device and a type identifier of a service, each restoration policy is associated with description information of a device and a type identifier of a service, each service template stores an acquisition path of each configuration data required by a corresponding service in a corresponding device, each restoration policy is used for converting each configuration data of a corresponding service into service data required for executing the service, and each restoration policy uses a service data structure stored in a service template corresponding to the service as a standard when converting the configuration data into the service data.
Further, each restore strategy is used for converting configuration data into service data based on an actual service scene, and each restore strategy is a pre-configured restore strategy or a custom restore strategy; the method comprises the steps of dividing a respective defined restoration strategy into a plurality of custom strategy sets, wherein each custom strategy set is associated with the description information of one device and the type identification of one service.
For example, a developer designs a set of pre-configuration restoration policies applicable to most services, in the embodiment of the application, the pre-configuration restoration policies are general data conversion methods written by the developer, redundant configuration adaptation work in the prior art is replaced by using a template-driven mode, so that the pre-configuration restoration policies can be adapted to devices of different manufacturers, conversion from service data to configuration data is automatically realized, in an actual application scene, a user can design and register one or more custom restoration policies for special services, wherein a plurality of custom restoration policies corresponding to the same service form a custom policy set, each custom policy set is associated with description information of one device and type identifier of one service, and a plurality of custom restoration policies in each custom policy set are also associated with the same device description information and service type identifier.
Therefore, based on the target description information and the target type identifier, when the corresponding target restoration policy is obtained in the preset restoration policy set, the method comprises the following two cases:
case one: and if the pre-configuration restoration strategy is obtained based on the target description information and the target type identifier, the pre-configuration restoration strategy is used as the target restoration strategy.
And a second case: if the self-defined strategy set is obtained based on the target description information and the target type identification in a matching way, selecting a self-defined restoration strategy from the self-defined strategy set as a target restoration strategy.
TABLE 4 Table 4
For example, referring to table 3, the device description information is: in a plurality of devices corresponding to the manufacturer 1+device model 1+software version 1, if the service type is route information acquisition, the restoration policy corresponding to the service is a custom policy set a, wherein selectable target restoration policies are as follows: a custom restoration strategy a1 and a custom restoration strategy a2; if the service type is type b, the restoration policy corresponding to the service is a custom policy set b, wherein the selectable target restoration policies include: a custom restoration policy b1 and a custom restoration policy b2; in addition, the device description information is: in one or more devices corresponding to the manufacturer 2+device model 2+software version 2, if the service type is the type c, the target restoration policy corresponding to the service is a pre-configured restoration policy.
Optionally, in the embodiment of the present application, when selecting a custom restoration policy from the custom policy set as the target restoration policy, the selection may be performed by any one of the following modes:
Mode 1: and randomly selecting a custom restoration strategy from the custom strategy set to serve as a target restoration strategy.
For example, the user randomly selects the custom restoration policy a1 or the custom restoration policy a2 from the selectable target restoration policies as the target restoration policy.
Mode 2: and selecting a custom restoration strategy with the priority meeting the preset priority condition from the custom strategy set as a target restoration strategy.
For example, taking the registration time of the custom restoration policy as a preset priority condition, that is, the priority of the custom restoration policy with the registration time closest to the current time is highest, assuming that the registration time of the custom restoration policy b1 is 2022, 6, 5, and 2022, 8, 10, the priority of the custom restoration policy b2 is higher than that of the custom restoration policy b1, and the SDN controller automatically selects the custom restoration policy b 2for the user as the target restoration policy.
Mode 3: and selecting a user-defined restoration strategy with the use frequency meeting the preset frequency condition from the user-defined strategy set as a target restoration strategy.
For example, a use identifier is added to each custom restoration policy set to record the number of times the custom restoration policy b1 is invoked, and if the use identifier of the custom restoration policy b1 shows that the custom restoration policy b1 has been invoked 200 times since the self-registration and the use identifier of the custom restoration policy b2 shows that the custom restoration policy b2 has been invoked 150 times since the self-registration, the SDN controller automatically selects the custom restoration policy b1 with a higher use frequency for the user as the target restoration policy.
Based on the step 202, a general pre-configuration restoration policy is provided for the user in the SDN controller, so that the rapid conversion from configuration data to service data can be realized, and meanwhile, the user-defined restoration policy is supported, so that the customization requirement of the user is met.
Step 203: and acquiring each target configuration data of the target service in the target equipment based on the target acquisition path recorded in the target service template, and converting each target configuration data into corresponding target service data based on a target restoration strategy.
Specifically, in the embodiment of the present application, when an SDN controller acquires each target configuration data of a target service in a target device based on a path list recorded in a target service template, the SDN controller sequentially reads a target acquisition path corresponding to each target configuration data based on the path list recorded in the target service template, where each time a target acquisition path is read, the following operations are performed:
Calling a preset configuration channel, and acquiring target configuration data of a target service pointed by a current acquisition path from target equipment; if the target configuration data of the target service pointed by the current acquisition path does not exist in the target device, setting the value of the target configuration data of the target service pointed by the current acquisition path to be null, and storing the acquired target configuration data in a configuration buffer until all the acquisition paths are read, wherein the SDN controller acquires all the target configuration data of the target service in the configuration buffer.
For example, when each target configuration data required by a service is acquired in the switch 1 based on the target acquisition path recorded in the service template a, each time an acquisition path is read, the SDN controller perfects path information by means of the dependency identifier in the acquisition path, and communicates with the switch 1 to acquire the target configuration data of the service a pointed by the current acquisition path, and supposes that the target configuration data is destination information forwarded by the data packet m, then stores the target configuration data in the configuration buffer, then judges whether the next acquisition path exists in the path list, if so, reads the configuration data relied on by the next acquisition path from the configuration buffer by means of the dependency identifier thereof, and uses the configuration data to perfect the path information, and communicates with the switch 1 by means of the netcon channel to acquire the next target configuration data. In particular, if the target configuration data of the service a pointed by the current acquisition path is null, if the switch 1 does not record the next hop information forwarded by the data packet m, the target configuration data is set to be null and stored in the configuration buffer, and when all the acquisition paths are read, the SDN controller acquires all the target configuration data of the service a from the configuration buffer.
Further, when the SDN controller converts each target configuration data into corresponding target service data based on the target restoration policy, if target configuration data with a null value exists in each target configuration data, deleting the target service data converted from the target configuration data with the null value.
For example, after each target configuration data of the service a is obtained, each target configuration data is converted into target service data required for executing the service a based on a data conversion method stored in a target restoration policy corresponding to the service a, wherein if the target configuration data with the null value exists, pruning processing is performed on the target service data in order to avoid execution error of the service a, that is, the target service data converted from the target configuration data with the null value is deleted.
Step 204: and returning the target service data to the service requester.
For example, the SDN controller returns final target service data to the service requester for executing service a.
The above embodiments are described in further detail below with reference to a specific application scenario.
Referring to fig. 4 and fig. 5, a specific flow of providing service data by the SDN controller in the embodiment of the present application is as follows:
The service request party x sends a service data query request x to the SDN controller, and the service request x is used for executing the service d and providing the device description information of the target device d associated with the service d: vendor 1+device model 2+software version 3, service type of service d: type d triggers the SDN controller to execute step 401.
Step 401: the SDN controller receives a service data query request x sent by a service request party x, and acquires device description information of a device d carried in the service query request x and a service type of the service d.
Step 402: the SDN controller acquires a target service template m corresponding to the service d in a preset service template set based on the equipment description information of the equipment d, and acquires a target restoration strategy n corresponding to the service d in a preset restoration strategy set based on the service type of the service d.
Step 403: the SDN controller acquires the acquisition path of each target configuration data corresponding to the service d based on the target service template m, and sequentially acquires each target configuration data from the device d.
Step 404: the SDN controller converts the obtained configuration data into target service data based on a data conversion method stored in the target restoration strategy n, and performs pruning processing on the target service data.
Step 405: and the SDN controller returns the final target service data to the service requester x to complete the service data providing flow.
Furthermore, although the operations of the methods of the present application are depicted in the drawings in a particular order, this is not required or suggested that these operations must be performed in this particular order or that all of the illustrated operations must be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.
Based on the same technical concept, referring to fig. 6, an embodiment of the present application further provides an apparatus for providing service data, where the apparatus includes:
A receiving module 601, configured to receive a service data query request sent by a service requester, where the service data query request carries target description information of a target device and a target type identifier of a target service;
The matching module 602 is configured to obtain, based on the target description information and the target type identifier, a corresponding target service template and a target restoration policy in a preset service template set and a preset restoration policy set; each service template is respectively associated with the description information of one device and the type identifier of one service, each restoration strategy is respectively associated with the description information of one device and the type identifier of one service, each service template stores the acquisition path of each configuration data required by the corresponding service in the corresponding device, and each restoration strategy is used for converting each configuration data of the corresponding service into service data required by executing the service;
The acquiring module 603 is configured to acquire, in the target device, each target configuration data of the target service based on the target acquisition path recorded in the target service template, and convert each target configuration data into corresponding target service data based on the target restoration policy;
a return module 604, configured to return the target service data to the service requester.
Optionally, before receiving the service data query request sent by the service requester, the receiving module 601 is further configured to:
Generating corresponding service templates for the designated services respectively, and generating a service template set based on the obtained service templates, wherein each service template is generated by adopting the following modes:
In response to a first configuration operation, determining a device associated with a service, wherein each device is provided with configuration data for realizing the service;
based on the service type of a service, obtaining the dependency relationship between the acquisition path corresponding to each configuration data and each configuration data; the dependency represents the acquisition sequence among the configuration data;
based on the dependency relationship among the configuration data, sequentially storing the acquired paths corresponding to the configuration data to form a path list;
Based on the path list, the description information of a device and the type identifier of a service, a corresponding service template is generated.
Optionally, each restoration policy is configured to convert the configuration data into service data based on an actual service scenario, and each restoration policy is a preconfigured restoration policy or a custom restoration policy; the method comprises the steps that each defined restoration strategy is divided into a plurality of custom strategy sets, and each custom strategy set is associated with the description information of one device and the type identifier of one service;
The matching module 602 is specifically configured to, when obtaining a corresponding target restoration policy based on the target description information and the target type identifier:
If the pre-configuration restoration strategy is obtained based on the target description information and the target type identifier, the pre-configuration restoration strategy is used as a target restoration strategy;
If the self-defined strategy set is obtained based on the target description information and the target type identification in a matching way, selecting a self-defined restoration strategy from the self-defined strategy set as a target restoration strategy.
Optionally, when a custom restoration policy is selected from the custom policy set as the target restoration policy, the matching module 602 performs any one of the following operations:
randomly selecting a custom restoration strategy from the custom strategy set to serve as a target restoration strategy;
Selecting a custom restoration strategy with the priority meeting the preset priority condition from the custom strategy set as a target restoration strategy;
And selecting a user-defined restoration strategy with the use frequency meeting the preset frequency condition from the user-defined strategy set as a target restoration strategy.
Optionally, when each target configuration data of the target service is acquired in the target device based on the target acquisition path recorded in the target service template, the acquiring module 603 is configured to:
Based on a path list recorded in the target service template, sequentially reading target acquisition paths corresponding to each target configuration data, wherein each time one target acquisition path is read, the following operations are executed:
calling a preset configuration channel, and acquiring target configuration data of a target service pointed by a current acquisition path from target equipment; if the target configuration data of the target service pointed by the current acquisition path does not exist in the target device, setting the value of the target configuration data of the target service pointed by the current acquisition path to be null, and storing the acquired target configuration data in a configuration buffer area;
And acquiring each target configuration data of the target service in the configuration buffer area.
Optionally, when each target configuration data is converted into corresponding target service data based on the target restoration policy, the obtaining module 603 is further configured to:
And if the target configuration data with the null value exists in the target configuration data, deleting the target business data converted from the target configuration data with the null value.
Optionally, the target description information of the target device includes any one of the following:
The manufacturer of the target device;
The manufacturer and the equipment model of the target equipment;
the manufacturer of the target device, the device model and the software version.
Based on the same technical concept, the embodiment of the application also provides electronic equipment, which can realize the method flow for providing service data provided by the embodiment of the application.
In one embodiment, the electronic device may be a server, a terminal device, or other electronic device.
Referring to fig. 7, the electronic device may include:
At least one processor 701, and a memory 702 connected to the at least one processor 701, in which the specific connection medium between the processor 701 and the memory 702 is not limited in the embodiment of the present application, and in fig. 7, the connection between the processor 701 and the memory 702 through the bus 700 is taken as an example. Bus 700 is shown in bold lines in fig. 7, and the manner in which the other components are connected is illustrated schematically and not by way of limitation. The bus 700 may be divided into an address bus, a data bus, a control bus, etc., and is represented by only one thick line in fig. 7 for convenience of representation, but does not represent only one bus or one type of bus. Alternatively, the processor 701 may be referred to as a controller, and the names are not limited.
In an embodiment of the present application, the memory 702 stores instructions executable by the at least one processor 701, and the at least one processor 701 may perform a method for providing service data as previously described by executing the instructions stored in the memory 702. The processor 701 may implement the functions of the various modules in the apparatus shown in fig. 6.
The processor 701 is a control center of the apparatus, and may connect various parts of the entire control device using various interfaces and lines, and by executing or executing instructions stored in the memory 702 and invoking data stored in the memory 702, various functions of the apparatus and processing data, thereby performing overall monitoring of the apparatus.
In one possible design, processor 701 may include one or more processing units, and processor 701 may integrate an application processor and a modem processor, wherein the application processor primarily processes operating systems, user interfaces, application programs, and the like, and the modem processor primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 701. In some embodiments, processor 701 and memory 702 may be implemented on the same chip, or they may be implemented separately on separate chips in some embodiments.
The processor 701 may be a general purpose processor such as a CPU, digital signal processor, application specific integrated circuit, field programmable gate array or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, and may implement or perform the methods, steps and logic blocks disclosed in embodiments of the application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method for providing service data disclosed in connection with the embodiments of the present application may be directly embodied as a hardware processor executing, or may be executed by a combination of hardware and software modules in the processor.
The memory 702 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 702 may include at least one type of storage medium, and may include, for example, flash Memory, hard disk, multimedia card, card Memory, random access Memory (Random Access Memory, RAM), static random access Memory (Static Random Access Memory, SRAM), programmable Read-Only Memory (Programmable Read Only Memory, PROM), read-Only Memory (ROM), charged erasable programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM), magnetic Memory, magnetic disk, optical disk, and the like. Memory 702 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 702 in embodiments of the present application may also be circuitry or any other device capable of performing storage functions for storing program instructions and/or data.
By programming the processor 701, code corresponding to a method for providing service data described in the foregoing embodiment may be cured into a chip, so that the chip can execute the steps of a method for providing service data in the embodiment shown in fig. 3 at the time of operation. How to design and program the processor 701 is a technology well known to those skilled in the art, and will not be described in detail herein.
Based on the same inventive concept, the embodiments of the present application also provide a storage medium storing computer instructions that, when executed on a computer, cause the computer to perform a method of providing service data as previously discussed.
In some possible embodiments, the present application provides a method of providing service data, the aspects of which may also be implemented in the form of a program product comprising program code for causing the control apparatus to carry out the steps of a method of providing service data according to the various exemplary embodiments of the application as described herein above when the program product is run on a device.
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such a division is merely exemplary and not mandatory. Indeed, the features and functions of two or more of the elements described above may be embodied in one element in accordance with embodiments of the present application. Conversely, the features and functions of one unit described above may be further divided into a plurality of units to be embodied.
Furthermore, although the operations of the methods of the present application are depicted in the drawings in a particular order, this is not required or suggested that these operations must be performed in this particular order or that all of the illustrated operations must be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (11)

1. A method of providing service data, characterized by being applied to an SDN controller, the method comprising:
Receiving a service data query request sent by a service requester, wherein the service data query request carries target description information of target equipment and a target type identifier of target service;
Based on the target description information and the target type identifier, acquiring a corresponding target service template and a target restoration strategy in a preset service template set and a preset restoration strategy set; each service template is respectively associated with the description information of one device and the type identifier of one service, each restoration strategy is respectively associated with the description information of one device and the type identifier of one service, each service template stores the acquisition path of each configuration data required by the corresponding service in the corresponding device, and each restoration strategy is used for converting each configuration data of the corresponding service into service data required by executing the service;
Acquiring each target configuration data of the target service in the target equipment based on a target acquisition path recorded in the target service template, and converting each target configuration data into corresponding target service data based on the target restoration strategy;
and returning the target service data to the service requester.
2. The method of claim 1, wherein prior to receiving the service data query request sent by the service requester, further comprising:
generating corresponding service templates for the designated services respectively, and generating the service template set based on the obtained service templates, wherein each service template is generated by adopting the following modes:
determining one device associated with one service in response to a first configuration operation, wherein each device is provided with configuration data for realizing the one service;
based on the service type of the service, obtaining the dependency relationship between the acquisition path corresponding to each configuration data and each configuration data; the dependency relationship characterizes the acquisition sequence among the configuration data;
based on the dependency relationship among the configuration data, sequentially storing the acquired paths corresponding to the configuration data to form a path list;
and generating a corresponding service template based on the path list, the description information of the one device and the type identifier of the one service.
3. The method of claim 1, wherein each restore policy is for converting configuration data into business data based on an actual business scenario, and wherein each restore policy is a pre-configured restore policy or a custom restore policy; the method comprises the steps that each defined restoration strategy is divided into a plurality of custom strategy sets, and each custom strategy set is associated with the description information of one device and the type identifier of one service;
Based on the target description information and the target type identifier, obtaining a corresponding target restoration policy in a preset restoration policy set, including:
If a pre-configured restoration strategy is obtained based on the target description information and the target type identifier in a matching way, the pre-configured restoration strategy is used as the target restoration strategy;
And if the self-defined strategy set is obtained based on the target description information and the target type identifier, selecting a self-defined restoration strategy from the self-defined strategy set as the target restoration strategy.
4. The method of claim 3, wherein selecting a custom restore policy from the set of custom policies as the target restore policy comprises any one of:
Randomly selecting a custom restoration strategy from the custom strategy set to serve as the target restoration strategy;
selecting a custom restoration strategy with the priority meeting the preset priority condition from the custom strategy set as the target restoration strategy;
and selecting a custom restoration strategy with the use frequency meeting the preset frequency condition from the custom strategy set as the target restoration strategy.
5. The method according to any one of claims 1-4, wherein the acquiring, in the target device, each target configuration data of the target service based on the target acquisition path recorded in the target service template includes:
Based on the path list recorded in the target service template, sequentially reading target acquisition paths corresponding to each target configuration data, wherein each time one target acquisition path is read, the following operations are executed:
Calling a preset configuration channel, and acquiring target configuration data of the target service pointed by a current acquisition path from the target device; if the target configuration data of the target service pointed by the current acquisition path does not exist in the target device, setting the value of the target configuration data of the target service pointed by the current acquisition path to be null, and storing the acquired target configuration data in a configuration buffer area;
And acquiring each target configuration data of the target service in the configuration buffer area.
6. The method according to any of claims 1-4, wherein the target description information of the target device comprises any of the following:
The manufacturer of the target device;
The manufacturer and the equipment model of the target equipment;
the manufacturer of the target device, the device model and the software version.
7. The method of claim 1, wherein the converting the respective target configuration data into the respective target traffic data based on the target restoration policy further comprises:
And if the target configuration data with the null value exists in the target configuration data, deleting the target business data converted from the target configuration data with the null value.
8. An apparatus for providing service data, comprising:
the receiving module is used for receiving a service data query request sent by a service requester, wherein the service data query request carries target description information of target equipment and a target type identifier of target service;
The matching module is used for obtaining a corresponding target service template and a target restoration strategy in a preset service template set and a preset restoration strategy set based on the target description information and the target type identifier; each service template is respectively associated with the description information of one device and the type identifier of one service, each restoration strategy is respectively associated with the description information of one device and the type identifier of one service, each service template stores the acquisition path of each configuration data required by the corresponding service in the corresponding device, and each restoration strategy is used for converting each configuration data of the corresponding service into service data required by executing the service;
The acquisition module is used for acquiring each target configuration data of the target service in the target equipment based on a target acquisition path recorded in the target service template and converting each target configuration data into corresponding target service data based on the target restoration strategy;
and the return module is used for returning the target service data to the service requester.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1-7 when executing the computer program.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any of claims 1-7.
11. A computer program product, characterized in that the computer program product, when called by a computer, causes the computer to perform the method according to any of claims 1-7.
CN202211280804.2A 2022-10-19 2022-10-19 Method for providing service data and related device Pending CN117956017A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211280804.2A CN117956017A (en) 2022-10-19 2022-10-19 Method for providing service data and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211280804.2A CN117956017A (en) 2022-10-19 2022-10-19 Method for providing service data and related device

Publications (1)

Publication Number Publication Date
CN117956017A true CN117956017A (en) 2024-04-30

Family

ID=90794838

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211280804.2A Pending CN117956017A (en) 2022-10-19 2022-10-19 Method for providing service data and related device

Country Status (1)

Country Link
CN (1) CN117956017A (en)

Similar Documents

Publication Publication Date Title
CN108989066B (en) Equipment management method and device
US10834013B2 (en) Network slice management
WO2017054531A1 (en) Yang model-based compiling method, and corresponding interface, component, and system
CN111580884B (en) Configuration updating method, device, server and electronic equipment
US11222343B2 (en) Method and apparatus for autonomous services composition
CN103891209A (en) Chassis controllers for converting universal flows
CN104753715A (en) Hybrid Sdn Controller
CN115150274B (en) Unified configuration method, system and storage medium for time-sensitive network equipment
CN111865662B (en) Network equipment configuration method and system
US10148486B2 (en) Object version management
EP3637690A1 (en) Service configuration-driven flow table method and device
JP6950576B2 (en) Network systems, topology management methods, and programs
CN109150583A (en) A kind of management method and device of northbound interface
CN101820354A (en) Collocation method based on TNDS (Total Network Data System) object, terminal equipment and server
CN117956017A (en) Method for providing service data and related device
CN114615150B (en) Simulation network generation method and device
JP2019205080A (en) Conversion device, and conversion program
CN117424848B (en) Node call optimization method, system, equipment and medium based on machine learning
US20210359928A1 (en) Model for template based testing in sdn networks
US20230385708A1 (en) Reconciling computing infrastructure and data in federated learning
US20230409371A1 (en) Method for creating network service ns and related apparatus
US20240007876A1 (en) Restoration of a network slice
CN110134467B (en) Parameter configuration processing method and device, storage medium and processor
WO2021083061A1 (en) Method and apparatus for processing software mirror image of virtual network function
CN117749611A (en) Multiparty network integrated management method, system, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication