CN116737130A - Method, system, equipment and storage medium for compiling modal-oriented intermediate representation - Google Patents

Method, system, equipment and storage medium for compiling modal-oriented intermediate representation Download PDF

Info

Publication number
CN116737130A
CN116737130A CN202311024639.9A CN202311024639A CN116737130A CN 116737130 A CN116737130 A CN 116737130A CN 202311024639 A CN202311024639 A CN 202311024639A CN 116737130 A CN116737130 A CN 116737130A
Authority
CN
China
Prior art keywords
intermediate representation
file
compiling
splitting
representation file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311024639.9A
Other languages
Chinese (zh)
Other versions
CN116737130B (en
Inventor
王永杰
朱俊
张富军
徐琪
邹涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Lab
Original Assignee
Zhejiang Lab
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Lab filed Critical Zhejiang Lab
Priority to CN202311024639.9A priority Critical patent/CN116737130B/en
Publication of CN116737130A publication Critical patent/CN116737130A/en
Application granted granted Critical
Publication of CN116737130B publication Critical patent/CN116737130B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/37Compiler construction; Parser generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to the technical field of computer networks, in particular to a compiling method, a compiling system, compiling equipment and a storage medium for modal-oriented intermediate representation, wherein the compiling method comprises the following steps: acquiring a first P4 program and a first configuration file thereof which are input by a user and comprise a plurality of network function modal messages, and acquiring login information of each terminal device; compiling the first P4 program to generate a first intermediate representation file; copying the first intermediate representation file to obtain a second intermediate representation file with the corresponding number of copies; splitting each second intermediate representation file to obtain a third intermediate representation file containing independent network function modal messages; and respectively sending the third intermediate representation files to corresponding terminal equipment, and respectively compiling the third intermediate representation files by utilizing the terminal equipment to generate target files. According to the technical scheme, compiling efficiency is improved, and system friendliness is improved.

Description

Method, system, equipment and storage medium for compiling modal-oriented intermediate representation
Technical Field
The present application relates to the field of computer network technologies, and in particular, to a compiling method, system, device, and storage medium for a modal-oriented intermediate representation.
Background
The internet architecture, protocols and services are continuously updated, and there is an increasing demand for flexibility and programmability of the network. The programmable data plane (Programmable Data Plane, PDP) provides data plane support for the rapid development of new networks. With the development of programmable data planes, various programmable data plane devices emerge, including software switching devices that accelerate component optimization using data plane development suite DPDK (Data Plane Development Kit), and hardware network devices based on programmable switching chips. Meanwhile, heterogeneous devices with various integrated software and hardware can bear various network function modes and large-flow network models.
For different data plane architectures, a high level programming language is required to lower the developer's network data plane programming threshold. The programmable protocol independent message processing (programming protocol-independent packet processors, P4) is currently widely used in the field of data plane programming as a protocol independent high level programming language. The P4 language has target independence, specific bottom layer equipment implementation details are not required to be concerned, and network developers can realize better and more flexible network protocol functions by means of the data plane programming capability provided by the P4.
P4c is an open source modular P4 language compiler that supports both P4-14 and P4-16 versions of P4 language. p4c can be divided into front-end, middle-end and back-end compilers from a structural logical partition. The P4 file is compiled by the front-end and the middle-end to generate a modal intermediate representation, i.e., IR, independent of the back-end structure. And compiling the intermediate representation into an executable file and configuration information which can be loaded and run to the target terminal equipment by a back-end compiler arranged on the target terminal equipment. P4c provides users with different types of monitor access classes for accessing Node nodes. The developer needs to access the operational Node, which can be achieved by creating different types of subclasses based on the common navigator access class.
The prior art has at least the following problems:
for heterogeneous devices with integrated software and hardware or novel network systems comprising various network devices, network protocol messages with various functional modes need to be processed. A developer typically writes a P4 program that incorporates multiple network function modalities and then compiles and loads it onto all target terminal devices. In the implementation of the prior art, a user is required to split a unified P4 program into a plurality of P4 programs, and then the P4 programs are compiled by the front-end compiler and the middle-end compiler for a plurality of times to generate a multi-part intermediate representation IR (Intermediate Representation), so that the front-end compiler and the middle-end compiler are very time-consuming in a plurality of times, and the compiling speed and the user friendliness are seriously affected.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a compiling method, system, computer device and storage medium for a modal-oriented intermediate representation.
In a first aspect, an embodiment of the present application provides a compiling method for a modal-oriented intermediate representation, where the method includes:
acquiring a first P4 program and a first configuration file thereof which are input by a user and comprise a plurality of network function modal messages, and acquiring login information of each terminal device;
compiling the first P4 program by using a front-end compiler and a middle-end compiler in sequence to generate a first middle representation file;
copying the first intermediate representation file according to the first configuration file to obtain a second intermediate representation file with the corresponding number of copies;
splitting each second intermediate representation file according to the first configuration file to obtain a third intermediate representation file containing an independent network function mode message;
and based on the login information of each terminal device, respectively sending each third intermediate representation file to the corresponding terminal device, and respectively compiling each third intermediate representation file by using each terminal device to generate a target file, wherein the target file is used for generating second configuration information of the corresponding terminal device.
In an embodiment, splitting each of the second intermediate representation files according to the first configuration file to obtain a third intermediate representation file including an independent network function mode packet includes:
generating a function mode list based on the division of each network function mode message contained in the first configuration file;
traversing each node accessing the second intermediate representation file based on the functional mode list, and extracting comparison basis required by splitting from the specific type of nodes;
and splitting each unit contained in each second intermediate representation file based on the comparison basis to generate third intermediate representation files respectively containing specific functional mode messages.
In an embodiment, the splitting each unit included in each second intermediate representation file according to the comparison, and generating a third intermediate representation file respectively including a specific function mode packet includes:
acquiring a father node of a specific type node, and searching a child node corresponding to the father node and containing a list storage unit;
creating a sub-node type empty list storage unit, traversing the list storage unit in the sub-node, extracting a functional mode identification element, comparing with the split basis, judging whether the functional mode identification element is reserved or not, and copying the functional mode identification element into the empty list storage unit under the reserved condition;
and replacing the node pointer corresponding to the empty list storage unit with the node pointer corresponding to the list storage unit to obtain a third intermediate representation file containing the specific functional mode message.
In an embodiment, after splitting each unit included in each second intermediate representation file according to the comparison basis to generate a third intermediate representation file respectively including a specific functional mode packet, the method further includes:
and carrying out optimization processing on each third intermediate representation file.
In an embodiment, the third intermediate representation file includes a structure unit, an parsing unit, a control unit, and an inverse parsing unit, and the optimizing the third intermediate representation files includes:
after the structural body units are split, the redundant structural body nodes are optimally deleted according to the splitting basis; after the resolution unit splits, optimizing and deleting redundant resolution state nodes; and after the control unit is split, redundant action and appearance information are optimally deleted.
In one embodiment, after the optimizing the third intermediate representation files, the method further includes:
reversely generating a corresponding second P4 program based on each third intermediate representation file;
and performing offline verification on the second P4 program, and re-splitting the corresponding second intermediate representation file under the condition that the offline verification result fails.
In a second aspect, an embodiment of the present application proposes a compiling system for a modal-oriented intermediate representation, the system comprising:
the acquisition module is used for acquiring a first P4 program and a first configuration file thereof which are input by a user and comprise a plurality of network function modal messages, and acquiring login information of each terminal device;
the first compiling module is used for compiling the first P4 program by utilizing a front-end compiler and a middle-end compiler in sequence to generate a first intermediate representation file;
the copying module is used for copying the first intermediate representation file according to the first configuration file to obtain a second intermediate representation file with the corresponding number of copies;
the splitting module is used for splitting each second intermediate representation file according to the first configuration file to obtain a third intermediate representation file containing an independent network function modal message;
and the second compiling module is used for respectively sending the third intermediate representation files to corresponding terminal equipment based on the login information of each terminal equipment, and respectively compiling the third intermediate representation files by utilizing the terminal equipment to generate target files, wherein the target files are used for generating second configuration information of the corresponding terminal equipment.
In an embodiment, the system further comprises:
the offline verification module is used for reversely generating a corresponding second P4 program based on each third intermediate representation file; and performing offline verification on the second P4 program, and re-splitting the corresponding second intermediate representation file under the condition that the offline verification result fails.
In a third aspect, an embodiment of the present application proposes a computer device comprising a memory storing a computer program and a processor executing the steps of the first aspect.
In a fourth aspect, an embodiment of the present application proposes a computer readable storage medium, on which a computer program is stored, the processor implementing the steps of the first aspect when executing the computer program.
Compared with the prior art, the method, the system, the computer equipment and the storage medium acquire a first P4 program and a first configuration file thereof which are input by a user and contain a plurality of network function modal messages, and acquire login information of each terminal equipment; compiling the first P4 program by using a front-end compiler and a middle-end compiler in sequence to generate a first middle representation file; copying the first intermediate representation file according to the first configuration file to obtain a second intermediate representation file with the corresponding number of copies; splitting each second intermediate representation file according to the first configuration file to obtain a third intermediate representation file containing an independent network function mode message; and based on the login information of each terminal device, respectively sending each third intermediate representation file to the corresponding terminal device, and respectively compiling each third intermediate representation file by using each terminal device to generate a target file, wherein the target file is used for generating second configuration information of the corresponding terminal device. According to the technical scheme, the network function modal messages processed by different types of terminal equipment can be automatically divided according to the first configuration file, and the user can flexibly schedule modal functions only by once P4 program coding, so that the compiling efficiency is improved, and the friendliness of the system is greatly improved.
Drawings
FIG. 1 is a schematic diagram of a terminal in an embodiment;
FIG. 2 is a flow diagram of a method of compiling a modal intermediate representation in one embodiment;
FIG. 3 is a flow chart of a splitting method according to an embodiment;
FIG. 4 is a flowchart of a third method for generating an intermediate representation file according to an embodiment;
FIG. 5 is a flow chart illustrating an offline verification method according to an embodiment;
FIG. 6 is a schematic diagram of the modular connection of a compilation system facing a modal intermediate representation in one embodiment;
fig. 7 is a schematic structural diagram of a computer device in an embodiment.
Detailed Description
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are used in the description of the embodiments will be briefly described below. It is apparent that the drawings in the following description are only some examples or embodiments of the present application, and it is apparent to those of ordinary skill in the art that the present application may be applied to other similar situations according to the drawings without inventive effort. Unless otherwise apparent from the context of the language or otherwise specified, like reference numerals in the figures refer to like structures or operations.
As used in the specification and in the claims, the terms "a," "an," "the," and/or "the" are not specific to a singular, but may include a plurality, unless the context clearly dictates otherwise. In general, the terms "comprises" and "comprising" merely indicate that the steps and elements are explicitly identified, and they do not constitute an exclusive list, as other steps or elements may be included in a method or apparatus.
While the present application makes various references to certain modules in a system according to embodiments of the present application, any number of different modules may be used and run on a computing device and/or processor. The modules are merely illustrative and different aspects of the systems and methods may use different modules.
It will be understood that when an element or module is referred to as being "connected," "coupled" to another element, module, or block, it can be directly connected or coupled or in communication with the other element, module, or block, or intervening elements, modules, or blocks may be present unless the context clearly dictates otherwise. The term "and/or" as used herein may include any and all combinations of one or more of the associated listed items.
The compiling method for the modal-oriented intermediate representation provided by the application can be applied to the terminal shown in the figure 1. As shown in fig. 1, the terminal may include one or two (only one is shown in fig. 1) processors 102 and a memory 104 for storing data, wherein the processors 102 may include, but are not limited to, a processing system such as a microprocessor MCU or a programmable logic device FPGA. The terminal may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 2 is merely illustrative and is not intended to limit the structure of the terminal. For example, the terminal may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1.
The memory 104 may be used to store computer programs, such as software programs of application software and modules, such as a computer program corresponding to a compiling method for a modal-oriented intermediate representation in the present embodiment, and the processor 102 executes the computer programs stored in the memory 104 to perform various functional applications and data processing, that is, to implement the above-described methods. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage systems, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. The network includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (NetworkInterfaceController, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a radio frequency (RadioFrequency, RF) module for communicating wirelessly with the internet.
As shown in fig. 2, an embodiment of the present application provides a compiling method for a modal-oriented intermediate representation, and the method is applied to a terminal in fig. 1 for illustration, and includes the following steps:
s202: and acquiring a first P4 program and a first configuration file thereof which are input by a user and comprise a plurality of network function modal messages, and acquiring login information of each terminal device.
The method comprises the steps of obtaining a first P4 program and a first configuration file thereof which are input by a user and comprise a plurality of network function modal messages, storing the first P4 program and the first configuration file under a designated path, and obtaining login information of each terminal device, wherein the login information comprises IP address information and login user name password information of the terminal device.
S204: and compiling the first P4 program by using a front-end compiler and a middle-end compiler in turn to generate a first intermediate representation file.
And starting a compiling program, and compiling the first P4 program by using a front-end compiler and a middle-end compiler in sequence.
S206: and copying the first intermediate representation file according to the first configuration file to obtain a second intermediate representation file with the corresponding number of copies.
The first configuration file divides the type of the terminal equipment to which each network function mode message belongs, so that the number of parts to be split in the first configuration file can be obtained.
And compiling by the front-end compiler and the middle-end compiler to generate a first intermediate representation file facing the universal back-end equipment, storing the first intermediate representation file in a memory of the compiler, copying the first intermediate representation file with corresponding parts in the memory, wherein the parts are determined by the parts to be split in the first configuration file.
S208: and splitting each second intermediate representation file according to the first configuration file to obtain a third intermediate representation file containing the independent network function modal message.
The first configuration file divides the type of the terminal equipment to which each network function mode message belongs, so that the splitting basis in the first configuration file can be obtained.
S210: and based on the login information of each terminal device, respectively sending each third intermediate representation file to the corresponding terminal device, and respectively compiling each third intermediate representation file by using each terminal device to generate a target file, wherein the target file is used for generating second configuration information of the corresponding terminal device.
And sending the processed third intermediate representation files to corresponding terminal equipment, completing back-end compiling, generating configuration information required by the terminal equipment, and loading and running the configuration information to the terminal equipment.
Based on the steps S202-S210, network function modal messages processed by different types of terminal equipment can be automatically divided according to the first configuration file, and the user can realize flexible scheduling of modal functions only by once P4 program coding, so that compiling efficiency is improved, and system friendliness is greatly improved.
In an embodiment, as shown in fig. 3, the splitting each of the second intermediate representation files according to the first configuration file to obtain a third intermediate representation file including an independent network function mode packet includes:
s302: generating a function mode list based on the division of each network function mode message contained in the first configuration file;
and reading the functional mode list into a memory, and enabling a subsequent compiling program to access the functional mode list which needs to be processed by the terminal equipment through inquiring the name of the terminal equipment.
S304: traversing each node accessing the second intermediate representation file based on the functional mode list, and extracting comparison basis required by splitting from the specific type of nodes;
in the splitting function, creating an Injector (accessor) sub-class object DeviceInfoColllect, globally traversing and accessing each node of the second intermediate representation file in a read-only mode through the accessor, defining a processing method of a specific type node in the sub-class object DeviceInfoColllect, and extracting comparison basis required by splitting from the specific type node by combining the acquired function mode list.
S306: and splitting each unit contained in each second intermediate representation file based on the comparison basis to generate third intermediate representation files respectively containing specific functional mode messages.
The second intermediate representation file includes a struct unit, a parameter unit, a control unit, and a parameter unit.
In the splitting function, a Transform (read-write) mode identifier (accessor) sub-class object DeviceInfoIRTrans is created, the Transform (read-write) mode identifier (accessor) class traverses and accesses IR nodes in a read-write mode, a splitting method of a specific type node is defined in the sub-class object DeviceInfoIRTrans, and splitting processing is carried out on a struct unit, a parameter unit, a control unit and a parameter unit according to acquired comparison basis to obtain a third intermediate representation file only containing specific function modes.
In a specific embodiment, as shown in fig. 4, the splitting each unit included in each second intermediate representation file according to the comparison, and generating a third intermediate representation file respectively including a specific functional mode packet includes:
s402: acquiring a father node of a specific type node, and searching a child node corresponding to the father node and containing a list storage unit;
acquiring a father Node of a Node of a specific type, and searching a child Node corresponding to the father Node and containing a vector list storage unit, wherein the vector list storage unit is a bearing unit of a specific functional mode;
s404: creating a sub-node type empty list storage unit, traversing the list storage unit in the sub-node, extracting a functional mode identification element, comparing with the split basis, judging whether the functional mode identification element is reserved or not, and copying the functional mode identification element into the empty list storage unit under the reserved condition;
s406: and replacing the node pointer corresponding to the empty list storage unit with the node pointer corresponding to the list storage unit to obtain a third intermediate representation file containing the specific functional mode message.
And splitting the struct unit, the parameter unit, the control unit and the deparser unit sequentially according to steps S402 to S406 to obtain a third intermediate representation file containing the specific functional mode message.
In an embodiment, after splitting each unit included in each second intermediate representation file according to the comparison basis to generate a third intermediate representation file respectively including a specific functional mode packet, the method further includes:
and carrying out optimization processing on each third intermediate representation file.
After the structural body units are split, the redundant structural body nodes are optimally deleted according to the splitting basis; after the resolution unit is split, each parameter pipeline is traversed from a starting state node, in the traversing of each pipeline, whether the traversed state node is reachable is judged, if the current state node is not reachable, the node is optimized, and otherwise, the node is reserved. The redundant state nodes are optimized and deleted in the mode, and irrelevant analysis states are removed; after the control unit is split, traversing the existing condition elements, traversing the action nodes, comparing with the basis extracted from the condition elements, and optimally deleting unused action nodes. Traversing the table item nodes, and optimizing and deleting the unused table item nodes by comparing with the extracted basis in the condition elements. In this way redundant actions and table entry information are optimally deleted.
In one embodiment, as shown in fig. 5, after the optimizing process is performed on each of the third intermediate representation files, the method further includes:
s502: reversely generating a corresponding second P4 program based on each third intermediate representation file;
s504: and performing offline verification on the second P4 program, and re-splitting the corresponding second intermediate representation file under the condition that the offline verification result fails.
In order to ensure the correctness and consistency of compiling execution, a second P4 program is reversely generated for the split third intermediate representation files, offline verification is carried out, whether the third intermediate representation files loaded on the terminal equipment are reprocessed or not is determined according to the offline verification result, namely, if the offline verification result is correct, the compiling process is finished, and if the offline verification result fails, the defeated rollback process is lost.
Further, in the splitting function, a PassManager (pipeline) mode manager sub-class object division is created, and the PassManager (pipeline) mode manager class adds the created sub-class object DeviceInfoCollect, deviceInfoIRTrans, simplifyIR and the IrPrettyPrint to a unified pipeline, and batch processing of the nodes is completed in a pipeline packaging mode, so that processing efficiency is improved.
According to the compiling method for the modal-oriented intermediate representation, network function modal messages processed by different types of terminal equipment can be automatically divided according to the first configuration file, and flexible scheduling of modal functions can be achieved only by once P4 program coding for users, so that the friendliness of the system is greatly improved.
It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described above may include a plurality of steps or stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of execution of the steps or stages is not necessarily sequential, but may be performed in turn or alternately with at least a part of other steps or stages.
In one embodiment, as shown in FIG. 6, the present application provides a compiling system for a modal-oriented intermediate representation, the system comprising:
the obtaining module 602 is configured to obtain a first P4 program and a first configuration file thereof, which are input by a user and include a plurality of network function modal messages, and obtain login information of each terminal device;
a first compiling module 604, configured to compile the first P4 program sequentially by using a front-end compiler and a middle-end compiler, to generate a first intermediate representation file;
a copying module 606, configured to copy, according to the first configuration file, the first intermediate representation file to obtain a second intermediate representation file with a corresponding number of copies;
a splitting module 608, configured to split each of the second intermediate representation files according to the first configuration file, to obtain a third intermediate representation file that includes an independent network function modal packet;
and a second compiling module 610, configured to send each third intermediate representation file to a corresponding terminal device based on the login information of each terminal device, and compile each third intermediate representation file with each terminal device to generate a target file, where the target file is used to generate second configuration information of the corresponding terminal device.
In an embodiment, the system further includes an offline verification module, configured to reversely generate a corresponding second P4 program based on each of the third intermediate representation files; and performing offline verification on the second P4 program, and re-splitting the corresponding second intermediate representation file under the condition that the offline verification result fails.
According to the technical scheme, the network function modal messages processed by different types of terminal equipment can be automatically divided according to the first configuration file, and the user can flexibly schedule modal functions only by once P4 program coding, so that the compiling efficiency is improved, and the friendliness of the system is greatly improved.
For specific limitations of the compiling system for the modality-oriented intermediate representation, reference may be made to the above limitation of the compiling method, and no further description is given here. The modules in the compiling system facing the modal intermediate representation can be realized in whole or in part by software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, the embodiment of the present application provides a computer device, which may be a server, and an internal structure diagram thereof may be as shown in fig. 7. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing motion detection data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements the steps of any of the above-described embodiment of a compilation method for modality-oriented intermediate representation.
It will be appreciated by those skilled in the art that the structure shown in FIG. 7 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an embodiment, an embodiment of the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any of the above-described embodiment of the compiling method for a modal intermediate representation.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of a computer program, which may be stored on a non-transitory computer readable storage medium and which, when executed, may comprise the steps of the above-described embodiments of the methods. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (DynamicRandom Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (10)

1. A method of compiling a modal-oriented intermediate representation, the method comprising:
acquiring a first P4 program and a first configuration file thereof which are input by a user and comprise a plurality of network function modal messages, and acquiring login information of each terminal device;
compiling the first P4 program by using a front-end compiler and a middle-end compiler in sequence to generate a first middle representation file;
copying the first intermediate representation file according to the first configuration file to obtain a second intermediate representation file with the corresponding number of copies;
splitting each second intermediate representation file according to the first configuration file to obtain a third intermediate representation file containing an independent network function mode message;
and based on the login information of each terminal device, respectively sending each third intermediate representation file to the corresponding terminal device, and respectively compiling each third intermediate representation file by using each terminal device to generate a target file, wherein the target file is used for generating second configuration information of the corresponding terminal device.
2. The method of claim 1, wherein splitting each of the second intermediate representation files according to the first configuration file to obtain a third intermediate representation file including an independent network function modality message includes:
generating a function mode list based on the division of each network function mode message contained in the first configuration file;
traversing each node accessing the second intermediate representation file based on the functional mode list, and extracting comparison basis required by splitting from the specific type of nodes;
and splitting each unit contained in each second intermediate representation file based on the comparison basis to generate third intermediate representation files respectively containing specific functional mode messages.
3. The method according to claim 2, wherein the splitting each unit included in each second intermediate representation file according to the comparison to generate a third intermediate representation file respectively including a specific function mode message includes:
acquiring a father node of a specific type node, and searching a child node corresponding to the father node and containing a list storage unit;
creating a sub-node type empty list storage unit, traversing the list storage unit in the sub-node, extracting a functional mode identification element, comparing with the split basis, judging whether the functional mode identification element is reserved or not, and copying the functional mode identification element into the empty list storage unit under the reserved condition;
and replacing the node pointer corresponding to the empty list storage unit with the node pointer corresponding to the list storage unit to obtain a third intermediate representation file containing the specific functional mode message.
4. The method according to claim 2, further comprising, after splitting each unit included in each second intermediate representation file according to the comparison, generating third intermediate representation files each including a specific function mode message, after the step of:
and carrying out optimization processing on each third intermediate representation file.
5. The method of claim 4, wherein the third intermediate representation files include a structure unit, a parsing unit, a control unit, and an inverse parsing unit, and wherein optimizing each of the third intermediate representation files includes:
after the structural body units are split, the redundant structural body nodes are optimally deleted according to the splitting basis; after the resolution unit splits, optimizing and deleting redundant resolution state nodes; and after the control unit is split, redundant action and appearance information are optimally deleted.
6. The method of claim 4, further comprising, after said optimizing each of said third intermediate representation files:
reversely generating a corresponding second P4 program based on each third intermediate representation file;
and performing offline verification on the second P4 program, and re-splitting the corresponding second intermediate representation file under the condition that the offline verification result fails.
7. A compilation system for modality-oriented intermediate representation, the system comprising:
the acquisition module is used for acquiring a first P4 program and a first configuration file thereof which are input by a user and comprise a plurality of network function modal messages, and acquiring login information of each terminal device;
the first compiling module is used for compiling the first P4 program by utilizing a front-end compiler and a middle-end compiler in sequence to generate a first intermediate representation file;
the copying module is used for copying the first intermediate representation file according to the first configuration file to obtain a second intermediate representation file with the corresponding number of copies;
the splitting module is used for splitting each second intermediate representation file according to the first configuration file to obtain a third intermediate representation file containing an independent network function modal message;
and the second compiling module is used for respectively sending the third intermediate representation files to corresponding terminal equipment based on the login information of each terminal equipment, and respectively compiling the third intermediate representation files by utilizing the terminal equipment to generate target files, wherein the target files are used for generating second configuration information of the corresponding terminal equipment.
8. The system of claim 7, wherein the system further comprises:
the offline verification module is used for reversely generating a corresponding second P4 program based on each third intermediate representation file; and performing offline verification on the second P4 program, and re-splitting the corresponding second intermediate representation file under the condition that the offline verification result fails.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any one of claims 1 to 6.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any one of claims 1 to 6.
CN202311024639.9A 2023-08-15 2023-08-15 Method, system, equipment and storage medium for compiling modal-oriented intermediate representation Active CN116737130B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311024639.9A CN116737130B (en) 2023-08-15 2023-08-15 Method, system, equipment and storage medium for compiling modal-oriented intermediate representation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311024639.9A CN116737130B (en) 2023-08-15 2023-08-15 Method, system, equipment and storage medium for compiling modal-oriented intermediate representation

Publications (2)

Publication Number Publication Date
CN116737130A true CN116737130A (en) 2023-09-12
CN116737130B CN116737130B (en) 2023-11-28

Family

ID=87901633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311024639.9A Active CN116737130B (en) 2023-08-15 2023-08-15 Method, system, equipment and storage medium for compiling modal-oriented intermediate representation

Country Status (1)

Country Link
CN (1) CN116737130B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991428A (en) * 2023-09-28 2023-11-03 飞腾信息技术有限公司 Compiling method, compiling device, compiler, computing device and storage medium
CN117076474A (en) * 2023-10-16 2023-11-17 之江实验室 Method, device, equipment and medium for updating offline multi-mode literature data

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5187789A (en) * 1990-06-11 1993-02-16 Supercomputer Systems Limited Partnership Graphical display of compiler-generated intermediate database representation
US10419242B1 (en) * 2015-06-04 2019-09-17 Netronome Systems, Inc. Low-level programming language plugin to augment high-level programming language setup of an SDN switch
CN113568634A (en) * 2021-06-28 2021-10-29 荣耀终端有限公司 Processing method and processing device for application optimization
CN114510452A (en) * 2022-01-10 2022-05-17 杭州未名信科科技有限公司 SOC (System on chip) integration method and device and electronic equipment
CN114995878A (en) * 2022-06-06 2022-09-02 深圳市芯源网络科技有限公司 Method for automatically generating network data forwarding plane driver code
CN115469894A (en) * 2022-09-21 2022-12-13 中国建设银行股份有限公司 Application program installation control method, device, equipment and storage medium
CN115955365A (en) * 2023-03-14 2023-04-11 之江实验室 Network compiling system and method for endogenous safety
CN116074208A (en) * 2023-03-24 2023-05-05 之江实验室 Modal deployment method and modal deployment system of multi-modal network
CN116088959A (en) * 2023-01-16 2023-05-09 篆芯半导体(南京)有限公司 Hardware configuration information generation method, generation device, electronic equipment and storage medium
CN116319390A (en) * 2023-02-07 2023-06-23 之江实验室 Multi-mode network resource abstraction and arrangement method and system
CN116302971A (en) * 2023-02-07 2023-06-23 北京大学 Extensible test generation method for programmable data plane
US20230236807A1 (en) * 2022-01-25 2023-07-27 Zhejiang Lab Software and hardware collaborative compilation processing system and method

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5187789A (en) * 1990-06-11 1993-02-16 Supercomputer Systems Limited Partnership Graphical display of compiler-generated intermediate database representation
US10419242B1 (en) * 2015-06-04 2019-09-17 Netronome Systems, Inc. Low-level programming language plugin to augment high-level programming language setup of an SDN switch
CN113568634A (en) * 2021-06-28 2021-10-29 荣耀终端有限公司 Processing method and processing device for application optimization
CN114510452A (en) * 2022-01-10 2022-05-17 杭州未名信科科技有限公司 SOC (System on chip) integration method and device and electronic equipment
US20230236807A1 (en) * 2022-01-25 2023-07-27 Zhejiang Lab Software and hardware collaborative compilation processing system and method
CN114995878A (en) * 2022-06-06 2022-09-02 深圳市芯源网络科技有限公司 Method for automatically generating network data forwarding plane driver code
CN115469894A (en) * 2022-09-21 2022-12-13 中国建设银行股份有限公司 Application program installation control method, device, equipment and storage medium
CN116088959A (en) * 2023-01-16 2023-05-09 篆芯半导体(南京)有限公司 Hardware configuration information generation method, generation device, electronic equipment and storage medium
CN116319390A (en) * 2023-02-07 2023-06-23 之江实验室 Multi-mode network resource abstraction and arrangement method and system
CN116302971A (en) * 2023-02-07 2023-06-23 北京大学 Extensible test generation method for programmable data plane
CN115955365A (en) * 2023-03-14 2023-04-11 之江实验室 Network compiling system and method for endogenous safety
CN116074208A (en) * 2023-03-24 2023-05-05 之江实验室 Modal deployment method and modal deployment system of multi-modal network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
童亚拉;: "分布式编译的方法和系统研究", 计算机技术与发展, no. 05 *
袁昭旭;于开平;张忠;李海波;: "基于混合模态综合法的耦合分析软件开发", 计算机辅助工程, no. 03 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991428A (en) * 2023-09-28 2023-11-03 飞腾信息技术有限公司 Compiling method, compiling device, compiler, computing device and storage medium
CN116991428B (en) * 2023-09-28 2023-12-15 飞腾信息技术有限公司 Compiling method, compiling device, compiler, computing device and storage medium
CN117076474A (en) * 2023-10-16 2023-11-17 之江实验室 Method, device, equipment and medium for updating offline multi-mode literature data
CN117076474B (en) * 2023-10-16 2024-03-12 之江实验室 Method, device, equipment and medium for updating offline multi-mode literature data

Also Published As

Publication number Publication date
CN116737130B (en) 2023-11-28

Similar Documents

Publication Publication Date Title
CN116737130B (en) Method, system, equipment and storage medium for compiling modal-oriented intermediate representation
US9906622B2 (en) Automated service interface optimization
CN107609004B (en) Application program embedding method and device, computer equipment and storage medium
CN110673853B (en) Compiling method, device and system
CN111309335B (en) Compiling method and device of plug-in application and computer readable storage medium
CN107341054B (en) Task execution method and device and computer readable storage medium
CN112769706B (en) Componentized routing method and system
CN111309636A (en) Robot automation test system, method, construction server and storage medium
CN111158680A (en) Page construction method, device, equipment and storage medium
US10552130B1 (en) Code optimization conversations for connected managed runtime environments
JPWO2014192867A1 (en) Distributed processing system, distributed processing apparatus, distributed processing method, and distributed processing program
CN113918635A (en) Interface data format conversion method and device
CN111597058B (en) Data stream processing method and system
CN111443919B (en) Method for realizing SCA core framework on DSP multi-core processor
CN109284222B (en) Software unit, project testing method, device and equipment in data processing system
CN111694639A (en) Method and device for updating address of process container and electronic equipment
CN112256247B (en) Method, device, computer equipment and storage medium for processing dependence of module assembly
CN114020840A (en) Data processing method, device, server, storage medium and product
CN115994085A (en) Code coverage rate test processing method, device, equipment and storage medium
CN116629015A (en) Digital twin task processing method, device, equipment and storage medium
CN115755867A (en) Vehicle diagnosis method and related device
CN115729590A (en) Service deployment method, device, equipment and computer readable storage medium
CN111400243B (en) Development management system based on pipeline service and file storage method and device
CN114490440A (en) Memory object reference analysis method, device, equipment and storage medium
CN114297202A (en) Server entity information interaction method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant