Inter-process communication method and system for graphic processing system
By using a custom binary communication protocol and the NNG framework, the real-time and high-efficiency issues of data transmission between the graphics processing system and the user operating system were resolved, achieving efficient and reliable inter-process data transmission and meeting the high-performance requirements of the graphics processing system.
Patent Information
- Application Number
- CN202511070480.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-11-21
AI Technical Summary
In existing technologies, inter-process communication between graphics processing systems and user operating systems suffers from insufficient real-time data transmission efficiency, especially when transmitting large files and massive amounts of small data, where existing communication protocols cannot meet the requirements for high real-time performance and high efficiency.
It adopts a custom binary communication protocol and a request-response mode. The data frame consists of a header and a content. It is combined with the NNG framework for data transmission. The data frame header only includes the Length and Header fields, which supports efficient data transmission between the graphics processing system and the user operating system.
It significantly reduces data packet size, reduces bandwidth requirements, improves transmission efficiency, supports low-latency and high-concurrency communication needs, meets the real-time data communication scenarios between graphics processing systems and user operating systems, and improves data transmission efficiency and reliability.
Smart Images

Figure CN120994419A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of a graphics processing system, and in particular to an inter-process communication method and system for a graphics processing system. BACKGROUND
[0002] The graphics processing system is used for raw layout data management and data analysis and conversion, including raw layout file reading, splitting and data storage management, and file data analysis and graphics segmentation and compilation, wherein the commonly used data format of the layout file is GDSII, which is a binary file, and thus the storage capacity of a single GDSII layout file of an advanced process (7nm and below) is large (up to 100GB). The user operating system is operated by the user and is used to send instructions and files to the graphics processing system to realize exposure layout data processing. On the one hand, the communication between the user operating system and the graphics processing system needs to support 100GB large file transmission, and binary stream transmission is adopted to be compatible with the GDSII file format; on the other hand, the communication between the user operating system and the graphics processing system also includes connection establishment, state query, task creation, parameter setting, cache management, log alarm and a large amount of small data instruction transmission. In addition, the graphics processing system also needs to support online conversion, segmentation and compilation of layout data, and once data packet loss or error occurs, the entire data analysis will fail. Therefore, the real-time and accuracy requirements of data transmission between the graphics processing system and the user operating system are high, and the data format processing time in the communication transmission process needs to be reduced as much as possible.
[0003] In the prior art, inter-process communication is usually implemented by using a general communication encoding and decoding scheme suitable for different application programs and different language platforms, and thus the data frame often has a large amount of redundant structure design. For example, in order to realize universality, the data structure is fixed and the single frame data length is short, and cannot support 100GB and above single file streaming transmission. At the same time, for the instruction transmission of a large amount of small data, the redundant data frame structure will increase the transmission data amount by several times, increase the communication time overhead, and cannot meet the high real-time requirement of the graphics processing system. Other communication methods based on specific mode serialization and deserialization operation of the transmission object will increase the file format conversion time when transmitting 100GB and above single file, which affects the real-time of transmission. SUMMARY
[0004] The technical problem to be solved by the present application is that in view of the technical problems existing in the prior art, the present application provides an inter-process communication method and system for a graphics processing system, which has the advantages of simple implementation method, low cost, low bandwidth consumption, high transmission speed and reliability, and strong flexibility, and can realize real-time and high-frequency data exchange between the graphics processing system and the user operating system.
[0005] To solve the above technical problems, the technical scheme provided by the present application is: An inter-process communication method for a graphics processing system, comprising the steps of: Configuring a communication protocol between a user operating system and a process of a graphics processing system, wherein the communication protocol comprises a data frame format and a data instruction defined between the user operating system and the graphics processing system, and the inter-process communication is realized in a request-response mode, the data instruction and a response parameter of the graphics processing system responding to the request are encoded in binary, the data frame format comprises a header and a content, the header comprises a Header field and a Length field, the Length field is used to store the length of the entire data packet, the Header field is used to store the packet header information of the data packet, the content comprises a plurality of content segments, each content segment comprises a content length and content data, the length of the content data is configured according to the data instruction, and the communication between the ports of the user operating system and the graphics processing system adopts an NNG framework to transmit binary data frames based on the NNG framework. The graphics processing system receives a request command sent by the user operating system, and obtains state information or an execution control command from the request command. The graphics processing system performs corresponding processing according to the execution control instruction obtained from the request command, and feeds back the result to the user operating system through a response command.
[0006] Further, the Header field comprises a device identifier DeviceId, a group type Group Type, a function type Function Type, a protocol version PType, a reserved byte SType, and a system byte System Bytes, and the system byte System Bytes is used to represent a message byte serial number.
[0007] Further, the message instruction in the communication protocol uses a GxFy representation method, wherein Gx represents the serial number of Group Type as x, and Fy represents Function Type as y, when y is odd, it represents that the current message is a Primary message, otherwise, it represents that the current message is a Secondary message, wherein the Primary message represents a message actively sent, and the Secondary message represents a message replied, in the communication process between the graphics processing system and the user operating system, whenever a Primary message is sent, a corresponding Secondary message will be received.
[0008] Further, the communication protocol further comprises a supported command set, which comprises state acquisition type commands, system control and debugging type commands, alarm transmission type commands, data collection type commands, and file transmission type commands, and any one or more of the following control commands: inquiring whether the PCS is online, online data, requesting PCS state data, returning state data, requesting PCS parameter data, returning PCS parameter data, requesting modification of PCS parameter information, returning modification of PCS parameter information result, PCS returning control instruction execution result, PCS reporting alarm information to the Host, Host receiving alarm information result, PCS reporting events to the Host, Host receiving event result, requesting whether a file exists in the PCS, returning file existence result, Host sending a file to the PCS, PCS receiving file result, Host reading a file from the PCS, and reading file result, wherein the PCS represents a graphic processing system, and the Host represents a user operating system.
[0009] Further, the command set comprises a first type of control command for requesting PCS operation, and a second type of control command for returning control instruction execution result, wherein the first type of control command comprises an instruction name, a first communication direction, a control operation requested to be executed by the PCS, a detailed description of the instruction, and a first Data structure, the first communication direction is data transmission from the Host to the PCS, and the first Data structure comprises the instruction name and parameter information, and the second type of control command comprises an instruction name, a second communication direction, a PCS returning execution result of a specified control instruction, a detailed description of the instruction, and a second Data structure, the second communication direction is data transmission from the PCS to the Host, and the second Data structure comprises returned result, whether the return is successful, an error code, and error information text.
[0010] Further, the communication protocol comprises different binary coding rules for state parameters according to data types, which comprises a first coding rule of converting parameter content into binary by querying a binary coding table, a second coding rule of converting ASCII codes of each symbol in the state parameter into binary respectively, and a third coding rule of using network bytes for data coding.
[0011] Further, the communication protocol comprises a command code and content byte number of a control command in a header of a data frame of the control command, and a command code and content byte number of a returned command in a header of a data frame of a response message.
[0012] Further, the data transmission between the user operating system and the graphic data processing system using the NNG framework comprises the following steps: Initializing the NNG: creating an NNG context and a socket, and selecting a protocol type; Set address: bind or connect to a specified address; Construct binary data frame: encapsulate the data frame into binary format, and construct a binary data frame; Send data: use the nng_send() function to send the binary data frame to the target socket; Receive data: on the receiving end, use the nng_recv() function to read the incoming data frame and parse it into the corresponding format.
[0013] A communication system comprising a graphics processing system and a user operating system, the graphics processing system comprising a processor and a memory, the memory being configured to store a computer program, the processor being configured to execute the computer program to perform the method as described above.
[0014] A computer-readable storage medium storing a computer program, the computer program being configured to perform the method as described above when executed.
[0015] Compared with the prior art, the present application has the following advantages: 1、The application uses a self-defined binary communication protocol, which adopts a request-response mode, and data commands and response parameters are encoded in binary, and a data frame is composed of only a header and content, and the header is composed of only a header field and a length field, forming a compact binary representation method, significantly reducing the size of the data packet, reducing the bandwidth requirement, and enabling efficient data transmission between the user operating system and the graphics data processing system, improving transmission efficiency, and ensuring reliable message passing mechanism when data transmission is combined with the NNG framework, supporting low-latency and high-concurrency communication requirements, and being able to match the real-time data communication scenario between the user operating system and the graphics processing system, effectively improving the data transmission efficiency and reliability between the user operating system and the graphics data processing system.
[0016] 2、The header structure of the data frame only includes Length and Header fields, which greatly reduces the waste of transmission bandwidth compared with the TCP / IP protocol, and the data length of the Data field of the data frame is specified by the instruction, which has high flexibility, can support long data transmission of large file transmission of the graphics processing system, and can also realize efficient transmission of small data of massive instructions, can effectively improve the data amount of single frame transmission, reduce the number of file block, thereby reducing the addressing delay caused by cross-block read and write, improving the speed of single file transmission of hundreds of GB, and meeting the high performance requirements of the graphics data processing system. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 is a schematic diagram of the communication principle of the graphics processing system and the user operating system applicable to the present embodiment.
[0018] Figure 2 is the implementation flow diagram of the inter-process communication method of the graphic processing system of the embodiment.
[0019] Figure 3 is the principle diagram of the data frame structure of the embodiment.
[0020] Figure 4 is the principle diagram of a Transaction process between the user operating system and the graphic processing system in the embodiment.
[0021] Figure 5 is the principle diagram of the inter-process communication between the user operating system and the graphic processing system in the embodiment. DETAILED DESCRIPTION
[0022] The application is further described below in combination with the accompanying drawings and specific preferred embodiments, but the protection scope of the application is not limited thereby.
[0023] The inter-process communication in the prior art usually adopts a general communication coding and decoding scheme adapted to different application programs and different language platforms, the data structure is fixed and the single frame data length is short, the single file stream transmission of more than 100 GB cannot be supported, and the data frame has a large amount of redundant structure design. For the instruction transmission of a large amount of small data, the redundant data frame structure will multiply the transmission data amount and increase the communication time cost, thus the high real-time requirement of the graphic processing system cannot be met. The existing communication protocol is also difficult to meet the real-time requirement of the inter-process data transmission between the user operating system and the graphic processing system and the requirement of large file transmission.
[0024] For example, although the standard TCP / IP protocol is widely used, it leads to waste of bandwidth due to large packet header overhead, especially when a large amount of small data needs to be transmitted. In addition, although the communication mode based on the HTTP protocol is simple and easy to use, the client needs to actively initiate a request, the server cannot actively push data, and bidirectional real-time communication cannot be achieved. Using JSON or XML format for data exchange, although such formats have strong readability, their structure is relatively long, and binary data (GDSII file) needs to be Base64 encoded, which will increase the data volume by about one third, thus the transmission efficiency is low, and it is not suitable for the data exchange scenario of binary format large files of a graphics processing system. Similarly, gRPC (gRPC Remote Procedure Call) uses Protocol Buffers as an interface definition language (IDL) and supports defining binary data types, but serializing a file data of up to 100 GB requires additional CPU cycles, which will increase a large amount of delay compared to directly transmitting raw binary data, and thus cannot meet the real-time data transmission requirement between a user operating system and a graphics processing system.
[0025] In addition, existing frameworks generally cannot provide support for compact data representation of specific applications, which limits the design of efficient communication protocols, and thus the existing technical frameworks cannot meet the high performance and low delay requirement of inter-process communication between a user operating system and a graphics processing system.
[0026] The application provides a self-defined binary communication protocol, which adopts a request and response mode, uses binary encoding for data commands and response parameters, and forms a compact binary representation method by composing a data frame from a header Header and content Content, and composing the header Header from only a Header field and a Length field, thereby significantly reducing the size of a data packet, reducing the bandwidth requirement, realizing efficient data transmission between a user operating system and a graphics data processing system, improving transmission efficiency, ensuring a reliable message passing mechanism by combining the NNG framework for data transmission, supporting low delay and high concurrency communication requirement, matching the real-time data communication scenario between a user operating system and a graphics processing system, and effectively improving the data transmission efficiency and reliability between a user operating system and a graphics data processing system.
[0027] The system architecture to which the application is applied is shown in Figure 1 The graphics data processing system acts as a slave station and actively starts a TCP Server service to wait for a master station to connect. The user operating system newly creates a TCP Client to actively connect to the slave station. After the connection is completed, the user operating system actively sends an instruction to inquire about the information of the slave station. After the information is confirmed, the user operating system sends a further instruction to control the communication between the user operating system and the graphics processing system.
[0028] AsFigure 2 As shown, the steps of the process intercommunication method for the graphic processing system in the embodiment include: Step S01. Configure the communication protocol between the user operating system and the graphic processing system process, which includes the definition of the data frame format and data instruction between the user operating system and the graphic data processing system, and the inter-process communication is realized by using the request and response mode, the data instruction and the response parameter of the graphic data processing system responding to the request are encoded by using binary, the data frame format is composed of a header and a content, the header is composed of a header field and a length field, the length field is used to store the length of the entire data packet, the header field is used to store the packet header information of the data packet, the content includes multiple content segments, each content segment includes content length and content data, and the length of the content data is configured according to the data instruction; the communication between the ports of the user operating system and the graphic data processing system adopts the NNG framework, and the binary data frame is transmitted based on the NNG framework; Step S02. The graphic data processing system receives the request command sent by the user operating system, and obtains the state information or the execution control command from the request command; Step S03. The graphic data processing system performs corresponding processing according to the execution control instruction obtained from the request command, and feeds back the result to the user operating system through the response command.
[0029] In the embodiment, the inter-process communication protocol of the user operating system and the graphic processing system is defined, which defines the communication format and data instruction between the user operating system and the graphic data processing system, is mainly realized through inter-process communication (IPC), and uses the communication library NNG (Nanomsg Next Gen) and the request and response mode (REQ / REP). Through the above-defined communication protocol, the user operating system can send a request command to the graphic data processing system to obtain state information or an execution control command, the graphic data processing system performs corresponding processing according to the request, and feeds back the result to the user operating system through the response command. These commands and response parameters are encoded by using binary, including the binary representation method definition of the basic data type and the structured data type, which guarantees the compactness of the data structure, ensures the efficient cooperation and data consistency between the systems, can effectively meet the real-time requirement of the inter-process data transmission between the user operating system and the graphic processing system and the large file transmission requirement, and can realize efficient cross-system process graphic processing and control function.
[0030] As Figure 3As shown, the structure of the data frame in the embodiment is composed of a header and content, wherein the header is composed of a Header field and a Length field, forming a compact data frame structure, significantly reducing the size of the data packet, and the content includes a plurality of content segments, each of which contains a length-content pair (content length k, content k) for transmission through a plurality of length-content pairs. Specifically, the command code is specifically defined as 2 bytes, the data frame content byte number is specifically positioned as 4 bytes, each content length is defined as 4 bytes, the length of each content data is indefinite, is configured according to the data instruction, and can support a plurality of basic data types (such as Boolean type, integer type, floating point type, etc.), thereby meeting the needs of different applications.
[0031] In a specific application embodiment, the data structure of the entire message can be defined as: Message = Length + Content. <header> + <data>, Length field is configured as 4 bytes, Header field is configured as 10 bytes, the length N of Data field is indefinite and is configured according to data instructions. The message structure is configured as shown in Table 1.
[0032] Table 1: Message structure
[0033] As shown in Table 1, the fields in the message structure are configured as follows: Length: 4 bytes long, 32-bit unsigned number, high bits first during transmission, indicating the length of the entire data packet.
[0034] Header: 10 bytes long, the header information contains relevant information of the data packet, including instruction number, protocol version, message sequence number, etc. For example, it can be composed of the following fields: <header> = <deviceid>+Group Type+Function Type+ <ptype> + <stype>+<System Bytes> The packet header information includes DeviceId, Group Type, Function Type, Protocol Version (PType), Reserved Bytes (SType), and System Bytes, which specifically represent the message byte sequence number.
[0035] Content: The data field contains the data for this message. The length of the byte data can be 0 or the length can be specified by the instruction.
[0036] This embodiment, by employing the aforementioned data structure, occupies only 12 bytes (Length and Header fields) in the data frame header. In contrast, a complete TCP / IP data frame header, including the network layer, transport layer, and data link layer, requires 54 bytes. Therefore, compared to TCP / IP, the data frame header structure in this embodiment significantly reduces bandwidth waste. Furthermore, the data length of the Data field in this embodiment is specified by the instruction, offering high flexibility. It supports both long data transmission for large files in graphics processing systems and efficient transmission of small data from massive instructions. Traditional TCP / IP's giant frames (MTU=9000) can only support 8KB of data transmission per frame. This embodiment, through the aforementioned data frame format, can support up to 4GB of data transmission per frame, effectively increasing the amount of data transmitted per frame, reducing the number of file blocks, and thus reducing addressing latency caused by cross-block read / write. This improves the speed of transmitting hundreds of gigabyte-level single files, meeting the high-performance requirements of graphics data processing systems.
[0037] This embodiment also includes a data frame defining a control command. The header of the data frame includes the command code and the number of bytes of the control command, while the Content field is empty. For example, let's define the command code for a command to inquire whether the system is online as G1F1. Figure 1 As shown, by sending the G1F1 command to inquire whether the graphics data processing system is online, the G1F1 data frame can be defined as follows: Length: 00 00 00 0E indicates that the total length of this message is 14 bytes; Header: Includes DeviceId, Command Number GF, Protocol Number Prot, reserved words, and SystemBytes. For example, if the DeviceId field is 0001, it means device number 1. If the Command Number GF field is 0101, it means command number G1F1. SystemBytes is used to represent message sequence number. This field is incremented by 1 when a Transaction is completed during communication. Content: This field has no content, and the number of occupied bytes is 0, N=0.
[0038] In this embodiment, the data frame defining the response message is also included, wherein the header of the data frame includes the command code of the response command and the number of content bytes, and the content Content of the data frame includes the information of the response. Taking the command code G1F2 defining the echo online state command as an example, as shown in the table, the content Content of the G1F2 command can be configured as Figure 1 <mdln> + <softrev>The content structure of the reply online status command includes MDLNPG and SOFTREV. MDLN represents the manufacturer information of the graphics processing system, and SOFTREV represents the version information of the graphics processing system. For example, the G1F2 command can be defined as follows: Length: 00 00 00 19, indicating that the total length of the message is 25 bytes; Header: including DeviceId, instruction number GF, protocol number Prot, reserved word, and system byte SystemBytes, wherein the instruction number GF segment uses 0102 to represent the instruction number G1F2; Content: including MDLN, SOFTREV, and the characters in the MDLN and SOFTREV fields are first split into single characters and then respectively converted into hexadecimal data.
[0039] In the embodiment, the message instruction in the communication protocol uses the GxFy representation method, wherein Gx represents the serial number of Group Type x, and Fy represents Function Type y. When y is odd, it indicates that the current message is a Primary message, otherwise it indicates that the current message is a Secondary message. The Primary message represents a message actively sent, and the Secondary message represents a reply message. In the communication process between the graphics processing system and the user operating system, after each Primary message is sent, a corresponding Secondary message is received, and the process is a Transaction. As shown in the following table, in the Transaction process between the user operating system and the graphics processing system, the GxFy message instruction is sent by the message sender (Sender) to the message receiver (Receiver). The message is a Primary message. After the message receiver (Receiver) receives the message instruction, a reply message of GxFy+1 is returned. The message is a Secondary message. Figure 4
[0040] In this embodiment, the communication protocol further includes a supported command set, which includes state acquisition type commands, system control and debugging type commands, alarm transmission type commands, data collection type commands, and file transmission type commands, etc. The command set includes commands such as inquiring whether the PCS is online, online data, requesting PCS status data, returning status data, requesting PCS parameter data, returning PCS parameter data, requesting modification of PCS parameter information, returning the result of modifying PCS parameter information, PCS returning control instruction execution results, PCS reporting alarm information to the Host, Host receiving alarm information results, PCS reporting events to the Host, Host receiving event results, requesting whether a file exists in the PCS, returning file existence results, Host sending a file to the PCS, PCS receiving file results, Host reading a file from the PCS, and reading file results, etc. In the commands, PCS represents a graphics processing system, and Host represents a user operating system.
[0041] In a specific application embodiment, the group sequence number is defined to be in the range of 1-255, and the specific group function allocation is shown in Table 2.
[0042] Table 2: Group sequence number definition
[0043] In a specific application embodiment, the supported command set is defined as shown in Table 3.
[0044] Table 3: Supported command table
[0045] In this embodiment, the command set includes a first type of control instruction for requesting PCS operation, and the instruction format of the first type of control instruction includes an instruction name, a first communication direction, a control operation requested to be executed by the PCS, a detailed description of the instruction, and a first Data structure. The first communication direction is data transmission from the Host to the PCS, and the first Data structure includes the instruction name and parameter information. The command set also includes a second type of instruction for returning control instruction execution results by the PCS, and the instruction format of the second type of instruction includes an instruction name, a second communication direction, a return of execution results of a specified control instruction by the PCS, a detailed description of the instruction, and a second Data structure. The second communication direction is data transmission from the PCS to the Host, and the second Data structure includes a returned result, a return success or failure, an error code, and error information text.
[0046] In a specific application example, when defining the G2F41 instruction format, the instruction belongs to the first type of control instruction for requesting the PCS operation, is used for requesting the PCS to perform a corresponding control operation, the direction is the first communication direction of transmitting data from the Host to the PCS, and the Data structure includes the instruction name and parameters; when defining the G2F42 instruction format, the instruction belongs to the second type of instruction for returning the control instruction execution result, is used for the PCS to return the control instruction execution result, the direction is the second communication direction of transmitting data from the PCS to the Host, and the Data structure includes the returned result, whether the return is successful (True: indicates success, and False: indicates failure), an error code, and error information text, and the specific example is shown in Table 4.
[0047] Table 4: Instruction G2F41 format example
[0048] Table 5: Instruction G2F42 format example
[0049] In the embodiment, a complete command set is defined in the communication protocol, the command set includes five parts of state acquisition, system control and debugging, alarm transmission, data collection, and file transmission, and covers system management, file transmission, and function control. Detailed descriptions are defined for specific commands and parameters, and each command has a unique command code, so as to facilitate efficient identification and processing between systems.
[0050] In the embodiment, different binary coding rules are adopted for the state parameters in the communication protocol according to data types, and the binary coding rules include a first coding rule of converting parameter contents into binary by querying a binary coding table, a second coding rule of respectively converting ASCII codes of various symbols in the state parameters into binary, and a third coding rule of adopting network bytes for data coding, etc. For example, when the first coding rule is adopted for the echo online state command parameter, the parameter of the echo online state command parameter is <mdln>represents the manufacturer name, the data type is ASCII, the parameter content is converted into binary by querying the binary encoding table of ASCII code; for example, for the manufacturer name CETC, the second encoding rule can be used to split "CETC" into the ASCII codes of four symbols "C", "E", "T", and "C", which are 67, 69, 84, and 67 respectively, and then the four numbers are converted into binary as "01000011", "01000101", "0101000", and "01000011" respectively. In the third encoding rule of network byte order, the network byte order can be directly converted into binary.
[0051] The embodiment can meet the demand of the graphics processing system for high-speed and reliable transmission of the layout file by defining the instruction set based on the simplified instruction, support various operations such as connection establishment, task creation, state query, and parameter setting, and can be flexibly applied in different environments and scenarios, has good expansibility, and can adapt to a wide range of application requirements by considering various data types.
[0052] In the embodiment, the communication between the user operating system and the port of the graphics data processing system in the communication protocol adopts the NNG open source framework, and the binary data frame is transmitted by using the NNG framework. As shown in Figure 5 When the user operating system process sends data, the data is sent to the sending buffer area, transmitted to the receiving buffer area of the graphics processing system process based on the NNG framework, and the graphics processing system process reads data from the receiving buffer area; correspondingly, when the graphics processing system process sends data, the data is sent to the sending buffer area, and transmitted to the receiving buffer area of the user operating system process based on the NNG framework. The NNG framework has a built-in CRC32 checksum and supports custom checksum algorithms (such as xxHash64), and the embodiment uses the feature of the NNG framework for binary data frame transmission, which can ensure the accuracy of the transmission of large amounts of layout files between the user operating system and the graphics processing system process, and at the same time, the NNG framework can support streaming transmission of binary data, thereby improving the data transmission efficiency of the layout file.
[0053] In the embodiment, the steps of data transmission between the user operating system and the graphics data processing system by using the NNG framework include: Initialize NNG: create NNG context and socket, and select protocol type (such as PUB / SUB, REQ / REP, etc.); Set address: bind or connect to a specified address, such as tcp: / / localhost:PORT; Constructing binary data frame: encapsulate the data frame into binary format, which can use byte array or buffer to construct binary data frame; Sending data: use the nng_send() function to send the binary data frame to the target socket; Receiving data: on the receiving end, use the nng_recv() function to read the incoming data frame and parse it into the corresponding format.
[0054] The embodiment utilizes the NNG framework to perform data transmission in the above manner, which can ensure the reliability and low delay of data transmission, support high-concurrency communication, and meet the needs of various device control and system monitoring applications.
[0055] The application realizes compact binary representation by customizing device data, control commands and setting parameters, realizes efficient and reliable inter-process communication by combining the NNG framework, significantly reduces the data packet size and bandwidth demand of data transmission, reduces bandwidth consumption, improves transmission efficiency, realizes real-time and high-frequency data exchange, ensures data integrity and real-time performance through a reliable message passing mechanism, realizes efficient data transmission, low delay and reliable data transmission, and can effectively meet the high real-time transmission needs between the graphics processing system and the user operating system.
[0056] The embodiment also provides a communication system including a graphics processing system and a user operating system, the graphics processing system including a processor and a memory, the memory being configured to store a computer program, and the processor being configured to execute the computer program to perform the above method.
[0057] It can be understood that the above method of the embodiment can be executed by a single device, such as a computer or a server, and can also be applied to a distributed scenario in which multiple devices cooperate to complete the method. In the distributed scenario, one of the multiple devices can only execute one or more steps of the above method, and the multiple devices interact to complete the above method. The processor can be implemented by a general-purpose CPU, a microprocessor, an application-specific integrated circuit, or one or more integrated circuits, and is configured to execute related programs to implement the above method of the embodiment. The memory can be implemented by a read-only memory (ROM), a random access memory (RAM), a static storage device, and a dynamic storage device. The memory can store an operating system and other application programs, and when the above method of the embodiment is implemented by software or firmware, the related program codes are stored in the memory and executed by the processor.
[0058] The embodiment further provides a computer-readable storage medium storing a computer program, which is executed by a processor to implement the above method.
[0059] Those skilled in the art will appreciate that the embodiments of the present application described above can be provided as methods, systems, or computer program products. Accordingly, the present application can be embodied in the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application can be embodied in the form of a computer program product on one or more computer readable storage media (including, but not limited to, disk memory, CD-ROMs, optical storage media, etc.) having computer usable program code embodied thereon. The present application is described in reference to flow diagrams and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and / or block in the flow diagrams and / or block diagrams, and combinations of flows and / or blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flow diagrams and / or block diagrams flow or flows and / or block or blocks. Figure 1 one or more flows and / or blocks Figure 1 one or more blocks or a combination of flows and / or blocks Figure 1 one or more flows and / or blocks Figure 1 one or more blocks or a combination of flows and / or blocks Figure 1 one or more flows and / or blocks Figure 1 one or more blocks or a combination of flows and / or blocks
[0060] The foregoing is merely illustrative of the principles of the application, and various modifications can be made by those skilled in the art without departing from the scope of the application. The above description is embodied in the form of a preferred embodiment, but is not intended to be limiting. Thus, the present application is not limited to the embodiments described above, but rather only by the claims below.< / mdln> < / softrev> < / mdln> < / stype> < / ptype> < / deviceid> < / header> < / data> < / header>
Claims
1. A method for inter-process communication in a graphics processing system, characterized in that the steps include... include: Configure a communication protocol between the user operating system and the graphics processing system processes. The communication protocol includes defining the data frame format and data commands between the user operating system and the graphics data processing system. Inter-process communication is implemented using a request-response mode. Data commands and response parameters of the graphics data processing system in response to requests are encoded in binary. In the data frame format, the data frame consists of a header and a content. The header consists of a header field and a length field. The length field is used to store the length of the entire data packet. The header field is used to store the packet header information. The content includes multiple content segments. Each content segment includes a content length and content data. The length of the content data is configured according to the data commands. The communication between the ports of the user operating system and the graphics data processing system adopts the NNG framework to transmit binary data frames based on the NNG framework. The graphics data processing system receives request commands sent by the user's operating system, and obtains status information or executes control commands from the request commands; The graphics data processing system processes the execution control instructions obtained from the request command and feeds back the results to the user's operating system through the response command.
2. The inter-process communication method for a graphics processing system according to claim 1, characterized in that, The Header field includes DeviceId, Group Type, Function Type, Protocol Version PType, Reserved Bytes SType, and System Bytes, whereby the System Bytes are used to represent the message byte sequence number.
3. The inter-process communication method for a graphics processing system according to claim 1, characterized in that, In the communication protocol, message commands use the GxFy notation, where Gx represents the group type number x and Fy represents the function type y. When y is odd, it indicates that the current message is a primary message; otherwise, it indicates that the current message is a secondary message. A primary message represents a message sent proactively, and a secondary message represents a reply message. During the communication between the graphics processing system and the user operating system, a secondary message is received after each primary message is sent.
4. The inter-process communication method for a graphics processing system according to claim 1, characterized in that, The communication protocol also includes a defined set of supported commands, which includes status acquisition commands, system control and debugging commands, alarm transmission commands, data collection commands, and file transfer commands. The command set also includes any one or more of the following control commands: querying whether the PCS is online, online data, requesting PCS status data, sending back status data, requesting PCS parameter data, sending back PCS parameter data, requesting modification of PCS parameter information, sending back the result of modifying PCS parameter information, PCS sending back control command execution result, PCS reporting alarm information to the Host, the Host receiving alarm information result, PCS reporting events to the Host, the Host receiving event result, requesting whether a file exists on the PCS, sending back the result of file existence, the Host sending a file to the PCS, the PCS receiving the file result, the Host reading a file from the PCS, and the result of reading a file. Here, PCS represents the graphics processing system, and Host represents the user operating system.
5. The inter-process communication method for a graphics processing system according to claim 4, characterized in that, The instruction format of the first type of control instruction in the command set used to request PCS operation includes an instruction name, a first communication direction, a control operation requested from the PCS, a detailed description of the instruction, and a first Data structure. The first communication direction is data transmission from the Host to the PCS. The first Data structure includes the instruction name and parameter information. The instruction format of the second type of instruction in the command set used to return the execution result of the control instruction by the PCS includes an instruction name, a second communication direction, the PCS returning the execution result of the specified control instruction, a detailed description of the instruction, and a second Data structure. The second communication direction is data transmission from the PCS to the Host. The second Data structure includes the returned result, whether the return was successful, an error code, and an error message text.
6. The inter-process communication method for a graphics processing system according to claim 1, characterized in that, In the communication protocol, the status parameters adopt different binary encoding rules according to the data type. The binary encoding rules include a first encoding rule that queries a binary encoding table to convert the parameter content into binary, a second encoding rule that converts the ASCII codes of each symbol in the status parameters into binary, and a third encoding rule that uses network bytes for data encoding.
7. The inter-process communication method for a graphics processing system according to any one of claims 1 to 6, characterized in that, In the communication protocol, the header of the control command data frame includes the command code and the number of bytes of the control command, and the header of the response message data frame includes the command code and the number of bytes of the echo command.
8. The inter-process communication method for a graphics processing system according to any one of claims 1 to 6, characterized in that, The steps for data transfer between the user operating system and the graphics data processing system using the NNG framework include: Initialize NNG: Create NNG context and socket, and select protocol type; Set Address: Binds or connects to the specified address; Constructing a binary data frame: Encapsulate the data frame into a binary format to construct a binary data frame; Sending data: Use the nng_send() function to send binary data frames to the target socket; Receiving data: At the receiving end, the nng_recv() function is used to read the incoming data frame and parse it into the corresponding format.
9. A communication system comprising a graphics processing system and a user operating system, the graphics processing system comprising a processor and a memory, the memory being used to store computer programs, characterized in that, The processor is used to execute the computer program to perform the method as described in any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed, it implements the method as described in any one of claims 1 to 8.