CFD software processing method, device, equipment and medium based on Netty

Through the Netty-based CFD software processing method, the portability and execution efficiency of existing CFD software when deploying on supercomputers is solved, efficient execution of simulation jobs and real-time result acquisition is achieved, and the compatibility and integrated deployment convenience of software are improved.

CN119248290BActive Publication Date: 2025-02-28CALCULATION AERODYNAMICS INST CHINA AERODYNAMICS RES & DEV CENT
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411731841.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-02-28
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

The existing CFD software lacks portability and efficient execution efficiency when deploying on supercomputers, and the interactive interface cannot obtain simulation result data in real time, making the user experience poor.

Method used

Using Netty-based CFD software processing method, various types of processors are built by establishing a connection relationship between the local and the client, and building various types of processors based on the Netty framework, obtaining simulation processing instructions sent by the client, performing decoding or encoding processing, to achieve efficient execution of simulation jobs and real-time result acquisition.

Benefits of technology

It improves the compatibility and portability of CFD software, improves the execution efficiency of simulation jobs, solves the problem that the solver's isolated jobs and interactive interface cannot obtain simulation results in real time, and lowers the threshold for the integrated deployment of the software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present application discloses a CFD software processing method, device, equipment and medium based on Netty, which relates to the field of computer technology, including building various types of processors based on the Netty framework, obtaining simulation processing instructions sent by the client, and determining the instruction type; if the instruction type is decoding, obtaining information to be processed, decoding and deserializing the information to be processed to obtain a string, parsing the string to obtain an attribute value, screening a target processor according to the attribute value, and processing the string using the target processor; if the instruction type is encoding, performing string conversion and serialization on the object to be encoded to obtain a byte stream, calculating the length of the byte stream, generating information to be sent according to the length and the byte stream, and sending the information to be sent to the client. The present application can improve the compatibility and portability of CFD software, solve the problem that the solver operates in isolation on a supercomputer, and the interactive interface cannot obtain the simulation result data on the supercomputer in real time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a Netty-based CFD software processing method, device, equipment, and medium. Background Art

[0002] CFD (Computational Fluid Dynamics) software is mostly deployed on industrial supercomputers as a standalone solver. Users must locally generate the required simulation parameter files and then manually submit simulation jobs. This approach not only increases simulation execution time but also prevents real-time access to simulation results. For engineering projects requiring batch simulations, executing and viewing simulation jobs is time-consuming. Existing solutions for supercomputer applications offer two deployment and operation methods: 1. When the supercomputer has visualization hardware support, the CFD software interface and solver are coupled and deployed on a visualization node. Users log in to the visualization node, launch the software, and perform simulations using the interface. 2. When the supercomputer does not have visualization hardware support, the solver is deployed separately on the supercomputer. Users use the Windows version of CFD software on a local PC (Personal Computer), manually generate input parameter files, upload them to the supercomputer, and then submit the job for simulation through the supercomputer scheduling system. The disadvantages are as follows: 1. Lack of portability. The supercomputer cannot be deployed as a whole when it lacks visualization hardware support. 2. When deploying the solver on the supercomputer, the user manually uploads the project files and executes the simulation job, which is inefficient. When facing batch simulation needs in the project, there are a lot of repetitive manual operations. 3. When deploying the solver on the supercomputer, the simulation job runs in isolation on the supercomputer. The interface and the solver cannot communicate data. Users cannot view the simulation results such as aerodynamic curves and cloud maps in real time through the interactive interface, resulting in a poor user experience.

[0003] As can be seen from the above, how to improve the compatibility and portability of CFD software, improve the execution efficiency of simulation jobs, solve the problem of solvers operating in isolation on supercomputers and the inability of interactive interfaces to obtain simulation result data on supercomputers in real time, and lower the threshold for software integration and deployment are issues that need to be addressed in this field. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a Netty-based CFD software processing method, apparatus, device, and medium, which can improve the compatibility and portability of CFD software, increase the execution efficiency of simulation operations, solve the problem of the solver operating in isolation on the supercomputer and the interactive interface being unable to obtain the simulation result data on the supercomputer in real time, and lower the threshold for software integration and deployment. The specific solution is as follows:

[0005] In a first aspect, the present application discloses a CFD software processing method based on Netty, comprising:

[0006] Establishing a connection relationship between the local and the client, and building various types of processors based on the Netty framework, using the connection relationship to obtain the simulation processing instructions sent by the client, and determining the instruction type of the simulation processing instructions;

[0007] If the instruction type is decoding, obtaining information to be processed from the client corresponding to the simulation processing instruction, decoding and deserializing the information to be processed to obtain a character string, parsing the character string to obtain an attribute value, screening a target processor from the processors of each type according to the attribute value, and processing the character string using the target processor;

