WO2019179392A1 - 报文的生成方法及相关设备 - Google Patents

报文的生成方法及相关设备 Download PDF

Info

Publication number
WO2019179392A1
WO2019179392A1 PCT/CN2019/078485 CN2019078485W WO2019179392A1 WO 2019179392 A1 WO2019179392 A1 WO 2019179392A1 CN 2019078485 W CN2019078485 W CN 2019078485W WO 2019179392 A1 WO2019179392 A1 WO 2019179392A1
Authority
WO
WIPO (PCT)
Prior art keywords
configuration data
data
operation instruction
instruction
southbound
Prior art date
Application number
PCT/CN2019/078485
Other languages
English (en)
French (fr)
Inventor
冯冲
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2019179392A1 publication Critical patent/WO2019179392A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/38Flow based routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/42Centralised routing

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a packet generating method and related device.
  • a controller in a network management system (NMS) or software defined networking (SDN) belongs to the control layer of the network.
  • the controller in the control layer is usually connected to the application server located at the network application layer through a northbound interface (NBI), and is connected to a network element at the network infrastructure layer through a southbound interface (SBI).
  • NMS or SDN controller obtains a northbound request from the service server, decomposes and orchestrate the northbound request, determines one or more network elements that need to be parameterized, and then generates for the network element.
  • the corresponding southbound packet is delivered, and the network element updates its corresponding configuration data according to the received southbound packet.
  • the southbound packet sent to the NE is a southbound packet generated by the same northbound request
  • the northbound request processing is considered unsuccessful. You need to ensure that the configuration data of the NEs that have been successfully processed in the southbound direction is restored to the state before the update, so that the southbound packets can be delivered according to the northbound request.
  • the traditional method of manually writing the reverse operation message for restoring the network element configuration data to the state before the update in the NMS or the SDN controller is not only inefficient, but also error-prone.
  • the embodiment of the present invention provides a method for generating a packet and a related device, which can solve the problem of low efficiency and low accuracy caused by manually writing an inverse operation message in the prior art.
  • a first aspect of the present application provides a method for generating a message, where the method is used in an NMS or an SDN controller, and the method includes:
  • Obtaining a northbound request sent by the service server for example, a request to update the configuration data stored in the network element, and generating at least one southbound message according to the northbound request, where the southbound packet corresponds to the network element, and may be based on The network element issues a list sequence to form a southbound message sequence.
  • Each of the southbound packets generated according to the northbound packet includes a first operation instruction, where the first operation instruction is an instruction to update configuration data of the network element corresponding to the southbound message, for example, Indicates to add, modify, and/or delete NE configuration data.
  • the reverse operation instruction of the operation instruction is used to restore the configuration data of the network element updated by the first operation instruction to the state before the update. And generating an inverse operation message according to the operation type of the second operation instruction and the operation data of the second operation instruction.
  • the northbound request sent by the service server is first obtained, and at least one southbound message is generated according to the northbound request to form a southbound message sequence, each of which forms a southbound message sequence.
  • the southbound message includes a first operation instruction, and the first operation instruction is used to update the configuration data of the network element corresponding to the southbound message.
  • the operation type and operation data of the reverse operation instruction of the first operation instruction that is, the operation type of the second operation instruction and the operation data of the second operation instruction, and the second, may be determined according to the first operation instruction, respectively.
  • the operation instruction is a reverse operation instruction of the first operation instruction, and is used to restore the configuration data of the network element updated by the first operation instruction to the state before the update.
  • an inverse operation message is generated according to the operation type of the second operation instruction and the operation data of the second operation instruction.
  • determining the operation type of the second operation instruction and the operation data of the second operation instruction according to the first operation instruction including: acquiring an original configuration of the network element corresponding to the southbound message Data; executing the first operation instruction on the original configuration data, generating target configuration data; comparing the original configuration data and the target configuration data, obtaining an operation type of the second operation instruction, and the The operational data of the second operational instruction.
  • the second operation instruction is to be able to restore the configuration data updated according to the first operation instruction to the state before the update, as a possible implementation, by comparing the original configuration data before the update with the updated target configuration
  • the data can determine an operation method for restoring the target configuration data to the original configuration data, thereby obtaining the operation type of the second operation instruction and the operation data of the second operation instruction, thereby realizing accurate data recovery.
  • the original configuration data includes an identifier of the first configuration data and the first configuration data
  • the target configuration data includes an identifier of the second configuration data and the second configuration data
  • the target configuration data may be restored.
  • the operation type and operation data of the second operation instruction are obtained in a targeted manner, thereby improving the accuracy of data recovery.
  • the comparing the original configuration data with the target configuration data, obtaining an operation type of the second operation instruction and operation data of the second operation instruction if:
  • the original configuration data includes an identifier of the third configuration data and the third configuration data, and the identifier of the third configuration data and the third configuration data does not exist in the target configuration data, and the second operation is confirmed
  • the operation type of the instruction includes a new operation
  • the operation data of the second operation instruction includes an identifier of the third configuration data and the third configuration data, where the new operation is used to store the third configuration data and The identifier of the third configuration data.
  • the target configuration data may be The original configuration data is restored, and the operation type and operation data of the second operation instruction are obtained in a targeted manner, thereby improving the accuracy of data recovery.
  • the comparing the original configuration data with the target configuration data, obtaining an operation type of the second operation instruction and operation data of the second operation instruction if:
  • the target configuration data includes an identifier of the fourth configuration data and the fourth configuration data, and the identifier of the fourth configuration data and the fourth configuration data does not exist in the original configuration data, and the second operation is confirmed
  • the operation type of the instruction includes a deletion operation
  • the operation data of the second operation instruction includes an identifier of the fourth configuration data and the fourth configuration data, where the deletion operation is used to delete the stored in the network element Identification of the fourth configuration data and the fourth configuration data.
  • the target configuration data may be restored.
  • the operation type and operation data of the second operation instruction are obtained in a targeted manner, thereby improving the accuracy of data recovery.
  • the second operation instruction is to be able to restore the configuration data updated according to the first operation instruction to the state before the update, as another possible implementation manner, by comparing the original configuration data before the update and the first
  • the operation instruction is used to determine the reverse operation instruction of the first operation instruction, thereby obtaining the operation type of the second operation instruction and the operation data of the second operation instruction, thereby realizing accurate recovery of the data.
  • the operation type of the first operation instruction includes at least one of the following: a merge operation, an alternate operation, a delete operation, and a new operation.
  • a merge operation an alternate operation
  • a delete operation an alternate operation
  • a new operation a new operation.
  • the determining, according to the first operation instruction, the operation type of the second operation instruction and the operation data of the second operation instruction, if the operation type of the first operation instruction includes a merge operation Acquiring the original configuration data of the network element corresponding to the southbound message; confirming the operation type of the second operation instruction and the operation of the second operation instruction according to the original configuration data and the operation data of the merge operation data.
  • the second operation instruction may be a merge operation or a delete operation, and the operation data of the second operation instruction may be determined according to the original configuration data and the operation data of the first operation instruction, and the specificity is determined. Obtain the operation type and operation data of the second operation instruction, thereby improving the accuracy of data recovery.
  • the original configuration data includes an identifier of the fifth configuration data and the fifth configuration data
  • the operation data of the merge operation includes an identifier of the sixth configuration data and the sixth configuration data
  • Determining the operation type of the second operation instruction and the operation data of the second operation instruction according to the original configuration data and the operation data of the merging operation including: if the identifier of the fifth configuration data and the The identifier of the sixth configuration data is the same, and the fifth configuration data is different from the sixth configuration data, determining that the operation type of the second operation instruction includes a merge operation, and the operation data of the second operation instruction includes An identifier of the fifth configuration data and the fifth configuration data, where the merging operation is used to modify the sixth configuration data in the network element to the fifth configuration data.
  • the operation type of the second operation instruction may be a merge operation
  • the operation data of the second operation instruction may be determined according to the original configuration data and the operation data of the first operation instruction, for example, the original
  • the fifth configuration data in the configuration data is targeted to obtain the operation type and operation data of the second operation instruction, thereby improving the accuracy of data recovery.
  • the confirming the operation type of the second operation instruction and the operation data of the second operation instruction according to the original configuration data and the operation data of the merge operation include: if the merging The operation data of the operation includes an identifier of the seventh configuration data and the seventh configuration data, and the identifier of the seventh configuration data and the seventh configuration data does not exist in the original configuration data, and the second is confirmed
  • the operation type of the operation instruction includes a deletion operation
  • the operation data of the second operation instruction includes an identifier of the seventh configuration data and the seventh configuration data, where the deletion operation is used to delete the location stored in the network element
  • the identification of the seventh configuration data and the seventh configuration data includes: if the merging The operation data of the operation includes an identifier of the seventh configuration data and the seventh configuration data, and the identifier of the seventh configuration data and the seventh configuration data does not exist in the original configuration data, and the second is confirmed
  • the operation type of the operation instruction includes a deletion operation
  • the operation data of the second operation instruction includes an identifier of the seventh configuration data and
  • the operation type of the second operation instruction may be a deletion operation, and the operation data of the second operation instruction may be determined according to the original configuration data and the operation data of the first operation instruction, for example, the target The seventh configuration data in the configuration data is targeted to obtain the operation type and operation data of the second operation instruction, thereby improving the accuracy of data recovery.
  • determining the operation type of the second operation instruction and the operation data of the second operation instruction according to the first operation instruction include: if the operation type of the first operation instruction includes the replacement In operation, the original configuration data of the network element corresponding to the southbound message is obtained, and the operation type of the second operation instruction is determined to include an alternative operation, and the operation data of the second operation instruction includes the original configuration data.
  • the replacement operation is for replacing configuration data stored in the network element with the original configuration data.
  • the operation type of the second operation instruction may be an alternative operation
  • the operation data of the second operation instruction may be the same as the original configuration data, and the operation type and operation data of the second operation instruction are obtained. , thereby improving the accuracy of data recovery.
  • determining the operation type of the second operation instruction and the operation data of the second operation instruction according to the first operation instruction include: if the operation type of the first operation instruction includes the deleting The operation determines that the operation type of the second operation instruction is a new operation, the operation data of the second operation instruction includes operation data of the newly added operation, and the new operation is used for the network element The operation data of the newly added operation is stored.
  • the operation type of the second operation instruction may be a new operation, and the operation data of the second operation instruction may be the same as the operation data of the first operation instruction, and the second operation instruction is obtained. Operation type and operational data to improve the accuracy of data recovery.
  • determining the operation type of the second operation instruction and the operation data of the second operation instruction according to the first operation instruction include: if the operation type of the first operation instruction includes the new The operation operation is performed to determine that the operation type of the second operation instruction is a deletion operation, the operation data of the second operation instruction includes operation data of the newly added operation, and the deletion operation is used to delete the network element.
  • the operation data of the newly added operation stored in.
  • the operation type of the second operation instruction may be a deletion operation, and the operation data of the second operation instruction may be the same as the operation data of the first operation instruction, and the second operation instruction is obtained. Operation type and operational data to improve the accuracy of data recovery.
  • the method further includes: sending the southbound message in the southbound message sequence to the corresponding network element in sequence according to the sequence of the southbound message sequence, and acquiring the network element If the processing result of the southbound packet is a processing failure, the corresponding reversed sequence of the southbound packet sequence is sent to the succeeding network element according to the reverse sequence of the southbound packet sequence. Operation message.
  • the reverse operation packet can be timely sent to recover the data.
  • the second aspect of the present application provides a message generating apparatus, where the apparatus includes:
  • a southbound message sequence generating unit configured to acquire a northbound request sent by the service server, and generate a southbound message sequence according to the northbound request, where the southbound message sequence includes at least one southbound message, each of the The southbound message includes a first operation instruction, where the first operation instruction is an instruction to update configuration data of the network element corresponding to the southbound message;
  • the second operation instruction is a reverse operation instruction of the first operation instruction
  • a reverse operation message generating unit configured to generate an inverse operation message according to the operation type of the second operation instruction and the operation data of the second operation instruction.
  • the second operation instruction determining unit includes:
  • the original configuration data acquiring sub-unit is configured to obtain original configuration data of the network element corresponding to the southbound message
  • a target configuration data generating subunit configured to execute the first operation instruction on the original configuration data to generate target configuration data
  • the second operation instruction determining subunit is configured to compare the original configuration data and the target configuration data to obtain an operation type of the second operation instruction and operation data of the second operation instruction.
  • the original configuration data includes an identifier of the first configuration data and the first configuration data
  • the target configuration data includes an identifier of the second configuration data and the second configuration data
  • the second operation instruction determining subunit is specifically configured to:
  • the configuration identifier of the first configuration data is the same as the configuration identifier of the second configuration data, and the first configuration data is different from the second configuration data, confirming that the operation type of the second operation instruction includes a merging operation, the operation data of the second operation instruction includes an identifier of the first configuration data and the first configuration data, and the merging operation is used to modify the second configuration data in the network element to The first configuration data is described.
  • the second operation instruction determining subunit is specifically configured to:
  • the original configuration data includes the identifiers of the third configuration data and the third configuration data, and the identifiers of the third configuration data and the third configuration data do not exist in the target configuration data, confirm the The operation type of the second operation instruction includes a new operation, the operation data of the second operation instruction includes an identifier of the third configuration data and the third configuration data, and the new operation is used to store the third The identification of the configuration data and the third configuration data.
  • the second operation instruction determining subunit is specifically configured to:
  • the operation type of the second operation instruction includes a deletion operation
  • the operation data of the second operation instruction includes an identifier of the fourth configuration data and the fourth configuration data
  • the deletion operation is used to delete the storage in the network element The fourth configuration data and the identifier of the fourth configuration data.
  • the operation type of the first operation instruction includes at least one of the following:
  • the second operation instruction determining unit includes:
  • a merge operation original configuration data acquisition subunit configured to acquire original configuration data of the network element corresponding to the southbound message if the operation type of the first operation instruction includes a merge operation
  • the merging operation second operation instruction acquiring subunit is configured to confirm the operation type of the second operation instruction and the operation data of the second operation instruction according to the original configuration data and the operation data of the merging operation.
  • the original configuration data includes an identifier of the fifth configuration data and the fifth configuration data
  • the operation data of the merge operation includes an identifier of the sixth configuration data and the sixth configuration data
  • the merge operation second operation instruction acquisition subunit is specifically configured to:
  • the operation type of the second operation instruction includes a merge operation
  • the operation data of the second operation instruction includes an identifier of the fifth configuration data and the fifth configuration data, where the merging operation is used to modify the sixth configuration data in the network element to the first Five configuration data.
  • the merge operation second operation instruction acquisition subunit is specifically used to:
  • the operation type of the second operation instruction includes a deletion operation
  • the operation data of the second operation instruction includes an identifier of the seventh configuration data and the seventh configuration data, where the deletion operation is used to delete the network element
  • the identifier of the seventh configuration data and the seventh configuration data stored in the storage.
  • the second operation instruction determining unit is specifically configured to:
  • the operation type of the first operation instruction includes the replacement operation, acquiring original configuration data of the network element corresponding to the southbound message, and determining that the operation type of the second operation instruction is an alternative operation,
  • the operation data of the second operation instruction includes the original configuration data, and the replacement operation is used to replace the configuration data stored in the network element with the original configuration data.
  • the second operation instruction determining unit is specifically configured to:
  • the new operation is used to store operation data of the newly added operation in the network element.
  • the second operation instruction determining unit is specifically configured to:
  • the deleting operation is used to delete operation data of the newly added operation stored in the network element.
  • the device further includes:
  • the processing result obtaining unit is configured to sequentially send the southbound message in the southbound message sequence to the corresponding network element according to the sequence of the southbound message sequence, and obtain the network element for the southbound report The processing result of the text;
  • the reverse operation packet issuance unit is configured to: if the processing result of any one of the southbound packets is a processing failure, send the corresponding reverse operation to the successfully processed network element according to the reverse sequence of the southbound message sequence Message.
  • a still further aspect of the present application provides a packet generating device, where the device includes: a processor and a memory;
  • the memory is configured to store an instruction
  • the processor is configured to execute the instruction in the memory to perform the method described in the above aspects.
  • Yet another aspect of the present application provides a computer readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the methods described in the various aspects above.
  • Yet another aspect of the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the methods described in the various aspects above.
  • the method for generating a packet and the related device first obtain a northbound request sent by the service server, and generate at least one southbound message according to the northbound request to form a southbound message.
  • the sequence, each southbound message includes a first operation instruction, and the first operation instruction is used to indicate that the configuration data of the network element corresponding to the southbound message is updated.
  • the operation type and operation data of the reverse operation instruction of the first operation instruction that is, the operation type of the second operation instruction and the operation data of the second operation instruction, and the second, may be determined according to the first operation instruction, respectively.
  • the operation instruction is a reverse operation instruction of the first operation instruction, and is used to restore the configuration data of the network element updated by the first operation instruction to the state before the update.
  • an inverse operation message is generated according to the operation type of the second operation instruction and the operation data of the second operation instruction.
  • FIG. 1 is a schematic diagram of a system for parameter configuration in an embodiment of the present application
  • FIG. 2 is a flowchart of a method for generating a packet according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a merge operation in an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a deletion operation in an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a new operation in the embodiment of the present application.
  • FIG. 7 is a schematic diagram of a southbound message sequence and an inverse operation message sequence in the embodiment of the present application.
  • FIG. 8 is a schematic diagram of a method for determining a second operation instruction by comparing configuration data in an embodiment of the present application
  • FIG. 9 is a schematic diagram of another method for determining a second operation instruction by comparing configuration data in an embodiment of the present application.
  • FIG. 10 is a schematic diagram of another method for determining a second operation instruction by comparing configuration data in an embodiment of the present application.
  • FIG. 11 is a schematic diagram of a method for determining a second operation instruction corresponding to a merge operation according to an embodiment of the present application
  • FIG. 12 is a schematic diagram of another method for determining a second operation instruction corresponding to a merge operation according to an embodiment of the present application.
  • FIG. 13 is a schematic diagram of another method for determining a second operation instruction corresponding to a merge operation according to an embodiment of the present application
  • FIG. 14 is a schematic diagram of a method for determining a second operation instruction corresponding to an alternate operation according to an embodiment of the present application
  • FIG. 15 is a schematic diagram of another method for determining a second operation instruction corresponding to an alternate operation in the embodiment of the present application.
  • FIG. 16 is a schematic diagram of a method for determining a second operation instruction corresponding to a deletion operation according to an embodiment of the present application
  • FIG. 17 is a schematic diagram of a method for determining a second operation instruction corresponding to a new operation according to an embodiment of the present application.
  • FIG. 18 is a schematic structural diagram of a device for generating a message according to an embodiment of the present application.
  • FIG. 19 is a schematic structural diagram of an apparatus for performing a method for generating a packet according to an embodiment of the present disclosure.
  • the embodiment of the present invention provides a method for generating a packet and a related device, which are used to generate an inverse operation message for restoring the configuration data of the network element to the state before the update in the NMS or the SDN controller, thereby improving development efficiency and improving accuracy.
  • a schematic diagram of a system configured for parameters includes a service server 101, an NMS or SDN controller 102, and a network element 103.
  • the service server 101 can interact with the user, that is, the user can send a command to the service server through the interaction interface, and the service server can generate a corresponding northbound request after receiving the command.
  • the NMS is a network management system, which can be used to manage networks of different regions and different equipment providers to implement alarm, configuration, security, and billing functions.
  • the SDN controller is a control in a software-defined network.
  • Network element 103 is typically a switch.
  • the service server 101 is also connected to the northbound interface of the NMS or SDN controller 102, through which the northbound request is sent to the NMS or SDN controller 102.
  • the network element 103 is connected to the southbound interface of the NMS or the SDN controller 102, and can obtain the southbound message through the southbound interface.
  • the NMS or SDN controller 102 includes a northbound request processing module 1021 and a southbound request processing module 1022.
  • the northbound request processing module 1021 includes a northbound request receiving module 10211, a northbound request analysis module 10212, and a southbound requesting orchestration module 10213.
  • the northbound request receiving module 10211 obtains the northbound request from the service server 101 through the northbound interface.
  • the northbound request may be a request to update configuration data stored in the network element 103. Updates here can include additions, modifications, and/or deletions.
  • the northbound request analysis module 10212 is configured to analyze the northbound request, for example, to determine whether the northbound request is valid, and the northbound request is legal. After determining that the northbound request is legal, the northbound request may determine the network element involved in the northbound request according to the type of the northbound request. Corresponding to the specific operation of each network element.
  • the southbound requesting module 10213 can arrange the northbound request into a southbound request corresponding to the network element according to the unified model according to the analysis result of the northbound request analyzing module 10212.
  • the southbound request processing module 1022 includes a southbound message construction module 10221 and a southbound message sending module 10222.
  • the southbound message construction module 10221 constructs the southbound request into a corresponding southbound message according to the southbound protocol corresponding to the network element, and forms a southbound message sequence according to a certain order; the southbound message sending module
  • the southbound interface of the NMS or the SDN controller 102 delivers each southbound message in the southbound message sequence to each network element 103.
  • the configuration data is stored in the network element 103, and the corresponding configuration data is updated according to the received southbound message, and the parameter configuration of the network element is completed.
  • the southbound packet sent to the NE is a southbound packet generated by the same northbound request, if one or more of the southbound packets are not processed successfully, for example, the southbound packet is unsuccessfully delivered, or If the configuration data of the NE is not successfully updated according to the southbound packet, the configuration of the northbound request is unsuccessful.
  • the configuration data updated by the southbound packet in the NE can be restored to the pre-update state. Execute the northbound request.
  • the conventional technology restores the configuration data to the state before the update by performing an inverse operation on the updated configuration data in the network element, and the reverse operation message used to indicate that the reverse operation is performed is manually written, and usually requires technology.
  • the personnel finds the operation type and operation data corresponding to each network element, determines the operation type and operation data of the reverse operation that needs to be performed before the updated configuration data is restored, and manually generates the reverse operation message. This way of generating reverse-message messages not only makes development inefficient, but also makes it easy to make mistakes by manual writing.
  • the embodiment of the present application provides a method for generating a packet, which can automatically generate a reverse operation message corresponding to the southbound message.
  • the northbound request sent by the service server may be obtained first, and the southbound message sequence is generated according to the northbound request. Determining, according to the first operation instruction included in the southbound message, an operation type and operation data of the corresponding second operation instruction, where the first operation instruction is a network element corresponding to the southbound message
  • the configuration data is updated to be an instruction, and the second operation instruction is a reverse operation instruction of the first operation instruction.
  • an inverse operation message is generated according to the operation type of the second operation instruction and the operation data of the second instruction.
  • the network element configuration data may be restored by sending the corresponding reverse operation packet to the successfully processed network element, even if the updated operation of the network element is indicated by the first operation instruction.
  • the configuration data is restored to the pre-update state, which improves development efficiency and improves the accuracy of configuration data updates.
  • FIG. 2 is a flowchart of a method for generating a packet according to an embodiment of the present application.
  • the method may be applied to an NMS or an SDN controller. Specifically, the method may include the following steps:
  • the obtained northbound request may be analyzed to determine the type of the northbound request, the network element involved, and the operation of each corresponding network element, according to the analysis result.
  • a southbound request sequence can be generated, and a southbound message sequence can be constructed according to the southbound request sequence and the southbound protocol. Since the northbound request involves at least one network element, the corresponding southbound message sequence includes at least one southbound message.
  • the southbound message sequence is a sequence of at least one southbound message formed in a particular order.
  • the southbound packet can be sent to the corresponding NE through the southbound interface. When a southbound packet is sent to each network element, it is usually sent in the order of the southbound message sequence.
  • Each of the network elements may correspond to at least one southbound message, and the plurality of southbound packets corresponding to the same network element may have a certain dependency relationship, or may be independent of each other, and is not limited herein.
  • the meaning of the dependency is that a southbound message needs to be executed first, and another southbound message is executed based on the execution result.
  • each southbound message includes a first operation instruction
  • the first operation instruction is an instruction to update configuration data of the network element corresponding to the southbound message, for example, the first operation instruction may indicate the network element. Delete, add, and/or modify one or several configuration data.
  • the southbound packet can be sent to the corresponding network element.
  • the network element can perform the southbound packet.
  • the first operation instruction updates the configuration data in the network element according to the first operation instruction in the southbound message.
  • the network element configuration data before the update is referred to as the original configuration data; the updated network element configuration data is referred to as the target configuration data.
  • the first operation instruction is used to indicate that the original configuration data A is updated to the target configuration data B
  • the corresponding second operation instruction is used to indicate that the target configuration data B generated by executing the first operation instruction is restored to the pre-update state.
  • Raw configuration data A is used to indicate that the original configuration data A is updated to the target configuration data B
  • the corresponding second operation instruction is used to indicate that the target configuration data B generated by executing the first operation instruction is restored to the pre-update state.
  • the operation type of the first operation instruction may include at least one of a plurality of operations such as a merge operation, an alternate operation, a delete operation, and a new operation.
  • the operation data of the first operation instruction, the original configuration data, and the target configuration data may carry a data identifier.
  • the operation type and operation data of the first operation instruction are exemplified below.
  • the merging operation instructs the configuration data of the network element to be merged with the operation data of the first operation instruction, that is, the configuration data existing in the operation data of the first operation instruction but not existing in the original configuration data is added, and/or the original configuration is The data is modified to the operational data of the first operational instruction.
  • it may be determined whether the data operation identifier of the operation data of the first operation instruction is the same as the data identifier of the original configuration data, and whether the physical operation of the merge operation is a new operation or a modification operation.
  • the configuration data of the first operation instruction includes the configuration data m with the data identifier n
  • the original configuration data includes the configuration data k with the data identifier n
  • the configuration data m is different from the configuration data k
  • the configuration data is configured by the merge operation. If the configuration data m is obtained, the configuration data is obtained. If the data identifier n does not exist in the original configuration data, and the configuration data m with the data identifier n is not present, the configuration data m with the data identifier n is added by the merge operation. And the data identifier n carried by it, and the target configuration data is obtained.
  • the figure is a schematic diagram of updating the original configuration data 301 of the network element to the target configuration data 303 according to the operation data 302 of the first operation instruction.
  • the original configuration data 301 of the network element, the operation data 302 of the first operation instruction, and the target configuration data 303 are all presented in a tree structure.
  • the above three kinds of data are presented in a tree structure. , no longer repeat the instructions.
  • the original configuration data 301 of the network element has a root node of the tree structure a and three sub-nodes a1, a2, and a3. For convenience of description, /a/a1, /a/a2, and /a/a3 may be used. It is indicated that there are two second-level sub-nodes a11 and a12 under the a1 node, which can be represented by /a/a1/a11 and /a/a1/a12 for convenience of explanation.
  • the operation data 302 of the first operation instruction has a root node of a tree structure and a sub-nodes a1, a2' and a4, which can be represented by /a/a1, /a/a2' and /a/a3, a1.
  • second-level sub-nodes a11' and a13 under the node which can be /a/a1/a11' and /a/a1/a12, where /a/a2' is the same as /a/a2 with the same data identifier.
  • the configuration data, /a/a1/a11', is different configuration data with the same data identifier as /a/a1/a11.
  • the operation type of the first operation instruction is a merge operation.
  • the operation data 302 of the first operation instruction and the original configuration data 301 of the network element are compared, and it is determined that the /a/a4 and /a/a1/a13 of the operation data 302 of the first operation instruction do not exist in the original configuration data 301, but exist Different configuration data /a/a2 having the same data identification as /a/a2', and different configuration data /a/a1/a11 having the same data identification as /a/a1/a11', thus the first operation instruction
  • the execution process is such that /a/a4 and /a/a1/a13 are added, and the /a/a2 and /a/a1/a11 correspondences are modified to /a/a2' and /a/a1/a11'.
  • the target configuration data 303 can be obtained, and the root node of the tree structure is a, and there are four child nodes a1, a2', a3, and a4, wherein there are three levels under a1.
  • the child nodes a11', a12, and a13 complete the merging of the original configuration data 301 with the operation data 302 of the first operation instruction.
  • the replacement operation instruction replaces the original configuration data of the network element with the operation data of the first operation instruction.
  • the network element may execute the first operation instruction to replace the operation data of the first operation instruction with the original configuration data of the network element.
  • the figure is a schematic diagram of modifying the original configuration data 401 of the network element to the target configuration data 403 according to the operation data 402 of the first operation instruction.
  • the original configuration data 401 of the network element includes /a/a1/a11, /a/a1/a12, /a/a2, and /a/a3;
  • the operation data 402 of the first operation instruction includes /a/a1 /a11', /a/a1/a13, /a/a2' and /a/a4.
  • /a/a1/a11' and /a/a1/a11 are different configuration data with the same data identifier
  • /a/a2' and /a/a2 are different configuration data with the same data identifier.
  • the original configuration data 401 can be replaced with the operation data 402 of the first operation instruction by executing the first operation instruction, that is, the target configuration data 403 includes /a/a1/a11'. , /a/a1/a13, /a/a2' and /a/a4.
  • the essence of the above alternative operation is to modify /a/a1/a11 in the original configuration data to /a/a1/a11', delete /a/a1/a12 in the original configuration data, and add configuration data /a/a1 /a13, /a/a2 in the original configuration data is modified to /a/a2', the configuration data /a/a3 is deleted, and the configuration data /a/a is added.
  • the deletion operation indicates that the same configuration data as the operation data of the first operation instruction in the original configuration data of the network element is deleted.
  • the figure is a schematic diagram of modifying the original configuration data 501 of the network element to the target configuration data 503 according to the operation data 502 of the first operation instruction.
  • the original configuration data 501 of the network element, the root node is a, and there are three child nodes a1, a2, and a3, wherein there are two second-level child nodes a11 and a12 under a1. That is, the original configuration data 501 includes configuration data /a/a1/a11, /a/a1/a12, /a/a2, and /a/a3.
  • the operation type of the first operation instruction is a delete operation, and the operation data 502 of the first operation instruction includes /a/a1/a12.
  • the original configuration data 501 of the network element is updated according to the first operation instruction, that is, the secondary node a12 is deleted, and the obtained target configuration data 503 includes /a/a1/a11, /a/a2, and /a/a3.
  • the new operation instruction adds the operation data of the first operation instruction to the configuration data of the network element.
  • the figure is a schematic diagram of modifying the original configuration data 601 of the network element to the target configuration data 603 according to the operation data 602 of the first operation instruction.
  • the original configuration data 601 of the network element has a root node a, three sub-nodes a1, a2, and a3, and two second-level sub-nodes a11 and a12 under the a1 node. That is, the original configuration data 601 includes /a/a1/a11, /a/a1/a12, /a/a2, and /a/a3.
  • the operation type of the first operation instruction is a new operation, and the operation data 602 of the first operation instruction includes /a/a1/a13.
  • the original configuration data 601 of the network element is updated according to the first operation instruction, that is, the secondary node a13 under the primary node a1 is newly added, and the obtained target configuration data 603 includes /a/a1/a11 and /a/a1/a12. , /a/a1/a13, /a/a2, and /a/a3.
  • S202 Determine, for each southbound message, an operation type of the second operation instruction and operation data of the second operation instruction according to the first operation instruction.
  • the operation type of the second operation instruction and the operation data of the second operation instruction may be determined according to the first operation instruction.
  • the second operation instruction is a reverse operation instruction of the first operation instruction
  • the reverse operation in the reverse operation instruction is an operation capable of restoring the network element configuration data updated by the first operation instruction to the state before the update.
  • two types of determining the operation type of the second operation instruction and the operation data of the second operation instruction according to the first operation instruction are provided.
  • the two methods do not constitute a limitation on the present application.
  • the method for determining the operation type of the second operation instruction and the operation data of the second operation instruction may be specifically: the NMS or the SDN controller acquires the original configuration data of the network element corresponding to the southbound message, Performing a first operation instruction on the original configuration data to generate target configuration data, and comparing the original configuration data with the target configuration data to obtain an operation type of the second operation instruction and operation data of the second operation instruction.
  • the original configuration data of the network element corresponding to the southbound packet is obtained.
  • the original configuration data obtaining request is sent by the NMS or the SDN controller to the southbound packet corresponding network element, and the network element receives the original configuration data obtaining request. Thereafter, the original configuration data stored in the network element is sent to the NMS or SDN controller.
  • the target configuration data generated by executing the first operation instruction is compared with the original configuration data to determine the target relative to the original configuration data.
  • the configuration data is to increase the configuration data, reduce the configuration data, or modify the configuration data, thereby determining the operation type and operation data of the corresponding second operation instruction according to the specific situation.
  • the operation type of the second operation instruction corresponding to the first operation instruction and the operation of the second operation instruction may be directly determined according to the operation type of the first operation instruction and the operation data of the first operation instruction. data.
  • the operation type of the first operation instruction is a delete operation
  • the operation type of the second operation instruction may be a new operation
  • the operation data of the second operation instruction is the same as the operation data of the first operation instruction
  • the operation type is a new operation
  • the operation type of the second operation instruction may be a deletion operation
  • the operation data of the second operation instruction is the same as the operation data of the first operation instruction.
  • the operation type of the second operation instruction may be a merge operation and/or a delete operation, and the operation data may be determined according to the first operation instruction and the original configuration data.
  • the operation type of the first operation instruction is an alternative operation
  • the operation type of the second operation instruction may be one or more of an alternative operation, a merge operation, a delete operation, or a new operation, and the operation data may be according to the first operation.
  • it can also be based on the first operational command and the original configuration data.
  • the first operation instruction and the second operation instruction may include not only one operation type, but when the operation type and operation data of the second operation instruction are acquired, the specific operation may be performed one by one, for example, the first operation.
  • the instruction is used to delete the configuration data C, and at the same time, the configuration data D is added, and the corresponding second operation instruction can be used to add the configuration data C and delete the configuration data D at the same time.
  • the reverse operation message is a message for restoring the target configuration data to the original configuration data.
  • the reverse operation message is generated mainly to restore the target configuration data to the original configuration data when the processing result of the southbound message is a processing failure.
  • the generation time of the reverse operation message may be performed immediately after the southbound message is generated, and when the processing result of the southbound message is a processing failure, the network element that successfully executes the first operation instruction is executed.
  • the generated reverse operation message is sent to restore the configuration data.
  • the operation type of the second operation instruction and the operation data of the second operation instruction may be acquired, and when it is determined that the processing result of the southbound message is processing failure, The southbound packet is generated, and the generated reverse operation packet is sent to the network element that executes the first operation instruction to recover the network configuration data.
  • the processing result of the southbound packet by the network element may be a result of whether one or more of the processing of receiving the southbound packet, parsing the southbound packet, and executing the southbound packet is successful. If the failure to receive the southbound packet, the failure to resolve the southbound packet, or the failure to execute the first operation command in the southbound packet fails, the processing result of the southbound packet is considered to be processing failure; otherwise, the processing is considered successful.
  • the corresponding reverse operation packet is sent to the network element that is successfully processed.
  • the reverse operation message may be sent in reverse order of the southbound message sequence.
  • the reverse operation packet is sent in the reverse order of the southbound message sequence to ensure the correctness of data recovery.
  • the figure is a schematic diagram of a southbound message sequence and an inverse operation message sequence.
  • the southbound message forms a southbound message sequence
  • the reverse operation message forms an inverse operation message sequence.
  • the southbound message can be sent in the order of the southbound message sequence. Specifically, according to the southbound message 1
  • the order of the southbound message 2, the southbound message 3, ..., and the southbound message n is issued.
  • the process of sending a southbound packet after a southbound packet is sent and the processing result corresponding to the southbound packet is received, it is determined whether to issue the next southbound packet.
  • the processing result is successful, the next southbound packet is delivered; if the processing result is unsuccessful, the next southbound packet is not delivered, and the network corresponding to the successfully processed southbound packet is delivered.
  • the element sends an inverse operation message. For example, after the transmission of the southbound packet 5 is completed, the processing result of the southbound packet 5 is that the processing fails. At this time, the transmission of the southbound packet 6 and the subsequent southbound packet can be stopped, and the southbound packet 1 is sent.
  • the network element corresponding to the southbound message 2, the southbound message 3, and the southbound message 4 sends a corresponding reverse operation message, and the reverse operation message can be sent in the reverse order of the southbound message sequence, that is, according to the inverse
  • the reverse operation message is sequentially transmitted in the order of the operation message 4, the reverse operation message 3, the reverse operation message 2, and the reverse operation message 1.
  • the northbound request sent by the service server is first obtained, and the southbound message sequence is generated according to the northbound request, and each southbound message includes a first operation instruction, which is used for the network.
  • the element configuration data is updated, and then the operation type of the corresponding second operation instruction and the operation data of the second operation instruction may be determined for the first operation instruction of each southbound message, wherein the second operation instruction is the first operation
  • the reverse operation instruction of the instruction is used to restore the configuration data of the network element updated by the first operation instruction to the state before the update, and finally generate the reverse operation report according to the operation type of the second operation instruction and the operation data of the second operation instruction.
  • the first operation instruction of the southbound message automatically generates the reverse operation message corresponding to the first operation instruction, and does not require the participation of other service modules, and does not need to be manually written.
  • any one of the southbound messages is unsuccessfully processed
  • the reverse operation packet is sent, the network element configuration parameter is updated, so that the configuration data of the network element updated by the first operation instruction is restored to the state before the update, thereby improving development efficiency and improving data update accuracy. Sex.
  • the original configuration data and the target configuration data may be compared to determine an operation type of the second operation instruction that restores the target configuration data to the original configuration data and operation data of the second operation instruction.
  • the original configuration data includes an identifier of the first configuration data and the first configuration data
  • the target configuration data includes an identifier of the second configuration data and the second configuration data. Comparing the original configuration data with the target configuration data, if the comparison result is that the configuration identifier of the first configuration data is the same as the configuration identifier of the second configuration data, and the first configuration data and the second configuration data are different, The network element needs to modify the first configuration data to the second configuration data according to the first operation instruction.
  • the second operation instruction is to modify the second configuration data in the network element target configuration data to the first configuration data
  • the operation type of the second operation instruction is a merge operation
  • the operation data of the second operation instruction includes the An identification of the configuration data and the first configuration data.
  • the figure is a schematic diagram of determining operation data 803 of the second operation instruction according to the original configuration data 801 and the target configuration data 802.
  • the original configuration data 801 of the network element has a root node a, three sub-nodes a1, a2, and a3, and two second-level sub-nodes a11 and a12 under the a1 node.
  • the target configuration data 802 of the network element is that the root node is a, there are three child nodes a1, a2', and a3, and there are two second-level child nodes a11' and a12 under the a1 node.
  • the second operation instruction functions to modify /a/a1/a11' in the target configuration data 802 to /a/a1/a11 and /a/a2' to /a/a2, thus the second operation instruction
  • the operation type may be a merge operation, and the operation data 803 of the second operation instruction includes /a/a1/a11 and /a/a2.
  • the operation type of the second operation instruction may also be a deletion operation and a new operation, for example, deleting /a/a1/a11' and /a/a2', and adding /a/a1/a11 and /a/a2, That is, the operation data corresponding to the deletion operation is /a/a1/a11' and /a/a2', and the operation data corresponding to the new operation is /a/a1/a11 and /a/a2, which can be implemented in the same manner as the above-mentioned merge operation. effect.
  • the comparison result of the original configuration data and the target configuration data is, the original configuration data includes an identifier of the third configuration data and the third configuration data, and the third configuration data does not exist in the target configuration data.
  • the network element may be configured to delete the identifiers of the third configuration data and the third configuration data according to the first operation instruction, and the second operation instruction may be confirmed to be in the network element target configuration data.
  • the identifier of the third configuration data and the third configuration data is stored, and the operation type of the second operation instruction may be a new operation, and the operation data of the second operation instruction includes an identifier of the third configuration data and the third configuration data.
  • the figure is a schematic diagram of determining operation data 903 of the second operation instruction according to the original configuration data 901 and the target configuration data 902.
  • the original configuration data 901 of the network element includes /a/a1/a11, /a/a1/a12, /a/a2, and /a/a3, and the target configuration data 902 exists in the original configuration data 901 except /a.
  • Other configuration data other than /a1/a12, that is, the target configuration data 902 is obtained by deleting /a/a1/a12 in the original configuration data 901, so it can be determined that the second operation instruction functions to add /a to the target configuration data 902. /a1/a12, so the operation type of the second operation instruction may be a new operation, and the operation data 903 of the second operation instruction includes /a/a1/a12.
  • the operation type of the second operation instruction may also be a merge operation
  • the operation data of the second operation instruction includes the identifiers of the third configuration data and the third configuration data, for example, including /a/a1/a12, that is, /a/a1/ A12 is merged with the target configuration data 902 to obtain the original configuration data 901.
  • the network element may be configured to add the fourth configuration data and the fourth configuration data identifier according to the first operation instruction, and the second operation instruction may be used to delete the network element target configuration data.
  • the operation type of the second operation instruction may be a deletion operation, and the operation data of the second operation instruction includes the identification of the fourth configuration data and the fourth configuration data.
  • the figure is a schematic diagram of determining operation data 1003 of the second operation instruction according to the original configuration data 1001 and the target configuration data 1002.
  • the original configuration data 1001 includes /a/a1/a11, /a/a1/a12, /a/a2, and /a/a3, and the target configuration data 1002 not only has all the configuration data in the original configuration data 1001,
  • configuration data /a/a1/a13 that does not exist in the original configuration data 1001, that is, the target configuration data 1002 is obtained by adding /a/a1/a13 to the original configuration data 1001, so that the role of the second operation instruction can be determined.
  • the operation type of the second operation instruction may be a deletion operation
  • the operation data 1003 of the second operation instruction is /a/a1/a13.
  • the role of the second operation instruction may be determined according to the comparison result, thereby directly determining the operation type and the second operation of the second operation instruction.
  • the operation data of the instruction thereby improving the efficiency of generating the reverse operation message.
  • the operation type and the operation data of the first operation instruction may also be directly used, for example, according to the first operation instruction, the combination, the substitution, the deletion, and the new One or more types of operations to determine an operation type of the second operation instruction corresponding to the first operation instruction and operation data of the second operation instruction, for example, the reverse operation of the merge operation may be a merge operation and/or deletion
  • the reverse operation of the substitute operation may be one or more of an alternative operation, a merge operation, a delete operation, or a new operation.
  • the reverse operation of the delete operation is a new operation
  • the reverse operation of the new operation is a delete operation.
  • the operation type of the second operation instruction corresponding to the merge operation may be a merge operation, a deletion operation, or a combination of a merge operation and a delete operation.
  • the operation data of the original configuration data and the merge operation may be used. determine.
  • the operation data of the second operation instruction may be correspondingly determined according to the original configuration data and the operation data of the merge operation.
  • the original configuration data of the network element corresponding to the acquired southbound packet includes the identifier of the fifth configuration data and the fifth configuration data, where the first operation instruction is a merge operation, and the operation data of the merge operation includes the sixth configuration data and The identification of the sixth configuration data. If the identifier of the fifth configuration data and the identifier of the sixth configuration data are the same, and the fifth configuration data and the sixth configuration data are different, the first operation instruction is configured to instruct the network element to modify the fifth configuration data to the sixth configuration data.
  • the second operation instruction is to modify the sixth configuration data in the network element target configuration data to the fifth configuration data
  • the operation type of the second operation instruction is a merge operation
  • the operation data of the second operation instruction is The identification of the five configuration data and the fifth configuration data.
  • the figure is a schematic diagram of determining the second operation instruction 1103 according to the original configuration data 1101 and the operation data 1102 of the first operation instruction.
  • the original configuration data 1101 of the network element includes /a/a1/a11
  • the operation type of the first operation instruction is a merge operation
  • the operation data 1102 of the merge operation includes /a/a1/a11', where / a/a1/a11' is a different configuration data having the same data identifier as /a/a1/a11
  • the first operation instruction is instructed to indicate that the network element modifies /a/a1/a11 to /a/a1/a11'
  • the second operation instruction is used to modify /a/a1/a11' to /a/a1/a11
  • the operation type of the second operation instruction is a merge operation
  • the operation data of the second operation instruction is 1103:/a /a1/a11.
  • the operation type of the second operation instruction may also be a deletion operation and a new operation, for example, deleting /a/a1/a11', and adding /a/a1/a11, that is, the operation data corresponding to the deletion operation is /a/ A1/a11', the operation data corresponding to the newly added operation is /a/a1/a11, which can achieve the same effect as the above merge operation.
  • the operation data of the merge operation includes the identifiers of the seventh configuration data and the seventh configuration data, and the seventh configuration data and the seventh configuration data are not present in the original configuration data.
  • the identifier of the first operation instruction is that the network element adds the identifier of the seventh configuration data and the seventh configuration data to the original configuration data.
  • the second operation instruction is used to delete the storage in the target configuration data of the network element.
  • the identifier of the seventh configuration data and the seventh configuration data is a deletion operation, and the operation data of the second operation instruction includes an identifier of the seventh configuration data and the seventh configuration data.
  • the figure is a schematic diagram of determining the second operation instruction 1203 according to the original configuration data 1201 and the operation data 1202 of the first operation instruction.
  • the operation type of the first operation instruction is a merge operation
  • the operation data 1202 of the merge operation is: /a/a1/a13
  • /a/a1/a13 does not exist in the original configuration data 1201
  • the first operation instruction instructs the network element to add /a/a1/a13 to the original configuration data 1201.
  • the second operation instruction is used to delete /a/a1/a13, and the operation type of the second operation instruction is deleted.
  • the operation data 1203 of the second operation instruction is: /a/a1/a13.
  • the operation type of the first operation instruction is a merge operation, and the operation data of the merge operation includes an identifier of the sixth configuration data and the sixth configuration data, and an identifier of the seventh configuration data and the seventh configuration data. If the identifier of the fifth configuration data and the identifier of the sixth configuration data are the same, and the fifth configuration data and the sixth configuration data are different, the first operation instruction is configured to instruct the network element to modify the fifth configuration data to the sixth configuration data. And adding the identification of the seventh configuration data and the seventh configuration data.
  • the second operation instruction is used to modify the sixth configuration data to the fifth configuration data, and delete the identifiers of the seventh configuration data and the seventh configuration data
  • the operation type of the second operation instruction is a merge operation and a delete operation.
  • the operation data of the merge operation is an identifier of the fifth configuration data and the fifth configuration data
  • the operation data of the deletion operation is an identifier of the seventh configuration data and the seventh configuration data.
  • the figure is a schematic diagram of determining the second operation instruction 1303 according to the original configuration data 1301 and the operation data 1302 of the first operation instruction.
  • the original configuration data 1301 has a root node a, a lower three sub-nodes a1, a2, and a3, and an a1 node has two second-level sub-nodes a11 and a12.
  • the first operation instruction is a merge operation
  • the operation data 1302 of the merge operation is: /a/a2', /a/a4, /a/a1/a11', and /a/a1/a13, where /a/a1/ A11' is a different configuration data with /a/a1/a11 having the same data identification, /a/a2' is and /a/a2 is different configuration data having the same data identification.
  • the second operation instruction is used to modify the target configuration data /a/a1/a11' to /a/a1/a11, /a/a2' to /a/a2, delete /a /a1/a13 and /a/a4,
  • the operation type of the second operation instruction is a merge operation and a delete operation
  • the operation data 1303 corresponding to the merge operation is /a/a1/a11 and /a/a2
  • the operation data corresponding to the delete operation is 1304 is /a/a1/a13
  • the operation data 1305 corresponding to the deletion operation is /a/a4.
  • the operation type of the first operation instruction includes an alternative operation
  • acquiring original configuration data of the network element corresponding to the southbound message and determining that the operation type of the second operation instruction is an alternative operation
  • the operation data of the second operation instruction includes original configuration data
  • the replacement operation is used to replace the configuration data stored in the network element with the original configuration data.
  • the figure is a schematic diagram of determining the second operation instruction 1403 according to the original configuration data 1401 and the operation data 1402 of the first operation instruction.
  • the operation type of the first operation instruction includes an alternative operation
  • the operation data of the first operation instruction is 1402
  • the operation type of the second operation instruction is an alternative operation
  • the operation data 1403 of the second operation instruction is the original configuration data. 1401, used to restore target configuration data to original configuration data 1401.
  • the data change caused by the replacement operation may be analyzed according to the original configuration data and the operation data of the first operation instruction, and the original configuration data 1501 and the first operation instruction 1502 of FIG. 15 may be determined.
  • An operation instruction instructs the network element to modify /a/a1/a11 to /a/a1/a11', /a/a2 to /a/a2', and add /a/a1/a13 and /a/a4, Therefore, the corresponding inverse operation can be used to modify /a/a1/a11' to /a/a1/a11, /a/a2' to /a/a2, and /a/a1/a13 and /a/a4.
  • the reverse operation of the substitute operation may be a merge operation and a delete operation.
  • the operation data 1503 of the merge operation is /a/a1/a11 and /a/a2
  • the operation data 1504 of the delete operation is /a/a1/a13
  • the operation data 1505 of the delete operation is /a/a4.
  • the operation type of the first operation instruction includes a deletion operation
  • determining that the operation type of the second operation instruction is a new operation and the operation data of the second operation instruction includes operation data of the newly added operation.
  • the new operation is used to store the operation data of the newly added operation in the network element.
  • the operation type of the first operation instruction is a deletion operation, and therefore the second operation instruction may be directly determined according to the first operation instruction, without acquiring the original configuration data, and does not affect the implementation of the embodiment of the present application.
  • the figure is a schematic diagram of determining the second operation instruction 1602 according to the operation data 1601 of the first operation instruction.
  • the operation type of the first operation instruction is a deletion operation
  • the operation data 1601 of the first operation instruction is: /a/a1/a12
  • the operation type of the second operation instruction is a new operation
  • the new operation The operation data 1602 is the same as the operation data 1601 of the first operation instruction, that is, /a/a1/a12.
  • the operation type of the second operation instruction may also be a merge operation, and the operation data of the second operation instruction is the same as the operation data of the first operation instruction, for example, including /a/a1/a12, that is, /a/a1/a12 and the target The configuration data is merged to restore the target configuration data to the original configuration data.
  • the operation type of the first operation instruction includes a new operation
  • determining that the operation type of the second operation instruction is a deletion operation and the operation data of the second operation instruction includes the operation data of the newly added operation.
  • the delete operation is used to delete the operation data of the newly added operation stored in the network element.
  • the operation type of the first operation instruction is a deletion operation, and therefore the second operation instruction may be directly determined according to the first operation instruction, without acquiring the original configuration data, and does not affect the implementation of the embodiment of the present application.
  • the figure is a schematic diagram of determining the second operation instruction 1702 according to the operation data 1701 of the first operation instruction.
  • the operation type of the first operation instruction is a new operation
  • the operation data 1701 of the first operation instruction is: /a/a1/a13
  • the operation type of the second operation instruction is a deletion operation, and the deletion operation is performed.
  • the operation data 1702 is the same as the operation data 1701 of the first operation instruction, that is, /a/a1/a13.
  • the device 1800 for generating a message specifically corresponds to the function of the method for generating the message provided above.
  • the functions can be implemented in hardware or in hardware by executing the corresponding software.
  • the hardware or software includes one or more units corresponding to the functions described above, which may be software and/or hardware.
  • the apparatus 1800 can include:
  • the southbound message sequence generating unit 1801 is configured to obtain a northbound request sent by the service server, and generate a southbound message sequence according to the northbound request, where the southbound message sequence includes at least one southbound message, each of the The southbound message includes a first operation instruction, where the first operation instruction is an instruction to update configuration data of the network element corresponding to the southbound message;
  • the second operation instruction determining unit 1802 is configured to determine, according to the first operation instruction, operation type of the second operation instruction and operation data of the second operation instruction, respectively, for each of the southbound messages,
  • the second operation instruction is a reverse operation instruction of the first operation instruction
  • the reverse operation message generating unit 1803 is configured to generate an inverse operation message according to the operation type of the second operation instruction and the operation data of the second operation instruction.
  • the second operation instruction determining unit includes:
  • the original configuration data acquiring sub-unit is configured to obtain original configuration data of the network element corresponding to the southbound message
  • a target configuration data generating subunit configured to execute the first operation instruction on the original configuration data to generate target configuration data
  • the second operation instruction determining subunit is configured to compare the original configuration data and the target configuration data to obtain an operation type of the second operation instruction and operation data of the second operation instruction.
  • the original configuration data includes identifiers of the first configuration data and the first configuration data, where the target configuration data includes identifiers of the second configuration data and the second configuration data;
  • the second operation instruction determining subunit is specifically configured to:
  • the configuration identifier of the first configuration data is the same as the configuration identifier of the second configuration data, and the first configuration data is different from the second configuration data, confirming that the operation type of the second operation instruction includes a merging operation, the operation data of the second operation instruction includes an identifier of the first configuration data and the first configuration data, and the merging operation is used to modify the second configuration data in the network element to The first configuration data is described.
  • the second operation instruction determining subunit is specifically configured to:
  • the original configuration data includes the identifiers of the third configuration data and the third configuration data, and the identifiers of the third configuration data and the third configuration data do not exist in the target configuration data, confirm the The operation type of the second operation instruction includes a new operation, the operation data of the second operation instruction includes an identifier of the third configuration data and the third configuration data, and the new operation is used to store the third The identification of the configuration data and the third configuration data.
  • the second operation instruction determining subunit is specifically configured to:
  • the operation type of the second operation instruction includes a deletion operation
  • the operation data of the second operation instruction includes an identifier of the fourth configuration data and the fourth configuration data
  • the deletion operation is used to delete the storage in the network element The fourth configuration data and the identifier of the fourth configuration data.
  • the operation type of the first operation instruction includes at least one of the following:
  • the second operation instruction determining subunit includes:
  • a merge operation original configuration data acquisition subunit configured to acquire original configuration data of the network element corresponding to the southbound message if the operation type of the first operation instruction includes a merge operation
  • the merging operation second operation instruction acquiring subunit is configured to confirm the operation type of the second operation instruction and the operation data of the second operation instruction according to the original configuration data and the operation data of the merging operation.
  • the original configuration data includes an identifier of the fifth configuration data and the fifth configuration data
  • the operation data of the merge operation includes an identifier of the sixth configuration data and the sixth configuration data
  • the merge operation second operation instruction acquisition subunit is specifically configured to:
  • the operation type of the second operation instruction includes a merge operation
  • the operation data of the second operation instruction includes an identifier of the fifth configuration data and the fifth configuration data, where the merging operation is used to modify the sixth configuration data in the network element to the first Five configuration data.
  • the merging operation second operation instruction acquiring subunit is specifically configured to:
  • the operation type of the second operation instruction includes a deletion operation
  • the operation data of the second operation instruction includes an identifier of the seventh configuration data and the seventh configuration data, where the deletion operation is used to delete the network element
  • the identifier of the seventh configuration data and the seventh configuration data stored in the storage.
  • the second operation instruction determining subunit is specifically configured to:
  • the operation type of the first operation instruction includes the replacement operation, acquiring original configuration data of the network element corresponding to the southbound message, and determining that the operation type of the second operation instruction is an alternative operation,
  • the operation data of the second operation instruction includes the original configuration data, and the replacement operation is used to replace the configuration data stored in the network element with the original configuration data.
  • the second operation instruction determining subunit is specifically configured to:
  • the new operation is used to store operation data of the newly added operation in the network element.
  • the second operation instruction determining subunit is specifically configured to:
  • the deleting operation is used to delete operation data of the newly added operation stored in the network element.
  • the device 1800 further includes:
  • the processing result obtaining unit is configured to sequentially send the southbound message in the southbound message sequence to the corresponding network element according to the sequence of the southbound message sequence, and obtain the network element for the southbound report The processing result of the text;
  • the reverse operation packet issuance unit is configured to: if the processing result of any one of the southbound packets is a processing failure, send the corresponding reverse operation to the successfully processed network element according to the reverse sequence of the southbound message sequence Message.
  • the device 1900 for message generation includes:
  • the receiver 1901, the transmitter 1902, the processor 1903, and the memory 1904 (wherein the number of processors 1903 in the device 1900 in which the message is generated may be one or more, exemplified by one processor in Fig. 19).
  • the receiver 1901, the transmitter 1902, the processor 1903, and the memory 1904 may be connected by a bus or other means, wherein the bus connection is taken as an example in FIG.
  • Memory 1904 can include read only memory and random access memory and provides instructions and data to processor 1903. A portion of the memory 1904 may also include an NVRAM.
  • the memory 1904 stores operating systems and operational instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, wherein the operational instructions can include various operational instructions for implementing various operations.
  • the operating system can include a variety of system programs for implementing various basic services and handling hardware-based tasks.
  • the processor 1903 controls the operation of the terminal device, and the processor 1903 may also be referred to as a CPU.
  • each component of the device for generating a message is coupled together by a bus system.
  • the bus system may include a power bus, a control bus, and a status signal bus in addition to the data bus.
  • the various buses are referred to as bus systems in the figures.
  • the method disclosed in the foregoing embodiment of the present application may be applied to the processor 1903 or implemented by the processor 1903.
  • the processor 1903 can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 1903 or an instruction in a form of software.
  • the processor 1903 described above may be a general purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component.
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly implemented by the hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in memory 1904, and processor 1903 reads the information in memory 1904 and, in conjunction with its hardware, performs the steps of the above method.
  • the receiver 1901 can be configured to receive input digital or character information, and generate signal inputs related to related settings and function control of the user plane device, the transmitter 1902 can include a display device such as a display screen, and the transmitter 1902 can be used to output through an external interface. Number or character information.
  • the receiver 1901 and the transmitter 1902 are configured to implement data transmission and reception.
  • the processor 1903 is configured to implement data transmission and reception by the receiver 1901 and the transmitter 1902, and complete a process of generating a message performed by the device that generates the foregoing message.
  • the embodiment of the present application further provides a computer readable storage medium for storing program code, which is used to execute any one of the foregoing methods for generating a message of each of the foregoing embodiments.
  • the embodiment of the present application further provides a computer program product comprising instructions, which when executed on a computer, causes the computer to perform any one of the methods for generating a message of the foregoing various embodiments.
  • a person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • a computer readable storage medium A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Landscapes

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

