Model replacement method, device, equipment and medium applied to chemical process software
By replacing the high resource consumption model component in the three-dimensional model into the low resource consumption model component and performing spatial morphology adjustment, the problem of excessive resource consumption during the processing of the three-dimensional model is solved, and more efficient model processing is achieved.
Patent Information
- Application Number
- CN202411464051.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-10-21
AI Technical Summary
When processing a three-dimensional model, the number of model areas in the original model file is high, resulting in excessive consumption of computer resources during subsequent processing, and a method is needed to reduce resource consumption.
By obtaining the position coordinates and spatial morphology information of the first model component in the target model, it is replaced with a second model component with fewer computing resources, and adjusting the spatial morphology of the second model component based on the spatial morphology information of the first model component to obtain the locally replaced target model.
The computer resource consumption during operation of the three-dimensional model is reduced, making subsequent processing more efficient. At the same time, the adjusted spatial morphology of the model component is similar to the original first model component.
Smart Images

Figure CN118981381B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a model replacement method, device, equipment and medium applied to chemical process software. Background Art
[0002] When processing a three-dimensional model, the original model file has a high number of model faces. Subsequent processing based on the model (such as establishing an interactive 3D data twin system) will generate pressure on resource consumption. In this case, how to pre-process the three-dimensional model to reduce the computer resources consumed in subsequent operations on the three-dimensional model is a technical problem that needs to be solved urgently. Summary of the invention
[0003] The present invention provides a model replacement method, device, equipment and medium applied to chemical process software, which can reduce the computer resources consumed during model processing.
[0004] According to one aspect of the present invention, there is provided a model replacement method applied to chemical process software, the method comprising:
[0005] Obtaining position coordinates and spatial morphology information of a first model component in a target model;
[0006] At the position coordinates of the first model component in the target model, the first model component is replaced with a second model component; the computing resources required to run the first model component are greater than the computing resources required to run the second model component;
[0007] The spatial form of the second model component in the target model is adjusted based on the spatial form information of the first model component to obtain a target model after partial replacement.
[0008] According to another aspect of the present invention, there is provided a model replacement device applied to chemical process software, comprising:
[0009] A related information acquisition module for the first model component, used to acquire the position coordinates and spatial morphological information of the first model component in the target model;
[0010] a model component replacement module, configured to replace the first model component with a second model component at the position coordinate of the first model component in the target model; the computing resources required to run the first model component are greater than the computing resources required to run the second model component;
[0011] The spatial morphology adjustment module of the model component is used to adjust the spatial morphology of the second model component in the target model based on the spatial morphology information of the first model component to obtain the target model after partial replacement.
[0012] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the model replacement method applied to chemical process software described in any embodiment of the present invention.
[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the model replacement method applied to chemical process software described in any embodiment of the present invention when executed.
[0017] The technical solution of the embodiment of the present application includes: obtaining the position coordinates and spatial morphology information of the first model component in the target model; replacing the first model component with the second model component at the position coordinates of the first model component in the target model; the computing resources required to run the first model component are greater than the computing resources required to run the second model component; adjusting the spatial morphology of the second model component in the target model based on the spatial morphology information of the first model component to obtain a target model after partial replacement. This technical solution reduces the resource consumption requirements when the target model is subsequently processed by replacing the first model component in the target model with the second model component that requires fewer computing resources, and adjusts the spatial morphology information of the second model component in the target model after partial replacement to make it similar to the spatial morphology of the original first model component.
[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 It is a flow chart of a model replacement method applied to chemical process software provided according to the first embodiment of the present application;
[0021] Figure 2 It is a flow chart of a model replacement method applied to chemical process software provided in Example 2 of the present application;
[0022] Figure 3 It is a schematic diagram of a first model component and a second model component provided in Embodiment 2 of the present application, in which the first model component and the second model component are valves;
[0023] Figure 4 is a schematic diagram of a first model component in a selected state provided according to Embodiment 2 of the present application;
[0024] Figure 5 It is a schematic diagram of model replacement for a target application in chemical process software according to the second embodiment of the present application;
[0025] Figure 6 It is a structural schematic diagram of a model replacement device applied to chemical process software provided according to the third embodiment of the present application;
[0026] Figure 7 It is a structural schematic diagram of an electronic device for implementing a model replacement method applied to chemical process software according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only embodiments of a part of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", "target", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Embodiment 1
[0030] Figure 1A flowchart of a model replacement method applied to chemical process software is provided for the first embodiment of the present application. The embodiment of the present application is applicable to the case of replacing a valve model. The method can be executed by a model replacement device applied to chemical process software. The model replacement device applied to chemical process software can be implemented in the form of hardware and / or software. The model replacement device applied to chemical process software can be configured in an electronic device with data processing capabilities. Figure 1 As shown, the method includes:
[0031] S110, obtaining position coordinates and spatial morphology information of a first model component in the target model.
[0032] Among them, the target model can be a visualized three-dimensional image obtained by reading the data in the original model file. For example, the original model file is rendered using a certain three-dimensional model rendering software to obtain a visualized three-dimensional model, which is the target model. The target model includes at least one model component, and each model component together constitutes the target model. For example, the target model is an equipment and facility model of a factory, and the target model includes various model components such as valve models, pipeline models, and equipment models. The first model component is a model component that needs to be replaced. The number of faces of the first model component is high, and the computing resources required to render the first model component are relatively large. The rendering of the first model component will be affected in a scenario with limited computing power. For example, the first model component is a valve. The position coordinates are the coordinates of the first model component in the target model. The spatial morphological information reflects the appearance information of the first model component in three-dimensional space, such as size, rotation angle, etc.
[0033] Specifically, after formatting the original model file, a file format that can be processed by the three-dimensional model rendering software is obtained. The original model file after formatting is read by the three-dimensional model rendering software to obtain the target model. In a feasible solution, the user's click information on each model component in the target model is obtained. If the clicked model components are all model components of the same category, all clicked model components are determined as the first model component, and the position coordinates and spatial morphology information of the first model component are obtained; if the clicked model components are model components of multiple categories, a model component of one category is determined as the first model component, and the position coordinates and spatial morphology information of the first model component are obtained. For the clicked model components of other categories, the processing method is the same as the first model component. In another feasible solution, the number of faces of the model component can be identified, and the model component whose number of faces meets the face number threshold requirement is determined as the first model component.
[0034] It should be noted that the first model component may include multiple models of the same category. For example, if the first model component is a valve, it may include valve 1, valve 2, valve 3, etc., and each valve may be different.
[0035] S120, replacing the first model component with the second model component at the position coordinate of the first model component in the target model; the computing resources required to run the first model component are greater than the computing resources required to run the second model component.
[0036] The second model component is a model component corresponding to the first model component. The second model component and the first model component may be of the same type, for example, both are valves. The number of faces of the second model component may be less than that of the first model component.
[0037] Specifically, after determining the first model component, a second model component corresponding to the first model component is determined in a pre-established low-polygon model library, and the first model component is replaced with the second model component based on the position coordinates of the first model component.
[0038] S130, adjusting the spatial form of the second model component in the target model based on the spatial form information of the first model component to obtain a target model after partial replacement.
[0039] Specifically, each first model component has its own spatial form, and the spatial form of the second model component can be adjusted one-to-one based on the spatial form information of the first model component, such as adjusting the geometric size, rotation angle, etc. When adjusting the geometric size, only part of the second model component can be adjusted to eventually obtain the target model after partial replacement.
[0040] The technical solution of the embodiment of the present application includes: obtaining the position coordinates and spatial morphology information of the first model component in the target model; replacing the first model component with the second model component at the position coordinates of the first model component in the target model; the computing resources required to run the first model component are greater than the computing resources required to run the second model component; adjusting the spatial morphology of the second model component in the target model based on the spatial morphology information of the first model component to obtain a target model after partial replacement. This technical solution reduces the resource consumption requirements when the target model is subsequently processed by replacing the first model component in the target model with the second model component that requires fewer computing resources, and adjusts the spatial morphology information of the second model component in the target model after partial replacement to make it similar to the spatial morphology of the original first model component.
[0041] Embodiment 2
[0042] Figure 2This is a flow chart of a model replacement method applied to chemical process software provided in Example 2 of the present application. The embodiment of the present application is optimized based on the above embodiment.
[0043] like Figure 2 As shown, the method of the embodiment of the present application specifically includes the following steps:
[0044] S210, obtaining position coordinates and spatial morphology information of a first model component in the target model.
[0045] In an embodiment of the present application, the technical solution can be applied to a computer script, which can be embedded in a three-dimensional model rendering software to partially replace the target model after the three-dimensional model rendering software renders the target model.
[0046] The name information, position coordinates, etc. of the first model component can be read from the target model. The spatial form information of the first model component can be exported in a txt format in software that can run the original model file.
[0047] Specifically, a model file of a target format is exported in software that can run the original model file, and the target format may be fbx format, etc., to obtain a target model, obtain the name information of the first model component input by the user, determine the first model component in the target model based on the name information, and read the position coordinates of the first model component from the target model. In the txt document exported by the software that can run the original model file, the spatial morphology information of the first model component is read.
[0048] S220: Put at least two first model components in the target model into a first model set.
[0049] Specifically, the number of the first model components may be one or more. If the number of the first model components is multiple, all the first model components may be put into the first model set, and the number of the first model components in the first model set may be counted.
[0050] S230, determining a second model component corresponding to the first model component, and copying the second model component to obtain a target number of second model components; the target number is the number of first model components in the first model set.
[0051] In an embodiment of the present application, optionally, the process of determining the second model component includes: obtaining target type information of the first model component; based on a pre-established correspondence between the type information and the model component, identifying the second model component corresponding to the target type information; or, among all the first model components, determining the first model component with the least number of model faces as the model component to be processed; calculating the folding error of each edge of the model component to be processed and sorting the calculated folding errors; folding a preset number of edges in order of the folding errors from small to large, and determining the model component to be processed after the edges are folded as the first model component.
[0052] Specifically, in a feasible solution, a low-poly model library can be established in advance, in which the number of faces and mapping accuracy of the models are relatively low, and different model types have corresponding low-poly models. Specifically, after determining the first model component, the second model component is determined in the low-poly model library according to the type of the first model component. In another feasible solution, the second model component can be temporarily constructed, specifically: among all the first model components, the first model component with the least number of model faces is determined as the model component to be processed, the folding error of each edge of the model component to be processed is calculated and the calculated folding errors are sorted, and the first preset number of edges are folded in the order of the folding errors from small to large, and the model component to be processed after the edges are folded is determined as the first model component.
[0053] S240: Put all second model components into a second model set.
[0054] S250, mapping the position coordinates of the first model component in the first model set to the coordinates of the second model component in the second model set, and removing the coordinate data of the first model component in the first model set; the first model component and the second model component are in one-to-one correspondence.
[0055] In an embodiment of the present application, optionally, before mapping the position coordinates of the first model component in the first model set to the coordinates of the second model component in the second model set, the method also includes: switching the name of the second model component in the second model set to the name of the first model component.
[0056] Specifically, the first model set contains first model components that require more computing resources, the second model set contains second model components that require fewer computing resources, and the number of models in the two sets is the same. The names of the second model components in the second model set can be switched to the names of the first model components in sequence to obtain the second model components after the name change. At this time, since the names are replaced in sequence, the first model components and the second model components are one-to-one corresponding.
[0057] Specifically, based on the one-to-one correspondence between the first model component and the second model component, the position coordinates of the first model component in the first model set are mapped to the coordinates of the second model component in the second model set, thereby realizing model replacement. At this time, the coordinate data of the first model component in the first model set can also be removed to avoid the problem of two models appearing at the same coordinates.
[0058] This solution is set up so that in the target model, the coordinates of the first model component are replaced by the second model component, and the second model component has the same name as the original first model component, thereby achieving perfect replacement of the model and avoiding other problems that may occur in subsequent rendering of the target model.
[0059] S260: Adjust the spatial form of the second model component in the target model based on the spatial form information of the first model component to obtain a target model after partial replacement.
[0060] In an embodiment of the present application, optionally, the second model component in the target model is spatially adjusted in form based on the spatial form information of the first model component to obtain a target model after partial replacement, including: determining the spatial form information corresponding to the second model component according to a position coordinate mapping relationship between the first model component and the second model component and the spatial form information of the first model component; and adjusting the second model component in the target model in space based on the spatial form information corresponding to the second model component to obtain a target model after partial replacement.
[0061] Specifically, before adjusting the spatial form, the embodiment of the present application determines the first model component replaced by each second model component based on the position coordinate mapping relationship between the first model component and the second model component, and then adjusts the spatial form of the second model component in the target model based on the spatial form information of the replaced first model component, so that when adjusting the spatial form, the second model component can be adjusted to the spatial form of the first model component in the original position, avoiding the problem of adjustment errors that are prone to occur when there are a large number of models.
[0062] In an embodiment of the present application, optionally, the spatial morphology information includes: posture information and / or geometric information; accordingly, the spatial morphology of the second model component in the target model is adjusted based on the spatial morphology information of the first model component to obtain a target model after partial replacement, including: adjusting the rotation angle of the second model component in the target model based on the posture information of the first model component; and / or adjusting the model size of the second model component in the target model based on the geometric information of the first model component to obtain a target model after partial replacement.
[0063] In the embodiment of the present application, the spatial morphology information includes geometric size and rotation angle. For the geometric size, it can be the geometric size of the entire second model component or the geometric size of a part of the second model component. The size of the entire second model component can be adjusted or the size of a part of the second model component can be adjusted. The embodiment of the present application does not limit this. For the rotation angle, it can be the rotation angle in various directions such as horizontal and vertical directions. The embodiment of the present application does not limit the specific rotation axis.
[0064] The present solution is configured in such a way that the geometric size and the rotation angle of the second model component can be completely the same as the geometric size and the rotation angle of the first model component.
[0065] In an embodiment of the present application, optionally, the first model component and the second model component are valves; the model size of the second model component in the target model is adjusted based on the geometric information of the first model component, including: obtaining a first nominal diameter of the first model component; adjusting the valve port size of the second model component in the target model according to the first nominal diameter to obtain a partially adjusted second model component.
[0066] Specifically, when the first model component and the second model component are valves, the first nominal diameter of the first model component can be obtained, and the valve opening size of the second model component in the target model can be adjusted based on the first nominal diameter to obtain the second model component after partial adjustment. This scheme is set up in this way, so that when the replacement model is a valve, since the valve and other models are connected by a pipeline, the valve opening size is adjusted in a targeted manner, so that the connection with the pipeline is more natural and the replacement effect is better.
[0067] The technical solution of the embodiment of the present application establishes a first model set for placing the first model component and a second model set for placing the second model component, and replaces the names and position coordinates of the model components in the two sets. This allows multiple models to be quickly replaced when multiple models need to be replaced, saves replacement time, and improves user experience.
[0068] In a specific example, Figure 3 It is a schematic diagram of a first model component and a second model component being valves, wherein the grey valve is the first model component and the green valve is the second model component. Figure 4 It is a schematic diagram of a first model component being in a selected state, wherein the valve with a blue edge is the first model component. Figure 5 The figure is a schematic diagram of a model replacement targeted for application in chemical process software, wherein the green valve is a second model component that has been replaced.
[0069] Embodiment 3
[0070] Figure 6 This is a schematic diagram of the structure of a model replacement device for chemical process software provided in the third embodiment of the present application. The device can execute the model replacement method for chemical process software provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. Figure 6 As shown, the device comprises:
[0071] The first model component related information acquisition module 310 is used to acquire the position coordinates and spatial morphology information of the first model component in the target model;
[0072] A model component replacement module 320 is used to replace the first model component with a second model component at the position coordinate of the first model component in the target model; the computing resources required to run the first model component are greater than the computing resources required to run the second model component;
[0073] The model component spatial morphology adjustment module 330 is used to adjust the spatial morphology of the second model component in the target model based on the spatial morphology information of the first model component to obtain a target model after partial replacement.
[0074] The technical solution of the embodiment of the present application includes: a first model component related information acquisition module 310, which is used to obtain the position coordinates and spatial morphology information of the first model component in the target model; a model component replacement module 320, which is used to replace the first model component with the second model component at the position coordinates of the first model component in the target model; the computing resources required to run the first model component are greater than the computing resources required to run the second model component; a model component spatial morphology adjustment module 330, which is used to adjust the spatial morphology of the second model component in the target model based on the spatial morphology information of the first model component to obtain a target model after partial replacement. This technical solution reduces the resource consumption requirements when the target model is subsequently processed by replacing the first model component in the target model with the second model component that requires fewer computing resources, and adjusts the spatial morphology information of the second model component in the target model after partial replacement to make it similar to the spatial morphology of the original first model component.
[0075] In the embodiment of the present application, optionally, the device further includes:
[0076] A first model set determination module, used to put at least two first model components in the target model into a first model set;
[0077] a second model component duplication module, used to determine a second model component corresponding to the first model component, and to duplicate the second model component to obtain a target number of second model components; the target number is the number of first model components in the first model set;
[0078] A second model set determination module, used to put all second model components into a second model set;
[0079] Accordingly, the model component replacement module 320 includes:
[0080] A model component replacement unit is used to map the position coordinates of the first model component in the first model set to the coordinates of the second model component in the second model set, and remove the coordinate data of the first model component in the first model set; the first model component and the second model component are in one-to-one correspondence.
[0081] In the embodiment of the present application, optionally, the device further includes:
[0082] A name switching module is used to switch the name of the second model component in the second model set to the name of the first model component.
[0083] In the embodiment of the present application, optionally, the spatial form adjustment module 330 of the model component includes:
[0084] a spatial form information determining unit, configured to determine the spatial form information corresponding to the second model component according to the position coordinate mapping relationship between the first model component and the second model component and the spatial form information of the first model component;
[0085] The spatial morphology adjustment unit is used to adjust the spatial morphology of the second model component in the target model based on the spatial morphology information corresponding to the second model component to obtain the target model after partial replacement.
[0086] In the embodiment of the present application, optionally, the spatial morphology information includes: posture information and / or geometric information;
[0087] Accordingly, the spatial form adjustment module 330 of the model component includes:
[0088] The spatial morphology adjustment unit of the model component is used to adjust the rotation angle of the second model component in the target model based on the posture information of the first model component; and / or adjust the model size of the second model component in the target model based on the geometric information of the first model component to obtain the target model after partial replacement.
[0089] In the embodiment of the present application, optionally, the first model component and the second model component are valves;
[0090] The spatial form adjustment unit of the model component includes:
[0091] A nominal diameter acquisition subunit, used to acquire a first nominal diameter of the first model component;
[0092] The valve port size adjustment subunit is used to adjust the valve port size of the second model component in the target model according to the first nominal diameter to obtain a partially adjusted second model component.
[0093] In the embodiment of the present application, optionally, the device further includes: a second model component determination module, specifically configured to:
[0094] Obtaining target type information of the first model component; based on a pre-established correspondence between type information and model components, identifying a second model component corresponding to the target type information; or,
[0095] Among all the first model components, determining the first model component with the least number of model faces as the model component to be processed;
[0096] Calculate the folding error of each edge of the model component to be processed and sort the calculated folding errors;
[0097] A preset number of edges are folded in the order of folding errors from small to large, and the model component to be processed after the edge folding is determined as the first model component.
[0098] A model replacement device applied to chemical process software provided in an embodiment of the present application can execute a model replacement method applied to chemical process software provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0099] Embodiment 4
[0100] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0101] like Figure 7As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0102] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0103] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a model replacement method applied to chemical process software.
[0104] In some embodiments, the model replacement method applied to chemical process software can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the model replacement method applied to chemical process software described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the model replacement method applied to chemical process software in any other appropriate manner (for example, by means of firmware).
[0105] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0106] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0107] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0108] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0109] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0110] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0111] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0112] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A model replacement method applied to chemical process software, characterized in that: include: Obtaining position coordinates and spatial morphology information of a first model component in a target model; The target model is a visualized three-dimensional image obtained after reading the data in the original model file; At the position coordinates of the first model component in the target model, the first model component is replaced with a second model component; the computing resources required to run the first model component are greater than the computing resources required to run the second model component; Adjusting the spatial form of the second model component in the target model based on the spatial form information of the first model component to obtain a target model after partial replacement; Wherein, before replacing the first model component with the second model component at the position coordinate of the first model component in the target model, the method further includes: Putting at least two first model components in the target model into a first model set; Determine a second model component corresponding to the first model component, and copy the second model component to obtain a target number of second model components; the target number is the number of first model components in the first model set; putting all second model components into a second model collection; Accordingly, at the position coordinate of the first model component in the target model, the first model component is replaced with the second model component, including: Mapping the position coordinates of the first model component in the first model set to the coordinates of the second model component in the second model set, and removing the coordinate data of the first model component in the first model set; the first model component and the second model component are in one-to-one correspondence; The step of adjusting the spatial form of the second model component in the target model based on the spatial form information of the first model component to obtain the target model after partial replacement includes: Determine the spatial morphology information corresponding to the second model component according to the position coordinate mapping relationship between the first model component and the second model component and the spatial morphology information of the first model component; Adjusting the spatial form of the second model component in the target model based on the spatial form information corresponding to the second model component to obtain a target model after partial replacement; Wherein, the spatial morphology information includes: posture information and / or geometric information; Correspondingly, adjusting the spatial form of the second model component in the target model based on the spatial form information of the first model component to obtain the target model after partial replacement includes: The rotation angle of the second model component in the target model is adjusted based on the posture information of the first model component; and / or the model size of the second model component in the target model is adjusted based on the geometric information of the first model component to obtain a target model after partial replacement.
2. The method according to claim 1, characterized in that Before mapping the position coordinates of the first model component in the first model set to the coordinates of the second model component in the second model set, the method further includes: The name of the second model component in the second model set is switched to the name of the first model component.
3. The method according to claim 1, characterized in that The first model component and the second model component are valves; The adjusting the model size of the second model component in the target model based on the geometric information of the first model component includes: Obtaining a first nominal diameter of the first model component; The valve port size of the second model component in the target model is adjusted according to the first nominal diameter to obtain a partially adjusted second model component.
4. The method according to claim 1, characterized in that: The process of determining the second model component includes: Obtaining target type information of the first model component; based on a pre-established correspondence between type information and model components, identifying a second model component corresponding to the target type information; or, Among all the first model components, determining the first model component with the least number of model faces as the model component to be processed; Calculate the folding error of each edge of the model component to be processed and sort the calculated folding errors; A preset number of edges are folded in the order of folding errors from small to large, and the model component to be processed after the edge folding is determined as the first model component.
5. A model replacement device applied to chemical process software, characterized in that: include: A related information acquisition module for the first model component, used to acquire the position coordinates and spatial morphological information of the first model component in the target model; The target model is a visualized three-dimensional image obtained after reading the data in the original model file; a model component replacement module, configured to replace the first model component with a second model component at the position coordinate of the first model component in the target model; the computing resources required to run the first model component are greater than the computing resources required to run the second model component; A spatial morphology adjustment module for a model component, configured to adjust the spatial morphology of a second model component in a target model based on the spatial morphology information of the first model component to obtain a target model after partial replacement; The device also includes: A first model set determination module, used to put at least two first model components in the target model into a first model set; a second model component duplication module, used to determine a second model component corresponding to the first model component, and to duplicate the second model component to obtain a target number of second model components; the target number is the number of first model components in the first model set; A second model set determination module, used to put all second model components into a second model set; Accordingly, the model component replacement module includes: a model component replacement unit, configured to map the position coordinates of the first model component in the first model set to the coordinates of the second model component in the second model set, and remove the coordinate data of the first model component in the first model set; the first model component and the second model component are in one-to-one correspondence; Wherein, the spatial form adjustment module of the model component includes: a spatial form information determining unit, configured to determine the spatial form information corresponding to the second model component according to the position coordinate mapping relationship between the first model component and the second model component and the spatial form information of the first model component; A spatial form adjustment unit, configured to adjust the spatial form of the second model component in the target model based on the spatial form information corresponding to the second model component, so as to obtain a target model after partial replacement; Wherein, the spatial morphology information includes: posture information and / or geometric information; Accordingly, the spatial form adjustment module of the model component includes: The spatial morphology adjustment unit of the model component is used to adjust the rotation angle of the second model component in the target model based on the posture information of the first model component; and / or adjust the model size of the second model component in the target model based on the geometric information of the first model component to obtain the target model after partial replacement.
6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the model replacement method applied to chemical process software as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the model replacement method for chemical process software according to any one of claims 1 to 4 when executed.
Citation Information
Patent Citations
Three-dimensional modeling method and device
CN112884887A
Model simplification method and device, terminal equipment and readable storage medium
CN114491914A