WO2020037607A1 - 一种传输数据的方法和装置 - Google Patents

一种传输数据的方法和装置 Download PDF

Info

Publication number
WO2020037607A1
WO2020037607A1 PCT/CN2018/101971 CN2018101971W WO2020037607A1 WO 2020037607 A1 WO2020037607 A1 WO 2020037607A1 CN 2018101971 W CN2018101971 W CN 2018101971W WO 2020037607 A1 WO2020037607 A1 WO 2020037607A1
Authority
WO
WIPO (PCT)
Prior art keywords
configuration
network device
field
item
configuration item
Prior art date
Application number
PCT/CN2018/101971
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 华为技术有限公司
Priority to CN201880086974.2A priority Critical patent/CN111615819B/zh
Priority to PCT/CN2018/101971 priority patent/WO2020037607A1/zh
Publication of WO2020037607A1 publication Critical patent/WO2020037607A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • the present application relates to the field of communication technologies, and in particular, to a method and device for transmitting data.
  • HTTP Hypertext Transfer Protocol
  • a message carried in an HTTP message may be used to trigger a network device that receives the HTTP message to execute multiple configuration items in batches, that is, one HTTP message may deliver multiple configuration items at the same time.
  • a web API such as a RESTful API (RESTful API, REST stands for Representational State Transfer, and API stands for Application Programming Interface)
  • RESTful API RESTful API, REST stands for Representational State Transfer, and API stands for Application Programming Interface
  • multiple APIs of the Web API can be issued in one HTTP message at the same time. Configuration items to achieve batch configuration of Web API.
  • the technical problem to be solved by the present application is to provide a method and device for transmitting data, so as to be able to specify an error processing strategy corresponding to the HTTP message in an HTTP message for sending a configuration item, so as to implement different HTTP While adopting different error handling strategies for packets, it not only avoids the extra interaction times between network devices, but also avoids the occurrence of errors in configuring error handling strategies on network devices.
  • a first aspect of the embodiments of the present application provides a method for transmitting data, including:
  • the first network device generates a Hypertext Transfer Protocol HTTP message
  • the message body field of the HTTP message carries configuration information, and the configuration information is used to trigger the second network device to execute multiple configuration items;
  • the protocol layer extension field of the HTTP message carries extension parameters, and the extension parameters are used to indicate an error handling strategy adopted by the second network device when a configuration item fails to execute among the multiple configuration items;
  • the extended parameters are added to the protocol layer extension field of the HTTP message, it can not only avoid the number of interactions between the first network device and the second network device caused by the modification of the global error processing strategy in the prior art. Increased, and for other HTTP messages received by the second network device, it is also possible to avoid the second network device from adopting the wrong error processing strategy for other HTTP messages due to the modification of the global error processing strategy.
  • the protocol-level extension field is specifically located in a start-line portion of the HTTP message.
  • specific extension parameters can be added to the start-line part of the HTTP message, instead of adding extension parameters by modifying the data model, so as to avoid the modification of the data model and the modified data model.
  • the first network device can use a uniform form of extended parameters to specify the error handling strategy, without having to The data model corresponding to the service, and then adjust the form of the extended parameters, so as to ensure that the first network device can specify a corresponding error handling strategy in HTTP.
  • the protocol-level extension field is specifically a uniform resource identifier in the start-line part.
  • an extension parameter may be added to the query field in the URI in the start-line part, which can avoid the problem that the modified data model is incompatible with the standard data model due to the modification of the data model.
  • the protocol-level field is specifically located in a message header-field of the HTTP packet.
  • the model is incompatible with the standard data model.
  • the first network device can use a unified form of extended parameters to specify the error handling strategy, without having to provide according to the second network device.
  • the data model corresponding to the service is adjusted by adjusting the form of the extended parameters, so as to ensure that the first network device can specify a corresponding error handling policy in HTTP.
  • the protocol-level extension field is specifically an error processing field in the header-field.
  • the error processing field in the header-field may be specifically added with extension parameters, which can avoid the problem that the modified data model is incompatible with the standard data model due to modification of the data model.
  • the error processing strategy is specifically any one of the following strategies:
  • the configuration item that has been executed in the plurality of configuration items is rolled back and execution of all the configuration items in the plurality of configuration items is stopped.
  • the configuration message is specifically configuration information of a World Wide Web Web Application Programming Interface API
  • the configuration item is a configuration item of the Web API.
  • the Web API is specifically an application programming interface RESTful API that represents a layered transformation.
  • a second aspect of the embodiments of the present application provides a method for transmitting data, including:
  • the message body field of the HTTP message carries configuration information, and the configuration information is used to trigger the second network device to execute multiple configuration items;
  • the protocol layer extension field of the HTTP message carries extension parameters, and the extension parameters are used to indicate an error handling strategy adopted by the second network device when a configuration item fails to execute among the multiple configuration items;
  • the second network device performs an action according to the information carried in the HTTP message.
  • the protocol-level extension field is specifically located in a start-line part of the HTTP message.
  • the protocol-level extension field is specifically a query in the uniform resource identifier URI in the start-line part Field.
  • the protocol-level field is specifically located in a message header-field of the HTTP packet.
  • the protocol-level extension field is specifically an error processing field in the header-field.
  • the error processing strategy is specifically any one of the following strategies:
  • the configuration item that has been executed in the plurality of configuration items is rolled back and execution of all the configuration items in the plurality of configuration items is stopped.
  • the configuration message is specifically configuration information of a World Wide Web Web Application Programming Interface API
  • the configuration item is a configuration item of the Web API.
  • the Web API is specifically an application programming interface RESTful API that represents a layered transformation.
  • the method for transmitting data provided in the second aspect corresponds to the method for transmitting data provided in the first aspect. Therefore, for various possible implementations of the method for transmitting data provided in the second aspect, reference may be made to the Various possible implementations of the method.
  • a third aspect of the embodiments of the present application provides a method for transmitting data, including:
  • the message body field of the HTTP message carries configuration information, and the configuration information is used to trigger the second network device to execute multiple configuration items;
  • the protocol layer extension field of the HTTP message carries extension parameters, and the extension parameters are used to indicate an error handling strategy adopted by the second network device when a configuration item fails to execute among the multiple configuration items;
  • a sending module configured to send the HTTP packet to the second network device.
  • the protocol-level extension field is specifically located in a start-line part of the HTTP message.
  • the protocol-level extension field is specifically a uniform resource identifier in the start-line part.
  • the protocol-level field is specifically located in a header-field of the HTTP packet.
  • the protocol-level extension field is specifically an error processing field in the header-field.
  • the error processing strategy is specifically any one of the following strategies:
  • the configuration item that has been executed in the plurality of configuration items is rolled back and execution of all the configuration items in the plurality of configuration items is stopped.
  • the configuration message is specifically configuration information of a web application programming interface API of the World Wide Web
  • the configuration item is a configuration item of the Web API.
  • the Web API is specifically an application programming interface RESTful API that represents a layered transformation.
  • the device for transmitting data provided in the third aspect corresponds to the method for transmitting data provided in the first aspect. Therefore, for various possible implementation modes of the device for transmitting data provided in the third aspect, reference may be made to the data transmission device provided in the first aspect. Various possible implementations of the method.
  • a fourth aspect of the embodiments of the present application provides a method for transmitting data, including:
  • An acceptance module configured to receive a Hypertext Transfer Protocol HTTP message sent by the first network device
  • the message body field of the HTTP message carries configuration information, and the configuration information is used to trigger the second network device to execute multiple configuration items;
  • the protocol layer extension field of the HTTP message carries extension parameters, and the extension parameters are used to indicate an error handling strategy adopted by the second network device when a configuration item fails to execute among the multiple configuration items;
  • the execution module is configured to perform an action according to the information carried in the HTTP message.
  • the protocol-level extension field is specifically located in a start-line portion of the HTTP message.
  • the protocol-level extension field is specifically a query in the uniform resource identifier URI in the start-line part Field.
  • the protocol-level field is specifically located in a header-field of the HTTP packet.
  • the protocol-level extension field is specifically an error processing field in the header-field.
  • the error processing strategy is specifically any one of the following strategies:
  • the configuration item that has been executed in the plurality of configuration items is rolled back and execution of all the configuration items in the plurality of configuration items is stopped.
  • the configuration message is specifically configuration information of a World Wide Web Web Application Programming Interface API
  • the configuration item is a configuration item of the Web API.
  • the Web API is specifically an application programming interface RESTful API that represents a layered transformation.
  • the device for transmitting data provided in the fourth aspect corresponds to the method for transmitting data provided in the second aspect. Therefore, for various possible implementation modes of the device for transmitting data provided in the fourth aspect, reference may be made to the data transmission device provided in the second aspect. Various possible implementations of the method.
  • an extension parameter of an error processing strategy that is required to be adopted when the second network device fails to execute multiple configuration items is added, so that the second network device
  • the error handling strategy corresponding to the HTTP message can be determined according to the extended parameters carried in the HTTP message to deal with the failure of the configuration item execution. This can not only avoid the global error handling strategy in the prior art.
  • the number of interactions between the first network device and the second network device caused by the modification is increased, and other HTTP messages received by the second network device can also be avoided due to the modification of the global error processing strategy.
  • the second network device uses a wrong error handling strategy for other HTTP messages.
  • FIG. 1 is a schematic diagram of an exemplary application scenario in an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a data transmission method according to an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a method according to a scenario embodiment in an embodiment of the present application.
  • FIG. 5 is a schematic diagram of another exemplary configuration message
  • FIG. 6 is a schematic structural diagram of a data transmission device according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of another apparatus for transmitting data according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a device for transmitting data according to an embodiment of the present application.
  • a network device executes multiple configuration items in batches based on HTTP messages sent by an application
  • the network device needs to implement a corresponding error handling policy to cope with the failure of executing the configuration item.
  • the network device needs to implement a corresponding error handling policy to cope with the failure of executing the configuration item.
  • the existing solutions for executing configuration item failures for each HTTP message received by a network device, when a configuration item that fails to execute appears in multiple configuration items of the HTTP message, the same error handling strategy is adopted. If different error handling strategies are required for different HTTP messages, the application must send a message modifying the error handling strategy to the network device through another interface in advance to achieve the error handling currently set on the network device. The policy is modified, which increases the number of interactions between the application and the network device.
  • different HTTP messages may require different error handling strategies. If network devices need to configure multiple HTTP message configuration items at the same time within a short period of time, the error handling policies configured on the network equipment are modified. Multiple modifications can easily cause the network device to use an unexpected (that is, incorrect) error handling strategy when configuring the configuration item delivered by another part of the HTTP message to deal with the failure of executing the configuration item. For example, assume that the network device processes both message A and message B in a short period of time, and the error handling strategy corresponding to message A is strategy a, and the error handling strategy corresponding to message B is strategy b.
  • the application program After changing the error handling policy on the network device to policy a for message A, the application quickly changes the error handling policy on the network device from policy a to policy b for message B, and then configure message A on the network device.
  • the network device In the process of configuration items in the process, if a configuration item fails to be configured, the network device will use the policy a to process the message A accordingly, but not the policy b to process the message A.
  • the embodiment of the present application provides a method for transmitting data, so as to specify an error handling policy corresponding to the HTTP message in an HTTP message for sending a configuration item, which may specifically be an HTTP message protocol.
  • a configuration item which may specifically be an HTTP message protocol.
  • the application does not need to send additional messages to modify the error handling strategy on the network device, which can avoid adding applications and Number of interactions between network devices; and for each HTTP message, the network device can determine the error handling strategy corresponding to the HTTP message according to the extended parameters in the HTTP message without modifying the global on the network device This method also prevents network devices from choosing the wrong error handling strategy for HTTP messages caused by multiple modification of the global error handling strategy.
  • an application on the terminal 101 can generate an HTTP message.
  • the body of the HTTP message carries configuration information used to trigger the network device 102 to execute multiple configuration items, and the protocol in the HTTP message.
  • the extension parameter carried in the layer extension field is used to indicate an extended parameter of the error processing strategy adopted by the network device 102 when a configuration item fails to execute among multiple configuration items.
  • the terminal 101 sends the HTTP message to the network device 102.
  • the network device 102 responds to the received HTTP message, and performs batch configuration of the Web API interface according to multiple configuration items in the HTTP message.
  • the corresponding error handling strategy is adopted to process the configuration of the Web API interface process. For example, you can continue to perform other Web API configuration, or roll back the Web API interface to the configuration that was performed, restore the state before the configuration, or stop configuring the Web API interface and retain the previously performed Configuration, etc.
  • FIG. 2 is a schematic flowchart of a data transmission method according to an embodiment of the present application.
  • the method may specifically include:
  • the first network device generates an HTTP message, where a message body field of the HTTP message carries configuration information for triggering the second network device to execute multiple configuration items, and a protocol layer extension field of the HTTP message It carries extension parameters used to indicate an error handling strategy adopted by the second network device when a configuration item that fails to execute appears in the multiple configuration items.
  • S202 The first network device sends the generated HTTP packet to the second network device.
  • S203 The second network device receives an HTTP packet sent by the first network device.
  • S204 The second network device performs a corresponding action according to the information carried in the HTTP message.
  • the HTTP message can be generated by an application such as Web APP, and then the application sends the generated HTTP message to the network device, so that the network device responds to the configuration item indicated by the HTTP message. Configure accordingly.
  • the network device where the application is located may be the first network device described in this embodiment, and the network device receiving the HTTP message sent by the application may be the second network device described in this embodiment.
  • the body field of the HTTP message carries configuration information for triggering the second network device to execute multiple configuration items, so that the second network device can execute multiple configuration items in batches based on the configuration information.
  • the HTTP message may carry configuration information for triggering the second network device to execute multiple configuration items of the Web API interface in batches. In this way, the second network device may perform batch configuration of the Web API interface based on the configuration information.
  • the configuration information carried in the HTTP message is the configuration information of the Web API interface, and the configuration item executed by the second network device is the configuration item of the Web API interface.
  • an error handling strategy may be specified in the HTTP message, which may specifically be an extension field at the protocol level of the HTTP message. Added extended parameters to indicate error handling strategies. In this way, when a configuration item that fails to execute appears in multiple configuration items, the second network device can adopt an error handling policy that is compatible with the HTTP according to the extended parameters carried in the protocol layer extension field of the HTTP message.
  • the message body in an HTTP message needs to be defined according to the service standard data model. Therefore, the first network device may not need to change the service standard data model corresponding to the message body in the HTTP message. Under the condition, an extended parameter specifying an error handling policy is added to the HTTP message. For example, when performing batch configuration on the RESTful API interface (representation layered application programming interface) of the second network device, the message body in the HTTP message needs to conform to the service standard corresponding to the configuration service for the RESTful API interface. Data model is used for definition. When adding extended parameters, the business standard data model corresponding to the message body is generally not allowed to be changed to avoid the situation where the modified business standard data model is incompatible with the original business standard data model.
  • the extended parameters are added in the protocol-level extension field of the HTTP message, so that even in the HTTP message Extended parameters are added to the article, and the data model of the message body in the HTTP message is not changed, so that the modification of the data model can avoid the problem that the modified data model is incompatible with the standard data model.
  • the form of the extended parameters in the HTTP message is usually defined by the second network device. Therefore, the existing scheme for adding extended parameters to the message body of the HTTP message may be used when the second network device provides different services.
  • the first network device adds different forms of extension parameters to the HTTP message based on the different data models corresponding to different services, but some data models may not provide the corresponding form of extension parameters, which will cause the first network device
  • extended parameters are added to the protocol layer extension field of the HTTP message.
  • the first network Devices can use a unified form of extended parameters to specify the error handling strategy, without having to adjust the form of the extended parameters according to the data model corresponding to the service provided by the second network device, thereby ensuring that the first network device can be used in HTTP. Specify the appropriate error handling strategy.
  • this embodiment provides the following two implementation manners of adding an extension parameter to a protocol-level extension field of an HTTP message:
  • the protocol-level extension field of the HTTP message may be located in the start-line part of the HTTP message. Further, the protocol-level extension field may specifically be in the start-line part.
  • the query field in a URI Uniform Resource Identifier.
  • RESTCONF protocol a network configuration management protocol defined in RFC8040
  • an optional query parameter is included in the URI of the HTTP request, and a parameter can be extended in the query parameter of the URI as an indication Extended parameters of the error handling strategy.
  • the protocol-level extension field of the HTTP message may also be located in the header-field of the HTTP message. Further, the protocol-level extension field may be specifically in the header-field. Error handling field.
  • the error handling strategy may include an error rollback strategy, an error stop strategy, and an error continue strategy.
  • the second network device adopts an error continuation policy; if the extended parameter carried in the HTTP message is rollback-on-error , The second network device adopts an error rollback policy; if the extended parameter carried in the HTTP message is stop-on-error, the second network device adopts an error stop policy.
  • error handling strategies mentioned here are only for illustrative purposes, and are not used to limit the error handling strategies to the above three types. In practical applications, the error handling strategies may also include other strategies. The needs of the situation are determined and will not be repeated here.
  • the error rollback strategy means that if the execution of the target configuration item fails in multiple configuration items, the second network device rolls back the configuration made to the configuration item that has been executed and stops executing the configuration information indicated All configuration items of, that is, the configuration performed on the configuration item by the second network device before revocation, fall back to the state before executing the configuration item. For example, the second network device needs to configure configuration item A, configuration item B, and configuration item C in sequence. When the second network device executes configuration item B, the execution fails.
  • the second network device can return to Roll back the configuration made to configuration item A that has already been executed, that is, roll back to the state before executing configuration item A, configuration item B, and configuration item C, and no longer execute configuration item A, configuration item B, and configuration item C .
  • the error continuation policy means that if the execution of the target configuration item fails in multiple configuration items, the configuration performed on the executed configuration item is maintained, and the execution of the multiple configuration items other than the target configuration item is continued.
  • Configuration items Still taking the second network device to sequentially configure configuration item A, configuration item B, and configuration item C as an example for illustration. When the second network device executes configuration item B and the execution fails, the second network device The configuration made for the configuration item A that has been executed is maintained, and the configuration item C is continuously executed, but the configuration item B is no longer executed. That is, the second network device skips the configuration of the configuration item B and executes only the configuration item A and the configuration item C.
  • the error stop policy means that if the execution of the target configuration item fails in multiple configuration items, the second network device maintains the configuration performed on the configuration item that has already been executed, and stops the execution of the configuration item that has not been executed in multiple configuration items.
  • Configuration items Still taking the second network device to sequentially configure configuration item A, configuration item B, and configuration item C as an example for illustration. When the second network device executes configuration item B and the execution fails, the second network device The configuration made to the configuration item A that has been executed is maintained, but the execution of the configuration items other than the configuration item A is stopped. That is, when the execution of the configuration item B fails, the second network device executes only the configuration item A, and no longer executes the configuration item B and the configuration item C.
  • the first network device After the first network device generates the HTTP message, it can send the HTTP message to the second network device. In this way, after receiving the HTTP message, the second network device can respond to the configuration information carried in the HTTP message.
  • Execute multiple configuration items and when a configuration item fails to execute, you can use an error handling policy that is compatible with the HTTP packet according to the extended parameters carried in the HTTP packet to deal with the failure of the configuration item execution .
  • the second network device In order to enable the second network device to determine the error handling policy corresponding to the HTTP message sent by the first network device, in this embodiment, in the protocol layer extension field of the HTTP message, add the second network device to configure multiple The extended parameter of the error handling strategy that needs to be adopted when the configuration item fails to execute, so that the second network device can determine the error handling strategy corresponding to the HTTP message according to the extended parameter carried in the HTTP message. Dealing with the failure of configuration item execution can not only avoid the increase in the number of interactions between the first network device and the second network device caused by the modification of the global error handling strategy in the prior art, but also for the second network The other HTTP packets received by the device can also prevent the second network device from adopting the wrong error processing policy for other HTTP packets due to the modification of the global error processing policy.
  • FIG. 3 is a schematic flowchart of a method for transmitting data in an embodiment of a scenario of the present application.
  • the network device communicates with the Web APP based on the RESTCONF protocol, and after receiving the HTTP message sent by the Web APP, the network device performs batch configuration of the Web API interface.
  • the method may include:
  • the Web APP sends an HTTP message to the network device.
  • the message body field of the HTTP message carries configuration information used to trigger the network device to perform multiple configuration items.
  • An error in the header-field of the message header of the HTTP message The processing field carries an extended parameter, which is used to indicate an error handling strategy adopted by the network device when a configuration item with a configuration failure occurs in multiple configuration items.
  • the Web APP and the network device can communicate based on the RESTCONF protocol. If the network device needs to perform batch configuration for the Web API interface, the Web APP can first generate an HTTP report containing the configuration information for the Web APP interface. Text to trigger network devices to batch configure the Web APP interface.
  • batch configuration of the Web API interface based on the RESTCONF protocol specifically, batch configuration of the RESTful API interface may be performed.
  • the Web APP when it generates an HTTP message, it also carries extended parameters in the error processing field in the header-field of the HTTP message, which is used to instruct the network device to perform a Web API interface based on a certain configuration item.
  • error handling strategy When configuration fails, which error handling strategy is adopted to handle the configuration failure.
  • the generated HTTP message may be a configuration message as shown in FIG. 4, which indicates that a request is made to add two users "wang" and "zhang” to the "users" list of "example”.
  • the extended parameter continuous-on-error can be carried in the error processing field Error-Option in the header field of the message header.
  • the extended parameter continuous-on-error is used to indicate the occurrence of multiple configuration items.
  • the network device adopts an error continuation policy, that is, if the execution of the target configuration item fails in multiple configuration items, the configuration performed on the executed configuration item is maintained, and multiple configuration items are continued to be executed Configuration items other than the target configuration item.
  • the error processing field error-option may also carry an extended parameter rollback-on-error.
  • the extended parameter rollback-on-error is used to indicate that the network device adopts an error rollback when a configuration item fails to be configured in multiple configuration items.
  • a policy that is, if the execution of a target configuration item fails in multiple configuration items, the second network device rolls back the configuration made to the configuration item that has been executed and stops executing all configuration items indicated by the configuration information;
  • the error processing field error-option may also carry an extended parameter stop-on-error.
  • the extended parameter stop-on-error is used to indicate that the network device adopts an error stop policy when a configuration item fails to be configured in multiple configuration items. That is, if the execution of the target configuration item fails in multiple configuration items, the second network device maintains the configuration performed on the configuration item that has already been executed, and stops executing the configuration item that has not been executed in the multiple configuration items.
  • the Web APP After the Web APP generates the HTTP message, it can send the HTTP message to the network device, so that the network device can start batch configuration of the Web API interface based on the received HTTP message.
  • the network device responds to the configuration information of the received HTTP message, and configures the configuration items one by one.
  • the network device can respond to the configuration information carried in the HTTP message, start a configuration executor, and use the configuration executor to sequentially configure the WebAPP interface based on each configuration item. That is, the configuration of configuration item 1 to configuration item n is performed in order.
  • a configuration item fails to be configured. If a configuration item fails to be configured, the network device is based on the header of the HTTP packet header- The extended parameter in the error handling field in the field determines the error handling strategy corresponding to the HTTP message. Specifically, if the extended parameter obtained by the network device is continuous-on-error, the error continuation policy is adopted; if the extended parameter obtained by the network device is rollback-on-error, the error rollback policy is adopted; If the obtained extended parameter is stop-on-error, an error stopping strategy is adopted.
  • corresponding processing may be performed. For example, if a configuration failure occurs during the execution of configuration item 3, if the network device determines that an error continuation policy is adopted, the configuration performed on configuration item 1 and configuration item 2 can be maintained, and configuration item 4 to configuration can be continuously executed Item n; if the network device determines to adopt an error rollback policy, it can undo the previous configuration performed on configuration item 1 and configuration item 2, roll back to the state before executing configuration item 1 and 2, and terminate the configuration, no longer Execute configuration item 1 to configuration item n; if the network device determines that an error stopping policy is adopted, the configuration performed on configuration item 1 and configuration item 2 may be maintained, and execution of configuration item 3 to configuration item n may be stopped.
  • the extended parameter is located in the error processing field of the header-field of the HTTP packet as an example, and in other scenario embodiments, the extended parameter is also It can be in the URI in the start-line part of the HTTP message.
  • the general URI format is [scheme:] [// authority] path [? query] [# fragment]
  • the URI includes an optional query parameter
  • a parameter can be extended in the query parameter of the URI as an extended parameter for indicating an error handling strategy.
  • a parameter error-option can be extended in the query field in the start-line part of the start line shown in FIG. 5, and the error processing policy corresponding to the HTTP packet is specified as continuous-on-error.
  • an error processing field in a header-field of a message header of an HTTP message delivered by a Web APP is added to instruct a network device that receives an HTTP message to execute multiple configuration items when execution fails.
  • the extended parameters of the error handling strategy to be adopted.
  • the network device can determine the error handling strategy corresponding to the HTTP message according to the extended parameters carried in the received HTTP message, which can not only avoid increasing the gap between the Web APP and the network device.
  • the number of interactions can also avoid adopting the wrong error handling strategy on the network device.
  • FIG. 6 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present application.
  • the apparatus 600 may specifically include:
  • the message body field of the HTTP message carries configuration information, and the configuration information is used to trigger the second network device to execute multiple configuration items;
  • the protocol layer extension field of the HTTP message carries extension parameters, and the extension parameters are used to indicate an error handling strategy adopted by the second network device when a configuration item fails to execute among the multiple configuration items;
  • the sending module 602 is configured to send the HTTP packet to the second network device.
  • the protocol-level extension field is specifically located in a start-line part of the HTTP message.
  • the protocol-level extension field is specifically a uniform resource identifier in the start-line part.
  • the protocol-level field is specifically located in a message header-field of the HTTP packet.
  • the protocol-level extension field is specifically an error processing field in the header-field.
  • the error processing strategy is specifically any one of the following strategies:
  • the configuration item that has been executed in the plurality of configuration items is rolled back and execution of all the configuration items in the plurality of configuration items is stopped.
  • the configuration message is specifically configuration information of a World Wide Web Application Programming Interface API; and the configuration item is a configuration item of the Web API.
  • the Web API is specifically an application programming interface RESTful API that represents a layered transformation.
  • the second network device In order to enable the second network device to determine the error handling policy corresponding to the HTTP message sent by the first network device, in this embodiment, in the protocol layer extension field of the HTTP message, add the second network device to configure multiple The extended parameter of the error handling strategy that needs to be adopted when the configuration item fails to execute, so that the second network device can determine the error handling strategy corresponding to the HTTP message according to the extended parameter carried in the HTTP message. Dealing with the failure of configuration item execution can not only avoid the increase in the number of interactions between the first network device and the second network device caused by the modification of the global error handling strategy in the prior art, but also for the second network The other HTTP packets received by the device can also prevent the second network device from adopting the wrong error processing policy for other HTTP packets due to the modification of the global error processing policy.
  • FIG. 7 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present application.
  • the apparatus 700 may specifically include:
  • An acceptance module 701 configured to receive a Hypertext Transfer Protocol HTTP message sent by a first network device
  • the message body field of the HTTP message carries configuration information, and the configuration information is used to trigger the second network device to execute multiple configuration items;
  • the protocol layer extension field of the HTTP message carries extension parameters, and the extension parameters are used to indicate an error handling strategy adopted by the second network device when a configuration item fails to execute among the multiple configuration items;
  • the execution module 702 is configured to perform an action according to the information carried in the HTTP message.
  • the protocol-level extension field is specifically located in a start-line part of the HTTP message.
  • the protocol-level extension field is specifically a query field in a uniform resource identifier URI in the start-line part.
  • the protocol-level field is specifically located in a message header-field of the HTTP packet.
  • the protocol-level extension field is specifically an error processing field in the header-field.
  • the error processing strategy is specifically any one of the following strategies:
  • the configuration item that has been executed in the plurality of configuration items is rolled back and execution of all the configuration items in the plurality of configuration items is stopped.
  • the configuration message is specifically configuration information of a World Wide Web Application Programming Interface API; and the configuration item is a configuration item of the Web API.
  • the Web API is specifically an application programming interface RESTful API that represents a layered transformation.
  • an extension parameter of an error processing strategy that is required to be adopted by the second network device when multiple configuration items fail to execute is added, so that the second network device can According to the extended parameters carried in the HTTP message, determine the error handling strategy corresponding to the HTTP message to deal with the failure of the configuration item execution.
  • This can not only avoid modifying the global error handling strategy in the prior art.
  • the increase in the number of interactions between the first network device and the second network device caused by the time, and for other HTTP messages received by the second network device it can also avoid the first error caused by the modification of the global error processing strategy.
  • the second network device adopts the wrong error handling strategy for other HTTP messages.
  • the previous embodiment describes the device for transmitting data in the embodiment of the present application from the perspective of a functional entity.
  • the following describes the device for transmitting data in the embodiment of the present application in detail from the perspective of hardware processing.
  • the device includes: a processor, a memory, a communication interface, and a bus; the processor, the communication interface, and the memory communicate with each other through the bus; A communication interface for receiving and sending data; the memory for storing instructions; the processor for executing the instructions in the memory, and performing the following operations:
  • the message body field of the HTTP message carries configuration information, and the configuration information is used to trigger the second network device to execute multiple configuration items;
  • the protocol layer extension field of the HTTP message carries extension parameters, and the extension parameters are used to indicate an error handling strategy adopted by the second network device when a configuration item fails to execute among the multiple configuration items.
  • the protocol-level extension field is specifically located in a start-line part of the HTTP message.
  • the protocol-level extension field is specifically a uniform resource identifier in the start-line part.
  • the protocol-level field is specifically located in a message header-field of the HTTP packet.
  • the protocol-level extension field is specifically an error processing field in the header-field.
  • the error processing strategy is specifically any one of the following strategies:
  • the configuration item that has been executed in the plurality of configuration items is rolled back and execution of all the configuration items in the plurality of configuration items is stopped.
  • the configuration message is specifically configuration information of a World Wide Web Application Programming Interface API; and the configuration item is a configuration item of the Web API.
  • the Web API is specifically an application programming interface RESTful API that represents a layered transformation.
  • a device 800 includes: a receiver 801, a transmitter 802, a processor 803, and a memory 804 (the number of the processors 803 in the device 800 may be one or more (A processor is taken as an example in FIG. 8).
  • the communication interface may include a receiver 801 and a transmitter 802.
  • the receiver 801, the transmitter 802, the processor 803, and the memory 804 may be connected through a bus or other manners. In FIG. 8, the connection through the bus is taken as an example.
  • the memory 804 may include a read-only memory and a random access memory, and provide instructions and data to the processor 803. A part of the memory 804 may further include a non-volatile random access memory (English full name: Non-Volatile Random Access Memory, English abbreviation: NVRAM).
  • the memory 804 stores an operating system and operation instructions, executable modules or data structures, or a subset thereof, or an extended set thereof.
  • the operation instructions may include various operation instructions for implementing various operations.
  • the operating system may include various system programs for implementing various basic services and processing hardware-based tasks.
  • the processor 803 controls the operation of the device 800.
  • the processor 803 may also be referred to as a central processing module (full name in English: Central Processing Unit, English for short: CPU).
  • the various components are coupled together through a bus system.
  • the bus system may include a power bus, a control bus, and a status signal bus in addition to a data bus.
  • various buses are called bus systems in the figure.
  • the method disclosed in the foregoing embodiment of the present application may be applied to the processor 803, or implemented by the processor 803.
  • the processor 803 may be an integrated circuit chip and has a signal processing capability.
  • each step of the above method may be completed by using hardware integrated logic circuits or instructions in the form of software in the processor 803.
  • the aforementioned processor 803 may be a general-purpose processor, a digital signal processor (full English name: digital processing, English abbreviation: DSP), an application specific integrated circuit (full English name: Application Specific Integrated Circuit, English abbreviation: ASIC), field programmable Gate array (full name in English: Field-Programmable Gate Array, English abbreviation: FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASIC Application Specific Integrated Circuit
  • FPGA field programmable Gate array
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in combination with the embodiments of the present application may be directly implemented by a hardware decoding processor, or may be performed by using a combination of hardware and software modules in the decoding processor.
  • the software module may be located in a mature storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, and the like.
  • the storage medium is located in the memory 804, and the processor 803 reads the information in the memory 804 and completes the steps of the foregoing method in combination with its hardware.
  • the receiver 801 can be used to receive input digital or character information, and to generate signal inputs related to the related settings and function control of the device 800.
  • the transmitter 802 can include display devices such as a display screen, and the transmitter 802 can be used to output numbers through an external interface. Or character information.
  • the processor 803 is configured to perform the following operations:
  • the message body field of the HTTP message carries configuration information, and the configuration information is used to trigger the second network device to execute multiple configuration items;
  • the protocol layer extension field of the HTTP message carries extension parameters, and the extension parameters are used to indicate an error handling strategy adopted by the second network device when a configuration item fails to execute among the multiple configuration items;
  • the technical solution of the present application may be embodied in the form of a software product, and the computer software product may be stored in a storage medium, such as a read-only memory (English: read-only memory (ROM) / RAM, magnetic disk,
  • ROM read-only memory
  • the optical disk and the like include a plurality of instructions for causing a computer device (which may be a personal computer, a server, or a network communication device such as a router) to execute the method described in each embodiment of the present application or some parts of the embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本申请公开了一种传输数据的方法和装置,包括:在HTTP报文的协议层面扩展字段中,添加第二网络设备在配置多个配置项出现执行失败时所需采用的错误处理策略的扩展参数,从而使得第二网络设备根据HTTP报文中所携带的扩展参数,确定与HTTP报文相对应的错误处理策略,以应对配置项执行失败的情况,这不仅避免现有技术中对全局的错误处理策略进行修改时所导致的第一网络设备与第二网络设备之间交互次数的增加,而且,针对第二网络设备接收到的其它HTTP报文,也避免由于对全局的错误处理策略进行修改而导致第二网络设备为其它HTTP报文采用错误的错误处理策略。

Description

一种传输数据的方法和装置 技术领域
本申请涉及通信技术领域,特别是涉及一种传输数据的方法和装置。
背景技术
在万维网(World Wide Web,简称Web)中,应用程序与网络设备之间通常采用超文本传输协议(Hypertext Transfer Protocol,简称HTTP)报文进行信息交互。有些情况下,HTTP报文所携带的消息,可能用于触发接收所述HTTP报文的网络设备批量执行多个配置项,也就是说,一个HTTP报文可以同时下发多个配置项。例如,对于表现层状转换式的应用程序编程接口(RESTful API,REST表示Representational State Transfer,API表示Application Programming Interface)等Web API来说,可以在一个HTTP报文中同时下发Web API的多个配置项,从而实现Web API的批量配置。
当一个HTTP报文同时下发了多个配置项时,有时存在个别配置项在接收所述HTTP报文的网络设备上执行失败。针对这种执行失败的情况,有多种错误处理策略可供选用,如,在一个配置项执行失败之后继续执行HTTP报文中未执行过的其他配置项,或,在一个配置项执行失败之后停止执行HTTP报文中所有未执行过的配置项,等等。通常,网络设备被配置了相同的错误处理策略,因此,针对不同的HTTP报文,当HTTP报文中下发的多个配置项出现执行失败的配置项时都将采用相同的错误处理策略。但是,不同的HTTP报文可能会需要采用不同的错误处理策略,为此就需要通过另外的接口针对当前的HTTP报文对网络设备上配置的错误处理策略进行修改,这不仅在应用程序与网络设备间增加了额外的交互次数,而且针对不同HTTP报文不断修改网络设备上的错误处理策略也十分容易出现错误。
发明内容
本申请所要解决的技术问题是,提供一种传输数据的方法和装置,以能够在用于下发配置项的HTTP报文中指定该HTTP报文对应的错误处理策略,从而在实现针对不同HTTP报文采用不同错误处理策略的同时,不仅避免了网络设备间额外的交互次数,也避免了网络设备上配置错误处理策略的错误出现。
本申请实施例的第一方面,提供了一种传输数据的方法,包括:
第一网络设备生成超文本传输协议HTTP报文;
其中,所述HTTP报文的消息体字段中携带有配置信息,所述配置信息用于触发所述第二网络设备执行多个配置项;
所述HTTP报文的协议层面扩展字段中携带有扩展参数,所述扩展参数用于指示所述第二网络设备在所述多个配置项中出现执行失败的配置项时采用的错误处理策略;
所述第一网络设备向所述第二网络设备发送所述HTTP报文。
由于是在HTTP报文的协议层面扩展字段中添加扩展参数,从而不仅可以避免现有技术中对全局的错误处理策略进行修改时所导致的第一网络设备与第二网络设备之间交互次数的增加,而且,针对第二网络设备接收到的其它HTTP报文,也可以避免由于对全局的错误处理策略进行修改而导致第二网络设备为其它HTTP报文采用错误的错误处理策略。
结合第一方面,在第一方面的第一种可能的实现方式中,所述协议层面扩展字段具体位于所述HTTP报文的start-line部分。本实现方式中,具体可以是在HTTP报文的start-line部分中添加扩展参数,而并非是通过修改数据模型的方式添加扩展参数,从而可以避免对数据模型进行修改而造成修改后的数据模型与标准的数据模型不兼容的问题,而且,对于第二网络设备提供的各种业务,第一网络设备均可以采用统一形式的扩展参数来指定错误处理策略,而无需根据第二网络设备提供的业务对应的数据模型,再对扩展参数的形式进行调整,从而可以保证第一网络设备可以在HTTP中指定相应的错误处理策略。
结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述协议层面扩展字段具体为所述start-line部分内统一资源标识符。本实现方式中,具体可以是在start-line部分内的URI中的query字段添加扩展参数,可以避免对数据模型进行修改而造成修改后的数据模型与标准的数据模型不兼容的问题。
结合第一方面,在第一方面的第三种可能的实现方式中,所述协议层面字段具体位于所述HTTP报文的消息头header-field。本实现方式中,具体可以是在HTTP报文的消息头header-field中添加扩展参数,而并非是通过修改数据模型的方式添加扩展参数,从而可以避免对数据模型进行修改而造成修改后的数据模型与标准的数据模型不兼容的问题,而且,对于第二网络设备提供的各种业务,第一网络设备均可以采用统一形式的扩展参数来指定错误处理策略,而无需根据第二网络设备提供的业务对应的数据模型,再对扩展参数的形式进行调整,从而可以保证第一网络设备可以在HTTP中指定相应的错误处理策略。
结合第一方面的第三种可能的实现方式,在第一方面的第四种可能的实现方式中,所述协议层面扩展字段具体为所述header-field内的错误处理字段。本实现方式中,具体可以是header-field内的错误处理字段添加扩展参数,可以避免对数据模型进行修改而造成修改后的数据模型与标准的数据模型不兼容的问题。
结合第一方面,在第一方面的第五种可能的实现方式中,所述错误处理策略具体为以下任意一种策略:
若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并继续执行所述多个配置项中除所述目标配置项之外的其他配置项;
若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并停止执行所述多个配置项中未执行过的配置项;
若在所述多个配置项中的目标配置项执行失败,对所述多个配置项中已执行过的配置项进行回退并停止执行所述多个配置项中的所有配置项。
结合第一方面的第一种至第五种任意一种可能的实现方式,在第一方面的第六种可能的实现方式中,所述配置消息具体为万维网Web应用程序编程接口API的配置信息;所述配置项为所述Web API的配置项。
结合第一方面的第六种可能的实现方式,在第一方面的第七种可能的实现方式中,所述Web API具体为表现层状转换式的应用程序编程接口RESTful API。
本申请实施例的第二方面,提供了一种传输数据的方法,包括:
第二网络设备接收第一网络设备发送的超文本传输协议HTTP报文;
其中,所述HTTP报文的消息体字段中携带有配置信息,所述配置信息用于触发所述第二网络设备执行多个配置项;
所述HTTP报文的协议层面扩展字段中携带有扩展参数,所述扩展参数用于指示所述第二网络设备在所述多个配置项中出现执行失败的配置项时采用的错误处理策略;
所述第二网络设备按照所述HTTP报文中携带的信息执行动作。
结合第二方面,在第二方面的第一种可能的实现方式中,所述协议层面扩展字段具体位于所述HTTP报文的start-line部分。
结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述协议层面扩展字段具体为所述start-line部分内统一资源标识符URI中的query字段。
结合第二方面,在第二方面的第三种可能的实现方式中,所述协议层面字段具体位于所述HTTP报文的消息头header-field。
结合第二方面的第三种可能的实现方式,在第二方面的第四种可能的实现方式中,所述协议层面扩展字段具体为所述header-field内的错误处理字段。
结合第二方面,在第二方面的第五种可能的实现方式中,所述错误处理策略具体为以下任意一种策略:
若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并继续执行所述多个配置项中除所述目标配置项之外的其他配置项;
若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并停止执行所述多个配置项中未执行过的配置项;
若在所述多个配置项中的目标配置项执行失败,对所述多个配置项中已执行过的配置项进行回退并停止执行所述多个配置项中的所有配置项。
结合第二方面的第一种至第五种任意一种可能的实现方式,在第二方面的第六种可能的实现方式中,所述配置消息具体为万维网Web应用程序编程接口API的配置信息;所述配置项为所述Web API的配置项。
结合第二方面的第六种可能的实现方式,在第二方面的第七种可能的实现方式中,所述Web API具体为表现层状转换式的应用程序编程接口RESTful API。
第二方面提供的传输数据的方法,对应于第一方面提供的传输数据的方法,故第二方面提供的传输数据的方法的各种可能的实施方式,可以参照第一方面提供的传输数据的方法的各种可能的实施方式。
本申请实施例的第三方面,提供了一种传输数据的方法,包括:
生成模块,用于生成超文本传输协议HTTP报文;
其中,所述HTTP报文的消息体字段中携带有配置信息,所述配置信息用于触发所述第二网络设备执行多个配置项;
所述HTTP报文的协议层面扩展字段中携带有扩展参数,所述扩展参数用于指示所述第二网络设备在所述多个配置项中出现执行失败的配置项时采用的错误处理策略;
发送模块,用于向所述第二网络设备发送所述HTTP报文。
结合第三方面,在第三方面的第一种可能的实现方式中,所述协议层面扩展字段具体位于所述HTTP报文的start-line部分。
结合第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,所述协议层面扩展字段具体为所述start-line部分内统一资源标识符。
结合第三方面,在第三方面的第三种可能的实现方式中,所述协议层面字段具体位于所述HTTP报文的消息头header-field。
结合第三方面的第三种可能的实现方式,在第三方面的第四种可能的实现方式中,所述协议层面扩展字段具体为所述header-field内的错误处理字段。
结合第三方面,在第三方面的第五种可能的实现方式中,所述错误处理策略具体为以下任意一种策略:
若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并继续执行所述多个配置项中除所述目标配置项之外的其他配置项;
若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并停止执行所述多个配置项中未执行过的配置项;
若在所述多个配置项中的目标配置项执行失败,对所述多个配置项中已执行过的配置项进行回退并停止执行所述多个配置项中的所有配置项。
结合第三方面的第一种至第五种任意一种可能的实现方式,在第三方面的第六种可能的实现方式中,所述配置消息具体为万维网Web应用程序编程接口API的配置信息;所述配置项为所述Web API的配置项。
结合第三方面的第六种可能的实现方式,在第三方面的第七种可能的实现方式中,所述Web API具体为表现层状转换式的应用程序编程接口RESTful API。
第三方面提供的传输数据的装置,对应于第一方面提供的传输数据的方法,故第三方面提供的传输数据的装置的各种可能的实施方式,可以参照第一方面提供的传输数据的方法的各种可能的实施方式。
本申请实施例的第四方面,提供了一种传输数据的方法,包括:
接受模块,用于接收第一网络设备发送的超文本传输协议HTTP报文;
其中,所述HTTP报文的消息体字段中携带有配置信息,所述配置信息用于触发所述第二网络设备执行多个配置项;
所述HTTP报文的协议层面扩展字段中携带有扩展参数,所述扩展参数用于指示所述第二网络设备在所述多个配置项中出现执行失败的配置项时采用的错误处理策略;
执行模块,用于按照所述HTTP报文中携带的信息执行动作。
结合第四方面,在第四方面的第一种可能的实现方式中,所述协议层面扩展字段具体位于所述HTTP报文的start-line部分。
结合第四方面的第一种可能的实现方式,在第四方面的第二种可能的实现方式中,所述协议层面扩展字段具体为所述start-line部分内统一资源标识符URI中的query字段。
结合第四方面,在第四方面的第三种可能的实现方式中,所述协议层面字段具体位于所述HTTP报文的消息头header-field。
结合第四方面的第三种可能的实现方式,在第四方面的第四种可能的实现方式中,所述协议层面扩展字段具体为所述header-field内的错误处理字段。
结合第四方面,在第四方面的第五种可能的实现方式中,所述错误处理策略具体为以下任意一种策略:
若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并继续执行所述多个配置项中除所述目标配置项之外的其他配置项;
若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并停止执行所述多个配置项中未执行过的配置项;
若在所述多个配置项中的目标配置项执行失败,对所述多个配置项中已执行过的配置项进行回退并停止执行所述多个配置项中的所有配置项。
结合第四方面的第一种至第五种任意一种可能的实现方式,在第四方面的第六种可能的实现方式中,所述配置消息具体为万维网Web应用程序编程接口API的配置信息;所述配置项为所述Web API的配置项。
结合第四方面的第六种可能的实现方式,在第四方面的第七种可能的实现方式中,所述Web API具体为表现层状转换式的应用程序编程接口RESTful API。
第四方面提供的传输数据的装置,对应于第二方面提供的传输数据的方法,故第四方面提供的传输数据的装置的各种可能的实施方式,可以参照第二方面提供的传输数据的方法的各种可能的实施方式。
本申请实施例中,在该HTTP报文的协议层面扩展字段中,添加第二网络设备在配置多个配置项出现执行失败时所需采用的错误处理策略的扩展参数,从而使得第二网络设备可以根据该HTTP报文中所携带的扩展参数,确定与该HTTP报文相对应的错误处理策略,以应对配置项执行失败的情况,这不仅可以避免现有技术中对全局的错误处理策略进行修改时所导致的第一网络设备与第二网络设备之间交互次数的增加,而且,针对第二网络设备接收到的其它HTTP报文,也可以避免由于对全局的错误处理策略进行修改而导致第二网络设备为其它HTTP报文采用错误的错误处理策略。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。
图1为本申请实施例中一种示例性的应用场景示意图;
图2为本申请实施例中一种传输数据的方法流程示意图;
图3为本申请实施例中一场景实施例的方法流程示意图;
图4为一种示例性配置报文的示意图;
图5为另一种示例性配置报文的示意图;
图6为本申请实施例中一种传输数据的装置结构示意图;
图7为本申请实施例中另一种传输数据的装置结构示意图;
图8为本申请实施例中一种传输数据的设备结构示意图。
具体实施方式
在网络设备基于应用程序发送的HTTP报文批量执行多个配置项时,如果存在某个配置项在网络设备上执行失败,则需要由网络设备执行相应的错误处理策略,以应对执行配置项失败的情况发生。现有的应对执行配置项失败的方案中,对于网络设备接收到的每个HTTP报文,当该HTTP报文的多个配置项中出现执行失败的配置项时,都采用相同的错误处理策略,而如果针对不同的HTTP报文需要采用不同的错误处理策略,则应用程序必须预先通过另外一个接口向网络设备发送修改错误处理策略的报文,以实现对网络设备上当前设定的错误处理策略进行修改,这就增加了应用程序与网络设备之间的交互次数。
而且,不同的HTTP报文可能需要采用不同的错误处理策略,如果网络设备需要在短时间内同时配置多个HTTP报文中的配置项,则,在对配置于网络设备上的错误处理策略进行多次修改,很容易造成网络设备在配置另一部分HTTP报文下发的配置项时,会采用非预期的(也即错误的)错误处理策略来应对执行配置项失败的情况发生。比如,假设网络设备在短时间内同时处理报文A以及报文B,并且,报文A所对应的错误处理策略为策略a,报文B所对应的错误处理策略为策略b,如果应用程序在为报文A将网络设备上的错误处理策略修改成策略a后,应用程序迅速为报文B将网络设备上的错误处理策略由策略a修改成策略b,则在网络设备配置报文A中的配置项的过程中,如果出现配置失败的配置项,则网络设备会采用策略a来对报文A进行相应的处理,而没有采用策略b来对报文A进行处理。
为此,本申请实施例提供了一种传输数据的方法,以实现在用于下发配置项的HTTP报文中指定该HTTP报文对应的错误处理策略,具体可以是在HTTP报文的协议层面扩展字段中,添加用于指示接收HTTP报文的网络设备在配置多个配置项出现执行失败时所需采用的错误处理策略的扩展参数,这样,网络设备可以根据接收到的HTTP报文中携带的扩展参数,确定该HTTP对应的错误处理策略。由于网络设备接收到的HTTP报文中包含了用于指示错误处理策略的扩展参数,因此,应用程序无需再发送额外的报文来修改网络设备上的错误处理策略,从而可以避免增加应用程序与网络设备之间的交互次数;并且,针对于每个HTTP报文,网络设备均可以根据该HTTP报文中的扩展参数,确定该HTTP报文所对应的错误处理策略,无需修改网络设备上全局的错误处理策略,这样也避免了多次修改全局的错误处理策略而导致的网络设备为HTTP报文选用错误的错误处理策略。
举例来说,本申请实施例可以应用至如图1所示的示例性场景中。在该场景中,终端101上的应用程序可以生成HTTP报文,该HTTP报文的消息体字段中携带有用于触发网络设备102执行多个配置项的配置信息,以及在该HTTP报文的协议层面扩展字段中携带 的、用于指示网络设备102在多个配置项中出现执行失败的配置项时所采用错误处理策略的扩展参数,然后,终端101向网络设备102发送该HTTP报文。接着,网络设备102响应接收到的HTTP报文,根据该HTTP报文中的多个配置项对Web API接口进行批量配置。若网络设备102在进行批量配置的过程中,存在配置失败的配置项,则根据该HTTP报文的协议层面扩展字段中携带的扩展参数,采用相应的错误处理策略来处理对Web API接口的配置过程。比如,可以是继续进行其他针对于Web API的配置,或者是将Web API接口回退已执行的配置,恢复到配置之前的状态,或者是停止对Web API接口进行配置,并保留之前已执行的配置等。
可以理解的是,上述场景仅是本申请实施例提供的一个场景示例,本申请实施例并不限于此场景。
为使本申请的上述目的、特征和优点能够更加明显易懂,下面将结合附图对本申请实施例中的各种非限定性实施方式进行示例性说明。显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。
参阅图2,图2示出了本申请实施例中一种传输数据的方法流程示意图,该方法具体可以包括:
S201:第一网络设备生成HTTP报文,其中,该HTTP报文的消息体字段中携带有用于触发所述第二网络设备执行多个配置项的配置信息,该HTTP报文的协议层面扩展字段中携带有用于指示所述第二网络设备在所述多个配置项中出现执行失败的配置项时采用的错误处理策略的扩展参数。
S202:第一网络设备将生成的HTTP报文发送给第二网络设备。
S203:第二网络设备接收第一网络设备发送的HTTP报文。
S204:第二网络设备按照HTTP报文中携带的信息执行相应的动作。
值得注意的是,HTTP报文具体可以是由诸如Web APP等应用程序来生成得到,然后由应用程序将生成的HTTP报文发送给网络设备,以使得网络设备对HTTP报文所指示的配置项进行相应配置。则,应用程序所在的网络设备即可以为本实施例中所述的第一网络设备,而接收应用程序发送的HTTP报文的网络设备即可以为本实施例中所述的第二网络设备。
其中,该HTTP报文的消息体字段中携带有用于触发第二网络设备执行多个配置项的配置信息,以便于第二网络设备能够基于该配置信息,批量执行多个配置项。比如,该HTTP报文中可以携带有用于触发第二网络设备批量执行多个Web API接口的配置项的配置信息,这样,第二网络设备可以基于该配置信息,对Web API接口进行批量配置。其中,HTTP报文中携带的配置信息即为Web API接口的配置信息,第二网络设备所执行的配置项为Web API接口的配置项。
需要说明的是,如果在第二网络设备对配置项进行配置的过程中,出现某个配置项执行失败,则第二设备需要采用与该HTTP报文相适应的错误处理策略来应对该情况的发生。 因此,本实施例中,为了使得第二网络设备能够获知该HTTP报文所对应的错误处理策略,可以在该HTTP报文中指定错误处理策略,具体可以是在HTTP报文的协议层面扩展字段中添加用于指示错误处理策略的扩展参数。这样,第二网络设备在多个配置项中出现执行失败的配置项时,能够根据HTTP报文的协议层面扩展字段中携带的扩展参数,采用与该HTTP相适应的错误处理策略。
实际应用的一些场景中,HTTP报文中的消息体需要按照业务标准数据模型来进行定义,因此,第一网络设备可能需要在不改变HTTP报文中的消息体所对应的业务标准数据模型的条件下,向HTTP报文中添加指定错误处理策略的扩展参数。比如,在对第二网络设备的RESTful API接口(表现层状转换式的应用程序编程接口)进行批量配置时,HTTP报文中的消息体需要按照针对RESTful API接口的配置业务所对应的业务标准数据模型来进行定义,则在添加扩展参数时,通常不允许消息体对应的业务标准数据模型发生改变,以避免修改后的业务标准数据模型与原先的业务标准数据模型不兼容的情况发生。
在上述实际应用的场景中,并非是通过对HTTP报文中消息体的数据模型进行修改来添加扩展参数,而是在HTTP报文的协议层面扩展字段中添加扩展参数,这样,即使在HTTP报文中添加了扩展参数,也没有改变该HTTP报文中消息体的数据模型,从而可以避免对数据模型进行修改而造成修改后的数据模型与标准的数据模型不兼容的问题。并且,HTTP报文中扩展参数的形式通常是由第二网络设备定义的,因此,现有的在HTTP报文的消息体中添加扩展参数的方案,可能在第二网络设备提供不同的业务时,要求第一网络设备基于不同业务所对应的数据模型的不同,在HTTP报文中添加不同形式的扩展参数,但是部分数据模型中可能没有提供相应形式的扩展参数,从而会造成第一网络设备无法在HTTP报文中指定错误处理策略的问题;而本实施例中,是在HTTP报文的协议层面扩展字段中添加扩展参数,这样,对于第二网络设备提供的各种业务,第一网络设备均可以采用统一形式的扩展参数来指定错误处理策略,而无需根据第二网络设备提供的业务对应的数据模型,再对扩展参数的形式进行调整,从而可以保证第一网络设备可以在HTTP中指定相应的错误处理策略。
作为示例,本实施例提供了以下两种在HTTP报文的协议层面扩展字段中添加扩展参数的实施方式:
在一种添加扩展参数的示例性实施方式中,HTTP报文的协议层面扩展字段,可以是位于该HTTP报文的start-line部分,进一步的,协议层面扩展字段具体可以是start-line部分内URI(Uniform Resource Identifier,统一资源标识符)中的query字段。例如,在RESTCONF协议(RFC8040中定义的一种网络配置管理协议)中规定了HTTP请求的URI中包括有可选的query参数,则可以在URI的query参数中扩展出一个参数,作为用于指示错误处理策略的扩展参数。
在另一种添加扩展参数的示例性实施方式中,HTTP报文的协议层面扩展字段,也可以位于HTTP报文的消息头header-field,进一步的,协议层面扩展字段具体可以是header-field内的错误处理字段。
值得注意的是,不同HTTP报文所对应的错误处理策略可能不同。作为一种示例,错误处理策略可以包括错误回滚策略、错误停止策略以及错误继续策略等策略。
在一种可能的实施方式中,若HTTP报文中携带的扩展参数为continue-on-error,则第二网络设备采用错误继续策略;若HTTP报文中携带的扩展参数为rollback-on-error,则第二网络设备采用错误回滚策略;若HTTP报文中携带的扩展参数为stop-on-error,则第二网络设备采用错误停止策略。需要说明的是,此处所提及的错误处理策略仅作为示例性说明,并不用于限定错误处理策略局限于上述三种,实际应用中,错误处理策略还可以包括其它策略,具体可根据实际情况的需求进行确定,在此不做赘述。
其中,错误回滚策略,是指如果在多个配置项中存在目标配置项执行失败,则第二网络设备回退对已经执行过的配置项所做出的配置,并停止执行配置信息所指示的所有配置项,即第二网络设备撤销之前对配置项所进行的配置,回退至执行配置项之前的状态。比如,第二网络设备需要依次对配置项A、配置项B以及配置项C进行配置,而在第二网络设备执行配置项B时,出现执行失败的情况,此时,第二网络设备可以回退对已经执行过的配置项A所做出的配置,即回退至执行配置项A、配置项B以及配置项C之前的状态,并不再执行配置项A、配置项B以及配置项C。
错误继续策略,是指如果在多个配置项中存在目标配置项执行失败,则保持对已执行过的配置项所进行的配置,并继续执行多个配置项中除目标配置项之外的其它配置项。依然以第二网络设备需要依次对配置项A、配置项B以及配置项C进行配置为例进行说明,当第二网络设备执行配置项B时,出现执行失败的情况,则,第二网络设备保持对已经执行过的配置项A所做出的配置,并继续执行配置项C,而不再执行配置项B。也就是说,第二网络设备跳过对配置项B的配置,而只执行配置项A以及配置项C。
错误停止策略,是指如果在多个配置项中存在目标配置项执行失败,则第二网络设备保持对已经执行过的配置项所进行的配置,并停止执行多个配置项中未执行过的配置项。依然以第二网络设备需要依次对配置项A、配置项B以及配置项C进行配置为例进行说明,当第二网络设备执行配置项B时,出现执行失败的情况,则,第二网络设备保持对已经执行过的配置项A所做出的配置,但停止执行除配置项A以外的其它配置项。也就是说,在执行配置项B失败时,第二网络设备只执行配置项A,而不再执行配置项B以及配置项C。
第一网络设备在生成HTTP报文后,可以将该HTTP报文发送给第二网络设备,这样,第二网络设备在接收到该HTTP报文后,能够响应该HTTP报文中携带的配置信息执行多个配置项,并且在出现某个配置项执行失败时,可以根据该HTTP报文中携带的扩展参数,采用与该HTTP报文相适应的错误处理策略,来应对配置项执行失败的情况。
为了使得第二网络设备能够确定第一网络设备发送的HTTP报文所对应的错误处理策略,本实施例中,在该HTTP报文的协议层面扩展字段中,添加第二网络设备在配置多个配置项出现执行失败时所需采用的错误处理策略的扩展参数,从而使得第二网络设备可以根据该HTTP报文中所携带的扩展参数,确定与该HTTP报文相对应的错误处理策略,以应对配置项执行失败的情况,这不仅可以避免现有技术中对全局的错误处理策略进行修改时所导致的第一网络设备与第二网络设备之间交互次数的增加,而且,针对第二网络设备 接收到的其它HTTP报文,也可以避免由于对全局的错误处理策略进行修改而导致第二网络设备为其它HTTP报文采用错误的错误处理策略。
为了便于理解本申请实施例的具体技术方案,下面以具体的示例性场景来对本申请实施例的具体方案进行详细说明。参阅图3,图3示出了本申请场景实施例中一种传输数据的方法流程示意图。在该场景中,网络设备与Web APP之间基于RESTCONF协议进行通信,并且,网络设备在接收到Web APP发送的HTTP报文后,对Web API接口进行批量配置。具体的,该方法可以包括:
S301:Web APP向网络设备发送HTTP报文,其中,HTTP报文的消息体字段中携带有用于触发网络设备进行多个配置项的配置信息,该HTTP报文的消息头header-field内的错误处理字段中携带有扩展参数,该扩展参数用于指示在多个配置项中出现配置失败的配置项时网络设备所采用的错误处理策略。
本实施例中,Web APP与网络设备之间可以基于RESTCONF协议进行通信,若网络设备需要针对于Web API接口进行批量配置,则Web APP首先可以生成包含针对于Web APP接口的配置信息的HTTP报文,以触发网络设备对Web APP接口进行批量配置。
在进一步可能的实施方式中,在基于RESTCONF协议对Web API接口进行批量配置时,具体可以是对RESTful API接口进行批量配置。
同时,Web APP在生成HTTP报文时,还在该HTTP报文的消息头header-field内的错误处理字段中携带有扩展参数,用于指示网络设备在基于某个配置项对Web API接口进行配置而出现配置失败时,采用哪种错误处理策略来处理配置失败的情况。
例如,所生成的HTTP报文可以是如图4所示的配置报文,该配置报文表示请求在“example”的“users”列表中添加两个用户“wang”“zhang”,Web APP在生成该配置报文时,可以在消息头头字段header-field内的错误处理字段Error-Option中携带扩展参数continue-on-error,该扩展参数continue-on-error用于指示多个配置项中出现配置失败的配置项时网络设备采用错误继续策略,即,如果在多个配置项中存在目标配置项执行失败,则保持对已执行过的配置项所进行的配置,并继续执行多个配置项中除目标配置项之外的其它配置项。
另外,错误处理字段error-option中也可以是携带扩展参数rollback-on-error,该扩展参数rollback-on-error用于指示多个配置项中出现配置失败的配置项时网络设备采用错误回滚策略,即,如果在多个配置项中存在目标配置项执行失败,则第二网络设备回退对已经执行过的配置项所做出的配置,并停止执行配置信息所指示的所有配置项;或者,错误处理字段error-option中也可以是携带扩展参数stop-on-error,该扩展参数stop-on-error用于指示多个配置项中出现配置失败的配置项时网络设备采用错误停止策略,即,如果在多个配置项中存在目标配置项执行失败,则第二网络设备保持对已经执行过的配置项所进行的配置,并停止执行多个配置项中未执行过的配置项。
Web APP在生成得到HTTP报文后,可以将该HTTP报文发送给网络设备,以便于网络设备可以基于接收到的HTTP报文开始对Web API接口进行批量配置。
S302:网络设备响应接收到的HTTP报文的配置信息,逐个对配置项进行配置。
本实施例中,网络设备在接收到HTTP报文后,可以响应该HTTP报文中携带的配置信息,启动配置执行器,并利用该配置执行器基于每个配置项依次对Web APP接口进行配置,即依次执行配置项1至配置项n的配置。
S303:若网络设备在对每个配置项执行配置的过程中,出现某个配置项执行失败,则网络设备基于HTTP报文的消息头header-field内的错误处理字段中的扩展参数确定错误处理策略。
实际应用中,网络设备在逐个执行每个配置项的配置时,有时会出现某个配置项出现配置失败的情况,若出现配置失败的配置项,则网络设备基于HTTP报文的消息头header-field内的错误处理字段中的扩展参数,确定与该HTTP报文所对应的错误处理策略。具体的,若网络设备所获取的扩展参数为continue-on-error,则采用错误继续策略;若网络设备所获取的扩展参数为rollback-on-error,则采用错误回滚策略;若网络设备所获取的扩展参数为stop-on-error,则采用错误停止策略。
S304:若根据扩展参数确定错误处理策略为错误继续策略,则网络设备保持已执行过的配置项,并继续执行未执行过的配置项。
S305:若根据扩展参数确定错误处理策略为错误回滚策略,则网络设备回退至执行所有配置项之前的状态,并停止执行所有配置项。
S306:若根据扩展参数确定错误处理策略为错误停止策略,则网络设备保持已执行过的配置项,并停止执行未执行过的配置项。
本实施例中,在根据扩展参数确定出与HTTP报文相适应的错误处理策略后,可以进行相应的处理。举例来说,假设在执行配置项3时出现配置失败,若网络设备确定采用错误继续策略,则可以保持对配置项1以及配置项2所执行过的配置,并继续依次执行配置项4至配置项n;若网络设备确定采用错误回滚策略,则可以撤销之前对配置项1和配置项2所执行过的配置,回退至执行配置项1和2之前的状态,并终止配置,不再执行配置项1至配置项n;若网络设备确定采用错误停止策略,则可以保持对配置项1以及配置项2所执行过的配置,并停止执行配置项3至配置项n。
需要说明的是,本场景实施例中,是以扩展参数位于HTTP报文的消息头header-field内的错误处理字段中为例进行说明,而在另一些的场景实施例中,该扩展参数也可以是位于HTTP报文的start-line部分内URI中的。具体的,一般URI的格式为[scheme:][//authority]path[?query][#fragment],该URI中包括有可选的query参数,则可以在URI的query参数中扩展出一个参数,作为用于指示错误处理策略的扩展参数。例如,可以在如图5所示的起始行start-line部分内的query字段中扩展一个参数error-option,指定该HTTP报文对应的错误处理策略为continue-on-error。实际应用中,可根据实际情况的需求确定在消息头header-field内的错误处理字段中定义扩展参数,还是在start-line部分内URI中的query字段中定义扩展参数,在此不做限定。
值得注意的是,通过在HTTP报文的协议层面扩展字段中添加扩展参数,而并非是在图4中所示的消息体中添加扩展参数,可以避免修改消息体对应的数据模型而导致的修改后的数据模型与标准的数据模型不兼容的问题。
本实施例中,是在Web APP下发的HTTP报文的消息头header-field内的错误处理字段中,添加用于指示接收HTTP报文的网络设备在执行多个配置项出现执行失败时所需采用的错误处理策略的扩展参数,这样,网络设备可以根据接收到的HTTP报文中携带的扩展参数,确定该HTTP报文对应的错误处理策略,不仅可以避免增加Web APP与网络设备之间的交互次数,也可以避免网络设备上采用错误的错误处理策略。
此外,本申请实施例还提供了一种传输数据的装置。参阅图6,图6示出了本申请实施例中一种传输数据的装置结构示意图,该装置600具体可以包括:
生成模块601,用于生成超文本传输协议HTTP报文;
其中,所述HTTP报文的消息体字段中携带有配置信息,所述配置信息用于触发所述第二网络设备执行多个配置项;
所述HTTP报文的协议层面扩展字段中携带有扩展参数,所述扩展参数用于指示所述第二网络设备在所述多个配置项中出现执行失败的配置项时采用的错误处理策略;
发送模块602,用于向所述第二网络设备发送所述HTTP报文。
在一些可能的实施方式中,所述协议层面扩展字段具体位于所述HTTP报文的start-line部分。
在一些可能的实施方式中,所述协议层面扩展字段具体为所述start-line部分内统一资源标识符。
在一些可能的实施方式中,所述协议层面字段具体位于所述HTTP报文的消息头header-field。
在一些可能的实施方式中,所述协议层面扩展字段具体为所述header-field内的错误处理字段。
在一些可能的实施方式中,所述错误处理策略具体为以下任意一种策略:
若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并继续执行所述多个配置项中除所述目标配置项之外的其他配置项;
若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并停止执行所述多个配置项中未执行过的配置项;
若在所述多个配置项中的目标配置项执行失败,对所述多个配置项中已执行过的配置项进行回退并停止执行所述多个配置项中的所有配置项。
在一些可能的实施方式中,所述配置消息具体为万维网Web应用程序编程接口API的配置信息;所述配置项为所述Web API的配置项。
在一些可能的实施方式中,所述Web API具体为表现层状转换式的应用程序编程接口RESTful API。
为了使得第二网络设备能够确定第一网络设备发送的HTTP报文所对应的错误处理策略,本实施例中,在该HTTP报文的协议层面扩展字段中,添加第二网络设备在配置多个配置项出现执行失败时所需采用的错误处理策略的扩展参数,从而使得第二网络设备可以根据该HTTP报文中所携带的扩展参数,确定与该HTTP报文相对应的错误处理策略,以应对配置项执行失败的情况,这不仅可以避免现有技术中对全局的错误处理策略进行修改时所导致的第一网络设备与第二网络设备之间交互次数的增加,而且,针对第二网络设备接收到的其它HTTP报文,也可以避免由于对全局的错误处理策略进行修改而导致第二网络设备为其它HTTP报文采用错误的错误处理策略。
另外,本申请实施例还提供了一种传输数据的装置。参阅图7,图7示出了本申请实施例中一种传输数据的装置结构示意图,该装置700具体可以包括:
接受模块701,用于接收第一网络设备发送的超文本传输协议HTTP报文;
其中,所述HTTP报文的消息体字段中携带有配置信息,所述配置信息用于触发所述第二网络设备执行多个配置项;
所述HTTP报文的协议层面扩展字段中携带有扩展参数,所述扩展参数用于指示所述第二网络设备在所述多个配置项中出现执行失败的配置项时采用的错误处理策略;
执行模块702,用于按照所述HTTP报文中携带的信息执行动作。
在一些可能的实施方式中,所述协议层面扩展字段具体位于所述HTTP报文的start-line部分。
在一些可能的实施方式中,所述协议层面扩展字段具体为所述start-line部分内统一资源标识符URI中的query字段。
在一些可能的实施方式中,所述协议层面字段具体位于所述HTTP报文的消息头header-field。
在一些可能的实施方式中,所述协议层面扩展字段具体为所述header-field内的错误处理字段。
在一些可能的实施方式中,所述错误处理策略具体为以下任意一种策略:
若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并继续执行所述多个配置项中除所述目标配置项之外的其他配置项;
若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并停止执行所述多个配置项中未执行过的配置项;
若在所述多个配置项中的目标配置项执行失败,对所述多个配置项中已执行过的配置项进行回退并停止执行所述多个配置项中的所有配置项。
在一些可能的实施方式中,所述配置消息具体为万维网Web应用程序编程接口API的配置信息;所述配置项为所述Web API的配置项。
在一些可能的实施方式中,所述Web API具体为表现层状转换式的应用程序编程接口RESTful API。
本实施例中,在该HTTP报文的协议层面扩展字段中,添加第二网络设备在配置多个配置项出现执行失败时所需采用的错误处理策略的扩展参数,从而使得第二网络设备可以根据该HTTP报文中所携带的扩展参数,确定与该HTTP报文相对应的错误处理策略,以应对配置项执行失败的情况,这不仅可以避免现有技术中对全局的错误处理策略进行修改时所导致的第一网络设备与第二网络设备之间交互次数的增加,而且,针对第二网络设备接收到的其它HTTP报文,也可以避免由于对全局的错误处理策略进行修改而导致第二网络设备为其它HTTP报文采用错误的错误处理策略。
上一实施例是从功能实体的角度对本申请实施例中传输数据的装置进行描述,下面从硬件处理的角度对本申请实施例中传输数据的装置进行详细描述。
接下来介绍本申请实施例提供的一种传输数据的设备,所述设备包括:处理器,存储器,通信接口和总线;所述处理器、通信接口、存储器通过所述总线相互的通信;所述通信接口,用于接收和发送数据;所述存储器用于存储指令;所述处理器用于执行所述存储器中的所述指令,执行如下操作:
生成超文本传输协议HTTP报文;
向所述第二网络设备发送所述HTTP报文;
其中,所述HTTP报文的消息体字段中携带有配置信息,所述配置信息用于触发所述第二网络设备执行多个配置项;
所述HTTP报文的协议层面扩展字段中携带有扩展参数,所述扩展参数用于指示所述第二网络设备在所述多个配置项中出现执行失败的配置项时采用的错误处理策略。
在一些可能的实施方式中,所述协议层面扩展字段具体位于所述HTTP报文的start-line部分。
在一些可能的实施方式中,所述协议层面扩展字段具体为所述start-line部分内统一资源标识符。
在一些可能的实施方式中,所述协议层面字段具体位于所述HTTP报文的消息头header-field。
在一些可能的实施方式中,所述协议层面扩展字段具体为所述header-field内的错误处理字段。
在一些可能的实施方式中,所述错误处理策略具体为以下任意一种策略:
若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并继续执行所述多个配置项中除所述目标配置项之外的其他配置项;
若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并停止执行所述多个配置项中未执行过的配置项;
若在所述多个配置项中的目标配置项执行失败,对所述多个配置项中已执行过的配置项进行回退并停止执行所述多个配置项中的所有配置项。
在一些可能的实施方式中,所述配置消息具体为万维网Web应用程序编程接口API的配置信息;所述配置项为所述Web API的配置项。
在一些可能的实施方式中,所述Web API具体为表现层状转换式的应用程序编程接口RESTful API。
接下来对该设备进行详细说明,请参阅图8所示,设备800,包括:接收器801、发射器802、处理器803和存储器804(其中设备800中的处理器803的数量可以一个或多个,图8中以一个处理器为例)。其中,通信接口可包括接收器801、发射器802。在本申请的一些实施例中,接收器801、发射器802、处理器803和存储器804可通过总线或其它方式连接,其中,图8中以通过总线连接为例。
存储器804可以包括只读存储器和随机存取存储器,并向处理器803提供指令和数据。存储器804的一部分还可以包括非易失性随机存取存储器(英文全称:Non-Volatile Random Access Memory,英文缩写:NVRAM)。存储器804存储有操作系统和操作指令、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,操作指令可包括各种操作指令,用于实现各种操作。操作系统可包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。
处理器803控制设备800的操作,处理器803还可以称为中央处理模块(英文全称:Central Processing Unit,英文简称:CPU)。具体的应用中,的各个组件通过总线系统耦合在一起,其中总线系统除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都称为总线系统。
上述本申请实施例揭示的方法可以应用于处理器803中,或者由处理器803实现。处理器803可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器803中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器803可以是通用处理器、数字信号处理器(英文全称:digital signal processing,英文缩写:DSP)、专用集成电路(英文全称:Application Specific Integrated Circuit,英文缩写:ASIC)、现场可编程门阵列(英文全称:Field-Programmable Gate Array,英文缩写:FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器804,处理器803读取存储器804中的信息,结合其硬件完成上述方法的步骤。
接收器801可用于接收输入的数字或字符信息,以及产生与设备800的相关设置以及功能控制有关的信号输入,发射器802可包括显示屏等显示设备,发射器802可用于通过外接接口输出数字或字符信息。
本申请实施例中,处理器803,用于执行如下操作:
生成超文本传输协议HTTP报文;
其中,所述HTTP报文的消息体字段中携带有配置信息,所述配置信息用于触发所述第二网络设备执行多个配置项;
所述HTTP报文的协议层面扩展字段中携带有扩展参数,所述扩展参数用于指示所述第二网络设备在所述多个配置项中出现执行失败的配置项时采用的错误处理策略;
向所述第二网络设备发送所述HTTP报文。
本申请实施例中提到的“第一网络设备”等名称中的“第一”只是用来做名字标识,并不代表顺序上的第一。该规则同样适用于“第二”等。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到上述实施例方法中的全部或部分步骤可借助软件加通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如只读存储器(英文:read-only memory,ROM)/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者诸如路由器等网络通信设备)执行本申请各个实施例或者实施例的某些部分所述的方法。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
以上所述仅是本申请示例性的实施方式,并非用于限定本申请的保护范围。

Claims (18)

  1. 一种传输数据的方法,其特征在于,包括:
    第一网络设备生成超文本传输协议HTTP报文;其中,所述HTTP报文的消息体字段中携带有配置信息,所述配置信息用于触发所述第二网络设备执行多个配置项;所述HTTP报文的协议层面扩展字段中携带有扩展参数,所述扩展参数用于指示所述第二网络设备在所述多个配置项中出现执行失败的配置项时采用的错误处理策略;
    所述第一网络设备向所述第二网络设备发送所述HTTP报文。
  2. 根据权利要求1所述的方法,其特征在于,所述错误处理策略具体为以下任意一种策略:
    若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并继续执行所述多个配置项中除所述目标配置项之外的其他配置项;
    若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并停止执行所述多个配置项中未执行过的配置项;
    若在所述多个配置项中的目标配置项执行失败,对所述多个配置项中已执行过的配置项进行回退并停止执行所述多个配置项中的所有配置项。
  3. 根据权利要求1所述的方法,其特征在于,所述协议层面扩展字段具体位于所述HTTP报文的start-line部分。
  4. 根据权利要求3所述的方法,其特征在于,所述协议层面扩展字段具体为所述start-line部分内统一资源标识符URI中的query字段。
  5. 根据权利要求1所述的方法,其特征在于,所述协议层面字段具体位于所述HTTP报文的消息头header-field。
  6. 根据权利要求5所述的方法,其特征在于,所述协议层面扩展字段具体为所述header-field内的错误处理字段。
  7. 根据权利要求1至6任意一项所述的方法,其特征在于,所述配置消息具体为万维网Web应用程序编程接口API的配置信息;所述配置项为所述Web API的配置项。
  8. 根据权利要求7所述的方法,其特征在于,所述Web API具体为表现层状转换式的应用程序编程接口RESTful API。
  9. 一种传输数据的方法,其特征在于,包括:
    第二网络设备接收第一网络设备发送的超文本传输协议HTTP报文;
    其中,所述HTTP报文的消息体字段中携带有配置信息,所述配置信息用于触发所述第二网络设备执行多个配置项;
    所述HTTP报文的协议层面扩展字段中携带有扩展参数,所述扩展参数用于指示所述第二网络设备在所述多个配置项中出现执行失败的配置项时采用的错误处理策略;
    所述第二网络设备按照所述HTTP报文中携带的信息执行动作。
  10. 根据权利要求9所述的方法,其特征在于,所述错误处理策略具体为以下任意一种策略:
    若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并继续执行所述多个配置项中除所述目标配置项之外的其他配置项;
    若在所述多个配置项中的目标配置项执行失败,保持所述多个配置项已执行过的配置项并停止执行所述多个配置项中未执行过的配置项;
    若在所述多个配置项中的目标配置项执行失败,对所述多个配置项中已执行过的配置项进行回退并停止执行所述多个配置项中的所有配置项。
  11. 根据权利要求9所述的方法,其特征在于,所述协议层面扩展字段具体位于所述HTTP报文的start-line部分。
  12. 根据权利要求11所述的方法,其特征在于,所述协议层面扩展字段具体为所述start-line部分内统一资源标识符URI中的query字段。
  13. 根据权利要求9所述的方法,其特征在于,所述协议层面字段具体位于所述HTTP报文的消息头header-field。
  14. 根据权利要求13所述的方法,其特征在于,所述协议层面扩展字段具体为所述header-field内的错误处理字段。
  15. 根据权利要求9至14任意一项所述的方法,其特征在于,所述配置消息具体为万维网Web应用程序编程接口API的配置信息;所述配置项为所述Web API的配置项。
  16. 根据权利要求15所述的方法,其特征在于,所述Web API具体为表现层状转换式的应用程序编程接口RESTful API。
  17. 一种传输数据的装置,其特征在于,所述装置包括:
    生成模块,用于生成超文本传输协议HTTP报文;
    其中,所述HTTP报文的消息体字段中携带有配置信息,所述配置信息用于触发所述第二网络设备执行多个配置项;
    所述HTTP报文的协议层面扩展字段中携带有扩展参数,所述扩展参数用于指示所述第二网络设备在所述多个配置项中出现执行失败的配置项时采用的错误处理策略;
    发送模块,用于向所述第二网络设备发送所述HTTP报文。
  18. 一种传输数据的装置,其特征在于,包括:
    接收模块,用于接收第一网络设备发送的超文本传输协议HTTP报文;
    其中,所述HTTP报文的消息体字段中携带有配置信息,所述配置信息用于触发所述第二网络设备执行多个配置项;
    所述HTTP报文的协议层面扩展字段中携带有扩展参数,所述扩展参数用于指示所述第二网络设备在所述多个配置项中出现执行失败的配置项时采用的错误处理策略;
    执行模块,用于按照所述HTTP报文中携带的信息执行动作。
PCT/CN2018/101971 2018-08-23 2018-08-23 一种传输数据的方法和装置 WO2020037607A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880086974.2A CN111615819B (zh) 2018-08-23 2018-08-23 一种传输数据的方法和装置
PCT/CN2018/101971 WO2020037607A1 (zh) 2018-08-23 2018-08-23 一种传输数据的方法和装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/101971 WO2020037607A1 (zh) 2018-08-23 2018-08-23 一种传输数据的方法和装置

Publications (1)

Publication Number Publication Date
WO2020037607A1 true WO2020037607A1 (zh) 2020-02-27

Family

ID=69592200

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/101971 WO2020037607A1 (zh) 2018-08-23 2018-08-23 一种传输数据的方法和装置

Country Status (2)

Country Link
CN (1) CN111615819B (zh)
WO (1) WO2020037607A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114070886A (zh) * 2021-11-17 2022-02-18 深圳壹账通智能科技有限公司 报文转换方法、装置、设备及介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160094688A1 (en) * 2012-06-29 2016-03-31 Cisco Technology, Inc. Methods for exchanging network management messages using udp over http protocol
CN106789486A (zh) * 2017-03-17 2017-05-31 杭州迪普科技股份有限公司 共享接入的检测方法及装置
US20170192766A1 (en) * 2015-12-31 2017-07-06 Quixey, Inc. Cooperative Web-Assisted Deep Link Redirection
CN107026821A (zh) * 2016-02-01 2017-08-08 阿里巴巴集团控股有限公司 报文的处理方法及装置
CN107295003A (zh) * 2017-07-17 2017-10-24 联动优势科技有限公司 一种数据传输方法、装置及系统
CN107431699A (zh) * 2015-03-02 2017-12-01 高通股份有限公司 对于部分段的指示

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
BRPI0808859A2 (pt) * 2007-03-12 2014-09-09 Citrix Systems Inc Sistemas e métodos para configurar, aplicar e gerenciar políticas de segurança
CN105591819B (zh) * 2015-12-24 2019-05-07 新华三技术有限公司 配置网络设备的方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160094688A1 (en) * 2012-06-29 2016-03-31 Cisco Technology, Inc. Methods for exchanging network management messages using udp over http protocol
CN107431699A (zh) * 2015-03-02 2017-12-01 高通股份有限公司 对于部分段的指示
US20170192766A1 (en) * 2015-12-31 2017-07-06 Quixey, Inc. Cooperative Web-Assisted Deep Link Redirection
CN107026821A (zh) * 2016-02-01 2017-08-08 阿里巴巴集团控股有限公司 报文的处理方法及装置
CN106789486A (zh) * 2017-03-17 2017-05-31 杭州迪普科技股份有限公司 共享接入的检测方法及装置
CN107295003A (zh) * 2017-07-17 2017-10-24 联动优势科技有限公司 一种数据传输方法、装置及系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114070886A (zh) * 2021-11-17 2022-02-18 深圳壹账通智能科技有限公司 报文转换方法、装置、设备及介质

Also Published As

Publication number Publication date
CN111615819B (zh) 2021-06-08
CN111615819A (zh) 2020-09-01

Similar Documents

Publication Publication Date Title
WO2020216280A1 (zh) 一种区块处理方法和节点以及系统
US6983324B1 (en) Dynamic modification of cluster communication parameters in clustered computer system
CN110636128A (zh) 一种数据同步方法、系统、电子设备及存储介质
WO2017088572A1 (zh) 一种处理数据的方法、装置及系统
US20220237295A1 (en) Remote Attestation Method and Device for Composite Device
WO2019090997A1 (zh) 一种数据获取方法、装置、计算机设备及存储介质
US11658870B2 (en) Method and apparatus for restoring network device to factory defaults, and network device
CN111045807B (zh) 基于zookeeper任务处理的方法、装置、计算机设备及存储介质
CN110633168A (zh) 一种分布式存储系统的数据备份方法和系统
CN112559461A (zh) 文件传输方法及装置、存储介质及电子设备
US8719622B2 (en) Recording and preventing crash in an appliance
CN114531373A (zh) 节点状态检测方法、节点状态检测装置、设备及介质
WO2020037607A1 (zh) 一种传输数据的方法和装置
WO2019119269A1 (zh) 一种网络故障探测方法及控制中心设备
WO2016154921A1 (zh) 一种数据业务的数据传输方法及装置
JP6577901B2 (ja) 計算機システムおよびシステム状態再現方法
CN110620695B (zh) 一种数据处理方法及相关设备
CN111684428B (zh) 超规模的云化n路路由保护
US10951732B2 (en) Service processing method and device
CN115220993A (zh) 进程监控方法、装置、车辆及存储介质
CN114760198A (zh) 一种基于区块链网络的共识方法、装置及系统
CN108234215B (zh) 一种网关的创建方法、装置、计算机设备及存储介质
CN112367386A (zh) 基于Ignite的自动化运维方法、装置及计算机设备
CN114221884B (zh) 心跳报文的订阅方法及装置
TW202040947A (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: 18930706

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: 18930706

Country of ref document: EP

Kind code of ref document: A1