[0008] If the instruction type is encoding, the object to be encoded is converted into a string and serialized to obtain a byte stream, the length of the byte stream is calculated, and the information to be sent is generated according to the length and the byte stream, and the information to be sent is sent to the client corresponding to the simulation processing instruction.

[0009] Optionally, the connection relationship between the local and client is established, and various types of processors are built based on the Netty framework, including:

[0010] Define a BossGroup thread group, and use the BossGroup thread group to establish a connection relationship between the local and client;

[0011] Initialize the data channel between the local and the client, and build various types of processors based on the Netty framework; the processors include processors that support Hypertext Transfer Protocol and Transmission Control Protocol.

[0012] Optionally, the acquiring the simulation processing instruction sent by the client by utilizing the connection relationship and determining the instruction type of the simulation processing instruction includes:

[0013] Based on the NioEventLoop in WorkerGroupp and utilizing the connection relationship between the local and the client, the simulation processing instruction sent by the client is obtained, and the instruction type of the simulation processing instruction is determined.

[0014] Optionally, decoding and deserializing the information to be processed to obtain a character string includes:

[0015] Determine the length of the information to be processed, and read the byte stream of the information to be processed;

[0016] The byte stream to be decoded is filtered from the byte stream according to the length, and the byte stream to be decoded is decoded and deserialized to obtain a character string in JSON format.

[0017] Optionally, parsing the character string to obtain an attribute value, and filtering a target processor from the processors of various types according to the attribute value, includes:

[0018] Parsing the string in JSON format to obtain attribute values;

[0019] A class object associated with the attribute value is obtained, and the string in JSON format is instantiated into a JavaBean object. A target processor is filtered from the processors of various types according to the class object and the JavaBean object.

[0020] Optionally, the processing the character string by using the target processor includes:

[0021] If the type of the target processor is a processor for performing numerical calculations, then using the target processor to perform numerical calculations on the character string;

[0022] If the type of the target processor is a processor for performing job status monitoring, performing job status monitoring processing on the character string using the target processor;

[0023] If the type of the target processor is a processor for performing curve monitoring, then using the target processor to perform curve monitoring processing on the character string;

[0024] If the type of the target processor is a processor for performing file management, performing file management processing on the character string using the target processor;

[0025] If the type of the target processor is a processor for performing job management, performing job management processing on the character string using the target processor;

[0026] If the type of the target processor is a processor for configuration, the target processor is used to perform configuration processing on the character string.

[0027] Optionally, performing string conversion and serialization on the object to be encoded to obtain a byte stream, calculating the length of the byte stream, and generating information to be sent according to the length and the byte stream includes:

[0028] Convert the object to be encoded into a string to obtain a string in JSON format; the object to be encoded is a JavaBean object;

[0029] Serialize the string in JSON format into a byte stream, and calculate the length of the byte stream;

[0030] The length is stored in the message header, and the byte stream is used as the message body to generate information to be sent.

[0031] In a second aspect, the present application discloses a CFD software processing device based on Netty, comprising:

[0032] A processor construction module is used to establish a connection relationship between the local and the client, and to build various types of processors based on the Netty framework, to obtain the simulation processing instructions sent by the client using the connection relationship, and to determine the instruction type of the simulation processing instructions;

[0033] a decoding module configured to, if the instruction type is decoding, obtain information to be processed from the client corresponding to the simulation processing instruction, decode and deserialize the information to be processed to obtain a character string, parse the character string to obtain an attribute value, filter a target processor from the processors of each type according to the attribute value, and process the character string using the target processor;

[0034] The encoding module is used to convert and serialize the object to be encoded to obtain a byte stream if the instruction type is encoding, calculate the length of the byte stream, generate information to be sent based on the length and the byte stream, and send the information to be sent to the client corresponding to the simulation processing instruction.

[0035] In a third aspect, the present application discloses an electronic device, comprising:

[0036] Memory, used to store computer programs;

[0037] A processor is used to execute the computer program to implement the aforementioned Netty-based CFD software processing method.

[0038] In a fourth aspect, the present application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned Netty-based CFD software processing method are implemented.