Abstract

本申请实施例公开了一种报文的生成方法及相关设备,该方法包括:先获取业务服务器发送的北向请求,根据北向请求生成南向报文序列,每个南向报文均包括第一操作指令,第一操作指令用于指示对与南向报文对应的网元的配置数据进行更新。针对每个南向报文,分别根据第一操作指令确定第二操作指令的操作类型和第二操作指令的操作数据,生成逆操作报文,用于将经过第一操作指令指示更新的网元的配置数据恢复到更新之前的状态。当其中至少一个南向报文处理不成功时,可以通过下发逆操作报文来使网元配置数据进行更新,使经过第一操作指令指示更新的网元的配置数据恢复到更新之前状态,从而提高开发效率,同时提高配置数据更新的准确性。

Description

报文的生成方法及相关设备
本申请要求于2018年3月23日提交中国国家知识产权局、申请号201810245562.0、申请名称为“报文的生成方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种报文的生成方法及相关设备。
背景技术
网络管理系统(net manager system,NMS)或软件定义网络(software defined networking,SDN)中的控制器,属于网络的控制层。控制层中的控制器通常通过北向接口(northbound interface,NBI)与位于网络应用层的应用服务器连接,并且通过南向接口(sorthbound interface,SBI)和位于网络基础设施层的网元连接。在为网元进行参数配置时,NMS或SDN控制器获取来自业务服务器的北向请求,对北向请求进行分解和编排,以确定需要进行参数配置的一个或多个网元,然后为这些网元生成相应的南向报文并进行下发,网元根据接收到的南向报文更新其对应的配置数据。当向网元发送的南向报文是根据同一个北向请求生成的南向报文时,若其中任意一个或多个南向报文处理不成功时,可认为该北向请求处理不成功,因此需要保证对南向报文处理成功的网元的配置数据恢复为更新前的状态,以便重新根据北向请求进行南向报文的下发。
为了实现上述目的,传统方式在NMS或SDN控制器中手动编写使网元配置数据恢复到更新之前状态的逆操作报文,不仅开发效率低下,而且容易出错。
发明内容
本申请实施例提供了一种报文的生成方法及相关设备,能够解决现有技术中通过手动编写逆操作报文导致的效率低下且准确性较低的问题。
本申请第一方面提供一种报文的生成方法,该方法用于NMS或SDN控制器,所述方法包括:
获取业务服务器发送的北向请求,例如指示对网元中存储的配置数据进行更新的请求,根据所述北向请求生成至少一个南向报文,南向报文是对应于网元的,可以根据向网元下发列表序列形成南向报文序列。根据北向报文生成的每个所述南向报文均包括第一操作指令,所述第一操作指令为对与所述南向报文对应的网元的配置数据进行更新的指令,例如可以指示对网元配置数据进行新增、修改和/或删除。针对每个所述南向报文,分别根据其第一操作指令,确定第二操作指令的操作类型和所述第二操作指令的操作数据,其中,所述第二操作指令为所述第一操作指令的逆操作指令,用于将经过第一操作指令指示更新的网元的配置数据恢复到更新之前的状态。根据所述 第二操作指令的操作类型和所述第二操作指令的操作数据生成逆操作报文。
与现有技术相比,本申请实施例提供的报文的生成方法中,先获取业务服务器发送的北向请求,并根据北向请求生成至少一个南向报文,形成南向报文序列,每个南向报文均包括第一操作指令,第一操作指令用于指示对与南向报文对应的网元的配置数据进行更新。针对每个南向报文,可以分别根据第一操作指令确定第一操作指令的逆操作指令的操作类型和操作数据,即第二操作指令的操作类型和第二操作指令的操作数据,第二操作指令为第一操作指令的逆操作指令,用于将经过第一操作指令指示更新的网元的配置数据恢复到更新之前的状态。最后根据第二操作指令的操作类型和第二操作指令的操作数据生成逆操作报文。当其中至少一个南向报文处理不成功时,可以通过下发逆操作报文来使网元配置数据进行更新,使经过第一操作指令指示更新的网元的配置数据恢复到更新之前状态,从而提高开发效率,同时提高配置数据更新的准确性。
在一些可能的设计中,所述根据所述第一操作指令,确定第二操作指令的操作类型和所述第二操作指令的操作数据包括:获取所述南向报文对应网元的原始配置数据;对所述原始配置数据执行所述第一操作指令,生成目标配置数据;将所述原始配置数据和所述目标配置数据进行比对,得到所述第二操作指令的操作类型和所述第二操作指令的操作数据。
由于第二操作指令是为了能够将根据第一操作指令进行更新的配置数据恢复至更新之前的状态,因此,作为一种可能的实施方式,通过比较更新前的原始配置数据和更新后的目标配置数据,可以确定出将目标配置数据恢复为原始配置数据的操作方法,据此得到第二操作指令的操作类型和第二操作指令的操作数据,实现数据的准确恢复。
在一些可能的设计中,所述原始配置数据包括第一配置数据和所述第一配置数据的标识,所述目标配置数据包括第二配置数据和所述第二配置数据的标识;则所述将所述原始配置数据和所述目标配置数据进行比对,得到所述第二操作指令的操作类型和所述第二操作指令的操作数据包括:若所述第一配置数据的配置标识与所述第二配置数据的配置标识相同,且所述第一配置数据与所述第二配置数据不同,则确认所述第二操作指令的操作类型包括合并操作,所述第二操作指令的操作数据包括所述第一配置数据和所述第一配置数据的标识,所述合并操作用于将所述网元中所述第二配置数据修改为所述第一配置数据。
通过将原始配置数据和目标配置数据进行比对,判断第二操作指令的操作类型为合并操作、第二操作指令的操作数据为原始配置数据中的第一配置数据时,可以将目标配置数据恢复为原始配置数据,针对性的得到第二操作指令的操作类型和操作数据,从而提高数据恢复的准确性。
在一些可能的设计中,所述将所述原始配置数据和所述目标配置数据进行比对,得到所述第二操作指令的操作类型和所述第二操作指令的操作数据包括:若所述原始配置数据包括第三配置数据和所述第三配置数据的标识,且所述目标配置数据中不存在所述第三配置数据和所述第三配置数据的标识,则确认所述第二操作指令的操作类型包括新增操作,所述第二操作指令的操作数据包括所述第三配置数据和所述第三配置数据的标识,所述新增操作用于存储所述第三配置数据和所述第三配置数据的标识。
通过将原始配置数据和目标配置数据进行比对,判断第二操作指令的操作类型为新增操作、第二操作指令的操作数据为原始配置数据中的第三配置数据时,可以将目标配置数据恢复为原始配置数据,针对性的得到第二操作指令的操作类型和操作数据,从而提高数据恢复的准确性。
在一些可能的设计中,所述将所述原始配置数据和所述目标配置数据进行比对,得到所述第二操作指令的操作类型和所述第二操作指令的操作数据包括:若所述目标配置数据包括第四配置数据和所述第四配置数据的标识,且所述原始配置数据中不存在所述第四配置数据和所述第四配置数据的标识,则确认所述第二操作指令的操作类型包括删除操作,所述第二操作指令的操作数据包括所述第四配置数据和所述第四配置数据的标识,所述删除操作用于删除所述网元中存储的所述第四配置数据和所述第四配置数据的标识。
通过将原始配置数据和目标配置数据进行比对,判断第二操作指令的操作类型为删除操作、第二操作指令的操作数据为目标配置数据中的第四配置数据时,可以将目标配置数据恢复为原始配置数据,针对性的得到第二操作指令的操作类型和操作数据,从而提高数据恢复的准确性。
由于第二操作指令是为了能够将根据第一操作指令进行更新的配置数据恢复至更新之前的状态,因此,作为另一种可能的实施方式,还可以通过比较更新前的原始配置数据和第一操作指令,来确定第一操作指令的逆操作指令,据此得到第二操作指令的操作类型和第二操作指令的操作数据,实现数据的准确恢复。
例如所述第一操作指令的操作类型至少包括以下任意一种:合并操作、替代操作、删除操作和新增操作。下面就以上四种操作类型进行分情况说明。
在一些可能的设计中,所述根据所述第一操作指令确定第二操作指令的操作类型和所述第二操作指令的操作数据包括:若所述第一操作指令的操作类型包括合并操作,则获取所述南向报文对应网元的原始配置数据;根据所述原始配置数据和所述合并操作的操作数据,确认所述第二操作指令的操作类型和所述第二操作指令的操作数据。
在第一操作指令的操作类型为合并操作时,第二操作指令可以是合并操作或删除操作,第二操作指令的操作数据可以根据原始配置数据和第一操作指令的操作数据来确定,针对性的得到第二操作指令的操作类型和操作数据,从而提高数据恢复的准确性。
在一些可能的设计中,所述原始配置数据包括第五配置数据和所述第五配置数据的标识,所述合并操作的操作数据包括第六配置数据和所述第六配置数据的标识;所述根据所述原始配置数据和所述合并操作的操作数据,确认所述第二操作指令的操作类型和所述第二操作指令的操作数据包括:若所述第五配置数据的标识和所述第六配置数据的标识相同,且所述第五配置数据和所述第六配置数据不同,则确定所述第二操作指令的操作类型包括合并操作,所述第二操作指令的操作数据包括所述第五配置数据和所述第五配置数据的标识,所述合并操作用于将所述网元中所述第六配置数据修改为所述第五配置数据。
在第一操作指令的操作类型为合并操作时,第二操作指令的操作类型可以是合并操作,第二操作指令的操作数据可以根据原始配置数据和第一操作指令的操作数据来 确定,例如原始配置数据中的第五配置数据,针对性的得到第二操作指令的操作类型和操作数据,从而提高数据恢复的准确性。
在一些可能的设计中,所述根据所述原始配置数据和所述合并操作的操作数据,确认所述第二操作指令的操作类型和所述第二操作指令的操作数据包括:若所述合并操作的操作数据包括第七配置数据和所述第七配置数据的标识,且所述原始配置数据中不存在所述第七配置数据和所述第七配置数据的标识,则确认所述第二操作指令的操作类型包括删除操作,所述第二操作指令的操作数据包括所述第七配置数据和所述第七配置数据的标识,所述删除操作用于删除所述网元中存储的所述第七配置数据和所述第七配置数据的标识。
在第一操作指令的操作类型为合并操作时,第二操作指令的操作类型可以是删除操作,第二操作指令的操作数据可以根据原始配置数据和第一操作指令的操作数据来确定,例如目标配置数据中的第七配置数据,针对性的得到第二操作指令的操作类型和操作数据,从而提高数据恢复的准确性。
在一些可能的设计中,所述根据所述第一操作指令确定第二操作指令的操作类型和所述第二操作指令的操作数据包括:若所述第一操作指令的操作类型包括所述替代操作,则获取所述南向报文对应网元的原始配置数据,并确定所述第二操作指令的操作类型为包括替代操作,所述第二操作指令的操作数据包括所述原始配置数据,所述替代操作用于将网元中存储的配置数据替代为所述原始配置数据。
在第一操作指令的操作类型为替代操作时,第二操作指令的操作类型可以是替代操作,第二操作指令的操作数据可以与原始配置数据相同,得到第二操作指令的操作类型和操作数据,从而提高数据恢复的准确性。
在一些可能的设计中,所述根据所述第一操作指令确定第二操作指令的操作类型和所述第二操作指令的操作数据包括:若所述第一操作指令的操作类型包括所述删除操作,则确定所述第二操作指令的操作类型为包括新增操作,所述第二操作指令的操作数据包括所述新增操作的操作数据,所述新增操作用于在所述网元中存储所述新增操作的操作数据。
在第一操作指令的操作类型为删除操作时,第二操作指令的操作类型可以是新增操作,第二操作指令的操作数据可以与第一操作指令的操作数据相同,得到第二操作指令的操作类型和操作数据,从而提高数据恢复的准确性。
在一些可能的设计中,所述根据所述第一操作指令确定第二操作指令的操作类型和所述第二操作指令的操作数据包括:若所述第一操作指令的操作类型包括所述新增操作,则确定所述第二操作指令的操作类型为包括删除操作,所述第二操作指令的操作数据包括所述新增操作的操作数据,所述删除操作用于删除在所述网元中存储的所述新增操作的操作数据。
在第一操作指令的操作类型为新增操作时,第二操作指令的操作类型可以是删除操作,第二操作指令的操作数据可以与第一操作指令的操作数据相同,得到第二操作指令的操作类型和操作数据,从而提高数据恢复的准确性。
在一些可能的设计中,所述方法还包括:按照所述南向报文序列的顺序依次向对应的网元发送所述南向报文序列中的南向报文,并获取所述网元对于所述南向报文的 处理结果;若任意一个南向报文的处理结果为处理失败,则按照所述南向报文序列的逆序向处理结果为成功的网元发送对应的所述逆操作报文。
通过获取南向报文的处理结果,可以判断是否有南向报文的处理结果为处理失败,若有,则可以及时下发逆操作报文进行数据的恢复。
本申请第二方面提供了一种报文的生成装置,所述装置包括:
南向报文序列生成单元,用于获取业务服务器发送的北向请求,并根据所述北向请求生成南向报文序列,所述南向报文序列包括至少一个南向报文,每个所述南向报文均包括第一操作指令,所述第一操作指令为对与所述南向报文对应的网元的配置数据进行更新的指令;
第二操作指令确定单元,用于针对每个所述南向报文,分别根据所述第一操作指令,确定第二操作指令的操作类型和所述第二操作指令的操作数据,所述第二操作指令为所述第一操作指令的逆操作指令;
逆操作报文生成单元,用于根据所述第二操作指令的操作类型和所述第二操作指令的操作数据生成逆操作报文。
在一些可能的设计中,所述第二操作指令确定单元包括:
原始配置数据获取子单元,用于获取所述南向报文对应网元的原始配置数据;
目标配置数据生成子单元,用于对所述原始配置数据执行所述第一操作指令,生成目标配置数据;
第二操作指令确定子单元,用于将所述原始配置数据和所述目标配置数据进行比对,得到所述第二操作指令的操作类型和所述第二操作指令的操作数据。
在一些可能的设计中,所述原始配置数据包括第一配置数据和所述第一配置数据的标识,所述目标配置数据包括第二配置数据和所述第二配置数据的标识;
所述第二操作指令确定子单元具体用于:
若所述第一配置数据的配置标识与所述第二配置数据的配置标识相同,且所述第一配置数据与所述第二配置数据不同,则确认所述第二操作指令的操作类型包括合并操作,所述第二操作指令的操作数据包括所述第一配置数据和所述第一配置数据的标识,所述合并操作用于将所述网元中所述第二配置数据修改为所述第一配置数据。
在一些可能的设计中,所述第二操作指令确定子单元具体用于:
若所述原始配置数据包括第三配置数据和所述第三配置数据的标识,且所述目标配置数据中不存在所述第三配置数据和所述第三配置数据的标识,则确认所述第二操作指令的操作类型包括新增操作,所述第二操作指令的操作数据包括所述第三配置数据和所述第三配置数据的标识,所述新增操作用于存储所述第三配置数据和所述第三配置数据的标识。
在一些可能的设计中,所述第二操作指令确定子单元具体用于:
若所述目标配置数据包括第四配置数据和所述第四配置数据的标识,且所述原始配置数据中不存在所述第四配置数据和所述第四配置数据的标识,则确认所述第二操作指令的操作类型包括删除操作,所述第二操作指令的操作数据包括所述第四配置数据和所述第四配置数据的标识,所述删除操作用于删除所述网元中存储的所述第四配 置数据和所述第四配置数据的标识。
在一些可能的设计中,所述第一操作指令的操作类型至少包括以下任意一种:
合并操作、替代操作、删除操作和新增操作。
在一些可能的设计中,所述第二操作指令确定单元包括:
合并操作原始配置数据获取子单元,用于若所述第一操作指令的操作类型包括合并操作,则获取所述南向报文对应网元的原始配置数据;
合并操作第二操作指令获取子单元,用于根据所述原始配置数据和所述合并操作的操作数据,确认所述第二操作指令的操作类型和所述第二操作指令的操作数据。
在一些可能的设计中,所述原始配置数据包括第五配置数据和所述第五配置数据的标识,所述合并操作的操作数据包括第六配置数据和所述第六配置数据的标识;
所述合并操作第二操作指令获取子单元具体用于:
若所述第五配置数据的标识和所述第六配置数据的标识相同,且所述第五配置数据和所述第六配置数据不同,则确定所述第二操作指令的操作类型包括合并操作,所述第二操作指令的操作数据包括所述第五配置数据和所述第五配置数据的标识,所述合并操作用于将所述网元中所述第六配置数据修改为所述第五配置数据。
在一些可能的设计中,所述合并操作第二操作指令获取子单元具体用于:
若所述合并操作的操作数据包括第七配置数据和所述第七配置数据的标识,且所述原始配置数据中不存在所述第七配置数据和所述第七配置数据的标识,则确认所述第二操作指令的操作类型包括删除操作,所述第二操作指令的操作数据包括所述第七配置数据和所述第七配置数据的标识,所述删除操作用于删除所述网元中存储的所述第七配置数据和所述第七配置数据的标识。
在一些可能的设计中,所述第二操作指令确定单元具体用于:
若所述第一操作指令的操作类型包括所述替代操作,则获取所述南向报文对应网元的原始配置数据,并确定所述第二操作指令的操作类型为包括替代操作,所述第二操作指令的操作数据包括所述原始配置数据,所述替代操作用于将网元中存储的配置数据替代为所述原始配置数据。
在一些可能的设计中,所述第二操作指令确定单元具体用于:
若所述第一操作指令的操作类型包括所述删除操作,则确定所述第二操作指令的操作类型为包括新增操作,所述第二操作指令的操作数据包括所述新增操作的操作数据,所述新增操作用于在所述网元中存储所述新增操作的操作数据。
在一些可能的设计中,所述第二操作指令确定单元具体用于:
若所述第一操作指令的操作类型包括所述新增操作,则确定所述第二操作指令的操作类型为包括删除操作,所述第二操作指令的操作数据包括所述新增操作的操作数据,所述删除操作用于删除在所述网元中存储的所述新增操作的操作数据。
在一些可能的设计中,所述装置还包括:
处理结果获取单元,用于按照所述南向报文序列的顺序依次向对应的网元发送所述南向报文序列中的南向报文,并获取所述网元对于所述南向报文的处理结果;
逆操作报文下发单元,用于若任意一个南向报文的处理结果为处理失败,则按照所述南向报文序列的逆序向处理结果为成功的网元发送对应的所述逆操作报文。
本申请又一方面提供了一种报文的生成设备,所述设备包括:处理器和存储器;
所述存储器,用于存储指令;所述处理器,用于执行所述存储器中的所述指令,执行上述各方面所述的方法。
本申请又一方面提供了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。
本申请又一方面提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。
与现有技术相比,本申请实施例提供的报文的生成方法及相关设备中,通过先获取业务服务器发送的北向请求,并根据北向请求生成至少一个南向报文,形成南向报文序列,每个南向报文均包括第一操作指令,第一操作指令用于指示对与南向报文对应的网元的配置数据进行更新。针对每个南向报文,可以分别根据第一操作指令确定第一操作指令的逆操作指令的操作类型和操作数据,即第二操作指令的操作类型和第二操作指令的操作数据,第二操作指令为第一操作指令的逆操作指令,用于将经过第一操作指令指示更新的网元的配置数据恢复到更新之前的状态。最后根据第二操作指令的操作类型和第二操作指令的操作数据生成逆操作报文。当其中至少一个南向报文处理不成功时,可以通过下发逆操作报文来使网元配置数据进行更新,使经过第一操作指令指示更新的网元的配置数据恢复到更新之前状态,从而提高开发效率,同时提高配置数据更新的准确性。
附图说明
图1为本申请实施例中的参数配置的系统的示意图;
图2为本申请实施例提供的报文的生成方法流程图;
图3为本申请实施例中的合并操作的示意图;
图4为本申请实施例中的替代操作的示意图;
图5为本申请实施例中的删除操作的示意图;
图6为本申请实施例中的新增操作的示意图;
图7为本申请实施例中的南向报文序列和逆操作报文序列的示意图;
图8为本申请实施例中一种通过比对配置数据确定第二操作指令的方法示意图;
图9为本申请实施例中另一种通过比对配置数据确定第二操作指令的方法示意图;
图10为本申请实施例中又一种通过比对配置数据确定第二操作指令的方法示意图;
图11为本申请实施例中一种确定合并操作对应的第二操作指令的方法示意图;
图12为本申请实施例中另一种确定合并操作对应的第二操作指令的方法示意图;
图13为本申请实施例中又一种确定合并操作对应的第二操作指令的方法示意图;
图14为本申请实施例中一种确定替代操作对应的第二操作指令的方法示意图;
图15为本申请实施例中另一种确定替代操作对应的第二操作指令的方法示意图;
图16为本申请实施例中一种确定删除操作对应的第二操作指令的方法示意图;
图17为本申请实施例中一种确定新增操作对应的第二操作指令的方法示意图;
图18为本申请实施例中报文的生成装置的结构示意图;
图19为本申请实施例中执行报文的生成方法的设备的结构示意图。
具体实施方式
本申请实施例提供了一种报文的生成方法及相关设备,用于在NMS或SDN控制器中生成使网元配置数据恢复到更新之前状态的逆操作报文,提高开发效率,提高准确性。
下面结合附图,对本申请的实施例进行描述。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分方式。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,以便包含一系列单元的过程、方法、系统、产品或设备不必限于那些单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它单元。
如图1所示,为参数配置的系统的示意图,该系统中包括业务服务器101、NMS或SDN控制器102和网元103。
业务服务器101可以与用户进行交互,即用户可以通过交互界面向业务服务器发送命令,业务服务器在接收到命令后可以生成相应的北向请求。NMS或SDN控制器102中,NMS是网络管理系统,可以用于管理不同地域和不同设备供应商的网络,实现告警、配置、安全和计费等功能,SDN控制器是软件定义网络中的控制器。网元103通常是交换机。
业务服务器101还与NMS或SDN控制器102的北向接口相连,通过该北向接口向NMS或SDN控制器102发送北向请求。网元103与NMS或SDN控制器102的南向接口连接,可以通过南向接口获取南向报文。
NMS或SDN控制器102包括北向请求处理模块1021和南向请求处理模块1022。
北向请求处理模块1021包括北向请求接收模块10211、北向请求分析模块10212和南向请求编排模块10213。其中,北向请求接收模块10211通过北向接口获取来自业务服务器101的北向请求。在本实施例中该北向请求可以是对网元103中存储的配置数据进行更新的请求。此处的更新可以包括新增、修改和/或删除。北向请求分析模块10212用于对北向请求进行分析,例如判断该北向请求的类型、北向请求是否合法等,在判断该北向请求合法后,可以根据北向请求的类型确定该北向请求涉及的网元、对应于各个网元的具体操作等。南向请求编排模块10213根据北向请求分析模块10212的分析结果,可以将北向请求按照统一的模型编排为网元对应的南向请求。
南向请求处理模块1022包括南向报文构建模块10221和南向报文发送模块10222。其中,南向报文构建模块10221根据与网元对应的南向协议,将南向请求构建为对应的南向报文,并按照一定的顺序形成南向报文序列;南向报文发送模块10222通过NMS或SDN控制器102的南向接口向各个网元103下发南向报文序列中的各个南向报文。
网元103中存储有配置数据,可以根据接收到的南向报文更新对应的配置数据,完成对网元的参数配置。
当向网元发送的南向报文是根据同一个北向请求生成的南向报文时,若其中一个或多个南向报文处理不成功,例如南向报文的下发不成功,或者根据南向报文更新网元的配置数据不成功,此时说明对对北向请求的执行不成功,可以将网元中根据南向报文更新了的配置数据恢复为更新前的状态,以便重新执行该北向请求。
传统技术通过对网元中更新了的配置数据执行逆操作来使配置数据恢复到更新之前的状态,而用于指示执行逆操作的逆操作报文是通过手动编写的方式生成的,通常需要技术人员在程序中,找到对应于每个网元的操作类型和操作数据,判断将更新了的配置数据恢复到更新之前所需要执行的逆操作的操作类型和操作数据,手动生成逆操作报文,这种逆操作报文的生成方式不仅使开发效率低下,同时手动编写容易出现错误。
为了解决上述问题,本申请实施例提供了一种报文的生成方法,可以自动生成与南向报文对应的逆操作报文。具体的,可以先获取业务服务器发送的北向请求,并根据北向请求生成南向报文序列。针对每个南向报文,分别根据其中包括的第一操作指令,确定对应的第二操作指令的操作类型和操作数据,其中,第一操作指令为对与南向报文对应的网元的配置数据进行更新的指令,第二操作指令为第一操作指令的逆操作指令。最后,根据第二操作指令的操作类型和第二指令的操作数据生成逆操作报文。在检测到有南向报文处理不成功时,可以通过向处理成功的网元下发对应的逆操作报文来使网元配置数据进行恢复,即使经过第一操作指令指示更新的网元的配置数据恢复到更新之前状态,从而提高开发效率,同时提高配置数据更新的准确性。
参见图2所示,为本申请实施例提供的报文的生成方法流程图,该方法可以应用于NMS或SDN控制器,具体的,该方法可以包括以下步骤:
S201,获取业务服务器发送的北向请求,并根据北向请求生成南向报文序列。
如前文所述,在获取到业务服务器发送的北向请求后,可以先对获取到的北向请求进行分析,来确定北向请求的类型、涉及的网元和对应各个网元的操作等,根据分析结果可以生成南向请求序列,根据南向请求序列和南向协议可以构建南向报文序列。由于北向请求至少涉及一个网元,则对应的南向报文序列包括至少一个南向报文。南向报文序列是至少一个南向报文按照特定的顺序形成的序列。南向报文可以通过南向接口下发至对应的网元。在向各个网元发送南向报文时,通常按照南向报文序列的顺序进行发送。
每个网元可以对应于至少一个南向报文,对应于同一个网元的多个南向报文之间可以具有一定的依赖关系,也可以相互独立,在此不做限定。具有依赖关系的含义是指需要先执行某个南向报文,基于执行结果再执行另外一个南向报文。
在本实施例中,每个南向报文都包括第一操作指令,第一操作指令为对南向报文对应的网元的配置数据进行更新的指令,例如第一操作指令可以指示网元删除、新增和/或修改某一项或某几项配置数据。在NMS或SDN控制器完成南向报文序列的构建后,可以将各个南向报文下发至对应的网元,网元在接收到南向报文后,可以执行南向报文中的第一操作指令,根据南向报文中的第一操作指令对网元中的配置数据进行 更新。为了描述清楚,在本实施例中,将更新前的网元配置数据称为原始配置数据;将更新后的网元配置数据称为目标配置数据。也就是说,第一操作指令用于指示将原始配置数据A更新为目标配置数据B,对应的第二操作指令则用于指示将执行第一操作指令生成的目标配置数据B恢复到更新前的原始配置数据A。
第一操作指令的操作类型可以包括合并操作、替代操作、删除操作和新增操作等多种操作中的至少一种。第一操作指令的操作数据、原始配置数据以及目标配置数据可以携带有数据标识。
下面对第一操作指令的操作类型和操作数据进行示例性说明。
合并操作指示将网元的配置数据与第一操作指令的操作数据进行合并,即新增第一操作指令的操作数据中存在而原始配置数据中不存在的配置数据,和/或,将原始配置数据修改为第一操作指令的操作数据。具体实现时,可以通过辨别第一操作指令的操作数据的数据标识是否与原始配置数据的数据标识相同,来判断合并操作的实质具体是新增操作还是修改操作。若第一操作指令的操作数据包括数据标识为n的配置数据m,原始配置数据中包括数据标识为n的配置数据k,且配置数据m不同于配置数据k,则通过合并操作将配置数据k修改为配置数据m,得到目标配置数据;若原始配置数据中不存在数据标识n,也就不存在数据标识为n的配置数据m,则通过合并操作新增数据标识为n的配置数据m、及其携带的数据标识n,得到目标配置数据。
举例来说,参考图3所示,该图为根据第一操作指令的操作数据302,将网元的原始配置数据301更新为目标配置数据303的示意图。在该图中,网元的原始配置数据301、第一操作指令的操作数据302和目标配置数据303都是以树形结构呈现的,在以下附图中上述三种数据均以树形结构呈现,不再重复说明。
其中,网元的原始配置数据301,其树形结构的根节点为a,下有三个子节点a1、a2和a3,为了方便说明,可以用/a/a1、/a/a2和/a/a3表示,a1节点下有两个二级子节点a11和a12,为了便于说明,可以用/a/a1/a11和/a/a1/a12表示。第一操作指令的操作数据302,其树形结构的根节点为a,下有三个子节点a1、a2′和a4,可以用/a/a1、/a/a2′和/a/a3表示,a1节点下有两个二级子节点a11′和a13,可以用/a/a1/a11′和/a/a1/a12,其中,/a/a2′是与/a/a2具有相同数据标识的不同配置数据,/a/a1/a11′是与/a/a1/a11具有相同数据标识的不同配置数据。
假设第一操作指令的操作类型为合并操作。首先比较第一操作指令的操作数据302和网元的原始配置数据301,确定原始配置数据301中不存在第一操作指令的操作数据302中/a/a4和/a/a1/a13,但存在与/a/a2′具有相同数据标识的不同配置数据/a/a2,且存在与/a/a1/a11′具有相同数据标识的不同配置数据/a/a1/a11,因此对第一操作指令的执行过程即为,增加/a/a4和/a/a1/a13,且将/a/a2和/a/a1/a11对应修改为/a/a2′和/a/a1/a11′。若对原始配置数据301执行第一操作指令,可以得到目标配置数据303,其树形结构的根节点为a,下有四个子节点a1、a2′、a3和a4,其中a1下有三个二级子节点a11′、a12和a13,完成原始配置数据301与第一操作指令的操作数据302的合并。
替代操作指示将网元的原始配置数据替换为第一操作指令的操作数据。具体实现时,网元接收到操作类型是替代操作的第一操作指令后,可以执行第一操作指令,以 将第一操作指令的操作数据作为网元的目标配置数据替换原始配置数据。
举例来说,参考图4所示,该图为根据第一操作指令的操作数据402,将网元的原始配置数据401修改为目标配置数据403的示意图。在该图中,网元的原始配置数据401包括/a/a1/a11、/a/a1/a12、/a/a2和/a/a3;第一操作指令的操作数据402包括/a/a1/a11′、/a/a1/a13、/a/a2′和/a/a4。其中,/a/a1/a11′和/a/a1/a11是数据标识相同的不同配置数据,/a/a2′和/a/a2也是数据标识相同过的不同配置数据。假设第一操作指令的操作类型为替代操作,那么通过执行第一操作指令,可以将原始配置数据401替代为第一操作指令的操作数据402,即目标配置数据403包括/a/a1/a11′、/a/a1/a13、/a/a2′和/a/a4。上述替代操作的实质是将原始配置数据中的/a/a1/a11修改为/a/a1/a11′,将原始配置数据中的/a/a1/a12删除,增加了配置数据/a/a1/a13,将原始配置数据中的/a/a2修改为/a/a2′,删除了配置数据/a/a3,以及增加了配置数据/a/a。
删除操作指示将网元的原始配置数据中与第一操作指令的操作数据相同的配置数据删除。
举例说明,如图5所示,该图为根据第一操作指令的操作数据502,将网元的原始配置数据501修改为目标配置数据503的示意图。在该图中,网元的原始配置数据501,根节点为a,下有三个子节点a1、a2和a3,其中a1下有两个二级子节点a11和a12。也就是说,原始配置数据501包括配置数据/a/a1/a11、/a/a1/a12、/a/a2和/a/a3。第一操作指令的操作类型为删除操作,第一操作指令的操作数据502包括/a/a1/a12。根据第一操作指令对网元的原始配置数据501进行更新,即删除二级节点a12,得到的目标配置数据503包括/a/a1/a11、/a/a2和/a/a3。
新增操作指示将第一操作指令的操作数据新增至网元的配置数据中。
举例说明,如图6所示,该图为根据第一操作指令的操作数据602,将网元的原始配置数据601修改为目标配置数据603的示意图。在该图中,网元的原始配置数据601,根节点为a,下有三个子节点a1、a2和a3,a1节点下有两个二级子节点a11和a12。即原始配置数据601包括/a/a1/a11、/a/a1/a12、/a/a2和/a/a3。第一操作指令的操作类型为新建操作,第一操作指令的操作数据602包括/a/a1/a13。对网元的原始配置数据601根据第一操作指令进行更新,即新增一级节点a1下的二级节点a13,得到的目标配置数据603包括/a/a1/a11、/a/a1/a12、/a/a1/a13、/a/a2和/a/a3。
S202,针对每个南向报文,分别根据第一操作指令确定第二操作指令的操作类型和第二操作指令的操作数据。
在本实施例中,针对每个南向报文,可以分别根据第一操作指令确定第二操作指令的操作类型和第二操作指令的操作数据。其中,第二操作指令为第一操作指令的逆操作指令,逆操作指令中的逆操作是能够使经过第一操作指令指示更新的网元配置数据恢复到更新之前状态的操作。
在本实施例中,提供两种根据第一操作指令确定第二操作指令的操作类型和第二操作指令的操作数据的确定方式,当然,这两种方式并不是构成对本申请的限定。
作为一种可能的实施方式,对第二操作指令的操作类型和第二操作指令的操作数据的确定方式,可以具体为,NMS或SDN控制器获取南向报文对应网元的原始配置数据,对原始配置数据执行第一操作指令生成目标配置数据,通过将原始配置数据和 目标配置数据进行比对,来得到第二操作指令的操作类型和第二操作指令的操作数据。其中,获取南向报文对应网元的原始配置数据,具体的,可以由NMS或SDN控制器向南向报文对应网元发送原始配置数据获取请求,网元在接收到原始配置数据获取请求之后,向NMS或SDN控制器发送存储在该网元中的原始配置数据。
当NMS或SDN控制器获取到存储在网元中的原始配置数据之后,将执行第一操作指令生成的目标配置数据与原始配置数据进行比对,以确定出相对于原始配置数据而言,目标配置数据是增加了配置数据、减少了配置数据还是修改了配置数据,从而根据具体情况确定对应的第二操作指令的操作类型和操作数据。
作为另一可能的实施方式,可以直接根据第一操作指令的操作类型和第一操作指令的操作数据,来确定对应于第一操作指令的第二操作指令的操作类型和第二操作指令的操作数据。例如若第一操作指令的操作类型为删除操作,则第二操作指令的操作类型可以为新增操作,第二操作指令的操作数据与第一操作指令的操作数据相同;若第一操作指令的操作类型为新增操作,则第二操作指令的操作类型可以为删除操作,第二操作指令的操作数据与第一操作指令的操作数据相同。此外,若第一操作指令的操作类型为合并操作,那么第二操作指令的操作类型可以是合并操作和/或删除操作,其操作数据可根据第一操作指令和原始配置数据而定。若第一操作指令的操作类型为替代操作,那么第二操作指令的操作类型可以是替代操作、合并操作、删除操作或新增操作中的一种或多种,其操作数据可根据第一操作指令而定,也可以根据第一操作指令和原始配置数据而定。
在本申请实施例中,第一操作指令和第二操作指令可以不只包括一种操作类型,在获取第二操作指令的操作类型和操作数据时,可以针对具体情况一一进行,例如第一操作指令用于删除配置数据C,同时增加配置数据D,则相应的第二操作指令可用于新增配置数据C,同时删除配置数据D。
关于上述两种实现方式的具体示例,请参见后文。
S203,根据第二操作指令的操作类型和第二操作指令的操作数据生成逆操作报文。
由于逆操作是用于将目标配置数据恢复至原始配置数据的操作,因此逆操作报文是用于将目标配置数据恢复至原始配置数据的报文。逆操作报文的生成主要是为了在南向报文的处理结果为处理失败时能够将目标配置数据恢复至原始配置数据。
作为一种可能的实施方式,逆操作报文的生成时间可以在南向报文生成后立即进行,在有南向报文的处理结果为处理失败时,向执行第一操作指令成功的网元发送生成的逆操作报文,以进行配置数据的恢复。
作为另一种可能的实施方式,也可以在南向报文生成后获取第二操作指令的操作类型和第二操作指令的操作数据,在判断有南向报文的处理结果为处理失败时,再生成南向报文,并向执行第一操作指令成功的网元发送生成的逆操作报文,以进行网元配置数据的恢复。
在本申请实施例中,网元对南向报文的处理结果可以是接收南向报文、解析南向报文、和执行南向报文其中一种或多种处理是否成功的结果。若没有接收到南向报文、解析南向报文失败或执行南向报文中的第一操作指令失败,则认为对南向报文的处理 结果为处理失败;反之,则认为处理成功。
若有任意一个南向报文的处理结果为处理失败,则向处理结果为成功的网元发送对应的逆操作报文。具体的,可以按照南向报文序列的逆序发送逆操作报文。当对应于同一个网元的多个南向报文有一定的依赖关系时,按照南向报文序列的逆序发送逆操作报文,可以保证数据恢复的正确性。
举例来说,如图7所示,该图为南向报文序列和逆操作报文序列的示意图。其中,南向报文形成南向报文序列,逆操作报文形成逆操作报文序列,南向报文的下发可以按照南向报文序列顺序进行,具体的,按照南向报文1、南向报文2、南向报文3、……、南向报文n的顺序进行下发。在南向报文的下发过程中,当下发了某个南向报文并接收到与该南向报文对应的处理结果之后,再决定是否下发下一个南向报文。即如果处理结果为成功,则下发下一个南向报文;如果处理结果为不成功,则不下发下一个南向报文,并且向之前下发的处理成功的南向报文对应的网元发送逆操作报文。例如完成南向报文5的发送后,得到的南向报文5的处理结果为处理失败,此时可以停止南向报文6及后续南向报文的发送,并向南向报文1、南向报文2、南向报文3和南向报文4对应的网元发送对应的逆操作报文,逆操作报文的发送可以按照南向报文序列的逆序发送,即按照逆操作报文4、逆操作报文3、逆操作报文2和逆操作报文1的顺序依次发送逆操作报文。
本申请实施例提供的报文的生成方法中,先获取业务服务器发送的北向请求,并根据北向请求生成南向报文序列,每个南向报文均包括第一操作指令,用于对网元配置数据进行更新,然后可以针对每个南向报文的第一操作指令,确定对应的第二操作指令的操作类型和第二操作指令的操作数据,其中,第二操作指令为第一操作指令的逆操作指令,用于将经过第一操作指令指示更新的网元的配置数据恢复到更新之前的状态,最后根据第二操作指令的操作类型和第二操作指令的操作数据生成逆操作报文。通过南向报文的第一操作指令来自动生成对应于第一操作指令的逆操作报文,不需要其他业务模块的参与,也不需要人工编写,当其中任意一个南向报文处理不成功时,可以通过下发逆操作报文来使网元配置参数进行更新,使经过第一操作指令指示更新的网元的配置数据恢复到更新之前状态,从而提高开发效率,同时提高数据更新的准确性。
为了便于理解,下面就S202中,根据第一操作指令确定第二操作指令的操作类型和第二操作指令的操作数据的两种可能的实现方式进行详细说明。
本申请实施例中,可以将原始配置数据和目标配置数据进行比对,来确定将目标配置数据恢复为原始配置数据的第二操作指令的操作类型和第二操作指令的操作数据。
作为一种可能的实施方式,原始配置数据包括第一配置数据和第一配置数据的标识,目标配置数据包括第二配置数据和第二配置数据的标识。将原始配置数据和目标配置数据进行比对,若比对结果是,第一配置数据的配置标识与第二配置数据的配置标识相同,且第一配置数据和第二配置数据不同,则可认为网元需要根据第一操作指令将第一配置数据修改为第二配置数据。此时可以确认第二操作指令的作用在于将网元目标配置数据中第二配置数据修改为第一配置数据,则第二操作指令的操作类型是 合并操作,第二操作指令的操作数据包括第一配置数据和第一配置数据的标识。
举例来说,参考图8所示,该图为根据原始配置数据801和目标配置数据802,确定第二操作指令的操作数据803的示意图。在该图中,网元的原始配置数据801,根节点为a,下有三个子节点a1、a2和a3,a1节点下有两个二级子节点a11和a12。网元的目标配置数据802:根节点为a,下有三个子节点a1、a2′和a3,a1节点下有两个二级子节点a11′和a12。其中,由于/a/a2′是与/a/a2具有相同数据标识的不同配置数据,/a/a1/a11′是与/a/a1/a11具有相同数据标识的不同配置数据,所以可以确定第二操作指令的作用在于将目标配置数据802中的/a/a1/a11′修改为/a/a1/a11,且将/a/a2′修改为/a/a2,因此第二操作指令的操作类型可以是合并操作,第二操作指令的操作数据803包括/a/a1/a11和/a/a2。
当然,第二操作指令的操作类型还可以是删除操作和新增操作,例如删除/a/a1/a11′和/a/a2′,且新增/a/a1/a11和/a/a2,即对应删除操作的操作数据为/a/a1/a11′和/a/a2′,对应新增操作的操作数据为/a/a1/a11和/a/a2,可与上述合并操作实现同样的效果。
作为另一种可能的实施方式,若原始配置数据和目标配置数据的比对结果是,原始配置数据包括第三配置数据和第三配置数据的标识,且目标配置数据中不存在第三配置数据和第三配置数据的标识,则可认为网元根据第一操作指令将第三配置数据和第三配置数据的标识删除,此时可以确认第二操作指令的作用在于在网元目标配置数据中存储第三配置数据和第三配置数据的标识,则第二操作指令的操作类型可以是新增操作,第二操作指令的操作数据包括第三配置数据和第三配置数据的标识。
举例来说,参考图9所示,该图为根据原始配置数据901和目标配置数据902,确定第二操作指令的操作数据903的示意图。在该图中,网元的原始配置数据901包括/a/a1/a11、/a/a1/a12、/a/a2和/a/a3,目标配置数据902存在原始配置数据901中除/a/a1/a12外的其他配置数据,即通过删除原始配置数据901中的/a/a1/a12得到目标配置数据902,所以可以确定第二操作指令的作用在于在目标配置数据902中增加/a/a1/a12,因此第二操作指令的操作类型可以是新增操作,第二操作指令的操作数据903包括/a/a1/a12。
当然,第二操作指令的操作类型还可以是合并操作,第二操作指令的操作数据包括第三配置数据和第三配置数据的标识,例如包括/a/a1/a12,即将/a/a1/a12与目标配置数据902进行合并,以便得到原始配置数据901。
作为又一种可能的实施方式,若原始配置数据和目标配置数据的比对结果是,目标配置数据包括第四配置数据和第四配置数据的标识,且原始配置数据中不存在第四配置数据和第四配置数据的标识,则可认为网元根据第一操作指令新增第四配置数据和第四配置数据的标识,此时可以确认第二操作指令的作用在于删除网元目标配置数据中存储的第四配置数据和第四配置数据的标识,则第二操作指令的操作类型可以是删除操作,第二操作指令的操作数据包括第四配置数据和第四配置数据的标识。
举例来说,参考图10所示,该图为根据原始配置数据1001和目标配置数据1002,确定第二操作指令的操作数据1003的示意图。在该图中,原始配置数据1001包括/a/a1/a11、/a/a1/a12、/a/a2和/a/a3,目标配置数据1002不仅存在原始配置数据1001中的全部配置数据,且还存在原始配置数据1001中不存在的配置数据/a/a1/a13,即通 过在原始配置数据1001中增加/a/a1/a13得到目标配置数据1002,所以可以确定第二操作指令的作用在于将目标配置数据1002中删除/a/a1/a13,因此第二操作指令的操作类型可以是删除操作,第二操作指令的操作数据1003:/a/a1/a13。
通过对原始配置数据执行第一操作指令,并将原始配置数据和目标配置数据进行比对,根据比较结果可以确定第二操作指令的作用,从而直接确定第二操作指令的操作类型和第二操作指令的操作数据,从而提高逆操作报文的生成效率。
为了便于理解,下面就S202中,根据第一操作指令确定第二操作指令的操作类型和第二操作指令的操作数据的另一种可能的实现方式进行详细说明。
由于第二操作指令为第一操作指令的逆操作,在本申请实施例中,还可以直接根据第一操作指令的操作类型和操作数据,例如根据第一操作指令是合并、替代、删除和新增中的一种或多种操作类型,来确定与第一操作指令对应的第二操作指令的操作类型和第二操作指令的操作数据,例如合并操作的逆操作可以是合并操作和/或删除操作,替代操作的逆操作可以是替代操作、合并操作、删除操作或新增操作的一种或多种,删除操作的逆操作是新增操作,新增操作的逆操作是删除操作。
作为一种可能的实施方式,若第一操作指令的操作类型包括合并操作,则获取南向报文对应网元的原始配置数据,根据原始配置数据和合并操作的操作数据,确认第二操作指令的操作类型和第二操作指令的操作数据。
合并操作的介绍可以参见S202,在此不再赘述。由于合并操作通常是在原始配置数据中,修改与第一操作指令的操作数据标识相同的配置数据,且新增原始配置数据中没有而第一操作指令的操作数据中包括的数据标识及其配置数据。因此对应于合并操作的第二操作指令的操作类型可以是合并操作,也可以是删除操作,还可以是合并操作和删除操作的组合,具体的,可以根据原始配置数据和合并操作的操作数据来确定。第二操作指令的操作数据可以根据原始配置数据和合并操作的操作数据来对应确定。
具体的,假设获取的南向报文对应网元的原始配置数据包括第五配置数据和第五配置数据的标识,第一操作指令为合并操作,该合并操作的操作数据包括第六配置数据和第六配置数据的标识。若第五配置数据的标识和第六配置数据的标识相同,且第五配置数据和第六配置数据不同,则可认为第一操作指令指示网元将第五配置数据修改为第六配置数据,此时可以确定第二操作指令的作用在于将网元目标配置数据中第六配置数据修改为第五配置数据,则第二操作指令的操作类型是合并操作,第二操作指令的操作数据为第五配置数据和第五配置数据的标识。
举例来说,参考图11所示,该图为根据原始配置数据1101和第一操作指令的操作数据1102,确定第二操作指令1103的示意图。在该图中,网元的原始配置数据1101中包括/a/a1/a11,第一操作指令的操作类型为合并操作,该合并操作的操作数据1102包括/a/a1/a11′,其中/a/a1/a11′是和/a/a1/a11具有相同数据标识的不同配置数据,则可认为第一操作指令指示网元将/a/a1/a11修改为/a/a1/a11′,此时可以确定第二操作指令用于将/a/a1/a11′修改为/a/a1/a11,则第二操作指令的操作类型为合并操作,第二操作指令的操作数据1103:/a/a1/a11。
当然,第二操作指令的操作类型还可以是删除操作和新增操作,例如删除/a/a1/a11′,且新增/a/a1/a11,即对应删除操作的操作数据为/a/a1/a11′,对应新增操作的操作数据为/a/a1/a11,可与上述合并操作实现同样的效果。
具体的,若第一操作指令的操作类型为合并操作,该合并操作的操作数据包括第七配置数据和第七配置数据的标识,且原始配置数据中不存在第七配置数据和第七配置数据的标识,则可认为第一操作指令指示网元在原始配置数据中增加第七配置数据和第七配置数据的标识,此时可以确认第二操作指令的作用在于删除网元目标配置数据中存储的第七配置数据和第七配置数据的标识,则第二操作指令的操作类型是删除操作,第二操作指令的操作数据包括第七配置数据和第七配置数据的标识。
举例来说,参考图12所示,该图为根据原始配置数据1201和第一操作指令的操作数据1202,确定第二操作指令1203的示意图。在该图中,第一操作指令的操作类型为合并操作,该合并操作的操作数据1202为:/a/a1/a13,且原始配置数据1201中不存在/a/a1/a13,则可认为第一操作指令指示网元在原始配置数据1201中新增/a/a1/a13,此时可以确认第二操作指令用于删除/a/a1/a13,则第二操作指令的操作类型为删除操作,第二操作指令的操作数据1203为:/a/a1/a13。
具体的,若原始配置数据包括第五配置数据和第五配置数据的标识,且不存在第七配置数据和第七配置数据的标识。第一操作指令的操作类型为合并操作,该合并操作的操作数据包括第六配置数据和第六配置数据的标识、第七配置数据和第七配置数据的标识。若第五配置数据的标识和第六配置数据的标识相同,且第五配置数据和第六配置数据不同,则可认为第一操作指令指示网元将第五配置数据修改为第六配置数据,并新增第七配置数据和第七配置数据的标识。此时可以确定第二操作指令用于将第六配置数据修改为第五配置数据,并删除第七配置数据和第七配置数据的标识,则第二操作指令的操作类型为合并操作和删除操作,合并操作的操作数据为第五配置数据和第五配置数据的标识,删除操作的操作数据为第七配置数据和第七配置数据的标识。
举例来说,参考图13所示,该图为根据原始配置数据1301和第一操作指令的操作数据1302,确定第二操作指令1303的示意图。在该图中,原始配置数据1301根节点为a,下有三个子节点a1、a2和a3,a1节点下有两个二级子节点a11和a12。第一操作指令为合并操作,该合并操作的操作数据1302为:/a/a2′、/a/a4、/a/a1/a11′和/a/a1/a13,其中,/a/a1/a11′是和/a/a1/a11是具有相同数据标识的不同配置数据,/a/a2′是和/a/a2是具有相同数据标识的不同配置数据。判断第一操作指令是指示网元将/a/a1/a11修改为/a/a1/a11′,将/a/a2修改为/a/a2′,且新增/a/a1/a13和/a/a4,此时可以确定第二操作指令用于将目标配置数据/a/a1/a11′修改为/a/a1/a11,将/a/a2′修改为/a/a2,删除/a/a1/a13和/a/a4,第二操作指令的操作类型为合并操作和删除操作,合并操作对应的操作数据1303为/a/a1/a11和/a/a2,删除操作对应的操作数据1304为/a/a1/a13,删除操作对应的操作数据1305为/a/a4。
作为另一种可能的实施方式,若第一操作指令的操作类型包括替代操作,则获取南向报文对应网元的原始配置数据,并确定第二操作指令的操作类型为包括替代操作,第二操作指令的操作数据包括原始配置数据,替代操作用于将网元中存储的配置数据 替代为原始配置数据。
举例来说,参考图14所示,该图为根据原始配置数据1401和第一操作指令的操作数据1402,确定第二操作指令1403的示意图。在该图中,第一操作指令的操作类型包括替代操作,第一操作指令的操作数据为1402,则第二操作指令的操作类型为替代操作,第二操作指令的操作数据1403为原始配置数据1401,用于将目标配置数据恢复为原始配置数据1401。
在本申请实施例中,还可以根据原始配置数据和第一操作指令的操作数据,对替代操作引起的数据变化进行分析,对于图15的原始配置数据1501和第一操作指令1502,可以判断第一操作指令指示网元将/a/a1/a11修改为/a/a1/a11′,将/a/a2修改为/a/a2′,新增/a/a1/a13和/a/a4,因此相应的逆操作可用于将/a/a1/a11′修改为/a/a1/a11,将/a/a2′修改为/a/a2,删除/a/a1/a13和/a/a4,即替代操作的逆操作可以是合并操作和删除操作,具体的,合并操作的操作数据1503为/a/a1/a11和/a/a2,删除操作的操作数据1504为/a/a1/a13,删除操作的操作数据1505为/a/a4。
作为又一种可能的实施方式,若第一操作指令的操作类型包括删除操作,则确定第二操作指令的操作类型为包括新增操作,第二操作指令的操作数据包括新增操作的操作数据,新增操作用于在网元中存储新增操作的操作数据。在该实施方式中,第一操作指令的操作类型为删除操作,因此也可以直接根据第一操作指令来确定第二操作指令,而不必获取原始配置数据,不影响本申请实施例的实现。
举例来说,参考图16所示,该图为根据第一操作指令的操作数据1601,确定第二操作指令1602的示意图。在该图中,第一操作指令的操作类型为删除操作,第一操作指令的操作数据1601为:/a/a1/a12,则第二操作指令的操作类型为新增操作,该新增操作的操作数据1602与第一操作指令的操作数据1601相同,即为/a/a1/a12。
当然,第二操作指令的操作类型还可以是合并操作,第二操作指令的操作数据与第一操作指令的操作数据相同,例如包括/a/a1/a12,即将/a/a1/a12与目标配置数据进行合并,以便实现目标配置数据向原始配置数据的恢复。
作为又一种可能的实施方式,若第一操作指令的操作类型包括新增操作,则确定第二操作指令的操作类型为包括删除操作,第二操作指令的操作数据包括新增操作的操作数据,删除操作用于删除在网元中存储的新增操作的操作数据。在该实施方式中,第一操作指令的操作类型为删除操作,因此也可以直接根据第一操作指令来确定第二操作指令,而不必获取原始配置数据,不影响本申请实施例的实现。
举例来说,参考图17所示,该图为根据第一操作指令的操作数据1701,确定第二操作指令1702的示意图。在该图中,第一操作指令的操作类型为新增操作,第一操作指令的操作数据1701为:/a/a1/a13,则第二操作指令的操作类型为删除操作,该删除操作的操作数据1702与第一操作指令的操作数据1701相同,即为/a/a1/a13。
为便于更好的实施本申请实施例的上述方案,下面还提供用于实施上述方案的相关装置。
请参考图18所示,本申请实施例提供的报文生成的装置1800,具体对应于上述提供的报文的生成的方法的功能。功能可以通过硬件实现,也可以通过硬件执行相应 的软件实现。硬件或软件包括一个或多个与上述功能相对应的单元,单元可以是软件和/或硬件。该装置1800可以包括:
南向报文序列生成单元1801,用于获取业务服务器发送的北向请求,并根据所述北向请求生成南向报文序列,所述南向报文序列包括至少一个南向报文,每个所述南向报文均包括第一操作指令,所述第一操作指令为对与所述南向报文对应的网元的配置数据进行更新的指令;
第二操作指令确定单元1802,用于针对每个所述南向报文,分别根据所述第一操作指令,确定第二操作指令的操作类型和所述第二操作指令的操作数据,所述第二操作指令为所述第一操作指令的逆操作指令;
逆操作报文生成单元1803,用于根据所述第二操作指令的操作类型和所述第二操作指令的操作数据生成逆操作报文。
可选的,所述第二操作指令确定单元包括:
原始配置数据获取子单元,用于获取所述南向报文对应网元的原始配置数据;
目标配置数据生成子单元,用于对所述原始配置数据执行所述第一操作指令,生成目标配置数据;
第二操作指令确定子单元,用于将所述原始配置数据和所述目标配置数据进行比对,得到所述第二操作指令的操作类型和所述第二操作指令的操作数据。
可选的,所述原始配置数据包括第一配置数据和所述第一配置数据的标识,所述目标配置数据包括第二配置数据和所述第二配置数据的标识;
所述第二操作指令确定子单元具体用于:
若所述第一配置数据的配置标识与所述第二配置数据的配置标识相同,且所述第一配置数据与所述第二配置数据不同,则确认所述第二操作指令的操作类型包括合并操作,所述第二操作指令的操作数据包括所述第一配置数据和所述第一配置数据的标识,所述合并操作用于将所述网元中所述第二配置数据修改为所述第一配置数据。
可选的,所述第二操作指令确定子单元具体用于:
若所述原始配置数据包括第三配置数据和所述第三配置数据的标识,且所述目标配置数据中不存在所述第三配置数据和所述第三配置数据的标识,则确认所述第二操作指令的操作类型包括新增操作,所述第二操作指令的操作数据包括所述第三配置数据和所述第三配置数据的标识,所述新增操作用于存储所述第三配置数据和所述第三配置数据的标识。
可选的,所述第二操作指令确定子单元具体用于:
若所述目标配置数据包括第四配置数据和所述第四配置数据的标识,且所述原始配置数据中不存在所述第四配置数据和所述第四配置数据的标识,则确认所述第二操作指令的操作类型包括删除操作,所述第二操作指令的操作数据包括所述第四配置数据和所述第四配置数据的标识,所述删除操作用于删除所述网元中存储的所述第四配置数据和所述第四配置数据的标识。
可选的,所述第一操作指令的操作类型至少包括以下任意一种:
合并操作、替代操作、删除操作和新增操作。
在一些可能的设计中,所述第二操作指令确定子单元包括:
合并操作原始配置数据获取子单元,用于若所述第一操作指令的操作类型包括合并操作,则获取所述南向报文对应网元的原始配置数据;
合并操作第二操作指令获取子单元,用于根据所述原始配置数据和所述合并操作的操作数据,确认所述第二操作指令的操作类型和所述第二操作指令的操作数据。
可选的,所述原始配置数据包括第五配置数据和所述第五配置数据的标识,所述合并操作的操作数据包括第六配置数据和所述第六配置数据的标识;
所述合并操作第二操作指令获取子单元具体用于:
若所述第五配置数据的标识和所述第六配置数据的标识相同,且所述第五配置数据和所述第六配置数据不同,则确定所述第二操作指令的操作类型包括合并操作,所述第二操作指令的操作数据包括所述第五配置数据和所述第五配置数据的标识,所述合并操作用于将所述网元中所述第六配置数据修改为所述第五配置数据。
可选的,所述合并操作第二操作指令获取子单元具体用于:
若所述合并操作的操作数据包括第七配置数据和所述第七配置数据的标识,且所述原始配置数据中不存在所述第七配置数据和所述第七配置数据的标识,则确认所述第二操作指令的操作类型包括删除操作,所述第二操作指令的操作数据包括所述第七配置数据和所述第七配置数据的标识,所述删除操作用于删除所述网元中存储的所述第七配置数据和所述第七配置数据的标识。
可选的,所述第二操作指令确定子单元具体用于:
若所述第一操作指令的操作类型包括所述替代操作,则获取所述南向报文对应网元的原始配置数据,并确定所述第二操作指令的操作类型为包括替代操作,所述第二操作指令的操作数据包括所述原始配置数据,所述替代操作用于将网元中存储的配置数据替代为所述原始配置数据。
可选的,所述第二操作指令确定子单元具体用于:
若所述第一操作指令的操作类型包括所述删除操作,则确定所述第二操作指令的操作类型为包括新增操作,所述第二操作指令的操作数据包括所述新增操作的操作数据,所述新增操作用于在所述网元中存储所述新增操作的操作数据。
可选的,所述第二操作指令确定子单元具体用于:
若所述第一操作指令的操作类型包括所述新增操作,则确定所述第二操作指令的操作类型为包括删除操作,所述第二操作指令的操作数据包括所述新增操作的操作数据,所述删除操作用于删除在所述网元中存储的所述新增操作的操作数据。
可选的,所述装置1800还包括:
处理结果获取单元,用于按照所述南向报文序列的顺序依次向对应的网元发送所述南向报文序列中的南向报文,并获取所述网元对于所述南向报文的处理结果;
逆操作报文下发单元,用于若任意一个南向报文的处理结果为处理失败,则按照所述南向报文序列的逆序向处理结果为成功的网元发送对应的所述逆操作报文。
接下来介绍本申请实施例中的报文的生成的设备。请参阅图19所示,报文生成的设备1900包括:
接收器1901、发射器1902、处理器1903和存储器1904(其中报文的生成的设备 1900中的处理器1903的数量可以一个或多个,图19中以一个处理器为例)。在本申请的一些实施例中,接收器1901、发射器1902、处理器1903和存储器1904可通过总线或其它方式连接,其中,图19中以通过总线连接为例。
存储器1904可以包括只读存储器和随机存取存储器,并向处理器1903提供指令和数据。存储器1904的一部分还可以包括NVRAM。存储器1904存储有操作系统和操作指令、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,操作指令可包括各种操作指令,用于实现各种操作。操作系统可包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。
处理器1903控制终端设备的操作,处理器1903还可以称为CPU。具体的应用中,报文的生成的设备的各个组件通过总线系统耦合在一起,其中总线系统除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都称为总线系统。
上述本申请实施例揭示的方法可以应用于处理器1903中,或者由处理器1903实现。处理器1903可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1903中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1903可以是通用处理器、DSP、ASIC、FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1904,处理器1903读取存储器1904中的信息,结合其硬件完成上述方法的步骤。
接收器1901可用于接收输入的数字或字符信息,以及产生与用户面装置的相关设置以及功能控制有关的信号输入,发射器1902可包括显示屏等显示设备,发射器1902可用于通过外接接口输出数字或字符信息。
本申请实施例中,接收器1901和发射器1902用于实现数据收发。处理器1903,用于通过接收器1901和发射器1902实现数据收发,完成前述报文的生成的设备所执行的报文的生成过程。
本申请实施例还提供一种计算机可读存储介质,用于存储程序代码,该程序代码用于执行前述各个实施例的一种报文的生成方法中的任意一种实施方式。
本申请实施例还提供一种包括指令的计算机程序产品,当其在计算机上运行时,使得计算机执行前述各个实施例的一种报文的生成的方法中的任意一种实施方式。所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执 行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (27)

  1. 一种报文的生成方法,其特征在于,所述方法包括:
    获取业务服务器发送的北向请求,并根据所述北向请求生成南向报文序列,所述南向报文序列包括至少一个南向报文,每个所述南向报文均包括第一操作指令,所述第一操作指令为对与所述南向报文对应的网元的配置数据进行更新的指令;
    针对每个所述南向报文,分别根据所述第一操作指令,确定第二操作指令的操作类型和所述第二操作指令的操作数据,所述第二操作指令为所述第一操作指令的逆操作指令;
    根据所述第二操作指令的操作类型和所述第二操作指令的操作数据生成逆操作报文。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述第一操作指令,确定第二操作指令的操作类型和所述第二操作指令的操作数据包括:
    获取所述南向报文对应网元的原始配置数据;
    对所述原始配置数据执行所述第一操作指令,生成目标配置数据;
    将所述原始配置数据和所述目标配置数据进行比对,得到所述第二操作指令的操作类型和所述第二操作指令的操作数据。
  3. 根据权利要求2所述的方法,其特征在于,所述原始配置数据包括第一配置数据和所述第一配置数据的标识,所述目标配置数据包括第二配置数据和所述第二配置数据的标识;
    所述将所述原始配置数据和所述目标配置数据进行比对,得到所述第二操作指令的操作类型和所述第二操作指令的操作数据包括:
    若所述第一配置数据的配置标识与所述第二配置数据的配置标识相同,且所述第一配置数据与所述第二配置数据不同,则确认所述第二操作指令的操作类型包括合并操作,所述第二操作指令的操作数据包括所述第一配置数据和所述第一配置数据的标识,所述合并操作用于将所述网元中所述第二配置数据修改为所述第一配置数据。
  4. 根据权利要求2所述的方法,其特征在于,所述将所述原始配置数据和所述目标配置数据进行比对,得到所述第二操作指令的操作类型和所述第二操作指令的操作数据包括:
    若所述原始配置数据包括第三配置数据和所述第三配置数据的标识,且所述目标配置数据中不存在所述第三配置数据和所述第三配置数据的标识,则确认所述第二操作指令的操作类型包括新增操作,所述第二操作指令的操作数据包括所述第三配置数据和所述第三配置数据的标识,所述新增操作用于存储所述第三配置数据和所述第三配置数据的标识。
  5. 根据权利要求2所述的方法,其特征在于,所述将所述原始配置数据和所述目标配置数据进行比对,得到所述第二操作指令的操作类型和所述第二操作指令的操作数据包括:
    若所述目标配置数据包括第四配置数据和所述第四配置数据的标识,且所述原始配置数据中不存在所述第四配置数据和所述第四配置数据的标识,则确认所述第二操作指令的操作类型包括删除操作,所述第二操作指令的操作数据包括所述第四配置数 据和所述第四配置数据的标识,所述删除操作用于删除所述网元中存储的所述第四配置数据和所述第四配置数据的标识。
  6. 根据权利要求1所述的方法,其特征在于,所述第一操作指令的操作类型至少包括以下任意一种:
    合并操作、替代操作、删除操作和新增操作。
  7. 根据权利要求6所述的方法,其特征在于,所述根据所述第一操作指令,确定第二操作指令的操作类型和所述第二操作指令的操作数据包括:
    若所述第一操作指令的操作类型包括合并操作,则获取所述南向报文对应网元的原始配置数据;
    根据所述原始配置数据和所述合并操作的操作数据,确认所述第二操作指令的操作类型和所述第二操作指令的操作数据。
  8. 根据权利要求7所述的方法,其特征在于,所述原始配置数据包括第五配置数据和所述第五配置数据的标识,所述合并操作的操作数据包括第六配置数据和所述第六配置数据的标识;
    所述根据所述原始配置数据和所述合并操作的操作数据,确认所述第二操作指令的操作类型和所述第二操作指令的操作数据包括:
    若所述第五配置数据的标识和所述第六配置数据的标识相同,且所述第五配置数据和所述第六配置数据不同,则确定所述第二操作指令的操作类型包括合并操作,所述第二操作指令的操作数据包括所述第五配置数据和所述第五配置数据的标识,所述合并操作用于将所述网元中所述第六配置数据修改为所述第五配置数据。
  9. 根据权利要求7所述的方法,其特征在于,所述根据所述原始配置数据和所述合并操作的操作数据,确认所述第二操作指令的操作类型和所述第二操作指令的操作数据包括:
    若所述合并操作的操作数据包括第七配置数据和所述第七配置数据的标识,且所述原始配置数据中不存在所述第七配置数据和所述第七配置数据的标识,则确认所述第二操作指令的操作类型包括删除操作,所述第二操作指令的操作数据包括所述第七配置数据和所述第七配置数据的标识,所述删除操作用于删除所述网元中存储的所述第七配置数据和所述第七配置数据的标识。
  10. 根据权利要求6所述的方法,其特征在于,所述根据所述第一操作指令确定第二操作指令的操作类型和所述第二操作指令的操作数据包括:
    若所述第一操作指令的操作类型包括所述替代操作,则获取所述南向报文对应网元的原始配置数据,并确定所述第二操作指令的操作类型为包括替代操作,所述第二操作指令的操作数据包括所述原始配置数据,所述替代操作用于将网元中存储的配置数据替代为所述原始配置数据。
  11. 根据权利要求6所述的方法,其特征在于,所述根据所述第一操作指令确定第二操作指令的操作类型和所述第二操作指令的操作数据包括:
    若所述第一操作指令的操作类型包括所述删除操作,则确定所述第二操作指令的操作类型为包括新增操作,所述第二操作指令的操作数据包括所述新增操作的操作数据,所述新增操作用于在所述网元中存储所述新增操作的操作数据。
  12. 根据权利要求6所述的方法,其特征在于,所述根据所述第一操作指令确定第二操作指令的操作类型和所述第二操作指令的操作数据包括:
    若所述第一操作指令的操作类型包括所述新增操作,则确定所述第二操作指令的操作类型为包括删除操作,所述第二操作指令的操作数据包括所述新增操作的操作数据,所述删除操作用于删除在所述网元中存储的所述新增操作的操作数据。
  13. 一种报文的生成装置,其特征在于,所述装置包括:
    南向报文序列生成单元,用于获取业务服务器发送的北向请求,并根据所述北向请求生成南向报文序列,所述南向报文序列包括至少一个南向报文,每个所述南向报文均包括第一操作指令,所述第一操作指令为对与所述南向报文对应的网元的配置数据进行更新的指令;
    第二操作指令确定单元,用于针对每个所述南向报文,分别根据所述第一操作指令,确定第二操作指令的操作类型和所述第二操作指令的操作数据,所述第二操作指令为所述第一操作指令的逆操作指令;
    逆操作报文生成单元,用于根据所述第二操作指令的操作类型和所述第二操作指令的操作数据生成逆操作报文。
  14. 根据权利要求13所述的装置,其特征在于,所述第二操作指令确定单元包括:
    原始配置数据获取子单元,用于获取所述南向报文对应网元的原始配置数据;
    目标配置数据生成子单元,用于对所述原始配置数据执行所述第一操作指令,生成目标配置数据;
    第二操作指令确定子单元,用于将所述原始配置数据和所述目标配置数据进行比对,得到所述第二操作指令的操作类型和所述第二操作指令的操作数据。
  15. 根据权利要求14所述的装置,其特征在于,所述原始配置数据包括第一配置数据和所述第一配置数据的标识,所述目标配置数据包括第二配置数据和所述第二配置数据的标识;
    所述第二操作指令确定子单元具体用于:
    若所述第一配置数据的配置标识与所述第二配置数据的配置标识相同,且所述第一配置数据与所述第二配置数据不同,则确认所述第二操作指令的操作类型包括合并操作,所述第二操作指令的操作数据包括所述第一配置数据和所述第一配置数据的标识,所述合并操作用于将所述网元中所述第二配置数据修改为所述第一配置数据。
  16. 根据权利要求14所述的装置,其特征在于,所述第二操作指令确定子单元具体用于:
    若所述原始配置数据包括第三配置数据和所述第三配置数据的标识,且所述目标配置数据中不存在所述第三配置数据和所述第三配置数据的标识,则确认所述第二操作指令的操作类型包括新增操作,所述第二操作指令的操作数据包括所述第三配置数据和所述第三配置数据的标识,所述新增操作用于存储所述第三配置数据和所述第三配置数据的标识。
  17. 根据权利要求14所述的装置,其特征在于,所述第二操作指令确定子单元具体用于:
    若所述目标配置数据包括第四配置数据和所述第四配置数据的标识,且所述原始 配置数据中不存在所述第四配置数据和所述第四配置数据的标识,则确认所述第二操作指令的操作类型包括删除操作,所述第二操作指令的操作数据包括所述第四配置数据和所述第四配置数据的标识,所述删除操作用于删除所述网元中存储的所述第四配置数据和所述第四配置数据的标识。
  18. 根据权利要求13所述的装置,其特征在于,所述第一操作指令的操作类型至少包括以下任意一种:
    合并操作、替代操作、删除操作和新增操作。
  19. 根据权利要求18所述的装置,其特征在于,所述第二操作指令确定单元包括:
    合并操作原始配置数据获取子单元,用于若所述第一操作指令的操作类型包括合并操作,则获取所述南向报文对应网元的原始配置数据;
    合并操作第二操作指令获取子单元,用于根据所述原始配置数据和所述合并操作的操作数据,确认所述第二操作指令的操作类型和所述第二操作指令的操作数据。
  20. 根据权利要求19所述的装置,其特征在于,所述原始配置数据包括第五配置数据和所述第五配置数据的标识,所述合并操作的操作数据包括第六配置数据和所述第六配置数据的标识;
    所述合并操作第二操作指令获取子单元具体用于:
    若所述第五配置数据的标识和所述第六配置数据的标识相同,且所述第五配置数据和所述第六配置数据不同,则确定所述第二操作指令的操作类型包括合并操作,所述第二操作指令的操作数据包括所述第五配置数据和所述第五配置数据的标识,所述合并操作用于将所述网元中所述第六配置数据修改为所述第五配置数据。
  21. 根据权利要求19所述的装置,其特征在于,所述合并操作第二操作指令获取子单元具体用于:
    若所述合并操作的操作数据包括第七配置数据和所述第七配置数据的标识,且所述原始配置数据中不存在所述第七配置数据和所述第七配置数据的标识,则确认所述第二操作指令的操作类型包括删除操作,所述第二操作指令的操作数据包括所述第七配置数据和所述第七配置数据的标识,所述删除操作用于删除所述网元中存储的所述第七配置数据和所述第七配置数据的标识。
  22. 根据权利要求18所述的装置,其特征在于,所述第二操作指令确定单元具体用于:
    若所述第一操作指令的操作类型包括所述替代操作,则获取所述南向报文对应网元的原始配置数据,并确定所述第二操作指令的操作类型为包括替代操作,所述第二操作指令的操作数据包括所述原始配置数据,所述替代操作用于将网元中存储的配置数据替代为所述原始配置数据。
  23. 根据权利要求18所述的装置,其特征在于,所述第二操作指令确定单元具体用于:
    若所述第一操作指令的操作类型包括所述删除操作,则确定所述第二操作指令的操作类型为包括新增操作,所述第二操作指令的操作数据包括所述新增操作的操作数据,所述新增操作用于在所述网元中存储所述新增操作的操作数据。
  24. 根据权利要求18所述的装置,其特征在于,所述第二操作指令确定单元具体 用于:
    若所述第一操作指令的操作类型包括所述新增操作,则确定所述第二操作指令的操作类型为包括删除操作,所述第二操作指令的操作数据包括所述新增操作的操作数据,所述删除操作用于删除在所述网元中存储的所述新增操作的操作数据。
  25. 一种报文的生成设备,其特征在于,所述设备包括:处理器和存储器;
    所述存储器,用于存储指令;
    所述处理器,用于执行所述存储器中的所述指令,执行如权利要求1至12中任一项所述的方法。
  26. 一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行如权利要求1-12任意一项所述的方法。
  27. 一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行如权利要求1-12任意一项所述的方法。
