A network device capability opening programming method and system
By using capability level descriptions and a unified operating framework, the problem of inconsistent programming methods among different network device manufacturers has been solved, enabling unified heterogeneous programming of network devices, simplifying the development process, and improving development efficiency.
Patent Information
- Application Number
- CN202211102290.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-09
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-09-09
AI Technical Summary
In the current technology, the programmable methods and programmable interfaces provided by different network chip manufacturers are inconsistent, lacking a unified standard, failing to meet the diverse programmable needs of users, and lacking a unified heterogeneous programming method for network devices.
The capability-level description method is used to describe the computing, storage, networking and other heterogeneous resources supported and opened by network devices. Heterogeneous unified programming is performed through a unified programming method, and a unified runtime framework is used to load, parse and run network applications. The runtime client and runtime server are used to parse and run the framework for interaction.
It enables the opening of programmable capabilities for network devices, supports abstract descriptions and heterogeneous unified programming of computing, storage, network and other heterogeneous resources, simplifies development difficulty and improves development efficiency.
Smart Images

Figure CN116301763B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network communication technology, and in particular to a method and system for programming open capabilities of network devices. Background Technology
[0002] Traditional networks lack programmability, hindering the research, development, and deployment of new network protocols, applications, and services. In recent years, Software Defined Networking (SDN) has become a hot research area in network communication. SDN initially proposed separating the control plane and data plane, using the OpenFlow protocol to achieve control plane programmability. However, OpenFlow does not support data plane programmability and suffers from poor scalability; adding a new protocol type or field requires extending OpenFlow. Currently, the latest advancements in networking include the p4 programming language and the target- and protocol-independent p4runtime protocol, enabling programmability of both the data and control planes and flexible protocol scalability.
[0003] While P4 (Programming Protocol-Independent Packet Processors) and p4runtime can perfectly implement software-defined networking, they are still in the experimental research stage, and progress in engineering applications is slow. Currently, many network chips do not support P4, and domestically produced chips especially do not, forcing the purchase of foreign chips for research and experimentation. Although fully programmable chips are relatively few, many network chips do support partial programmability; however, the programmability methods and interfaces provided by different chip manufacturers vary, lacking a unified standard. Furthermore, user needs are diverse; some services only require partial programmability of network functions, without requiring full programmability from all network devices. Additionally, P4 only addresses software definition for network chips, while network devices also include CPUs, memory, storage, network chips, FPGAs, and other heterogeneous chips, currently lacking a unified heterogeneous programming method for network devices.
[0004] Therefore, existing technologies still need to be improved and enhanced. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a network device capability open programming method and system to address the above-mentioned defects of the prior art. The aim is to solve the problem that the programmable methods and programmable interfaces provided by different network chip manufacturers are different, no unified standard has been formed, and the diverse programmable needs of users cannot be met, and there is a lack of a unified heterogeneous programming method for network devices.
[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0007] In a first aspect, the present invention provides a method for programming network device capabilities, wherein the method includes:
[0008] The capability-level description method is used to describe the computing, storage, network and other heterogeneous resources supported and available by network devices;
[0009] By using a unified programming approach, heterogeneous unified programming can be performed on the computing, storage, networking, and other heterogeneous resources of network devices to develop network applications.
[0010] A unified runtime framework is used to load, parse, and run the network application.
[0011] In one implementation, the unified runtime framework comprises two parts: a Runtime Client and a Runtime Server parsing and runtime framework. The Runtime Server is integrated into the network device to provide program parsing, adaptation, and execution for the network device. The Runtime Client is integrated into the controller to provide a unified programming interface for network applications / services. The Runtime Client and Runtime Server interact through the RPC remote procedure call protocol.
[0012] In one implementation, the Runtime Client includes an interface layer and a protocol layer, and the Runtime Server includes a protocol layer, an interpretation layer, and an adaptation layer.
[0013] The interface layer is used to provide a unified programming interface to network applications / services; the parsing layer is used to parse programming instructions; and the adaptation layer is used to adapt instructions.
[0014] In one implementation, the description of the computing, storage, network, and other heterogeneous resources supported and available by the network device using a capability-level description method includes:
[0015] The YAML markup language is used to describe the computing, storage, networking and other heterogeneous resources supported and opened by the network device, in order to mark the parameters, specifications, descriptions and API interfaces of the programmable functions supported and developed by the network device.
[0016] The capability level description is stored in the network device as a file. The capability level description file of the network device is read during the first handshake communication between the Runtime Client and the Runtime Server, so that users or developers can program the network device and develop network application / service programs based on the capability level description in the capability level description file.
[0017] In one implementation, the programmable functions include: basic device functions, cache functions, register functions, storage functions, network functions, CPU functions, and other functions.
[0018] In one implementation, the step of developing network applications by performing heterogeneous unified programming on the computing, storage, network, and other heterogeneous resources of network devices using a unified programming approach includes:
[0019] For memory function operations, the memory capability description of the network device in the capability level description is processed by programming to obtain code programs that support reading and writing of number, string, list and dictionary types;
[0020] For the operation of register functions, the network device's capability description of register name, size, and read / write attributes in the capability level description is programmed to obtain a code program that can perform read / write operations on register functions;
[0021] For the operation of the storage function, the capability descriptions of file storage, block storage, and object storage in the capability level description of the network device are programmed to obtain code programs that can perform creation, reading, writing, closing, and deletion operations on file storage, block storage, and object storage.
[0022] In one implementation, the step of developing network applications by performing heterogeneous unified programming on the computing, storage, network, and other heterogeneous resources of network devices using a unified programming approach further includes:
[0023] For network function operations, the capability descriptions of the network device in the capability level description, including message structure, message transmission and reception, and flow table structure, are programmed to obtain code programs that can define message structure, message transmission and reception, and flow table structure, and perform read, write, and delete operations on the flow table.
[0024] For CPU function operations, the capability description of the network device's custom function in the capability level description is programmed to obtain code programs that can perform operations such as calculation, branching, looping, and calling within the function.
[0025] Secondly, embodiments of the present invention also provide a network device capability open programming system, wherein the system includes a unified framework composed of a network controller and network devices, and the system includes:
[0026] The capability-level description module is used to describe the computing, storage, network, and other heterogeneous resources supported and available by network devices using a capability-level description approach.
[0027] The code programming module is used to perform heterogeneous unified programming of network device computing, storage, network and other heterogeneous resources through a unified programming approach, and to develop network applications.
[0028] The program execution module is used to load, parse, and run the network application using a unified runtime framework.
[0029] In one implementation, the unified runtime framework comprises two parts: a Runtime Client and a Runtime Server parsing and runtime framework. The Runtime Server is integrated into the network device to provide program parsing, adaptation, and execution for the network device. The Runtime Client is integrated into the controller to provide a unified programming interface for network applications / services. The Runtime Client and Runtime Server interact through the RPC remote procedure call protocol.
[0030] In one implementation, the Runtime Client includes an interface layer and a protocol layer, and the Runtime Server includes a protocol layer, an interpretation layer, and an adaptation layer.
[0031] The interface layer is used to provide a unified programming interface to network applications / services; the parsing layer is used to parse programming instructions; and the adaptation layer is used to adapt instructions.
[0032] In one implementation, the capability level description module includes:
[0033] The description unit is used to describe the computing, storage, network and other heterogeneous resources supported and opened by the network device using the YAML markup language, so as to mark the parameters, specifications, descriptions and API interfaces of the programmable functions supported and developed by the network device.
[0034] The storage unit is used to store the capability level description in the network device as a file. During the initial handshake communication between the RuntimeClient and the Runtime Server, the capability level description file of the network device is read so that users or developers can program the network device and develop network applications / services based on the capability level description in the capability level description file.
[0035] In one implementation, the programmable functions include: basic device functions, cache functions, register functions, storage functions, network functions, CPU functions, and other functions.
[0036] In one implementation, the code programming module includes:
[0037] The first programming module is used for memory function operations. It programs the memory capability description of the network device in the capability level description to obtain code programs that support reading and writing of number, string, list and dictionary types.
[0038] The second programming module is used for operations on register functions. It programs the network device to process the capability description of the registers in the capability level description, including the name, size, and read / write attributes, to obtain code programs that can perform read / write operations on the register functions.
[0039] The third programming module is used for operations on storage functions. It processes the capability descriptions of the network device in the capability level description for file storage, block storage, and object storage to obtain code programs that can perform creation, reading, writing, closing, and deletion operations on file storage, block storage, and object storage.
[0040] In one implementation, the code programming module includes:
[0041] The fourth encoding module is used for network function operations. It programs the capability description of the network device in the capability level description, including message structure, message transmission and reception, and flow table structure, to obtain code programs that can define message structure, message transmission and reception, and flow table structure, and perform read, write, and delete operations on the flow table.
[0042] The fifth encoding module is used for operating the CPU function. It programs the capability description of the network device's custom function in the capability level description to obtain code programs that can perform operations such as calculation, branching, looping, and calling within the function.
[0043] Beneficial Effects: Compared with existing technologies, this invention provides a network device capability open programming method. The method includes: describing the computing, storage, network, and other heterogeneous resources supported and open by the network device using a capability-level description approach; developing network applications by performing heterogeneous unified programming on the network device's computing, storage, network, and other heterogeneous resources using a unified programming approach; and loading, parsing, and running the network applications using a unified runtime framework. This invention enables the openness of the programmable capabilities supported by network devices to users and supports the abstract description and heterogeneous unified programming of computing, storage, network, and other heterogeneous resources. Attached Figure Description
[0044] Figure 1 A flowchart illustrating a specific implementation of the network device capability opening programming method provided in this embodiment of the invention.
[0045] Figure 2This invention provides a description of the basic capabilities, caching capabilities, register capabilities, storage capabilities, network capabilities, and other functions of a network device in the network device capability open programming method provided in this embodiment of the invention.
[0046] Figure 3 This is an architecture diagram of the network device capability open programming system provided in an embodiment of the present invention.
[0047] Figure 4 This is a schematic diagram illustrating the parsing and operational principle and process of the unified framework in the network device capability open programming method provided in this embodiment of the invention.
[0048] Figure 5 This is an example diagram of the program code in the network device capability opening programming method provided in an embodiment of the present invention.
[0049] Figure 6 A schematic diagram of the network device capability open programming system provided in this embodiment of the invention.
[0050] Figure 7 A schematic diagram of a terminal device provided in an embodiment of the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0052] This embodiment provides a method for programming open capabilities of network devices. Based on this method, the programmable capabilities supported by network devices can be opened to users, and abstract descriptions and heterogeneous unified programming of computing, storage, network, and other heterogeneous resources can be supported. Specifically, this embodiment first describes the computing, storage, network, and other heterogeneous resources supported and opened by the network device using a capability-level description approach; then, it performs heterogeneous unified programming of the network device's computing, storage, network, and other heterogeneous resources using a unified programming approach to develop network applications; and finally, it uses a unified runtime framework to load, parse, and run the network applications.
[0053] Exemplary methods
[0054] The network device capability opening programming method of this embodiment can be applied to a terminal device, which is a network device. For example... Figure 1 As shown in the figure, the network device capability opening programming method of this embodiment includes the following steps:
[0055] Step S100: Describe the computing, storage, network and other heterogeneous resources supported and open by the network device using the capability level description method.
[0056] This embodiment describes the network functions and APIs exposed by the network device through capability level descriptions, providing an abstract description of computing, storage, networking, and other heterogeneous functions. YAML markup language is used to describe the computing, storage, networking, and other heterogeneous resources supported and exposed by the network device, marking the parameters, specifications, descriptions, and API interfaces of the programmable functions supported and developed by the network device. These programmable functions include: basic device functions, caching functions, register functions, storage functions, network functions, CPU functions, and other functions. For example, the capability level description of caching is: name "cache", size 1024M, read / write attribute, and API is the = assignment instruction. Figure 2 Demonstrates the functionality and API descriptions of network device basics, caches, registers, storage, networking, and other functions (Note: Figure 2 This is just a general example of a capability level description; in a real network, network devices provide much more content and parameters for capability level descriptions than this example suggests.
[0057] Different manufacturers provide different capability level descriptions for their network devices based on their own open capabilities. When the device leaves the factory, the manufacturer edits the capability level description file, writing its open capabilities into the description file and making it available to developers. The Runtime Client reads the network device's capability level description during the initial handshake communication with the Runtime Server and verifies it during program runtime. The general descriptions for each resource are as follows:
[0058] The network device's basic capabilities are described, including the number of ports, port speed / duplex / operating mode, manufacturer information, and serial number. The network device's caching capabilities are described, including cache size, cache attributes, cache description, and cache operation commands. The network device's register capabilities are described, including register name, register size, register attributes, register description, and register operation commands. The network device's storage capabilities are described, separately for file storage, block storage, and object storage, including storage size, storage attributes, storage description, storage path, storage operation APIs, and parameters. The network device's network capabilities are described, including flow table size, flow matching type, flow action type, flow table and packet operation APIs, and parameters. Manufacturer-defined network function capabilities are also described, such as encryption and decryption, including the name, attributes, operation APIs, and parameters of the custom functions.
[0059] Step S200: Develop network applications by performing heterogeneous unified programming on the computing, storage, network and other heterogeneous resources of network devices using a unified programming approach.
[0060] In this embodiment, an interpreted programming language is used to run the network function program, simplifying the development process and improving efficiency. This embodiment supports the extension and customization of the network function API, enabling unified heterogeneous programming for computing, storage, networking, and other heterogeneous functions. The programming methods, instructions / APIs, and examples for memory, registers, storage, networking, functions, and other functions are shown in Table 1.
[0061]
[0062]
[0063]
[0064]
[0065] Table 1
[0066] For memory operations, the memory capability description of the network device in the capability level description is programmed to obtain code that supports reading and writing of number, string, list, and dictionary types. Specifically, in this embodiment, memory operations use the "=" assignment instruction, supporting reading and writing of number, string, list, and dictionary types. Memory allocation, release, and garbage collection are automatically completed by the interpreted runtime framework. Memory operations are performed using variable names, which can be customized by the user.
[0067] For register operations, the network device's capability description of register names, sizes, and read / write attributes in the capability level description is programmed to obtain code that can perform read / write operations on registers. Specifically, in this embodiment, for register operations, the network device describes the register names, sizes, read / write attributes, and descriptions in the capability level file, uses the "=" assignment instruction, and the program performs read / write operations through the register names, which are defined by the manufacturer in the capability level file when the device is shipped.
[0068] For storage operations, the network device's capabilities in file storage, block storage, and object storage, as described in its capability level description, are programmed to generate code programs capable of creating, reading, writing, closing, and deleting file storage, block storage, and object storage. Specifically, this embodiment provides creation, reading, writing, closing, and deletion operations for file storage, block storage, and object storage using API functions. File storage provides APIs such as open, read, write, and close; block storage provides APIs such as create, read, write, and delete; and object storage provides APIs such as get, post, put, and delete.
[0069] For network function operations, the capability descriptions of the network device in the capability-level description, including packet structure, packet transmission and reception, and flow table structure, are programmed to obtain code programs that can define packet structure, packet transmission and reception, and flow table structure, as well as perform read, write, and delete operations on the flow table. Specifically, this embodiment provides packet structure definition, packet transmission and reception, flow table structure definition, and flow table read, write, and delete operations for network operations. The matching fields and actions supported by the flow table are described in the capability-level file, including the name, size, attributes, and descriptions of the matching fields and actions. The structure definition of packets and flow tables is implemented using the combination of =:{}, and the API functions Table, WriteTable, ReadTable, DeleteTable, PacketIn, and PacketOut are used for creating, reading, writing, and deleting flow tables, as well as receiving and sending packets.
[0070] For CPU operations, the capability description of the network device's custom functions in the capability level description is processed through programming to obtain code programs that support operations such as calculation, branching, looping, and calling within the functions. Specifically, in this embodiment, for CPU operations, users can define custom functions that support operations such as calculation, branching, looping, and calling within the functions. The format of a custom function is `func function_name(parameter1, parameter2, ...)`, the branching instructions are `if else-if` and `else`, and the looping instructions are `while / for` and `break / continue`.
[0071] For other functional programming methods and programming APIs, each equipment manufacturer can add definitions and descriptions of other network functions, such as encryption and decryption, to the capability level description and operate them using API methods.
[0072] Step S300: Load, parse, and run the network application using a unified runtime framework.
[0073] The network device capability open programming system framework of this embodiment is as follows: Figure 3 As shown, the system consists of two parts: network devices and a network controller. The network controller programs and manages the operation of the network devices. The unified runtime framework in this embodiment includes two parts: a Runtime Client and a Runtime Server parsing and runtime framework. The Runtime Server is integrated into the network devices, providing program parsing, adaptation, and execution. The Runtime Client is integrated into the controller, providing a unified programming interface for network applications / services. The Runtime Client and Runtime Server interact via the RPC (Remote Procedure Call) protocol.
[0074] The unified framework's parsing and operation principles and processes are as follows: Figure 4 As shown, the Runtime Client includes an interface layer and a protocol layer. The interface layer provides a unified programming interface to network applications / services, while the protocol layer communicates and interacts with network devices. The Runtime Server includes a protocol layer, a parsing layer, and an adaptation layer. The protocol layer communicates and interacts with the network controller, the parsing layer parses programming instructions, and the adaptation layer adapts the instructions.
[0075] Specifically, the interface layer performs lexical and syntactic analysis on the network application code, and semantic analysis and verification on the code based on the device capability level description. Upon successful verification, instructions are generated and sent to the network device via the protocol layer.
[0076] The protocol layer uses RPC (Remote Procedure Call) for communication and protocol interaction, serializing instructions and sending them to the network device. Simultaneously, it receives the network device's status information, deserializes it, and sends the device status information to the interface layer, which then returns it to the network application.
[0077] The parsing layer parses and invokes instructions, records the instruction status, and returns the instruction invocation result to the network application. To ensure correct instruction invocation and return, the parsing layer needs to manage and schedule device status and resources, including memory management, storage management, CPU status management, and network status management.
[0078] The adaptation layer needs to be adapted by each device manufacturer, and the instructions should be adapted according to the capabilities provided by the device. Instruction adaptation can be carried out through instruction translation and API registration and callback methods. For hardware-level instructions, instruction translation can be used to translate the issued instructions into executable hardware chip instructions, such as register read and write instructions. For software-level instructions, API registration and callback methods can be used to register custom API functions to the corresponding instructions. When the instruction is called, the registered API functions, such as open, read, and write APIs, are called back.
[0079] In another implementation, this embodiment uses an example to illustrate the programming and operation process of network applications / services, demonstrating how network devices can open their network functionalities through capability level descriptions, and how to perform heterogeneous unified programming of computing, storage, networking, and other heterogeneous resources. This example implements a network application that handles flow table distribution, packet transmission and reception, and state storage, requiring the cooperation of various heterogeneous resources such as computing, storage, and networking. The capability levels required for this example program are: memory read / write, register read / write, CPU computation, custom packet creation and transmission, flow table read / write / deletion, file storage, and Ethernet type packet matching and forwarding support. Therefore, this embodiment can use a unified encoding method based on the above capability level descriptions, including heterogeneous programming of other functions such as memory read / write, register read / write, CPU computation, custom packet creation and transmission, flow table read / write / deletion, and file storage. Figure 5 For this example program code, the program first sends a flow table to the network device. The rules of the flow table are to send Ethernet packets to the CPU, and the CPU sends a start message to port 1. Then, the CPU receives matching packets, stores them in a file, and updates the registers. Finally, the program checks the results, prints the flow table, registers, and packets, deletes the flow table, and exits. When the program runs, first connect the network device to the controller, then write the program and run the start program in the controller, and finally check the results.
[0080] The result of running this example program is:
[0081] 1) The network device generates a flow table with a priority of 1, matches packets of Ethernet type 0x0800, and forwards them to port 0.
[0082] 2) counter0 counts the number of packets received by the network device from port 1.
[0083] 3) The pkt.bin file caches message content.
[0084] Therefore, this embodiment can uniformly adapt and extend the capabilities of equipment from various manufacturers through a unified framework and capability level description, and flexibly program network devices through a unified programming method and programming API. Furthermore, it uses an interpreted programming language to run network functions, simplifying development and improving efficiency.
[0085] Exemplary System
[0086] Based on the above embodiments, the present invention also provides a network device capability open programming system, which includes a unified framework composed of a network controller and network devices, as shown in the schematic diagram. Figure 6 Specifically, such as Figure 6As shown, the system includes a capability level description module 10, a code programming module 20, and a program execution module 30. Specifically, the capability level description module 10 is used to describe the computing, storage, network, and other heterogeneous resources supported and available by the network device using a capability level description method. The code programming module 20 is used to perform heterogeneous unified programming on the computing, storage, network, and other heterogeneous resources of the network device using a unified programming method to develop network applications. The program execution module 30 is used to load, parse, and run the network application using a unified execution framework.
[0087] In one implementation, the unified runtime framework comprises two parts: a Runtime Client and a Runtime Server parsing and runtime framework. The Runtime Server is integrated into the network device to provide program parsing, adaptation, and execution for the network device. The Runtime Client is integrated into the controller to provide a unified programming interface for network applications / services. The Runtime Client and Runtime Server interact through the RPC remote procedure call protocol.
[0088] In one implementation, the Runtime Client includes an interface layer and a protocol layer, and the Runtime Server includes a protocol layer, an interpretation layer, and an adaptation layer; the interface layer is used to provide a unified programming interface to network applications / services, the interpretation layer is used to parse programming instructions, and the adaptation layer is used to adapt instructions.
[0089] In one implementation, the capability level description module 10 includes:
[0090] The description unit is used to describe the computing, storage, network and other heterogeneous resources supported and opened by the network device using the YAML markup language, so as to mark the parameters, specifications, descriptions and API interfaces of the programmable functions supported and developed by the network device.
[0091] The storage unit is used to store the capability level description in the network device as a file. During the initial handshake communication between the RuntimeClient and the Runtime Server, the capability level description file of the network device is read so that users or developers can program the network device and develop network applications / services based on the capability level description in the capability level description file.
[0092] In one implementation, the programmable functions include: basic device functions, cache functions, register functions, storage functions, network functions, CPU functions, and other functions.
[0093] In one implementation, the code programming module 20 includes:
[0094] The first programming module is used for memory function operations. It programs the memory capability description of the network device in the capability level description to obtain code programs that support reading and writing of number, string, list and dictionary types.
[0095] The second programming module is used for operations on register functions. It programs the network device to process the capability description of the registers in the capability level description, including the name, size, and read / write attributes, to obtain code programs that can perform read / write operations on the register functions.
[0096] The third programming module is used for operations on storage functions. It processes the capability descriptions of the network device in the capability level description for file storage, block storage, and object storage to obtain code programs that can perform creation, reading, writing, closing, and deletion operations on file storage, block storage, and object storage.
[0097] In one implementation, the code programming module 20 includes:
[0098] The fourth encoding module is used for network function operations. It programs the capability description of the network device in the capability level description, including message structure, message transmission and reception, and flow table structure, to obtain code programs that can define message structure, message transmission and reception, and flow table structure, and perform read, write, and delete operations on the flow table.
[0099] The fifth encoding module is used for operating the CPU function. It programs the capability description of the network device's custom function in the capability level description to obtain code programs that can perform operations such as calculation, branching, looping, and calling within the function.
[0100] The working principle of each module in the network device capability open programming system of this embodiment is the same as that of each step in the above method embodiment, and will not be repeated here.
[0101] Based on the above embodiments, the present invention also provides a terminal device, the principle block diagram of which can be as follows: Figure 7As shown, the terminal device includes a processor and memory connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the terminal device is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a network device capability open programming method. Specifically, in this embodiment, the terminal device includes computing, storage, network, and heterogeneous resources, wherein: computing resources include general-purpose processors such as CPUs / microprocessors / microcontrollers; storage resources include non-volatile memory such as ROM / FLASH / SD cards / hard disks, and volatile memory such as RAM / DRAM / SDRAM; network resources include network chips, switching chips, NPUs (Network Processing Units), DPUs (Data Processing Units), etc. Other heterogeneous resources include FPGAs, CPLDs, TCAMs, DSPs, GPUs, TPUs, and other programmable chips and dedicated ASIC chips.
[0102] Those skilled in the art will understand that Figure 7 The block diagram shown is merely a partial structural diagram related to the present invention and does not constitute a limitation on the terminal device to which the present invention is applied. The specific terminal device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0103] In one embodiment, a terminal device is provided, comprising a memory, a processor, and a network device capability opening program stored in the memory and executable on the processor. When the processor executes the network device capability opening program, it implements the following operation instructions:
[0104] The capability-level description method is used to describe the computing, storage, network and other heterogeneous resources supported and available by network devices;
[0105] By using a unified programming approach, heterogeneous unified programming can be performed on the computing, storage, networking, and other heterogeneous resources of network devices to develop network applications.
[0106] A unified runtime framework is used to load, parse, and run the network application.
[0107] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, operational databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual operating data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0108] In summary, this invention discloses a method and system for open programming of network device capabilities. The method includes: describing the computing, storage, network, and other heterogeneous resources supported and open by the network device using a capability-level description approach; developing network applications by performing heterogeneous unified programming of the network device's computing, storage, network, and other heterogeneous resources using a unified programming approach; and loading, parsing, and running the network applications using a unified runtime framework. This invention enables the openness of the programmable capabilities supported by network devices to users and supports the abstract description and heterogeneous unified programming of computing, storage, network, and other heterogeneous resources.
[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for programming open capabilities of network devices, characterized in that, The method includes: The capability-level description method is used to describe the computing, storage, network and other heterogeneous resources supported and available by network devices; By using a unified programming approach, heterogeneous unified programming can be performed on the computing, storage, networking, and other heterogeneous resources of network devices to develop network applications. A unified runtime framework is used to load, parse, and run the network application. The network application runs in an interpreted programming language; The unified runtime framework comprises two parts: a Runtime Client and a Runtime Server. The Runtime Server is integrated into the network device, providing program parsing, adaptation, and execution for the network device. The Runtime Client is integrated into the controller, providing a unified programming interface for network applications / services. The Runtime Client and Runtime Server interact via the RPC remote procedure call protocol. The Runtime Client includes an interface layer and a protocol layer, and the Runtime Server includes a protocol layer, a parsing layer, and an adaptation layer. The interface layer is used to provide a unified programming interface to network applications / services; the parsing layer is used to parse programming instructions; and the adaptation layer is used to adapt the instructions. The adaptation layer is performed by the equipment manufacturer. It adapts instructions according to the capabilities of the equipment. The instruction adaptation includes instruction translation and API registration and callback methods. For hardware-level instructions, the instruction translation method translates the issued instructions into executable hardware chip instructions. For software-level instructions, the API registration and callback method registers custom API function functions to the corresponding instructions. When the instruction is called, the registered API function is called back.
2. The network device capability opening programming method according to claim 1, characterized in that, The capability-level description method is used to describe the computing, storage, network, and other heterogeneous resources supported and available by network devices, including: The YAML markup language is used to describe the computing, storage, networking and other heterogeneous resources supported and opened by the network device, in order to mark the parameters, specifications, descriptions and API interfaces of the programmable functions supported and developed by the network device. The capability level description is stored in the network device as a file. The capability level description file of the network device is read during the first handshake communication between the Runtime Client and the Runtime Server, so that users or developers can program the network device and develop network application / service programs based on the capability level description in the capability level description file.
3. The network device capability opening programming method according to claim 2, characterized in that, The programmable functions include: basic device functions, cache functions, register functions, storage functions, network functions, CPU functions, and other functions.
4. The network device capability opening programming method according to claim 3, characterized in that, The method of developing network applications by performing heterogeneous unified programming on the computing, storage, network, and other heterogeneous resources of network devices through unified programming includes: For memory function operations, the memory capability description of the network device in the capability level description is processed by programming to obtain code programs that support reading and writing of number, string, list and dictionary types; For the operation of register functions, the network device's capability description of register name, size, and read / write attributes in the capability level description is programmed to obtain a code program that can perform read / write operations on register functions; For the operation of the storage function, the capability descriptions of the network device in the capability level description of file storage, block storage, and object storage are programmed to obtain code programs that can perform creation, reading, writing, closing, and deletion operations on file storage, block storage, and object storage.
5. The network device capability opening programming method according to claim 4, characterized in that, The method of developing network applications by performing heterogeneous unified programming on the computing, storage, network, and other heterogeneous resources of network devices using a unified programming approach also includes: For network function operations, the capability descriptions of the network device in the capability level description, including message structure, message transmission and reception, and flow table structure, are programmed to obtain code programs that can define message structure, message transmission and reception, and flow table structure, and perform read, write, and delete operations on the flow table. For CPU function operations, the capability description of the network device's custom function in the capability level description is programmed to obtain code programs that can perform operations such as calculation, branching, looping, and calling within the function.
6. A network device capability open programming system, characterized in that, The system is used to implement the network device capability open programming method as described in any one of claims 1-5, the system includes a unified framework composed of a network controller and network devices, the system comprising: The capability-level description module is used to describe the computing, storage, network, and other heterogeneous resources supported and available by network devices using a capability-level description approach. The code programming module is used to perform heterogeneous unified programming of network device computing, storage, network and other heterogeneous resources through a unified programming approach, and to develop network applications. The program execution module is used to load, parse, and run the network application using a unified runtime framework.
7. The network device capability open programming system according to claim 6, characterized in that, The unified runtime framework comprises two parts: a Runtime Client and a Runtime Server. The Runtime Server is integrated into the network device, providing program parsing, adaptation, and execution for the network device. The Runtime Client is integrated into the controller, providing a unified programming interface for network applications / services. The Runtime Client and Runtime Server interact through the RPC remote procedure call protocol.
8. The network device capability open programming system according to claim 7, characterized in that, The RuntimeClient includes an interface layer and a protocol layer, and the Runtime Server includes a protocol layer, a parsing layer, and an adaptation layer. The interface layer is used to provide a unified programming interface to network applications / services; the parsing layer is used to parse programming instructions; and the adaptation layer is used to adapt instructions.
9. The network device capability open programming system according to claim 6, characterized in that, The capability level description module includes: The description unit is used to describe the computing, storage, network and other heterogeneous resources supported and opened by the network device using the YAML markup language, so as to mark the parameters, specifications, descriptions and API interfaces of the programmable functions supported and developed by the network device. The storage unit is used to store the capability level description in the network device as a file. During the initial handshake communication between the Runtime Client and the Runtime Server, the capability level description file of the network device is read so that users or developers can program the network device and develop network applications / services based on the capability level description in the capability level description file.
10. The network device capability open programming system according to claim 9, characterized in that, The programmable functions include: basic device functions, cache functions, register functions, storage functions, network functions, CPU functions, and other functions.
11. The network device capability open programming system according to claim 8, characterized in that, The code programming module includes: The first programming module is used for memory function operations. It programs the memory capability description of the network device in the capability level description to obtain code programs that support reading and writing of number, string, list and dictionary types. The second programming module is used for operations on register functions. It programs the network device to process the capability description of the registers in the capability level description, including the name, size, and read / write attributes, to obtain code programs that can perform read / write operations on the register functions. The third programming module is used for operations on storage functions. It processes the capability descriptions of the network device in the capability level description for file storage, block storage, and object storage to obtain code programs that can perform creation, reading, writing, closing, and deletion operations on file storage, block storage, and object storage.
12. The network device capability open programming system according to claim 11, characterized in that, The code programming module includes: The fourth encoding module is used for network function operations. It programs the capability description of the network device in the capability level description, including message structure, message transmission and reception, and flow table structure, to obtain code programs that can define message structure, message transmission and reception, and flow table structure, and perform read, write, and delete operations on the flow table. The fifth encoding module is used for operating the CPU function. It programs the capability description of the network device's custom function in the capability level description to obtain code programs that can perform operations such as calculation, branching, looping, and calling within the function.
Citation Information
Patent Citations
Distributed computing method and system
CN102915229A
A programmable network element compilation system and compilation method
CN114938322A