Communication method and apparatus
By converting Netconf requests into logic files through a network proxy and enabling direct interaction with business modules, the communication waiting and resource waste issues encountered by the Netconf Agent when processing Netconf requests are resolved, thereby improving processing efficiency and plugin development efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEW H3C TECH CO LTD
- Filing Date
- 2022-09-22
- Publication Date
- 2026-07-07
AI Technical Summary
The existing Netconf Agent consumes a significant amount of time in communication waiting and plugin development when processing Netconf requests, resulting in wasted resources and low efficiency.
By using a network proxy and configured format conversion rules, Netconf requests are converted into logical files and interact directly with business modules, reducing the number of communications. The business processing of logical files is implemented using the Xquery processor and data client.
It improves the processing efficiency of Netconf Agent, reduces communication waiting time and human resource consumption, and enhances plugin development efficiency.
Smart Images

Figure CN115632924B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a communication method and apparatus. Background Technology
[0002] Currently, the existing Netconf protocol uses Extensible Markup Language (XML) as its data format. Through standard operations (GET, MERGE, REMOVE, etc.) and a public data model, it enables functions such as obtaining, adding, modifying, and deleting network device configuration and operational data.
[0003] XML format offers excellent human-computer interoperability; therefore, the Netconf protocol has gradually replaced traditional command-line configuration methods, becoming the mainstream configuration method for network devices. This is especially true in large networks, where controllers use the Netconf protocol to configure and monitor network devices.
[0004] like Figure 1 As shown, Figure 1 This is a schematic diagram of the existing Netconf protocol framework. Figure 1 In this process, the controller sends a Netconf request to the network device. This Netconf request is received by the Netconf agent included in the network device. After parsing the Netconf request as XML, the Netconf agent locates the corresponding processing plugin based on the request content, encapsulates the data required by the plugin as parameters, and sends them to the plugin. The plugin obtains and sends data through interaction with backend services. The plugin returns the Netconf request result to the Netconf agent, which then generates a Netconf response including the Netconf request result and returns it to the user.
[0005] The following is a simple example of the interaction process between the Netconf Agent and the plugin, using a Netconf request.
[0006]
[0007]
[0008] The plugin's processing flow is as follows: After receiving a Netconf request, the Netconf Agent parses the request as XML, traversing the request content using a depth-first approach. The Netconf Agent determines that the Netconf request is a GET request and finds the relevant information for the first interface. The Netconf Agent extracts the first interface's... <name>The tag is: Ethernet1. The Netconf Agent continues to iterate, and the first tag it needs to obtain is... <mtu>The Netconf Agent determines the relationship with... <mtu>The corresponding MTU plugin, and the GET request type, <name>The tag is sent to the MTU plugin. The MTU plugin attempts to communicate with the MTU service, including the GET request type. <name>The tag is sent to the MTU service. After completing the query, the MTU service sends the query result back to the MTU plugin. The MTU plugin sends the query result back to the NetconfAgent, which converts the query result into XML tags and assembles them into the data of the user to be fed back.
[0009] Similarly, the Netconf Agent continues its iteration; the second tag it needs to retrieve is... <vpn>,and <mtu>Similarly, Netconf Agent will be handled by the VPN plugin. The VPN plugin communicates with the VPN service and returns the query results, which are then converted and assembled by NetconfAgent.
[0010] After the first Interface segment is processed, the Netconf Agent continues processing the second Interface segment. The processing procedure for each tag is similar to that described above and will not be repeated here.
[0011] As can be seen from the above process, in order to process Netconf requests, the Netconf agent initiates five communications with the backend services: the MTU plugin and MTU service of Ethernet1; the VPN plugin and VPN service of Ethernet1; the MTU plugin and MTU service of Ethernet2; the VPN plugin and VPN service of Ethernet2; and the Tunnel plugin and Tunnel service of Ethernet3.
[0012] The Netconf request processing process described above also reveals the following problems: 1) Because the Netconf Agent cannot recognize the private data format within the backend business, backend business personnel develop plugins to convert the content exchanged between the Netconf Agent and the backend business. However, this introduces the first problem: every time a backend business is expanded, backend business personnel need to participate in the development of a new plugin. This results in a high proportion of plugin development, consuming significant human resources; 2) In multiple communications initiated by the Netconf agent and the backend business, multiple communications involve interaction with the same backend business, causing the Netconf Agent to spend the majority of its time waiting for communication. Summary of the Invention
[0013] In view of this, this application provides a communication method and apparatus to solve the problems of existing Netconf Agents spending most of their time waiting for communication and consuming a lot of human resources to develop plugins when processing Netconf requests.
[0014] In a first aspect, this application provides a communication method applied to a network proxy, the method comprising:
[0015] Receive a first request, wherein the first request has a first format;
[0016] Using the configured format conversion rules, the first request is converted into a logical file;
[0017] The logic file is sent to the business module so that the business module can perform business processing on the logic file;
[0018] Receive a first file sent by the service module, the first file including the service processing result, and the first file having a second format;
[0019] Based on the business processing result, a first response is generated, the first response including the business processing result, and the first response having the first format;
[0020] Send the first response.
[0021] Secondly, this application provides a communication device applied to a network proxy, the device comprising:
[0022] A receiving unit is configured to receive a first request, wherein the first request has a first format;
[0023] A conversion unit is used to convert the first request into a logical file using configured format conversion rules;
[0024] The sending unit is used to send the logic file to the business module so that the business module can perform business processing on the logic file;
[0025] The receiving unit is further configured to receive a first file sent by the service module, the first file including a service processing result, and the first file having a second format;
[0026] A generation unit is configured to generate a first response based on the business processing result, wherein the first response includes the business processing result and has the first format;
[0027] The sending unit is further configured to send the first response.
[0028] Thirdly, this application provides a network device including a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, which in turn cause the processor to perform the method provided in the first aspect of this application.
[0029] Therefore, by applying the communication method and apparatus provided in this application, the network proxy receives a first request, which has a first format; according to the first request, the network proxy converts the first request into a logical file using configured format conversion rules; the network proxy sends the logical file to the service module so that the service module performs business processing on the logical file; the network proxy receives a first file sent by the service module, which includes the business processing result and has a second format; according to the business processing result, the network proxy generates a first response, which includes the business processing result and has a first format; and the network proxy sends the first response.
[0030] In this way, the network agent converts the first request with the first format into a first logic file, allowing business modules to directly process business logic according to the logic file. This solves the problem that existing Netconf Agents spend most of their time waiting for communication and consume a lot of manpower developing plugins when processing Netconf requests. Attached Figure Description
[0031] Figure 1 A schematic diagram of the existing Netconf protocol framework;
[0032] Figure 2 A flowchart illustrating the communication method provided in the embodiments of this application;
[0033] Figure 3 This is a schematic diagram of a tree structure provided in an embodiment of this application;
[0034] Figure 4 A schematic diagram of the Netconf protocol framework provided in an embodiment of this application;
[0035] Figure 5 A structural diagram of a communication device provided in an embodiment of this application;
[0036] Figure 6 The network device hardware structure provided in the embodiments of this application. Detailed Implementation
[0037] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0038] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms "a," "the," and "the" as used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and includes any and all possible combinations of one or more corresponding listed items.
[0039] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0040] The following is a detailed description of a communication method provided by an embodiment of this application. See also... Figure 2 , Figure 2 A flowchart illustrating a communication method provided in an embodiment of this application. This method is applied to a network proxy. The communication method provided in an embodiment of this application may include the following steps.
[0041] Step 210: Receive a first request, wherein the first request has a first format;
[0042] Specifically, when administrators (or users) or controllers pre-configure network devices, obtain the current configuration of network devices, or modify the current configuration of network devices, they may send a first request to the network devices, and the first request has a first format.
[0043] In this embodiment, the network device includes a network proxy and at least one service module. The network proxy includes an Xquery processor and a data client. The service module includes a data server.
[0044] The network proxy receives the first request through the first interface. The first interface then transmits the first request to the Xquery processor.
[0045] In one example, the first request might be a Netconf request, and the first format might be an XML format. The XML format can be broken down into actions and data. A Netconf request includes business type tags and object attribute tags. Business type tags correspond to the business logic they indicate, such as GET, DELETE, etc.; data corresponds to object attribute tags, such as Interface, MTU, Speed, etc.
[0046] For example, a Netconf request can be specifically as follows:
[0047]
[0048] The above Netconf request is used to represent the MTU value of GET Ethernet1.
[0049] Step 220: Using the configured format conversion rules, convert the first request into a logical file;
[0050] Specifically, according to the description in step 210, after receiving the Netconf request, the Xquery processor uses the configured format conversion rules to convert the Netconf request into a logical file.
[0051] It should be noted that, as described in step 210, the Netconf request includes a business type label and an object attribute label. The Xquery processor can determine the business module to be processed in the Netconf request based on the object attribute label.
[0052] Optionally, the Xquery processor uses the configured format conversion rules to convert the first request into a logic file. The specific process is as follows: Based on the business type label, the Xquery processor determines at least one atomic operation from a plurality of configured atomic operations to implement the business indicated by the business type label; under each atomic operation, the Xquery processor calls the doc function, which includes the logical path; the Xquery processor inputs the object attribute logical labels corresponding to the object attribute labels within the logical path to obtain the logic file.
[0053] Furthermore, administrators first configure the format conversion rules within the Xquery processor. These rules are written using the Xquery language. Within the format conversion rules, six atomic operations are defined to implement existing Netconf requests, as shown in the following example:
[0054] 1) GET atomic operation: Retrieves the current configuration of the instance based on the input index; 2) GET_Default atomic operation: Retrieves the default configuration of the instance based on the input index; 3) GET_NEXT atomic operation: Retrieves the index of the next instance of the specified instance; 4) SET atomic operation: Modifies the value of the corresponding field; 5) CREATE_INS atomic operation: Creates a new instance; 6) DELETE_INS atomic operation: Deletes a specified instance.
[0055] The atomic operations described above can be used to implement existing Netconf requests, as shown in the following example:
[0056] 1) The Netconf Get operation is equivalent to the GET atomic operation.
[0057] 2) The Netconf GetBulk operation is a batch Netconf Get operation: it retrieves multiple data at once.
[0058] The index of the next data item is obtained through the GET_NEXT atomic operation. If the index exists, the runtime configuration is retrieved using the GET atomic operation on that index. If the index does not exist, the iteration ends.
[0059] 3) The Netconf GetConfig operation is equivalent to the GET atomic operation and / or the GET_DEFAULT atomic operation. If the runtime configuration of an object is the same as the default configuration, the object is skipped; otherwise, the runtime configuration of the object is returned.
[0060] 4) The Netconf GetBulkConfig operation is a batch Netconf GetConfig operation: it retrieves the index of the next data item through the GET_NEXT atomic operation. If the index exists, it retrieves the runtime configuration of an object through the GET atomic operation; it retrieves the default configuration of an object through the GET_DEFAULT atomic operation; if the runtime configuration of an object is the same as the default configuration, it skips that object; otherwise, it returns the runtime configuration of that object. If the index does not exist, the traversal ends.
[0061] 5) The Netconf Merge operation is equivalent to the SET atomic operation.
[0062] 6) The Netconf Remove operation is equivalent to the GET atomic operation and / or the GET_DEFAULT atomic operation. If an object's runtime configuration is the same as the default configuration, it returns success. If an object's runtime configuration is different from the default configuration, the SET atomic operation is used to modify it to the default configuration.
[0063] 7) The Netconf Delete operation is equivalent to the GET atomic operation and / or the GET_DEFAULT atomic operation. If an object's runtime configuration is the same as the default configuration, it returns failure. If an object's runtime configuration is different from the default configuration, it uses the SET atomic operation to modify it to the default configuration.
[0064] It is understandable that in practical applications, Netconf also includes a variety of other operations, all of which can be implemented by at least one of the atomic operations mentioned above, and will not be listed here.
[0065] Based on the aforementioned example, after receiving the GET request in step 210, the Xquery processor uses the configured format conversion rules to determine that the Netconf GET operation is equivalent to a GET atomic operation. The Xquery processor then converts the GET request into a logic file. The converted logic file can be specifically as follows:
[0066] Get($XML_REQ)
[0067] {
[0068] File=Doc("mtud") / Data / [MTUName=$XML_REQ / interface / Name]
[0069] Return <mtu> {{File / MTUValue}}< / mtu>
[0070] }
[0071] The above logic file is used to represent the MTUValue that matches the interface / name in the GET and Netconf requests, and is returned in the form of a file.
[0072] After obtaining the logic file, the Xquery processor determines that the business module is an MTU business module that can process the interface based on the object attribute tags (interface, name, mtu) included in the GET request.
[0073] The Xquery processor sends logic files and business module identifiers to the data client.
[0074] Optionally, after receiving the logic file, the data client can identify the logical paths included in the doc functions. Based on these logical paths, the processing method for the current business logic can be determined.
[0075] If the logical attribute logical label of the object carried by the logical path is a fuzzy label, the data client determines the business processing method as sequential processing; if the logical attribute logical label of the object carried by the logical path is a non-fuzzy label, the data client determines the business processing method as non-sequential processing. Fuzzy labels are used to enable business modules to output business processing results sequentially, while non-fuzzy labels are used to enable business modules to output business processing results as needed.
[0076] In this context, a fuzzy tag is specifically a tag with uncertainty (a wider range). For example, `doc("interface management: / / interfaces")` is used to retrieve the configuration of all interfaces. A non-fuzzy tag is specifically a deterministic tag (a narrower range). For example, `doc("interface management: / / interfaces[name=ethernet2]")` is used to retrieve the configuration of interface Eth2.
[0077] Step 230: Send the logic file to the business module so that the business module can perform business processing on the logic file;
[0078] Specifically, according to the description of step 220, after receiving the logic file and the identifier of the business module, the data client sends the logic file to the business module corresponding to the identifier so that the business module can perform business processing on the logic file.
[0079] After receiving the logic file, the business module transmits it to the data server. The data server performs business processing based on the atomic operation tags included in the logic file and writes a first file using XML. This first file includes the business processing results and has a second format.
[0080] In this embodiment, the second format is specifically a data format. The data format can be decomposed into data, that is, the first file no longer includes business type tags or atomic operation tags, but only includes business data after the business is executed, or the execution result after the business is executed.
[0081] Furthermore, depending on the type of business, each business module stores the configuration content of the network device for a specific object.
[0082] For example, if a service module implements a service related to the MTU of an interface, then the MTU value of the interface within the network device is stored within that service module. The service module stores the MTU values of the interface within the network device in the form of a linked list. For example, Eth1 MTU 1500 → Eth2 MTU 2000 → Eth3 MTU 1500 → Eth4 MTU 1000.
[0083] Optionally, after receiving the logical file, the data server can identify the logical paths included in the doc function. Based on these logical paths, it can determine the processing method for the current business logic.
[0084] If the logical attribute logical label of the object carried by the logical path is a fuzzy label, the data server determines the business processing method as sequential processing; if the logical attribute logical label of the object carried by the logical path is a non-fuzzy label, the data server determines the business processing method as non-sequential processing. Fuzzy labels are used to enable the data server to output business processing results sequentially, while non-fuzzy labels are used to enable the data server to output business processing results as needed.
[0085] Based on the aforementioned example, after receiving the logic file from step 220, the data server determines that the logical attribute logical label carried by the logical path is a non-fuzzy label, which is the MTU value of the output interface Eth1. The data server outputs a first file, which can be specifically as follows:
[0086]
[0087] The data server sends the first file to the data client.
[0088] It should be noted that if the data server determines that the logical attribute logical tag of the object carried by the logical path is an ambiguous tag, such as Doc("mtud") / Data / [MTUName= / interface / ], it will output the MTU values of all interfaces. The data server outputs the first file, which can be as follows:
[0089]
[0090]
[0091] Step 240: Receive a first file sent by the service module, the first file including the service processing result, and the first file having a second format;
[0092] Specifically, according to the description of step 230, after receiving the first file, the data client obtains the business processing result from the first file.
[0093] Optionally, after receiving the first file, the data client may perform the step of storing the first file in its own memory.
[0094] Furthermore, by utilizing a tree-structured storage method, the data client stores the business processing results in the tree structure; using the invoked doc function, the data client accesses the tree structure and retrieves the corresponding business processing results from the tree structure sequentially or as needed.
[0095] Optionally, such as Figure 3 As shown, Figure 3 This is a schematic diagram of a tree structure provided for an embodiment of this application. Figure 3 In the code, the tree structure includes a root node, intermediate nodes, and child nodes. The root node is the access point indicated by "File" in the logical file, and the child nodes store the business processing results.
[0096] In this embodiment, the tree structure includes a first number of child nodes. The specific process by which the data client stores the business processing results in the tree structure using the above-described tree structure storage method is as follows:
[0097] From the first file, the data client obtains a first number of business processing results for the first time; the data client stores the first number of business processing results obtained for the first time in a first number of child nodes included in the tree structure.
[0098] It should be noted that the data client uses a "prefetch" method to store the business processing results in a tree structure, which can improve the access efficiency for administrators or controllers.
[0099] Optionally, after storing the first number of business processing results in a tree structure, the data client can subsequently retrieve some business processing results from the first file and overwrite the unaccessed business processing results in the tree structure with these additional results.
[0100] From the first file, the data client retrieves a second number of business processing results. If the second number of business processing results stored in the first number of child nodes have not been accessed, the data client determines that the second number of business processing results stored in the first number of child nodes will not be accessed again. The data client then deletes the second number of business processing results stored in the first number of child nodes, thus releasing the second number of child nodes and reducing memory pressure.
[0101] The data client stores the second batch of retrieved business processing results in the child nodes of the deleted business processing results. This avoids the problem of increased memory usage caused by retrieving all business processing results at once.
[0102] The tree structure described above can also be viewed as a queue (e.g., a queue containing 1-50 elements). The data client initially retrieves 50 business processing results and stores them sequentially in elements 1-50. Subsequently, the data client can retrieve no more than 50 business processing results from the first file each time and store them sequentially in elements 1-50. For example, if the data client retrieves 20 business processing results from the first file a second time and stores these 20 results sequentially in elements 1-20 at the head of the queue, then by default, the business processing results in elements 31-50 at the tail of the queue will no longer be accessed and will be removed from the queue, effectively releasing the child nodes. This process repeats continuously, reducing memory pressure.
[0103] Based on the previous example, the business processing result obtained by the data client from the tree structure is as follows: <mtu> 1500< / mtu> .
[0104] Step 250: Generate a first response based on the business processing result, wherein the first response includes the business processing result and has the first format;
[0105] Specifically, according to the description in step 240, after the data client obtains the business processing result, it returns the business processing result to the Xquery processor.
[0106] After receiving the business processing result, the Xquery processor generates a first response. This first response includes the business processing result and has a first format.
[0107] As in the example above, after receiving the business processing result in step 240, the Xquery processor encapsulates the Netconf response header before the business processing result and the Netconf response footer after the business processing result to generate a Netconf response. This Netconf response is in XML format.
[0108] The Xquery processor transmits the first response to the first interface of the network device.
[0109] Step 260: Send the first response.
[0110] Specifically, according to the description of step 250, after receiving the first response, the network device's first interface sends the first response to the controller through the first interface, or displays the first response to the administrator through the first interface. In this way, the administrator or the controller can configure the network device, obtain the current configuration of the network device, or modify the current configuration of the network device.
[0111] Optionally, in this embodiment, the format of the first request / response is not limited to XML format; the first request can also be in JSON format. In this case, the format conversion rule is written by JSONIQ, and the processor can convert the JSON format request into a format that the business module can process, and send it to the data server through the data client. The data server can also perform business processing, generate a JSON file in data format, and send it to the processor through the data client. Finally, the processor generates a first response in JSON format and feeds it back to the administrator or controller.
[0112] In this embodiment, internal data is made public and transparent, decoupling the development of front-end plugins (Netconf / command line, etc.) from business development. When the front-end changes, the back-end remains unaware. With the increasing number of Netconf models, the development workload for back-end business personnel can be significantly reduced. Using Xquery in conjunction with the internal data XML formalization replaces the original C development, greatly improving plugin development efficiency. For example, in the experimental project, what originally required 4500 lines of C code requires only 300 lines using Xquery. The standard Xquery's `load XML` function `doc` has been modified; by parsing path parameters, the Client / Server framework performs pre-fetching / filtering, avoiding the drawbacks of traditional module pre-fetching. The framework uses atomic operations such as GET / GETNEXT / SET to achieve batch retrieval and distribution, without the business modules being aware of it.
[0113] Therefore, by applying the communication method provided in this application, the network proxy receives a first request, which has a first format; according to the first request, the network proxy converts the first request into a logical file using configured format conversion rules; the network proxy sends the logical file to the business module so that the business module performs business processing on the logical file; the network proxy receives a first file sent by the business module, which includes the business processing result and has a second format; according to the business processing result, the network proxy generates a first response, which includes the business processing result and has a first format; and the network proxy sends the first response.
[0114] In this way, the network agent converts the first request with the first format into a first logic file, allowing business modules to directly process business logic according to the logic file. This solves the problem that existing Netconf Agents spend most of their time waiting for communication and consume a lot of manpower developing plugins when processing Netconf requests.
[0115] Optionally, after step 260 in the embodiments of this application, the process further includes caching multiple request transformation logic files by the network device and sending them to the business modules in batches.
[0116] Specifically, the network device identifies the type of atomic operation indicated by the atomic operation tags included in the logical file. If the service type corresponding to the atomic operation is a modification service (e.g., SET atomic operation, CREATE_INS atomic operation, DELETE_INS atomic operation), then after converting multiple first requests into multiple logical files, the network device sends multiple logical files in batches to the service module, so that the service module can perform service processing on multiple logical files.
[0117] Furthermore, the data client identifies the type of atomic operation indicated by the atomic operation tags included in the logic file. If the business type corresponding to the atomic operation is a modification business (e.g., SET atomic operation, CREATE_INS atomic operation, DELETE_INS atomic operation), then after receiving the logic file, the data client caches the logic file, and after receiving multiple logic files converted from multiple first requests, it sends multiple logic files in batches (e.g., 50 logic files) to the business module, so that the business module can perform business processing on multiple logic files.
[0118] The following is a detailed description of a communication method provided by an embodiment of this application. See also... Figure 4 , Figure 4 A schematic diagram of the Netconf protocol framework provided in an embodiment of this application.
[0119] exist Figure 4 The network device internally includes a network proxy and three service modules. The network proxy includes an Xquery processor and a data client. Each service module includes a data server. The data client establishes a communication connection with the data server.
[0120] The controller pre-obtains the current configuration of the network devices. The controller sends a Netconf request to the network devices, which is in XML format.
[0121] The network agent receives the Netconf request through the first interface. The first interface then forwards the Netconf request to the Xquery processor.
[0122] After receiving a Netconf request, the Xquery processor uses the configured format conversion rules to convert the Netconf request into a logic file. Simultaneously, based on the object attribute tags included in the Netconf request, the Xquery processor determines the business module to be processed, for example, business module 1.
[0123] It is understandable that the process by which the Xquery processor converts Netconf requests into logical files has been described in detail in the foregoing embodiments and will not be repeated here.
[0124] The Xquery processor sends the logic file and the identifier of business module 1 to the data client.
[0125] After receiving the logic file and the identifier of business module 1, the data client sends the logic file to business module 1 so that business module 1 can perform business processing on the logic file.
[0126] After receiving the logic file, business module 1 transmits it to data server 1. Data server 1 performs business processing based on the atomic operation tags included in the logic file and writes a first file using XML. This first file includes the business processing results and has a data format.
[0127] It is understandable that the process of the data server performing business processing and generating the first file has been described in detail in the aforementioned embodiments and will not be repeated here.
[0128] The data server sends the first file to the data client. After receiving the first file, the data client retrieves the business processing result from it.
[0129] The data client returns the business processing result to the Xquery processor. After receiving the business processing result, the Xquery processor generates a Netconf response. This Netconf response includes the business processing result and is in XML format.
[0130] The Xquery processor transmits a first response to the first interface of the network device, and the first interface sends a Netconf response to the controller.
[0131] Based on the same inventive concept, embodiments of this application also provide a communication device corresponding to the communication method. See also Figure 5 , Figure 5 The communication apparatus provided in this application embodiment is applied to a network proxy, and the apparatus includes:
[0132] The receiving unit 510 is configured to receive a first request, wherein the first request has a first format;
[0133] The conversion unit 520 is used to convert the first request into a logical file using the configured format conversion rules;
[0134] The sending unit 530 is used to send the logic file to the service module so that the service module can perform business processing on the logic file;
[0135] The receiving unit 510 is further configured to receive a first file sent by the service module, the first file including service processing results, and the first file having a second format;
[0136] The generation unit 540 is configured to generate a first response based on the business processing result, wherein the first response includes the business processing result and has the first format;
[0137] The sending unit 530 is further configured to send the first response.
[0138] Optionally, the first request includes a business type tag and an object attribute tag;
[0139] The conversion unit 520 is specifically used to determine, from a plurality of configured atomic operations, at least one atomic operation for implementing the service indicated by the service type label, based on the service type label.
[0140] Under each atomic operation, the doc function is called, and the doc function includes the logical path;
[0141] Enter the object attribute logical tags corresponding to the object attribute tags within the logical path to obtain the logical file.
[0142] Optionally, the device further includes: a determining unit (not shown in the figure), configured to determine that the business processing method is sequential processing if the logical label of the object attribute carried by the logical path is an fuzzy label;
[0143] If the logical attribute logical label of the object carried by the logical path is a non-fuzzy label, then the business processing method is determined to be non-sequential processing;
[0144] The fuzzy labels are used to enable the business modules to output business processing results sequentially, while the non-fuzzy labels are used to enable the business modules to output business processing results as needed.
[0145] Optionally, the device further includes: a storage unit (not shown in the figure), used to store the business processing result in the tree structure using a tree structure storage method;
[0146] The acquisition unit (not shown in the figure) is used to access the tree structure using the invoked doc function, and to obtain the corresponding business processing results from the tree structure in sequence or as needed.
[0147] Optionally, the tree structure includes a first number of child nodes;
[0148] The storage unit (not shown in the figure) is specifically used to obtain a first number of business processing results from the first file for the first time;
[0149] The first number of business processing results obtained for the first time are stored in the first number of child nodes included in the tree structure.
[0150] Optionally, the acquisition unit (not shown in the figure) is further configured to acquire a second number of business processing results from the first file;
[0151] The device further includes: a deletion unit (not shown in the figure), used to delete the second number of service processing results stored in the first number of child nodes if the second number of service processing results stored in the first number of child nodes have not been accessed;
[0152] The storage unit (not shown in the figure) is also used to store the second number of business processing results obtained again in the child nodes of the deleted business processing results.
[0153] Optionally, the sending unit 530 is specifically used to, if the type of atomic operation indicated by the atomic operation tag is a modification service, then after converting multiple first requests into multiple logical files, send multiple logical files in batches to the service module so that the service module can perform service processing on the multiple logical files.
[0154] Therefore, by applying the communication device provided in this application, the network proxy receives a first request having a first format; according to the first request, the network proxy converts the first request into a logical file using configured format conversion rules; the network proxy sends the logical file to the service module so that the service module performs business processing on the logical file; the network proxy receives a first file sent by the service module, the first file including the business processing result and having a second format; according to the business processing result, the network proxy generates a first response, the first response including the business processing result and having a first format; and the network proxy sends the first response.
[0155] In this way, the network agent converts the first request with the first format into a first logic file, allowing business modules to directly process business logic according to the logic file. This solves the problem that existing Netconf Agents spend most of their time waiting for communication and consume a lot of manpower developing plugins when processing Netconf requests.
[0156] Based on the same inventive concept, embodiments of this application also provide a network device, such as... Figure 6 As shown, the system includes a processor 610, a transceiver 620, and a machine-readable storage medium 630. The machine-readable storage medium 630 stores machine-executable instructions that can be executed by the processor 610. The processor 610 is prompted by the machine-executable instructions to execute the communication method provided in the embodiments of this application. (The foregoing...) Figure 5 The communication device shown can be used as follows: Figure 6 The hardware structure of the network device shown is implemented.
[0157] The aforementioned computer-readable storage medium 630 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the computer-readable storage medium 630 may also be at least one storage device located remotely from the aforementioned processor 610.
[0158] The processor 610 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0159] In this embodiment of the application, the processor 610 reads the machine-executable instructions stored in the machine-readable storage medium 630, and is prompted by the machine-executable instructions to enable the processor 610 itself and the transceiver 620 to execute the communication method described in the foregoing embodiment of the application.
[0160] In addition, this application provides a machine-readable storage medium 630 that stores machine-executable instructions. When called and executed by the processor 610, the machine-executable instructions cause the processor 610 itself and the transceiver 620 to execute the communication method described in the aforementioned application.
[0161] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0162] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0163] For the embodiments of communication devices and machine-readable storage media, since the methods involved are basically similar to those of the aforementioned method embodiments, the description is relatively simple, and relevant details can be found in the descriptions of the method embodiments.
[0164] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.< / mtu> < / vpn> < / name> < / name> < / mtu> < / mtu> < / name>
Claims
1. A communication method, characterized in that, The method is applied to a network proxy, and the method includes: Receive a first request, wherein the first request has a first format; Using the configured format conversion rules, the first request is converted into a logical file; The logic file is sent to the business module so that the business module can perform business processing on the logic file; Receive a first file sent by the service module, the first file including the service processing result, and the first file having a second format; Based on the business processing result, a first response is generated, the first response including the business processing result, and the first response having the first format; Send the first response; The first request includes a business type tag and an object attribute tag; The step of converting the first request into a logical file using the configured format conversion rules specifically includes: Based on the service type label, determine at least one atomic operation from a plurality of configured atomic operations to implement the service indicated by the service type label; Under each atomic operation, the doc function is called, and the doc function includes the logical path; Enter the object attribute logical tags corresponding to the object attribute tags within the logical path to obtain the logical file.
2. The method according to claim 1, characterized in that, The method further includes: If the logical attribute logical label of the object carried by the logical path is an fuzzy label, then the business processing method is determined to be sequential processing; If the logical attribute logical label of the object carried by the logical path is a non-fuzzy label, then the business processing method is determined to be non-sequential processing; The fuzzy labels are used to enable the business modules to output business processing results sequentially, while the non-fuzzy labels are used to enable the business modules to output business processing results as needed.
3. The method according to claim 1, characterized in that, After receiving the first file sent by the service module, the method further includes: The business processing results are stored in the tree structure using a tree-structured storage method. Using the invoked doc function, access the tree structure and retrieve the corresponding business processing results from the tree structure sequentially or as needed.
4. The method according to claim 3, characterized in that, The tree structure includes a first number of child nodes; The method of storing the business processing results in a tree structure specifically includes: From the first file, obtain a first number of business processing results for the first time; The first number of business processing results obtained for the first time are stored in the first number of child nodes included in the tree structure.
5. The method according to claim 4, characterized in that, After storing the business processing results in the tree structure using the tree structure storage method, the method further includes: From the first file, obtain a second number of business processing results; If the second number of business processing results stored in the first number of child nodes are not accessed, then delete the second number of business processing results stored in the first number of child nodes. The second number of business processing results obtained again are stored in the child nodes of the deleted business processing results.
6. The method according to claim 1, characterized in that, Sending the logic file to the business module specifically includes: If the atomic operation indicated by the atomic operation label is a modification service, then after converting multiple first requests into multiple logical files, multiple logical files are sent to the service module in batches so that the service module can perform business processing on the multiple logical files.
7. A communication device, characterized in that, The device is used in a network proxy, and the device includes: A receiving unit is configured to receive a first request, wherein the first request has a first format; A conversion unit is used to convert the first request into a logical file using configured format conversion rules; The sending unit is used to send the logic file to the business module so that the business module can perform business processing on the logic file; The receiving unit is further configured to receive a first file sent by the service module, the first file including a service processing result, and the first file having a second format; A generation unit is configured to generate a first response based on the business processing result, wherein the first response includes the business processing result and has the first format; The sending unit is further configured to send the first response; The first request includes a business type tag and an object attribute tag; The conversion unit is specifically used to determine, based on the service type label, at least one atomic operation from a plurality of configured atomic operations for implementing the service indicated by the service type label; Under each atomic operation, the doc function is called, and the doc function includes the logical path; Enter the object attribute logical tags corresponding to the object attribute tags within the logical path to obtain the logical file.
8. The apparatus according to claim 7, characterized in that, The device further includes: The determining unit is configured to determine that the business processing method is sequential processing if the logical label of the object attribute carried by the logical path is a fuzzy label. If the logical attribute logical label of the object carried by the logical path is a non-fuzzy label, then the business processing method is determined to be non-sequential processing; The fuzzy labels are used to enable the business modules to output business processing results sequentially, while the non-fuzzy labels are used to enable the business modules to output business processing results as needed.
9. The apparatus according to claim 7, characterized in that, The device further includes: A storage unit is used to store the business processing results in the tree structure using a tree-structured storage method; The acquisition unit is used to access the tree structure using the invoked doc function, and to obtain the corresponding business processing results from the tree structure sequentially or as needed.
10. The apparatus according to claim 9, characterized in that, The tree structure includes a first number of child nodes; The storage unit is specifically used to obtain a first number of business processing results from the first file for the first time; The first number of business processing results obtained for the first time are stored in the first number of child nodes included in the tree structure.
11. The apparatus according to claim 10, characterized in that, The acquisition unit is also used to acquire a second number of business processing results from the first file; The device further includes: a deletion unit, configured to delete the second number of service processing results stored in the first number of child nodes if the second number of service processing results stored in the first number of child nodes have not been accessed; The storage unit is also used to store the second number of business processing results obtained again in the child nodes of the deleted business processing results.
12. The apparatus according to claim 7, characterized in that, The sending unit is specifically used to, if the type of atomic operation indicated by the atomic operation tag is a modification service, then after converting multiple first requests into multiple logical files, send multiple logical files in batches to the service module so that the service module can perform service processing on the multiple logical files.
Citation Information
Patent Citations
System for integrated business management
US20090037225A1