[0039] It can be seen that the present application provides a CFD software processing method based on Netty, including establishing a connection relationship between the local and the client, and building various types of processors based on the Netty framework, using the connection relationship to obtain the simulation processing instructions sent by the client, and determining the instruction type of the simulation processing instructions; if the instruction type is decoding, then obtaining the information to be processed from the client corresponding to the simulation processing instruction, and decoding and deserializing the information to be processed to obtain a string, parsing the string to obtain an attribute value, filtering the target processor from the various types of processors according to the attribute value, and using the target processor to process the string; if the instruction type is encoding, then performing string conversion and serialization on the object to be encoded to obtain a byte stream, calculating the length of the byte stream, generating information to be sent according to the length and the byte stream, and sending the information to be sent to the client corresponding to the simulation processing instruction. This application establishes a connection relationship between the local and the client, and builds various types of processors based on the Netty framework, which is compatible with both Windows and Linux operating systems, improving the compatibility and portability of the software. When the simulation processing instruction sent by the client is decoding, the information to be processed is decoded and deserialized to obtain a string, the string is parsed, and the attribute value obtained after parsing is used to filter the target processor, so that the target processor is used to process the string, solving the problem that the solver operates in isolation on the supercomputer and the interactive interface cannot obtain the simulation result data on the supercomputer in real time, improving the software's integrated simulation service capabilities, and eliminating the need for users to manually submit simulation jobs on the supercomputer, thereby improving the execution efficiency of the simulation job. When the simulation processing instruction sent by the client is encoding, the encoded object is converted and serialized to a string to obtain a byte stream, and the information to be sent is generated according to the length and byte stream of the byte stream, and the information to be sent is sent to the corresponding client, solving the problem that the supercomputer lacks a visual node and cannot be deployed as a whole. In addition, this application can support multiple supercomputers and one client for simulation operations, so when the client exits, the simulation job can still run in the background, effectively integrating computing resources and lowering the threshold for software integration and deployment. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0041] Figure 1 This is a flow chart of a Netty-based CFD software processing method disclosed in this application;

[0042] Figure 2 This is a partial code diagram of a server built based on the Netty framework disclosed in this application;

[0043] Figure 3 This is an example diagram of encoding and decoding disclosed in this application;

[0044] Figure 4 This is a specific flow chart of the Netty-based CFD software processing disclosed in this application;

[0045] Figure 5 This is a schematic diagram of a Netty-based CFD software server request processing thread disclosed in this application;

[0046] Figure 6 This is a schematic diagram of a CFD software client / server deployment model disclosed in this application;

[0047] Figure 7 This is a schematic diagram of the structure of a Netty-based CFD software processing device disclosed in this application;

[0048] Figure 8 This is a structural diagram of an electronic device provided in this application. DETAILED DESCRIPTION

[0049] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0050] Most CFD software is deployed on industrial supercomputers in the form of isolated solvers. Users generate the parameter files required for simulation locally and then manually submit simulation jobs. This method not only increases the execution time of simulation jobs, but also makes it impossible to obtain simulation job results in real time. When faced with engineering needs for batch simulation calculations, it takes a lot of time to execute and view simulation jobs. When the existing solution is used for supercomputer applications, there are two deployment and operation methods: 1. When the supercomputer has the hardware conditions to support visualization, the CFD software interface and solver are coupled together and deployed as a whole on the supercomputer visualization node. The user logs in to the supercomputer visualization node, starts the software, and uses the software interface to perform simulation calculations; 2. When the supercomputer does not have the hardware conditions to support visualization, the solver is deployed separately on the supercomputer. The user needs to use the Windows version of CFD software on the local PC to generate the input parameter file and manually upload it to the supercomputer. The job is submitted through the supercomputer scheduling system for simulation calculations. The disadvantages are as follows: 1. Lack of portability. When the supercomputer lacks visualization hardware support, it cannot be deployed as a whole. 2. When deploying solvers on supercomputers, users manually upload engineering files and execute simulation jobs, which is inefficient. When facing batch simulation requirements in engineering, there are a lot of repetitive manual operations. 3. When deploying solvers on supercomputers, simulation jobs run in isolation on the supercomputer. The interface and solver cannot communicate with each other. Users cannot view aerodynamic curves, cloud maps and other simulation results in real time through the interactive interface, resulting in a poor user experience. As can be seen from the above, how to improve the compatibility and portability of CFD software, improve the execution efficiency of simulation jobs, solve the problem of solvers running in isolation on supercomputers and the interactive interface being unable to obtain simulation result data on the supercomputer in real time, and lower the threshold for software integration and deployment are issues that need to be addressed in this field.

[0051] See also Figure 1 As shown, the embodiment of the present invention discloses a CFD software processing method based on Netty, which may specifically include:

[0052] Step S11: Establish a connection relationship between the local and the client, and build various types of processors based on the Netty framework, use the connection relationship to obtain the simulation processing instruction sent by the client, and determine the instruction type of the simulation processing instruction.

[0053] In this embodiment, a BossGroup thread group is defined, and a connection relationship between the local and the client is established by using the BossGroup thread group; the data channel between the local and the client is initialized, and various types of processors are constructed based on the Netty framework. Based on the NioEventLoop in WorkerGroupp and using the connection relationship between the local and the client, the simulation processing instructions sent by the client are obtained, and the instruction type of the simulation processing instructions is determined; the processor includes a processor that supports the Hypertext Transfer Protocol and the Transmission Control Protocol.