PCT/CN2019/078485 2018-03-23 2019-03-18 报文的生成方法及相关设备 WO2019179392A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810245562.0A CN110300009A (zh) 2018-03-23 2018-03-23 报文的生成方法及相关设备
CN201810245562.0 2018-03-23

Publications (1)

Publication Number Publication Date
WO2019179392A1 true WO2019179392A1 (zh) 2019-09-26

Family

ID=67988145

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/078485 WO2019179392A1 (zh) 2018-03-23 2019-03-18 报文的生成方法及相关设备

Country Status (2)

Country Link
CN (1) CN110300009A (zh)
WO (1) WO2019179392A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116069733A (zh) * 2021-11-04 2023-05-05 华为云计算技术有限公司 执行操作指令的方法、装置、设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1855841A (zh) * 2005-04-27 2006-11-01 华为技术有限公司 一种对分布式电信系统进行数据配置的方法
CN102271057A (zh) * 2011-08-02 2011-12-07 大唐移动通信设备有限公司 参数更新方法和设备
CN104410517A (zh) * 2011-11-29 2015-03-11 华为技术有限公司 一种配置回退的方法和设备
CN104484470A (zh) * 2014-12-31 2015-04-01 天津南大通用数据技术股份有限公司 一种数据库集群元数据管理方法
CN106936857A (zh) * 2015-12-29 2017-07-07 中国电信股份有限公司 一种混合云的连接管理方法、sdn控制器及混合云系统

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100555958C (zh) * 2007-07-03 2009-10-28 中兴通讯股份有限公司 网元管理系统中的配置方法
US9152522B2 (en) * 2010-10-22 2015-10-06 Hewlett-Packard Development Company, L.P. Methods for configuration management using a fallback configuration
EP2713555B1 (en) * 2011-12-13 2015-11-04 Huawei Technologies Co., Ltd. Data configuration method and device, and rollback method and device for data configuration
CN105208585A (zh) * 2014-06-23 2015-12-30 中兴通讯股份有限公司 调度信息的配置、配置参数的处理方法及装置
CN106776120A (zh) * 2016-11-24 2017-05-31 珠海市魅族科技有限公司 数据恢复的方法及装置
CN107070682A (zh) * 2016-12-12 2017-08-18 浙江鹏信信息科技股份有限公司 一种网络配置数据回滚的方法及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1855841A (zh) * 2005-04-27 2006-11-01 华为技术有限公司 一种对分布式电信系统进行数据配置的方法
CN102271057A (zh) * 2011-08-02 2011-12-07 大唐移动通信设备有限公司 参数更新方法和设备
CN104410517A (zh) * 2011-11-29 2015-03-11 华为技术有限公司 一种配置回退的方法和设备
CN104484470A (zh) * 2014-12-31 2015-04-01 天津南大通用数据技术股份有限公司 一种数据库集群元数据管理方法
CN106936857A (zh) * 2015-12-29 2017-07-07 中国电信股份有限公司 一种混合云的连接管理方法、sdn控制器及混合云系统

