Construction method and device of three-dimensional industrial modeling environment and computer equipment
By combining differential packaging and bidirectional communication channels, the problems of cross-domain request errors and performance loss in industrial simulation and power system analysis application software in offline environments are solved, and lightweight modeling file rendering is achieved, ensuring efficient use in offline environments.
Patent Information
- Application Number
- CN202511460659.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-10-14
Smart Images

Figure CN120930383A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial simulation and power system analysis technology, and in particular to a method, apparatus and computer equipment for constructing a three-dimensional industrial modeling environment. Background Technology
[0002] In the fields of industrial simulation and power system analysis, various application software developed using C / C++ language technology are widely used as core tools in scenarios such as substation design, power grid simulation, and fault analysis. The application software required for each scenario's equipment is deployed online through front-end functional modules, which enable functions such as equipment layout and scenario simulation, single-line diagram editing, equipment attribute panels, and result visualization dashboard control.
[0003] When modifying and manipulating applications based on front-end functional modules, traditional solutions require obtaining modeling files via network links. Due to browser security policies, requests are prohibited without deployment in a proxy container like Nginx, potentially resulting in cross-origin request errors. Embedding modeling files into native application software also necessitates fully packaging the browser kernel, leading to increased installation package size and performance degradation from cross-process communication. Furthermore, the functional expansion of C / C++ applications often relies on Qt service architecture, requiring real-time calls to local offline interfaces. In intranet or network-constrained scenarios, this directly impacts the operation of front-end functional modules. Summary of the Invention
[0004] Based on this, the purpose of this application is to find a way to embed the front-end modified application into the native application software in a lightweight, offline and seamless way. Therefore, there is an urgent need for an innovative implementation solution that balances development efficiency and offline stability.
[0005] Firstly, this application provides a method for constructing a 3D industrial modeling environment. This includes: Obtain the modeling files and determine their file types; these file types include 3D model files, image files, compressed plugin files, and font files. The environment variables in the modeling file are parsed according to the preset configuration rules; Based on the file type and the environment variables, the modeling files are differentially packaged to obtain a static file directory; the static file directory includes target program files of the first type of language; Based on the constructed bidirectional communication channel and the target program file, the target function corresponding to the second type of language is called to render and present the industrial modeling environment through the target function.
[0006] In one embodiment, parsing the environment variables in the modeling file according to preset configuration rules includes: running various command lines in the modeling file; the command lines include at least regular packaging commands or embedded mode commands; identifying the target identifier in the embedded mode command line and obtaining the associated environment configuration file according to the target identifier; the environment configuration file is pre-created in the project root directory; and identifying the environment variables in the environment configuration file according to preset configuration rules.
[0007] In one embodiment, the modeling file is differentially packaged according to the file type and the environment variable to obtain a static file directory, including: determining the file size of the modeling file when the environment variable represents a target mode; the target mode is an encoding method that converts binary data into plain text; converting the modeling file into a target program file of a first type of language according to the file size and the file type; packaging the modeling file into an associated directory file when the environment variable represents a non-target mode; and combining the target program file and the associated directory file to obtain a static file directory.
[0008] In one embodiment, converting the modeling file into a target program file of a first type language based on the file size and file type of the modeling file includes: when the file type is a 3D model file, determining whether the file size of the modeling file is less than a first preset value; if so, converting the modeling file into a first string associated with the target method; and converting the first string into a target program file of the first type language.
[0009] In one embodiment, converting the modeling file into a target program file of a first type language based on the file size and file type of the modeling file includes: when the file type is an image file, determining whether the file size of the modeling file is less than a second preset value; the second preset value is less than a first preset value; if so, converting the modeling file into a second string associated with the target method; and converting the second string into a target program file of the first type language.
[0010] In one embodiment, the associated directory file includes at least a resource directory file, an image directory file, and a font library file. When the environment variable represents a non-target mode, the modeling file is packaged into the associated directory file, including: when the file type is a 3D model file, the modeling file is packaged into the resource directory file according to the resource copy rules in the packager, and referenced by the resource address; when the file type is an image file, the modeling file is packaged into the image directory file; when the file type is a font file, the modeling file is packaged into the font library file.
[0011] In one embodiment, the modeling file is differentially packaged according to the file type and the environment variable to obtain a static file directory, including: when the environment variable represents the target mode and the file type is a font file, the modeling file is packaged using web page text to obtain a static file directory; when the environment variable represents a non-target mode and the file type is a compressed plugin file, the modeling file is compressed.
[0012] In one embodiment, the bidirectional communication channel includes a first channel between the front-end page and the Qt browser, and a second channel between the Qt browser and the Qt server. Based on the constructed bidirectional communication channel and the target program file, calling the target function corresponding to the second type of language includes: importing the target program file into the code library and determining the channel object associated with the initial function of the second type of language; triggering the front-end page to load the code library and mounting the channel object to the global interface object through the first channel; when a webpage update request is obtained, calling the global interface object and triggering the target function in the Qt server through the second channel.
[0013] Secondly, this application also provides a device for constructing a three-dimensional industrial modeling environment. It includes: The modeling file acquisition module is used to acquire modeling files and determine the file type of the modeling files; the file types include 3D model files, image files, compressed plugin files, and font files; and parses the environment variables in the modeling files according to preset configuration rules.
[0014] The differential packaging module is used to differentially package the modeling files according to the file type and the environment variables to obtain a static file directory; the static file directory includes target program files of the first type of language.
[0015] The bidirectional communication and invocation module is used to invoke the target function corresponding to the second type of language based on the constructed bidirectional communication channel and the target program file, so as to render and present the industrial modeling environment through the target function.
[0016] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the above-described method for constructing a three-dimensional industrial modeling environment.
[0017] The aforementioned method, apparatus, and computer equipment for constructing a 3D industrial modeling environment differentiate and package modeling files based on file type and environment variables, generating a static file directory associated with the first type of language. This achieves file classification and environment adaptation, ensuring usability in offline scenarios or scenarios requiring embedding into other terminals. Subsequently, by utilizing a bidirectional communication channel and target program files, the corresponding target functions in the second type of language are called, successfully connecting resources from different language types. This allows the converted modeling files to be embedded in the code of the second type of language, eliminating the need to load external resources and avoiding cross-domain requests, thus ensuring efficient subsequent industrial modeling. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the interaction between the front-end page and the Qt server in one embodiment. Figure 2 This is a flowchart illustrating a method for constructing a 3D industrial modeling environment in one embodiment; Figure 3 This is a schematic diagram illustrating the process of packaging modeling files according to different commands in one embodiment; Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0020] Given that existing application software runs in environments without internet access, such as classified units, factory workshops, field equipment, embedded industrial control computers, or when processing highly sensitive data such as military, financial, and medical privacy data, requiring complete offline operation, and considering that front-end functional modules need powerful local computing capabilities (e.g., C / C++ language development) and good visual interaction (Web application technology), a method is needed that combines the convenience of Web application front-end interfaces with the performance and offline capabilities of C++. This method involves building a standalone offline package based on, for example, Vue CLI, and then embedding it into the C / C++ application software.
[0021] like Figure 1 As shown, Figure 1This is a flowchart illustrating the interaction between a front-end page and a Qt server (C++ side). The front-end page associated with the web application is implemented using HTML and JavaScript. For front-end applications built with Vue CLI, Vue CLI is an official scaffolding tool provided by Vue.js for quickly building, developing, and managing Vue front-end projects. A Vue project is a front-end application built with JavaScript as its core framework.
[0022] Qt is a cross-platform C++ application development framework. Qt server refers to server-side applications developed using the Qt framework, which run on the server or in the background and are mainly responsible for "backend" tasks such as processing data, providing services, and responding to client requests. Qt browser refers to client-side web browsers developed using the Qt framework, which are mainly used to parse and display web page content. Figure 1 The web engine modules included in the Qt browser (such as Qt WebEngine) are used to parse the HTML and JavaScript in the front-end page, and also realize the interaction between the front-end page and the Qt server (C++ side) through the constructed bidirectional communication channel.
[0023] The Qm server (C++ side) can be implemented using a standalone server or a server cluster consisting of multiple servers. It can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, and big data and artificial intelligence platforms.
[0024] In one embodiment, such as Figure 2 As shown, a method for constructing a 3D industrial modeling environment is provided, which can be applied to... Figure 1 This explanation will be based on the Qt browser in the example, and includes the following steps: Step 202: Obtain the modeling file and determine the file type of the modeling file.
[0025] The file types include 3D model files, image files, compression plugin files, and font files. 3D model files include glb files, which package all the resources of a 3D model into a single binary file; image files include img image files; compression plugin files include draco compression plugin files, which are third-party plugins for compressing glb files; and font files include the TextGeometry font.
[0026] Specifically, the modeling files are provided by users based on different modifications and applications of the front-end functional modules. When the front-end functional modules construct equipment layout and scene simulation: users drag and drop equipment models (transformers, circuit breakers, busbars, etc.) into the 3D scene through the browser interface, and obtain the modeling files after adjusting their position and orientation. For implementing a 2D single-line diagram editor: visually draw the main electrical wiring diagram and associate equipment parameters. For implementing an equipment attribute panel: select the equipment in the scene, and display and edit its detailed parameters (model, rated values, etc.) on the webpage side panel. For implementing a results visualization dashboard: after the simulation calculations (such as power flow calculations and short-circuit calculations) are completed, the results are displayed on the webpage in the form of charts (line graphs, bar charts), color mapping (displaying line load rate and voltage level), animations (fault current propagation), etc.
[0027] Step 204: Parse the environment variables in the modeling file according to the preset configuration rules.
[0028] Specifically, in a front-end Vue project, configuration rules, such as `rules`, are used to predefine constraints or logic. These rules include those that differentiate packaging based on whether environment variables are set when the Vue CLI scaffolding performs a single offline package build. Environment variables are pre-configured via commands. The Qt browser identifies and judges environment variables in the modeling file, such as `VUE_APP_FILE_TYPE`, and checks if the environment variable is equal to 'base64'.
[0029] In one embodiment, the webpack bundler's associated module (module configuration) is deployed in the bundling configuration file (vue.config.js). This module is used to break down the Vue project into several "chunks / units," serving as a build layer or runtime configuration that loads, bundles, and starts / stops on demand. The webpack bundler can package fragmented front-end resources into a few files that the browser can efficiently load.
[0030] Step 206: Based on file type and environment variables, perform differential packaging on the modeling files to obtain a static file directory.
[0031] The static file directory includes target program files for a first-type language. First-type languages include, but are not limited to, JavaScript. Target program files can be viewed as JS code embedded in various modeling files. Static file directories, such as the `dist` directory, are the final output packages automatically generated after the front-end project is built; they contain the static files that the browser can actually run.
[0032] Specifically, the Qt browser determines the file size of the modeling file and the encoding method represented by environment variables. Based on the file size, file type, or encoding method represented by environment variables, it converts the modeling file into a target program file in the first type of language, or directly packages the modeling file into an associated directory file, or performs a model compression process on the modeling file. The static file directory includes the target program file and the associated directory file.
[0033] Step 208: Based on the constructed bidirectional communication channel and target program file, call the target function corresponding to the second type of language to render and present the industrial modeling environment through the target function.
[0034] The second type of language includes, but is not limited to, C++. The bidirectional communication channels include a first channel between the front-end page and the Qt browser, and a second channel between the Qt browser and the Qt server (C++ side).
[0035] Specifically, refer to Figure 1 As shown, after loading an HTML page, the Qt browser initializes the code library associated with the first type of language (such as qwebchannel.js, which is the JS library provided by Qt) and the channel object (WebChannel) associated with the second type of language based on the first channel. After obtaining the modeling file triggered by the second type of language, the Qt browser calls the corresponding target function of the second type of language based on the first channel and the channel object, until the industrial modeling environment is rendered and presented through the target function. That is, JavaScript can call the public slot functions of C++ objects and can also receive signals emitted by C++ objects, realizing real-time data transmission and interaction.
[0036] For example, in application software related to substation design, the core functions achieved through objective functions may include power equipment parameter calculation, electrical wiring logic verification, short-circuit current analysis, grounding grid design, engineering drawing generation, and database management. In substation fault simulation scenarios, using objective functions to render the industrial modeling environment can prevent simulation module loading timeouts caused by network fluctuations.
[0037] In the aforementioned method for constructing a 3D industrial modeling environment, the modeling files are packaged differently based on their file type and environment variables to generate a static file directory associated with the first type of language. This achieves file classification and environment adaptation, ensuring usability in offline scenarios or scenarios requiring embedding into other terminals. Subsequently, using a bidirectional communication channel and target program files, the corresponding target functions of the second type of language are called, successfully connecting resources from different types of languages. This allows the converted modeling files to be embedded in the code of the second type of language, becoming part of the second type of language code. Therefore, it is no longer necessary to load external resources, avoiding cross-domain requests and ensuring efficient subsequent industrial modeling.
[0038] In one embodiment, parsing environment variables in a modeling file according to preset configuration rules includes: running various command lines in the modeling file; identifying target identifiers in embedded mode command lines and obtaining associated environment configuration files based on the target identifiers; and identifying environment variables in the environment configuration files according to preset configuration rules.
[0039] The command line includes at least regular packaging commands or embedded mode commands. Embedded mode commands represent packaging commands that convert 3D model files (such as glb files) that need to be loaded by the industrial model into plain text encoding (base64). Environment configuration files are pre-created in the root directory of the VUE project, such as the env.base64 file. The env file is a plain text file consisting of multiple lines of key-value pairs, and its custom environment variable is set to VUE_APP_FILE_TYPE='base64'.
[0040] Specifically, such as Figure 3 As shown, Figure 3 This is a flowchart illustrating the process of packaging modeling files according to different commands. When the Node environment runs the command line in the modeling file, if it reaches the embedded mode command line (such as vue-cli-servicebuild --modebase64), it will recognize the target identifier (such as base64) in the embedded mode command line and then look for an environment configuration file with the base64 identifier in the project folder. For regular packaging commands, it is not necessary to create or look for an environment configuration file. Only under the embedded mode command will it look for and apply the environment variables (such as VUE_APP_FILE_TYPE) in the environment configuration file. This is essentially setting a global variable identifier 'base64' for the current packaging environment for subsequent differential packaging judgments.
[0041] In this embodiment, the basic modeling process is initiated by running the modeling file command line. After identifying the target identifier of the embedded mode command line and obtaining the associated environment configuration file, the modeling is matched with the appropriate environment. Environment variables are identified according to preset rules to ensure the accuracy of environment parameters during the modeling process.
[0042] In one embodiment, either the regular build command or the inline mode command is pre-created in the Vue project. For example, a new script can be added to the unified management execution commands (scripts) in the Vue project's base configuration file (package.json) to distinguish between the two types of build commands. For instance, the regular build command is: "build":"vue-cli-servicebuild"; the inline mode command is: "build:64":"vue-cli-servicebuild--modebase64".
[0043] In one embodiment, the modeling files are differentially packaged according to file type and environment variables to obtain a static file directory, including: determining the file size of the modeling files when the environment variables represent the target mode; converting the modeling files into target program files of a first type of language according to the file size and file type of the modeling files; packaging the modeling files into an associated directory file when the environment variables represent a non-target mode; and combining the target program files and the associated directory files to obtain a static file directory.
[0044] The target method is an encoding method that converts binary data into plain text. For example, the target method is base64 encoding, and the encoded plain text contains 64 safe characters.
[0045] Specifically, when the environment variable represents a base64 encoding method, the binary modeling file can be converted into a base64 encoded string, and then the string can be converted into a target program file in a first-type language. Here, the first-type language is JavaScript, which is associated with the front-end page. This achieves the conversion of all resources, and subsequent access is no longer restricted by cross-domain security policies. Alternatively, after determining the file size of the modeling file, a modeling file that meets the preset size can be converted and embedded into a JavaScript target program file. When the environment variable represents a non-target method, the modeling file is directly packaged into the associated directory file corresponding to each file type.
[0046] In this embodiment, modeling files are processed differently depending on whether the environment variable is encoded in binary to plain text. If so, they are converted into target program files of the first type of language according to file size and type. Otherwise, they are packaged into the associated directory. Finally, the two types of files are integrated to form a static file directory, realizing file classification and standardized collection, and ensuring that the subsequent use of files is orderly and efficient.
[0047] In one embodiment, converting a modeling file into a target program file of a first type of language based on the file size and file type of the modeling file includes: when the file type is a 3D model file, determining whether the file size of the modeling file is less than a first preset value; if so, converting the modeling file into a first string associated with the target method; and converting the first string into a target program file of the first type of language.
[0048] The first preset value, for example, is 200KB, which is set by the user.
[0049] Specifically, there are generally two scenarios applicable to 3D model files. In the first scenario, when the file size of the modeling file is determined to be less than a preset value, the binary format 3D model file is directly converted into a plain text string, and then the string is converted into a target program file in a first-type language. When the target program file is JS code, i.e., the JavaScript script ultimately running in the browser, it is responsible for restoring the string to binary, which can then be rendered in 3D and displayed on the front-end page, avoiding additional HTTP requests. The second scenario is when directly embedding native C++ application software, where cross-domain issues must be strictly avoided (such as offline applications or local deployments without CDN). In this case, file size is not a concern; the file, such as a .glb file, is directly converted into a string, and then the string is converted into a target program file in a first-type language.
[0050] In this embodiment, for a modeling file of the 3D model type, it is first determined whether its size is less than a first preset value. If it is, it is first converted into a first string associated with the target method, and then the string is converted into a target program file of the first type language. This achieves targeted format conversion for small-volume 3D model files and provides an adaptation file for subsequent related program calls or processing.
[0051] In one embodiment, converting a modeling file into a target program file of a first type of language based on the file size and file type of the modeling file includes: when the file type is an image file, determining whether the file size of the modeling file is less than a second preset value; if so, converting the modeling file into a second string associated with the target method; and converting the second string into a target program file of the first type of language.
[0052] The second preset value is less than the first preset value; the second preset value is, for example, 10KB, and is preset by the user.
[0053] Specifically, for image files, if the modeling file size is less than a second preset value, the binary image file is directly converted into a plain text string, and then the string is converted into a target program file in a first-type language. When the target program file is JavaScript code (i.e., the JavaScript script ultimately running in the browser), it is responsible for restoring the string to binary, and finally, the image can be rendered and displayed on the front-end page, avoiding additional HTTP requests. Conversely, if the image file is larger than a certain size, it is directly packaged into an image directory file.
[0054] In this embodiment, for image-type modeling files, images smaller than the second preset value are embedded in the JS code to minimize unnecessary HTTP requests, thus achieving targeted processing of small-sized image files. Meanwhile, large images are packaged into an image directory file for centralized management, providing adaptation files for subsequent program calls.
[0055] In one embodiment, when the environment variable represents a non-target mode, packaging the modeling file into an associated directory file includes: when the file type is a 3D model file, packaging the modeling file into a resource directory file according to the resource copy rules in the packager, and referencing it through the resource address; when the file type is an image file, packaging the modeling file into an image directory file; when the file type is a font file, packaging the modeling file into a font library file.
[0056] The associated directory files include at least resource directory files, image directory files, and font library files. Resource directory files, such as the assets directory, are used to store various static resources that need to be used and to ensure that these resources are successfully referenced during project operation; the font library file is a subset font description file that converts the glyph information of, for example, the simplified version of Source Han Sans into JSON.
[0057] Specifically, when the file type is a 3D model file, it is output to a resource directory file according to resource copying rules such as those of the Webpack bundler (e.g., asset / resource rules), and referenced via an accessible address (URL). A URL reference simply uses an accessible address to point to a specific resource, instructing the browser to download the resource from that address. This is typically suitable for situations that support browser caching mechanisms, resulting in faster loading on repeated visits, and where the main package size is small. When the file type is an image file, the modeling file is packaged into an image directory file, and when the file type is a font file, the modeling file is packaged into the corresponding font library file.
[0058] In this embodiment, modeling files can be packaged differently according to file type. 3D model files are placed into the resource directory according to the resource copy rules of the packager and referenced by the resource address. Image files are placed into the image directory and font files are placed into the font library. This realizes the classification and orderly storage of different types of files, which facilitates accurate subsequent retrieval and retrieval and ensures the orderliness of file management and use.
[0059] In one embodiment, the modeling files are differentially packaged according to file type and environment variables to obtain a static file directory, including: when the environment variable represents the target method and the file type is a font file, the modeling files are packaged using web page text to obtain a static file directory; when the environment variable represents a non-target method and the file type is a compressed plugin file, the modeling files are compressed.
[0060] Specifically, for font files under the regular packaging command, the text can be packaged and rendered directly using the webpage text format. For compressed plugin files under the regular packaging command, the model compression process for the modeling file is performed, while for compressed plugin files under the embedded mode command, the model compression process for the modeling file is skipped. Therefore, font files and compressed plugin files are processed differently based on both environment variables and file type, achieving efficient processing by category and adapting to the needs of different user scenarios.
[0061] In one embodiment, based on the constructed bidirectional communication channel and the target program file, calling the target function corresponding to the second type of language includes: importing the target program file into the code library and determining the channel object associated with the initial function of the second type of language; triggering the front-end page to load the code library and mounting the channel object to the global interface object through the first channel; when a webpage update request is obtained, calling the global interface object and triggering the target function in the Qt server through the second channel.
[0062] Webpage update requests include, but are not limited to, update requests for native application software triggered by modeling files.
[0063] Specifically, the C++ side (Qt server) pre-encapsulates the initial functions and signals to be exposed in a class and attaches this class to the channel object (WebChannel). After the Qt browser imports the target program file into the codebase, the front-end page loads qwebchannel.js into index.html in the public folder and attaches the channel object to the global interface object (window.api) to expose the relevant APIs on the C++ side through the JavaScript code. Files in the public folder are copied intact to the final static file directory (dist package). index.html is the first file loaded when the browser opens the page and is responsible for importing global scripts. When a webpage update request is received, the global interface object is directly called, and the target function in the Qt server (C++ side) is triggered directly through the second channel. The Qt server receives the request, executes the function, and then returns the result to the front-end page.
[0064] In this embodiment, by importing the target program file into the code library and determining the channel object, the front-end loads the code library and then mounts the channel object to the global interface object through the first channel. When there is a webpage update request, the global interface object is called and the Qt server-side target function is triggered through the second channel, thus achieving the connection between the front-end and back-end and the server, and ensuring the efficient triggering of the target function when the webpage is updated.
[0065] In summary, for reference Figure 3 In some traditional methods, all resources are indiscriminately placed in a static file directory. This static file directory is only applicable to online environments with deployed Nginx, and access to the front-end HTML page is limited to a URL. Direct previewing of files within the static file directory is not possible, leading to security restrictions such as cross-domain errors and resource access denial. This application combines 3D industrial modeling with a hybrid technology architecture. Through base64 encoding, all modeling files requiring network requests in the "front-end" are embedded in the "back-end" C++ code, eliminating reliance on a server proxy. The resulting index.html file in the static file directory can be viewed by double-clicking. The offline static file directory can also be embedded into native C++ applications without cross-domain restrictions, solving the problem of offline viewing or interaction under intranet or extreme network conditions.
[0066] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0067] Based on the same inventive concept, this application also provides a device for constructing a three-dimensional industrial modeling environment to implement the above-described method for constructing a three-dimensional industrial modeling environment. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more embodiments of the device for constructing a three-dimensional industrial modeling environment provided below can be found in the limitations of the method for constructing a three-dimensional industrial modeling environment described above, and will not be repeated here.
[0068] In one embodiment, a device for constructing a 3D industrial modeling environment is provided, comprising: a modeling file acquisition module, a differentiated packaging module, and a two-way communication and invocation module, wherein: The modeling file acquisition module is used to acquire modeling files and determine their file types. File types include 3D model files, image files, compressed plugin files, and font files. It also parses environment variables from the modeling files according to preset configuration rules.
[0069] The differential packaging module is used to differentially package modeling files based on file type and environment variables to obtain a static file directory; the static file directory includes target program files of the first type of language.
[0070] The bidirectional communication and invocation module is used to invoke the target function corresponding to the second type of language based on the constructed bidirectional communication channel and the target program file, so as to render and present the industrial modeling environment through the target function.
[0071] The various modules in the construction of the aforementioned 3D industrial modeling environment can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0072] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores modeling files. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for constructing a 3D industrial modeling environment.
[0073] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0074] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0075] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0076] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the steps in the above method embodiments.
[0077] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0078] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0079] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for constructing a three-dimensional industrial modeling environment, characterized in that, The method includes: Obtain the modeling files and determine their file types; these file types include 3D model files, image files, compressed plugin files, and font files. The environment variables in the modeling file are parsed according to the preset configuration rules; Based on the file type and the environment variables, the modeling files are differentially packaged to obtain a static file directory; the static file directory includes target program files of the first type of language; Based on the constructed bidirectional communication channel and the target program file, the target function corresponding to the second type of language is called to render and present the industrial modeling environment through the target function.
2. The method according to claim 1, characterized in that, The step of parsing the environment variables in the modeling file according to preset configuration rules includes: Run the command lines in the modeling file; the command lines include at least regular packaging commands or embedded mode commands. Identify the target identifier in the embedded mode command line and obtain the associated environment configuration file based on the target identifier; the environment configuration file is pre-created in the project root directory; Based on preset configuration rules, the environment variables in the environment configuration file are identified.
3. The method according to claim 1, characterized in that, Based on the file type and the environment variables, the modeling files are differentially packaged to obtain a static file directory, including: When the environmental variable represents the target method, the file size of the modeling file is determined; the target method is an encoding method that converts binary data into plain text. Based on the file size and file type of the modeling file, the modeling file is converted into a target program file of a first type of language; When the environmental variables represent non-target methods, the modeling files are packaged into the associated directory file; By combining the target program file and the associated directory file, a static file directory is obtained.
4. The method according to claim 3, characterized in that, Based on the file size and file type of the modeling file, the modeling file is converted into a target program file in a first type of language, including: When the file type is a 3D model file, determine whether the file size of the modeling file is less than a first preset value; If so, the modeling file is converted into a first string associated with the target method; Convert the first string into a target program file of the first type of language.
5. The method according to claim 3, characterized in that, Based on the file size and file type of the modeling file, the modeling file is converted into a target program file in a first type of language, including: When the file type is an image file, determine whether the file size of the modeling file is less than a second preset value; the second preset value is less than a first preset value. If so, the modeling file is converted into a second string associated with the target method; Convert the second string into a target program file in the first type of language.
6. The method according to claim 3, characterized in that, The associated directory files include at least resource directory files, image directory files, and font library files; When the environmental variables represent a non-target mode, the modeling files are packaged into an associated directory file, including: When the file type is a 3D model file, the modeling file is packaged into a resource directory file according to the resource copy rules in the packager, and referenced by the resource address; When the file type is an image file, the modeling file is packaged into an image directory file; When the file type is a font file, the modeling file is packaged into a font library file.
7. The method according to claim 1, characterized in that, Based on the file type and the environment variables, the modeling files are differentially packaged to obtain a static file directory, including: When the environment variable represents the target method and the file type is a font file, the modeling file is packaged using web page text to obtain a static file directory; When the environment variable represents a non-target mode and the file type is a compressed plugin file, the model compression process of the modeling file is performed.
8. The method according to claim 1, characterized in that, The bidirectional communication channel includes a first channel between the front-end page and the Qt browser, and a second channel between the Qt browser and the Qt server; Based on the constructed bidirectional communication channel and the target program file, the target function corresponding to the second type of language is called, including: The target program file is imported into the code library, and the channel object associated with the initial function of the second type of language is identified; The front-end page is triggered to load the code library, and the channel object is mounted to the global interface object through the first channel; When a webpage update request is received, the global interface object is invoked and the target function in the Qt server is triggered through the second channel.
9. A device for constructing a three-dimensional industrial modeling environment, characterized in that, The device includes: The modeling file acquisition module is used to acquire modeling files and determine the file type of the modeling files; the file types include 3D model files, image files, compressed plugin files, and font files; and parses the environment variables in the modeling files according to preset configuration rules. A differentiated packaging module is used to differentiate and package the modeling files according to the file type and the environment variables to obtain a static file directory; the static file directory includes target program files of the first type of language; The bidirectional communication and invocation module is used to invoke the target function corresponding to the second type of language based on the constructed bidirectional communication channel and the target program file, so as to render and present the industrial modeling environment through the target function.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Static file packaging method and device, equipment and storage medium
CN116841608A
Method for assembling cross-platform full-stack application and medium
CN119473333A
Multi-version front-end language generation method and device based on environment variables
CN120216010A
File packaging method, apparatus and device, and storage medium
WO2020233057A1