[0054] Specifically, first define two NioEventLoopGroup thread groups, Boss and Worker. The BossGroup thread group is responsible for handling connections with the client, and the WorkerGroupp thread group is responsible for handling client request events. Then create the ServerBootstrap startup class, define the network transmission method, bind the listening port, and build a partial code list of the server based on the Netty framework as follows Figure 2 Initialize the data channel and build processors based on the Netty framework to support HTTP (Hypertext Transfer Protocol), TCP (Transmission Control Protocol), and other processors required for business processing.

[0055] Step S12: If the instruction type is decoding, the information to be processed is obtained from the client corresponding to the simulation processing instruction, and the information to be processed is decoded and deserialized to obtain a character string, and the character string is parsed to obtain an attribute value. According to the attribute value, a target processor is filtered from the processors of each type, and the character string is processed using the target processor.

[0056] In this embodiment, if the instruction type is decoding, the information to be processed is obtained from the client corresponding to the simulation processing instruction, and the length of the information to be processed is determined, the byte stream of the information to be processed is read, the byte stream to be decoded is filtered from the byte stream according to the length, the byte stream to be decoded is decoded and deserialized to obtain a string in JSON format, the string in JSON format is parsed to obtain attribute values, the class object associated with the attribute value is obtained, and the string in JSON format is instantiated into a JavaBean object, the target processor is filtered from the processors of each type according to the class object and the JavaBean object, and the string is processed using the target processor.

[0057] Among them, processing the character string includes: if the type of the target processor is a processor for performing numerical calculation, using the target processor to perform numerical calculation processing on the character string; if the type of the target processor is a processor for performing job status monitoring, using the target processor to perform job status monitoring processing on the character string; if the type of the target processor is a processor for performing curve monitoring, using the target processor to perform curve monitoring processing on the character string; if the type of the target processor is a processor for performing file management, using the target processor to perform file management processing on the character string; if the type of the target processor is a processor for performing job management, using the target processor to perform job management processing on the character string; if the type of the target processor is a processor for performing configuration, using the target processor to perform configuration processing on the character string.

[0058] The specific decoding process is as follows: first read the first 4 bytes of the byte stream in the information to be processed, obtain the length L of the letter, then read L bytes starting from the 5th byte, and deserialize the read byte stream to obtain a string in JSON format, then call the message forwarding module, and pass in the decoded string. Use the message forwarding module to parse the attribute value of the message type (MessageType) in the string, obtain the Class object (class object) associated with the attribute value, and instantiate the JSON format string into a JavaBean object, and filter the target processor from each type of processor based on the class object and JavaBean object.

[0059] The main processing tasks of the processor used for numerical calculations are: after receiving a numerical calculation request, it first determines whether it is a batch calculation. If it is a batch calculation, it copies the reference job according to the reference job path and batch job quantity in the numerical calculation request. Then, based on the batch job parameters such as angle of attack, Mach number, altitude, etc., it modifies the corresponding values ​​in the input parameter file of each job. After completing the simulation job project configuration work, it calls the calculation instruction to perform the simulation calculation;

[0060] The main tasks of the processor used for job status monitoring are as follows: after receiving a job status monitoring request, it reads the job ID (identity document) in the job status monitoring request, calls a script file that has integrated supercomputing job management instructions according to the configuration file, polls the supercomputing scheduling system for the job running status based on the job ID, updates and saves it to a file, and compares the current status written in the file with the last saved status to see if they are consistent. If they are inconsistent, it calls the encoder and message sender to return the current status to the client.

[0061] The main processing tasks of the processor used for curve monitoring are: after receiving the curve monitoring request, read the project name and monitoring type parameters in the curve monitoring request, match the file that needs to be monitored in real time based on the above two parameters, obtain the absolute path of the file and add the file path to the file monitoring queue. The file listener will scan whether the file has changed at the beginning of the next polling. If changed, it will read the changed content and call the encoder and message sender to return the message to the client.

[0062] The main tasks of the file management processor are: after receiving a file operation request, it reads the operation type parameter in the file operation request, calls different interfaces such as file upload, file download, file deletion, file query, and file modification to perform file management operations, generates the result in JSON format, and calls the encoder and message sender to return the message to the client;

[0063] The main tasks of the job management processor are: after receiving a request, it reads the project management type parameter in the request and calls different interfaces such as single job query, batch job query, single job cancellation, and batch job cancellation based on the parameter. The project management interface executes the job management instructions based on the job ID in the request to complete the project management request processing, generates the processing results in JSON format, and calls the encoder and message sender to return the message to the client;

[0064] Processor used for configuration: The main configuration includes the port number, operating system type, scheduling system type and the script file of the corresponding instruction set. The configuration file is pre-placed in the specified path of the installation package and pre-loaded when the server is started.

[0065] Step S13: If the instruction type is encoding, the object to be encoded is converted into a string and serialized to obtain a byte stream, the length of the byte stream is calculated, and the information to be sent is generated according to the length and the byte stream, and the information to be sent is sent to the client corresponding to the simulation processing instruction.

[0066] In this embodiment, if the instruction type is encoding, the object to be encoded is converted into a string to obtain a string in JSON format; the object to be encoded is a JavaBean object; the string in JSON format is serialized into a byte stream, and the length of the byte stream is calculated; the length is stored in the message header, and the byte stream is used as the message body to generate information to be sent, and the information to be sent is sent to the client corresponding to the simulation processing instruction.

[0067] Specifically, the example diagram of encoding and decoding is as follows Figure 3As shown, if the instruction type is encoding, the JavaBean object is converted into a JSON string, which is then serialized into a byte stream. The length of the byte stream is calculated and then stored in the message header as a fixed length of 4 additional bytes. The byte stream is then used as the message body to generate the information to be sent, which is then sent to the client corresponding to the simulation processing instruction. The message header can also be further subdivided into attributes such as magic number, version number, serialization algorithm, message type, and length, but all of them are in the form of a message header plus a message body.

[0068] In this embodiment, the specific process of CFD software processing based on Netty is as follows Figure 4 As shown, a connection relationship is established between the local and the client, and various types of processors are built based on the Netty framework to obtain the simulation processing instructions sent by the client and determine the instruction type of the simulation processing instructions; if the instruction type is decoding, it is necessary to execute the process of receiving messages, obtain the information to be processed sent by the client, process the information to be processed to obtain attribute values, filter the target processor from various types of processors according to the attribute values, and use the target processor to process the string; if the instruction type is encoding, it is necessary to execute the process of sending messages, perform message processing on the encoded object to generate information to be sent, and send the information to be sent to the client corresponding to the simulation processing instruction.

[0069] The present invention heterogeneously transforms the CFD software interface and solver into a client / server model. The client is responsible for parameter setting and result rendering, and the server provides simulation calculation, job management, and monitoring services. By deploying the client and server on a local PC (Personal Computer) and a remote supercomputer respectively, the problem of integrated simulation application of CFD software on industrial supercomputers is solved. The CFD software server request processing thread process based on Netty is as follows: Figure 5As shown, the NioEventLoop in the BossGroup is used to poll the Accept event of the client connection request. After discovering the Accept event, a connection is established with the corresponding client and a NioSocketChannel is generated, which is registered with the Selector on the NioEventLoop in a WorkerGroup. The NioEventLoop in the WorkerGroup polls the client's I / O (Input / Output) read and write events. After discovering the I / O event, the message processor in the Pipeline performs preliminary processing and finds the corresponding business processor based on the message type MessageType for subsequent processing. In the business processor, the supercomputer scheduling instructions are integrated according to the business processing requirements, the simulation processing instruction task initiated by the client is completed, and the encoder and message sender are called to return the results to the client.

[0070] Among them, the CFD software client / server deployment model diagram is as follows Figure 6 As shown, the CFD software service system is developed in Java and has excellent cross-platform features, compatible with Windows and Linux environments. Locally, the server and client are deployed on the same PC as microservices. Remote servers can be installed simultaneously on local and remote PCs, remote workstations, and multiple remote supercomputers. Users can initiate simulation jobs from the local client to multiple servers.

[0071] In addition, data objects and byte streams can be converted to each other through serialization methods such as ProtocolBuffer and msgpack to replace the JSON format.

[0072] This application is compatible with simulation requests of TCP and Http protocols, and simulation jobs can be initiated through desktop application clients and web pages; it provides a multi-source asynchronous simulation mode, and a heterogeneous approach enables one client to connect to multiple supercomputers for simulation jobs, and after the client exits, the simulation job can still run in the background, effectively integrating computing resources; it is compatible with both Windows and Linux operating systems, improving the compatibility and portability of the software.

[0073] The present invention solves the problem that the solver operates in isolation on the supercomputer and the interactive interface cannot obtain the simulation result data on the supercomputer in real time, thereby improving the software's integrated simulation service capabilities; solves the problem that users manually submit simulation jobs on the supercomputer, thereby improving the execution efficiency of simulation jobs; provides a multi-source asynchronous simulation mode, thereby solving the problem that simulation jobs are synchronously stopped after the CFD software interactive interface exits; solves the problem that the supercomputer lacks visual nodes and cannot be deployed as a whole, thereby improving the software portability; the server provides an interface compatible with Http requests, which facilitates the integration of the server and the supercomputer management platform, thereby lowering the threshold for integrated deployment of software in industrial sectors.

[0074] In this embodiment, a connection relationship is established between the local and client, and various types of processors are constructed based on the Netty framework. The connection relationship is used to obtain the simulation processing instruction sent by the client, and the instruction type of the simulation processing instruction is determined; if the instruction type is decoding, the information to be processed is obtained from the client corresponding to the simulation processing instruction, and the information to be processed is decoded and deserialized to obtain a string, the string is parsed to obtain an attribute value, and a target processor is filtered from the processors of various types according to the attribute value, and the string is processed by the target processor; if the instruction type is encoding, the object to be encoded is converted into a string and serialized to obtain a byte stream, the length of the byte stream is calculated, and the information to be sent is generated according to the length and the byte stream, and the information to be sent is sent to the client corresponding to the simulation processing instruction. This application establishes a connection relationship between the local and the client, and builds various types of processors based on the Netty framework, which is compatible with both Windows and Linux operating systems, improving the compatibility and portability of the software. When the simulation processing instruction sent by the client is decoding, the information to be processed is decoded and deserialized to obtain a string, the string is parsed, and the attribute value obtained after parsing is used to filter the target processor, so that the target processor is used to process the string, solving the problem that the solver operates in isolation on the supercomputer and the interactive interface cannot obtain the simulation result data on the supercomputer in real time, improving the software's integrated simulation service capabilities, and eliminating the need for users to manually submit simulation jobs on the supercomputer, thereby improving the execution efficiency of the simulation job. When the simulation processing instruction sent by the client is encoding, the encoded object is converted and serialized to a string to obtain a byte stream, and the information to be sent is generated according to the length and byte stream of the byte stream, and the information to be sent is sent to the corresponding client, solving the problem that the supercomputer lacks a visual node and cannot be deployed as a whole. In addition, this application can support multiple supercomputers and one client for simulation operations, so when the client exits, the simulation job can still run in the background, effectively integrating computing resources and lowering the threshold for software integration and deployment.

[0075] See also Figure 7 As shown, the embodiment of the present invention discloses a CFD software processing device based on Netty, which may specifically include:

[0076] The processor construction module 11 is used to establish a connection relationship between the local and the client, and to build various types of processors based on the Netty framework, to obtain the simulation processing instructions sent by the client using the connection relationship, and to determine the instruction type of the simulation processing instructions;

[0077] a decoding module 12 configured to, if the instruction type is decoding, obtain information to be processed from the client corresponding to the simulation processing instruction, decode and deserialize the information to be processed to obtain a character string, parse the character string to obtain an attribute value, filter a target processor from the processors of each type according to the attribute value, and process the character string using the target processor;

[0078] The encoding module 13 is used to perform string conversion and serialization on the object to be encoded to obtain a byte stream if the instruction type is encoding, calculate the length of the byte stream, generate information to be sent based on the length and the byte stream, and send the information to be sent to the client corresponding to the simulation processing instruction.

[0079] In this embodiment, a connection relationship is established between the local and client, and various types of processors are constructed based on the Netty framework. The connection relationship is used to obtain the simulation processing instruction sent by the client, and the instruction type of the simulation processing instruction is determined; if the instruction type is decoding, the information to be processed is obtained from the client corresponding to the simulation processing instruction, and the information to be processed is decoded and deserialized to obtain a string, the string is parsed to obtain an attribute value, and a target processor is filtered from the processors of various types according to the attribute value, and the string is processed by the target processor; if the instruction type is encoding, the object to be encoded is converted into a string and serialized to obtain a byte stream, the length of the byte stream is calculated, and the information to be sent is generated according to the length and the byte stream, and the information to be sent is sent to the client corresponding to the simulation processing instruction. This application establishes a connection relationship between the local and the client, and builds various types of processors based on the Netty framework, which is compatible with both Windows and Linux operating systems, improving the compatibility and portability of the software. When the simulation processing instruction sent by the client is decoding, the information to be processed is decoded and deserialized to obtain a string, the string is parsed, and the attribute value obtained after parsing is used to filter the target processor, so that the target processor is used to process the string, solving the problem that the solver operates in isolation on the supercomputer and the interactive interface cannot obtain the simulation result data on the supercomputer in real time, improving the software's integrated simulation service capabilities, and eliminating the need for users to manually submit simulation jobs on the supercomputer, thereby improving the execution efficiency of the simulation job. When the simulation processing instruction sent by the client is encoding, the encoded object is converted and serialized to a string to obtain a byte stream, and the information to be sent is generated according to the length and byte stream of the byte stream, and the information to be sent is sent to the corresponding client, solving the problem that the supercomputer lacks a visual node and cannot be deployed as a whole. In addition, this application can support multiple supercomputers and one client for simulation operations, so when the client exits, the simulation job can still run in the background, effectively integrating computing resources and lowering the threshold for software integration and deployment.

[0080] In some specific embodiments, the processor building module 11 may specifically include:

[0081] A connection relationship establishment module is used to define a BossGroup thread group and use the BossGroup thread group to establish a connection relationship between the local and the client;

[0082] The processor construction module is used to initialize the data channel between the local and the client, and to build various types of processors based on the Netty framework; the processors include processors that support the Hypertext Transfer Protocol and the Transmission Control Protocol.

[0083] In some specific embodiments, the processor building module 11 may specifically include:

[0084] The instruction type determination module is used to obtain the simulation processing instruction sent by the client based on the NioEventLoop in WorkerGroupp and using the connection relationship between the local and the client, and determine the instruction type of the simulation processing instruction.

[0085] In some specific embodiments, the decoding module 12 may specifically include:

[0086] A reading module, configured to determine the length of the information to be processed and read a byte stream of the information to be processed;

[0087] The decoding and deserialization module is used to filter the byte stream to be decoded from the byte stream according to the length, and decode and deserialize the byte stream to be decoded to obtain a string in JSON format.

[0088] In some specific embodiments, the decoding module 12 may specifically include:

[0089] A parsing module, used to parse the string in JSON format to obtain attribute values;

[0090] A screening module is used to obtain a class object associated with the attribute value, instantiate the string in JSON format into a JavaBean object, and screen a target processor from the processors of various types based on the class object and the JavaBean object.

[0091] In some specific embodiments, the decoding module 12 may specifically include:

[0092] a numerical calculation module, configured to perform numerical calculation processing on the character string using the target processor if the target processor is a processor for performing numerical calculation;

[0093] a job status monitoring module, configured to, if the type of the target processor is a processor for performing job status monitoring, perform job status monitoring processing on the character string using the target processor;

[0094] a curve monitoring module, configured to perform curve monitoring processing on the character string using the target processor if the target processor is a processor for performing curve monitoring;

[0095] a file management module configured to perform file management processing on the character string using the target processor if the target processor is a processor for performing file management;

[0096] a job management module, configured to perform job management processing on the character string using the target processor if the target processor is a processor for performing job management;

[0097] A configuration module is configured to, if the type of the target processor is a processor for configuration, perform configuration processing on the character string using the target processor.

[0098] In some specific embodiments, the encoding module 13 may specifically include:

[0099] A string conversion module is used to convert the object to be encoded to obtain a string in JSON format; the object to be encoded is a JavaBean object;

[0100] A serialization module, used to serialize the string in JSON format into a byte stream and calculate the length of the byte stream;

[0101] The module for generating information to be sent is used to store the length in the message header and use the byte stream as the message body to generate information to be sent.

[0102] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the Netty-based CFD software processing method performed by the electronic device disclosed in any of the aforementioned embodiments.

[0103] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0104] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.

[0105] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, so as to enable the processor 21 to calculate and process data 223 in the memory 22. The operating system 221 can be Windows, Unix, Linux, etc. In addition to including computer programs capable of implementing the Netty-based CFD software processing method disclosed in any of the aforementioned embodiments and executed by the electronic device 20, the computer program 222 may further include computer programs capable of performing other specific tasks. In addition to data transmitted from external devices received by the Netty-based CFD software processing device, the data 223 may also include data collected by its own input and output interface 25.

[0106] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0107] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the Netty-based CFD software processing method disclosed in any of the aforementioned embodiments are implemented.

[0108] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0109] The above is a detailed introduction to a Netty-based CFD software processing method, device, equipment and storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method and core ideas of the present invention. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A CFD software processing method based on Netty, characterized in that: include: Establishing a connection relationship between the local and the client, and building various types of processors based on the Netty framework, using the connection relationship to obtain the simulation processing instruction sent by the client, and determining the instruction type of the simulation processing instruction; If the instruction type is decoding, obtaining information to be processed from the client corresponding to the simulation processing instruction, decoding and deserializing the information to be processed to obtain a character string, parsing the character string to obtain an attribute value, filtering a target processor from the processors of each type according to the attribute value, and processing the character string using the target processor; If the instruction type is encoding, the object to be encoded is converted into a string and serialized to obtain a byte stream, the length of the byte stream is calculated, information to be sent is generated according to the length and the byte stream, and the information to be sent is sent to the client corresponding to the simulation processing instruction; The method heterogeneously transforms the CFD software interaction interface and solver into a client / server mode, wherein the client is responsible for parameter setting and result rendering, and the server provides simulation calculation, job management and monitoring services. The client and the server are respectively deployed on a local PC and a remote supercomputer, thereby solving the problem of integrated simulation application of CFD software on supercomputers in industrial departments. In a request processing thread process of a CFD software server based on Netty, the NioEventLoop in the BossGroup is used to poll the Accept event of the client connection request. After the Accept event is found, a connection is established with the corresponding client and a NioSocketChannel is generated, which is registered with a Selector on the NioEventLoop in a WorkerGroup. The NioEventLoop in the WorkerGroup polls the I / O read / write events of the client. After the I / O event is found, the message processor in the Pipeline performs preliminary processing, finds the corresponding business processor according to the message type MessageType for subsequent processing, integrates the scheduling instructions of the supercomputer in the business processor according to the business processing requirements, completes the simulation processing instruction task initiated by the client, and calls the encoder and the message sender to return the result to the client.

2. The Netty-based CFD software processing method according to claim 1, characterized in that: The connection relationship between the local and the client is established, and various types of processors are built based on the Netty framework, including: Define a BossGroup thread group, and use the BossGroup thread group to establish a connection relationship between the local and the client; Initialize the data channel between the local and the client, and build various types of processors based on the Netty framework; the processors include processors that support the Hypertext Transfer Protocol and the Transmission Control Protocol.

3. The Netty-based CFD software processing method according to claim 2, characterized in that: The obtaining the simulation processing instruction sent by the client by using the connection relationship and determining the instruction type of the simulation processing instruction includes: Based on the NioEventLoop in the WorkerGroup and utilizing the connection relationship between the local and the client, the simulation processing instruction sent by the client is obtained, and the instruction type of the simulation processing instruction is determined.

4. The Netty-based CFD software processing method according to claim 1, characterized in that: The decoding and deserializing of the information to be processed to obtain a character string includes: Determine the length of the information to be processed, and read the byte stream of the information to be processed; The byte stream to be decoded is filtered from the byte stream according to the length, and the byte stream to be decoded is decoded and deserialized to obtain a character string in JSON format.

5. The Netty-based CFD software processing method according to claim 4, characterized in that: The parsing of the character string to obtain an attribute value, and filtering a target processor from the processors of various types according to the attribute value, includes: Parse the string in JSON format to obtain attribute values; A class object associated with the attribute value is obtained, and the string in JSON format is instantiated into a JavaBean object, and a target processor is filtered from the processors of various types according to the class object and the JavaBean object.

6. The Netty-based CFD software processing method according to claim 1, characterized in that: The processing of the character string by the target processor includes: If the type of the target processor is a processor for performing numerical calculations, then using the target processor to perform numerical calculations on the character string; If the type of the target processor is a processor for performing job status monitoring, then using the target processor to perform job status monitoring processing on the character string; If the type of the target processor is a processor for performing curve monitoring, using the target processor to perform curve monitoring processing on the character string; If the type of the target processor is a processor for performing file management, using the target processor to perform file management processing on the character string; If the type of the target processor is a processor for performing job management, performing job management processing on the character string using the target processor; If the type of the target processor is a processor for configuration, the target processor is used to perform configuration processing on the character string.

7. The Netty-based CFD software processing method according to any one of claims 1 to 6, characterized in that: The step of converting and serializing the object to be encoded to obtain a byte stream, calculating the length of the byte stream, and generating information to be sent according to the length and the byte stream includes: Convert the object to be encoded into a string to obtain a string in JSON format; the object to be encoded is a JavaBean object; Serialize the string in JSON format into a byte stream, and calculate the length of the byte stream; The length is stored in the message header, and the byte stream is used as the message body to generate information to be sent.

8. A CFD software processing device based on Netty, characterized in that: include: A processor construction module is used to establish a connection relationship between the local and the client, and to build various types of processors based on the Netty framework, to obtain the simulation processing instructions sent by the client using the connection relationship, and to determine the instruction type of the simulation processing instructions; A decoding module, for obtaining information to be processed from the client corresponding to the simulation processing instruction if the instruction type is decoding, and decoding and deserializing the information to be processed to obtain a character string, parsing the character string to obtain an attribute value, filtering a target processor from the processors of each type according to the attribute value, and processing the character string using the target processor; An encoding module, for, if the instruction type is encoding, performing string conversion and serialization on the object to be encoded to obtain a byte stream, calculating the length of the byte stream, generating information to be sent according to the length and the byte stream, and sending the information to be sent to the client corresponding to the simulation processing instruction; The device heterogeneously transforms the CFD software interaction interface and solver into a client / server mode, wherein the client is responsible for parameter setting and result rendering, and the server provides simulation calculation, job management and monitoring services. The client and the server are respectively deployed on a local PC and a remote supercomputer, thereby solving the problem of integrated simulation application of CFD software on supercomputers in industrial departments. In a CFD software server request processing thread process based on Netty, the NioEventLoop in the BossGroup is used to poll the Accept event of the client connection request. After the Accept event is found, a connection is established with the corresponding client and a NioSocketChannel is generated, which is registered with a Selector on the NioEventLoop in a WorkerGroup. The NioEventLoop in the WorkerGroup polls the I / O read / write events of the client. After the I / O event is found, the message processor in the Pipeline performs preliminary processing, finds the corresponding business processor according to the message type MessageType for subsequent processing, integrates the scheduling instructions of the supercomputer in the business processor according to the business processing requirements, completes the simulation processing instruction task initiated by the client, and calls the encoder and the message sender to return the result to the client.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the Netty-based CFD software processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the Netty-based CFD software processing method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Customized communication protocol and service method based on netty framework

    CN111683069A

  • Management system and method for multi-user customized interactive interface of CFD software

    CN113392627A