Also Published As

Publication number Publication date
CN110300009A (zh) 2019-10-01

Similar Documents

Publication Publication Date Title
US11516129B2 (en) Packet edit processing method and related device
CN110166299B (zh) Sdn控制器配置恢复方法及装置
US11044156B2 (en) Secure mechanism to manage network device configuration and audit with a blockchain
US8438573B2 (en) Dependency on a resource type
US11909744B2 (en) Network verification method and apparatus
CN109391673A (zh) 一种管理更新文件的方法、系统及终端设备
US10469620B2 (en) Method for transferring a new software version to at least one electricity meter via a communication network
CN105072398B (zh) 一种设备升级方法和装置
WO2020132870A1 (zh) 一种文件更新方法、文件更新装置及终端设备
WO2020062959A1 (zh) 配置数据的方法及装置
CN111817869A (zh) 一种网络配置恢复方法及其相关设备
WO2022267175A1 (zh) 信息处理方法、装置、计算机设备及存储介质
CN109189403B (zh) 操作系统os批量安装方法、装置和网络设备
CN110460668B (zh) 一种文件上传方法、装置、计算机设备和存储介质
WO2019095388A1 (zh) 一种远程协助处理方法及设备
WO2020038337A1 (zh) 网络配置方法、装置及系统
WO2019179392A1 (zh) 报文的生成方法及相关设备
CN114489594A (zh) 一种命令解析器的构建方法、命令解析处理方法及装置
CN110912725A (zh) 一种OpenFlow虚拟交换机的配置方法及配置装置
CN112395339A (zh) 系统间数据准入校验方法、装置、计算机设备和存储介质
CN111416732A (zh) 一种sdn中网络设备扩容自动配置业务的方法及装置
CN110888892A (zh) 一种区块同步方法、装置及存储介质
CN110620695A (zh) 一种数据处理方法及相关设备
US11403093B1 (en) Application modification with proxy service process
CN111090853B (zh) 账户管理方法、系统、电子设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19770826

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19770826

Country of ref document: EP

Kind code of ref document: A1