CFD software processing method and device based on Netty, equipment and medium
Through the CFD software processing method based on Netty framework, the portability and efficiency problems of CFD software when deploying on supercomputer are solved, efficient execution of simulation jobs and real-time result acquisition are achieved, and software compatibility and integrated simulation are improved. Service capability.
Patent Information
- Application Number
- CN202411731841.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-11-29
AI Technical Summary
The existing CFD software lacks portability and efficiency when deploying on supercomputers. The isolated job of the solver makes it impossible for the interactive interface to obtain simulation results in real time. Users need to submit jobs manually and are inefficient, and the threshold for integrated deployment is high.
Using the CFD software processing method based on the Netty framework, by establishing a local connection with the client, the processor is built to decode and encode simulation processing instructions, real-time processing and transmission of simulation data is realized, and simulation operations of multiple supercomputers and one client are supported, reducing The threshold for integrated deployment.
It improves the compatibility and portability of CFD software, realizes efficient execution of simulation jobs and real-time result acquisition, reduces user manual operations, improves the software's integrated simulation service capabilities, and effectively integrates computing resources.
Smart Images

Figure CN119248290A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a CFD software processing method, device, equipment and medium based on Netty. Background Art
[0002] Most CFD (Computational Fluid Dynamics) software is deployed on industrial supercomputers in the form of isolated solvers. Users generate the parameter files required for simulation locally and then submit simulation jobs manually. This method not only increases the execution time of simulation jobs, but also fails to obtain simulation job results in real time. When facing 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 modes: 1. When the supercomputer has visualization hardware support, the CFD software interactive interface and solver are coupled together and deployed as a whole on the supercomputer visualization node. Users log in to the supercomputer visualization node, start the software and use the software interactive interface to perform simulation calculations; 2. When the supercomputer does not have visualization hardware support, the solver is deployed separately on the supercomputer. Users need to use the Windows version of CFD software on the local PC (Personal Computer) to generate input parameter files and manually upload them to the supercomputer, and submit jobs through the supercomputer scheduling system for simulation calculations. 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 engineering, 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, and 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, and the user experience is poor.
[0003] From the above, it can be seen that how to improve the compatibility and portability of CFD software, improve the execution efficiency of simulation jobs, solve 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, and lower the integration and deployment threshold of the software are issues to be solved in this field. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a CFD software processing method, device, equipment and medium based on Netty, which can improve the compatibility and portability of CFD software, improve the execution efficiency of simulation operations, solve 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, and reduce the integration and deployment threshold of the software. The specific scheme 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 instruction sent by the client, and determining the instruction type of the simulation processing instruction;
[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, filtering 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, 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 establishment of a connection relationship between the local and the client, and the construction of various types of processors based on the Netty framework, include:
[0010] Define a BossGroup thread group, and use the BossGroup thread group to establish a connection relationship between the local and the 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 the Hypertext Transfer Protocol and the Transmission Control Protocol.
[0012] Optionally, the acquiring the simulation processing instruction sent by the client by using 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 string to obtain an attribute value, and filtering a target processor from the processors of various types according to the attribute value, includes:
[0018] Parse 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, and 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, then using the target processor to perform job status monitoring processing on the character string;
[0023] 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;
[0024] 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;
[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, 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;
[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 according to 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 disclosed above 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 a local and a 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 a target processor from 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 the 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 present application establishes a connection relationship between the local and the client, and builds various types of processors based on the Netty framework, which can be compatible with Windows / Linux operating systems at the same time, thereby 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 target processor is screened using the attribute value obtained after parsing, so as to use the target processor to process the string, thereby 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, thereby improving the software's integrated simulation service capability, and there is no 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 into a string and serialized to obtain a byte stream, and the information to be sent is generated according to the length of the byte stream and the byte stream, and the information to be sent is sent to the corresponding client, thereby solving the problem that the supercomputer lacks a visualization node and cannot be deployed as a whole, and the present 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 integrated deployment of software. 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 drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0041] Figure 1 A flow chart of a CFD software processing method based on Netty 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 A specific flow chart of the Netty-based CFD software processing disclosed in this application;
[0045] Figure 5 A schematic diagram of a CFD software server request processing thread based on Netty disclosed in this application;
[0046] Figure 6 A schematic diagram of a CFD software client / server deployment mode disclosed in this application;
[0047] Figure 7 This is a schematic diagram of the structure of a CFD software processing device based on Netty disclosed in this application;
[0048] Figure 8 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work 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 submit simulation jobs manually. This method not only increases the execution time of simulation jobs, but also fails to obtain simulation job results in real time. When faced with engineering requirements 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 modes: 1. When the supercomputer has visualization hardware support, the CFD software interactive interface and solver are coupled together and deployed as a whole on the supercomputer visualization node. Users log in to the supercomputer visualization node, start the software, and use the software interactive interface to perform simulation calculations; 2. When the supercomputer does not have visualization hardware support, the solver is deployed separately on the supercomputer. Users need to use the Windows version of CFD software on the local PC to generate input parameter files and manually upload them to the supercomputer, and submit jobs 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 needs in engineering, there are a lot of repetitive manual operations; 3. When deploying solvers on supercomputers, simulation jobs run in isolation on the supercomputer, and the interface and solver cannot communicate with each other. Users cannot view simulation results such as aerodynamic curves and cloud maps in real time through the interactive interface, and the user experience is poor. 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 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, and lower the threshold for integrated deployment of software are problems to be solved 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 a local and a client is established by using the BossGroup thread group; a 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 the connection with the client, and the WorkerGroupp thread group is responsible for handling the client's 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 that support Http (Hypertext Transfer Protocol), TCP (Transmission Control Protocol) and other processors that need to be defined for business processing based on the Netty framework.
[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, and a target processor is filtered from the processors of each type according to the attribute value, 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] Wherein, 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: 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 string in JSON format into a JavaBean object, and filter the target processor from processors of various types based on the class object and JavaBean object.
[0059] Among them, the processing tasks of the processor used for numerical calculation are mainly: after receiving the numerical calculation request, first determine whether it is a batch calculation. If it is a batch calculation, copy the benchmark operation according to the benchmark operation path and batch operation quantity in the numerical calculation request, and then modify the corresponding values in the input parameter file of each operation according to the parameters of the batch operation, such as angle of attack, Mach number, altitude, etc. After completing the simulation operation engineering configuration work, call the calculation instruction to perform simulation calculation;
[0060] The processing tasks of the processor used for job status monitoring are mainly as follows: after receiving a job status monitoring request, read the job ID (Identity document) in the job status monitoring request, call the script file that has integrated the supercomputing job management instructions according to the configuration file, poll the supercomputing scheduling system for the job running status according to the job ID, and update and save it to the file, compare whether the current written status in the file is consistent with the last saved status, if they are inconsistent, call the encoder and message sender to return the current status to the client;
[0061] The processing tasks of the processor used for curve monitoring are mainly: 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 according to 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 processor for file management are: after receiving a file operation request, read the operation type parameter in the file operation request, call different interfaces such as file upload, file download, file deletion, file query, file modification, etc. to perform file management operations, generate a result in JSON format, and call the encoder and message sender to return the message to the client;
[0063] The main processing tasks of the processor for job management are: after receiving the request, read the engineering management type parameter in the request, call different interfaces such as single job query, batch job query, single job cancellation, batch job cancellation, etc. according to the parameter, and the engineering management interface executes the job management instruction according to the job ID in the request to complete the processing of the engineering management request, generate the processing result in JSON format, and call 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, and then the JSON string is serialized into a byte stream, the length of the byte stream is calculated, and then the length is stored in the message header with a fixed length of 4 additional bytes, and the byte stream is used as the message body to generate the information to be sent, and the information to be sent is sent to the client corresponding to the simulation processing instruction. The message header can also be subdivided into properties such as magic number, version number, serialization algorithm, message type, length, etc., but they are all in the form of message header plus 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 interactive interface and solver into a client / server mode. 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 the local PC (Personal Computer) and the 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 the Accept event is found, 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 the I / O event is found, the message processor in the Pipeline performs preliminary processing, and finds the corresponding business processor according to the message type MessageType for subsequent processing. In the business processor, the scheduling instructions of the supercomputer are integrated according to the needs of business processing, 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 mode diagram is as follows Figure 6 As shown in the figure, the CFD software service system is developed based on Java language, has good cross-platform characteristics, and is compatible with Windows and Linux environments. The server and client are deployed locally on the same PC in a microservice manner. The remote server can be installed locally, on a remote PC, on a remote workstation, and on multiple remote supercomputers. Users can initiate simulation jobs to multiple servers from the local client.
[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 the client and web page of the desktop application; it provides a multi-source asynchronous simulation mode, and the 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 / 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 integrated simulation service capability of the software; 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 the simulation job stops synchronously 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 portability of the software; 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 the software in the industrial sector.
[0074] In this embodiment, a connection relationship is established between the local and the 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 screened 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. The present application establishes a connection relationship between the local and the client, and builds various types of processors based on the Netty framework, which can be compatible with Windows / Linux operating systems at the same time, thereby 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 target processor is screened using the attribute value obtained after parsing, so as to use the target processor to process the string, thereby 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, thereby improving the software's integrated simulation service capability, and there is no 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 into a string and serialized to obtain a byte stream, and the information to be sent is generated according to the length of the byte stream and the byte stream, and the information to be sent is sent to the corresponding client, thereby solving the problem that the supercomputer lacks a visualization node and cannot be deployed as a whole, and the present 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 integrated deployment of software.
[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 construct various types of processors based on the Netty framework, to obtain the simulation processing instructions sent by the client by using the connection relationship, and to determine the instruction type of the simulation processing instructions;
[0077] A decoding module 12, 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;
[0078] The encoding module 13 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 according to 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 the 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 screened 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. The present application establishes a connection relationship between the local and the client, and builds various types of processors based on the Netty framework, which can be compatible with Windows / Linux operating systems at the same time, thereby 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 target processor is screened using the attribute value obtained after parsing, so as to use the target processor to process the string, thereby 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, thereby improving the software's integrated simulation service capability, and there is no 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 into a string and serialized to obtain a byte stream, and the information to be sent is generated according to the length of the byte stream and the byte stream, and the information to be sent is sent to the corresponding client, thereby solving the problem that the supercomputer lacks a visualization node and cannot be deployed as a whole, and the present 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 integrated deployment of software.
[0080] In some specific embodiments, the processor building module 11 may specifically include:
[0081] A connection relationship establishment module, 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 processor includes a processor that supports 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, used to determine the length of the information to be processed and read the 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 for parsing the string in JSON format to obtain attribute values;
[0090] The screening module is used to obtain the class object associated with the attribute value, instantiate the string in JSON format into a JavaBean object, and screen the target processor from the processors of various types according to 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 type of the target processor is a processor for performing numerical calculation;
[0093] A job status monitoring module, configured to perform job status monitoring processing on the character string using the target processor if the type of the target processor is a processor for performing job status monitoring;
[0094] A curve monitoring module, configured to perform curve monitoring processing on the character string using the target processor if the type of 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 type of 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 type of the target processor is a processor for performing job management;
[0097] The configuration module is used for, if the type of the target processor is a processor for configuration, using the target processor to perform configuration processing on the character string.
[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 the information to be sent.
[0102] Figure 8 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 in 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 working 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, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present 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, and 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 storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, 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] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20 to realize the operation and processing of the data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the Netty-based CFD software processing method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data transmitted from an external device received by the Netty-based CFD software processing device, the data 223 can also include data collected by its own input and output interface 25, etc.
[0106] The steps of the method or algorithm 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 a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, 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 article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[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 in this article 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 of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on 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, 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.
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 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.
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; 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 according to the length and the byte stream, and send the information to be sent to the client corresponding to the simulation processing instruction.
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
B / S architecture-based ship resistance CFD software cloud application system and method
CN115758590A
Surrogate modeling of computational fluid dynamics simulations
WO2024177675A1
