Physical model medium updating method and device, electronic equipment and storage medium

By receiving the target component's medium parameters selected by the user, identifying the connector and output port, and automatically updating the medium parameters of the component to be propagated, the problem of cumbersome and error-prone medium parameter settings in traditional fluid system modeling is solved, achieving efficient, accurate, and consistent updates of medium parameters.

CN121637784APending Publication Date: 2026-03-10SUZHOU TONGYUAN SOFT CONTROL INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511741436.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In traditional fluid system modeling, setting medium parameters is cumbersome and prone to errors, making it difficult to ensure the consistency of the medium in the system.

Method used

By receiving the target component media parameters selected by the user, identifying the connector and output port, and automatically updating the media parameters of the component to be propagated, the consistency of media parameters is ensured.

Benefits of technology

This improves the efficiency and accuracy of updating medium parameters, ensuring the consistency of medium parameters in the physical model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121637784A_ABST
    Figure CN121637784A_ABST
Patent Text Reader

Abstract

The invention discloses a physical model medium updating method and device, electronic equipment and a storage medium, and relates to the field of fluid systems. The method comprises the steps that target medium parameters of a target component selected by a user in a physical model are received, and current medium parameters of the target component are updated. Wherein the physical model comprises at least one system component and a connector between the system components in a connection relationship; identifying at least one first connector connected with the target assembly; according to the output port of each first connector, acquiring a system component with the output port of each first connector in the physical model, and determining the system component as a to-be-propagated component corresponding to each first connector; and updating the current medium parameter of each to-be-propagated component according to the target medium parameter. According to the embodiment of the invention, the medium parameters of the components in the system can be quickly and accurately transmitted.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of fluid systems, and in particular to a physical model medium updating method and device, an electronic device, and a storage medium. BACKGROUND

[0002] In the process of Modelica-based system modeling, fluid systems such as hydraulic or thermal systems often involve multiple medium parameters.

[0003] Traditional modeling methods require users to set medium parameters for each component one by one, which is tedious and prone to errors, and it is difficult to ensure the consistency of the medium in the system. SUMMARY

[0004] The present application provides a physical model medium updating method and device, an electronic device, and a storage medium, which can quickly and accurately transfer medium parameters of components in a system.

[0005] According to an aspect of the present application, a physical model medium updating method is provided, the method comprising:

[0006] receiving target medium parameters of a target component selected by a user in a physical model, and updating current medium parameters of the target component, wherein the physical model comprises at least one system component and connectors between system components having a connection relationship;

[0007] identifying at least one first connector connected to the target component;

[0008] According to the output ports of each first connector, acquiring system components having the output ports of each first connector in the physical model, and determining corresponding to-be-propagated components for each first connector;

[0009] updating current medium parameters of each to-be-propagated component according to the target medium parameters.

[0010] According to another aspect of the present application, a physical model medium updating device is provided, the device comprising:

[0011] a target medium updating module configured to receive target medium parameters of a target component selected by a user in a physical model, and update current medium parameters of the target component, wherein the physical model comprises at least one system component and connectors between system components having a connection relationship;

[0012] a connector identification module configured to identify at least one first connector connected to the target component;

[0013] The propagation component determination module is used to obtain system components that have the output ports of each of the first connectors in the physical model based on the output ports of each of the first connectors, and determine them as the propagation components corresponding to each of the first connectors.

[0014] The media transmission update module is used to update the current media parameters of each of the components to be propagated according to the target media parameters.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] At least one processor; and

[0017] A memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the physical model media update method according to any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the physical model media update method according to any embodiment of the present invention.

[0020] The technical solution of this invention updates the current medium parameters of the target component when the user specifies the medium parameters of the target component as the target medium parameters, and queries the components with output ports by identifying the connectors of the target medium and the output ports of the connectors, and uses these components as the components to be propagated, updating the current medium parameters of the components to be propagated to the target medium parameters. This achieves the transmission and updating of the medium parameters of the components to be propagated connected to the target component, solving the problems of low efficiency and high error rate of manually setting medium parameters one by one in the prior art. It can improve the update efficiency and accuracy of medium parameters in the physical model and ensure the consistency of the updated medium parameters.

[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart of a physical model media update method provided by an embodiment of the present invention;

[0024] Figure 2 This is a flowchart of another physical model medium update method provided by an embodiment of the present invention;

[0025] Figure 3 This is a schematic diagram of a configuration panel for component parameters of a system component in a physical model provided according to an embodiment of the present invention;

[0026] Figure 4 This is a scene diagram of a physical model media update method provided in an embodiment of the present invention;

[0027] Figure 5 This is a schematic diagram of a physical model provided according to an embodiment of the present invention;

[0028] Figure 6 This is a schematic diagram of a physical model media updating device according to an embodiment of the present invention;

[0029] Figure 7 This is a schematic diagram of the structure of an electronic device that implements the physical model media update method of the present invention. Detailed Implementation

[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] Figure 1 This is a flowchart illustrating a physical model media update method provided in an embodiment of the present invention. This embodiment is applicable to situations where the media of components in a physical model are updated. The method can be executed by a physical model media update device, which can be implemented in hardware and / or software. This device can be configured in an electronic device, which can be a server or a client. The client can include: mobile phones, tablets, laptops, desktop computers, vehicle terminals, or wearable devices, etc.

[0033] See Figure 1 The physical model medium update method shown includes:

[0034] S101. Receive the target medium parameters of the target component selected by the user in the physical model, and update the current medium parameters of the target component, wherein the physical model includes at least one system component and connectors between system components that are connected.

[0035] The physical model refers to a simulation model based on a physical fluid system. The operating principle of the physical model is consistent with the fluid flow principles in the real world. The physical model includes system components and connectors. System components can be modules abstracted with specific functions. A system component can correspond to a physical device or a physical system. Connectors can be connection modules between system components. Connectors can be connecting wires. In the physical model, the fluid medium flows between the various system components. The medium parameters of the target component can refer to the parameters of the medium passing through the target component. In some embodiments, the medium parameters can include the type of medium. For example, the medium parameters can also include the specific volume or density of the medium. The current medium parameters can refer to the medium parameters existing in the target component at the current moment. The current medium parameters can be updated to the target medium parameters, thus updating the current medium parameters.

[0036] In some embodiments, the physical model is the Modelica model, which is an equation-based physical system modeling language designed for complex systems across multiple domains and supports co-simulation of multiple domains such as mechanical, electrical, hydraulic or thermal.

[0037] S102, Identify at least one first connector to which the target component is connected.

[0038] The target component can exist independently or be connected to at least one connector. When the target component exists independently, i.e., it has no connected connectors, steps S102-S104 do not need to be executed; only the current medium parameters of the target component need to be updated. When the target component has at least one connected connector, each connected connector is considered a first connector, and it is necessary to determine whether to pass the target medium parameters to other system components in the physical model. In some embodiments, the topological relationship between target components can be obtained in the physical model, and the existence of connected first connectors, the number of connected first connectors, and their identifiers can be identified from the topological relationship.

[0039] S103. Based on the output ports of each of the first connectors, obtain the system components that have the output ports of each of the first connectors in the physical model, and determine them as the components to be propagated corresponding to each of the first connectors.

[0040] In the physical model, system components are connected to connectors via ports. The physical model's topology actually includes: system component-port-connector. Media transmission in the physical model is directional, and this direction is unidirectional. In the system component-port-connector structure, the positions of the system component and connector can be interchanged. The direction of media flow is determined by the port, which has a unidirectional direction. The port's direction can be either input or output. Input direction indicates media flow from the system component to the connector, and output direction indicates media flow from the connector to the system component. In some embodiments, there is a one-to-one correspondence between the ports of a system component and the connectors. In some embodiments, ports with the same direction can be reused, and connectors connected to ports with the same direction can be connected together to a port with the same direction, reducing the number of ports and the complexity of the physical model.

[0041] The connector's output port indicates the flow of media from the connector to the system component. A system component with an output port of the first connector can also refer to a system component with an input port identical to the output port of the first connector. The component to be propagated can be a system component whose media parameters are consistent with those of the target component. The component to be propagated is essentially the system component from which the media flows from the target component. The connector's input port indicates that the media flows from the target component to the connector, and the connector's output port indicates that the media flows from the connector to the system component.

[0042] In some embodiments, the physical model does not record the connection relationships between system components and connectors, nor the connection relationships between system components; the physical model only records the ports possessed by system components and the ports possessed by connectors. Based on whether connectors and system components have the same ports, it can be determined whether connectors and system components are connected, thereby indirectly determining the connection relationships between system components.

[0043] S104. Update the current medium parameters of each of the components to be propagated according to the target medium parameters.

[0044] In this process, the medium flowing from the target component is directed to the component to be propagated. Therefore, the medium parameters of the target component and the component to be propagated are consistent; that is, the current medium parameters of the target component and the current medium parameters of the component to be propagated are the same. The current medium parameters of the component to be propagated can be updated to match the target medium parameters. When the component to be propagated is not empty, its current medium parameters are updated. When the component to be propagated is empty, its current medium parameters are not updated.

[0045] In an optional embodiment, the physical model includes: a simulation model of the physical system of fluid transport, and the target medium parameters include: the switched fluid type.

[0046] The fluid may include liquids or gases. In some embodiments, the physical model is a simulation model of an automotive thermal system, and the medium parameters may include the fluid type. For example, the medium parameters may include oxygen, hydrogen, methane, carbon dioxide, or nitrogen.

[0047] It is evident that by applying the physical model to the simulation scenario of a physical system for fluid transport and configuring the target medium parameter as the fluid type, the medium parameter configuration in the physical model can be quickly configured in the simulation scenario of physical systems that require a large amount of medium, such as hydraulic systems or thermal systems, thus simplifying the efficiency of medium parameter update.

[0048] The technical solution of this invention updates the current medium parameters of the target component when the user specifies the medium parameters of the target component as the target medium parameters, and queries the components with output ports by identifying the connectors of the target medium and the output ports of the connectors, and uses these components as the components to be propagated, updating the current medium parameters of the components to be propagated to the target medium parameters. This achieves the transmission and updating of the medium parameters of the components to be propagated connected to the target component, solving the problems of low efficiency and high error rate of manually setting medium parameters one by one in the prior art. It can improve the update efficiency and accuracy of medium parameters in the physical model and ensure the consistency of the updated medium parameters.

[0049] In an optional embodiment, after determining the component to be propagated corresponding to each of the connectors, the method further includes: obtaining at least one second connector connected to each of the components to be propagated; and for each component to be propagated, obtaining system components with output ports of each of the second connectors in the physical model based on the output ports of each of the second connectors, and determining them as components to be propagated corresponding to each of the first connectors.

[0050] In reality, fluid can flow from the component to be propagated to other system components. Therefore, the component to be propagated, directly determined by the target component, may not be the endpoint of the medium parameter transfer, but rather an intermediate node. Based on the component to be propagated, we can further determine whether there are any indirect components to be propagated.

[0051] Each component to be propagated can be traversed and processed individually. For each component to be propagated, the same method used to determine the target component is employed to identify the second connector connected to that component. The input ports of each system component are obtained, and system components with input ports that are identical to the output ports of each second connector are queried. These system components are then designated as propagation components of the target component, as propagation components corresponding to the second connector, and as propagation components corresponding to the first connector that forms the target component, thereby increasing the number of propagation components for the target component.

[0052] It is evident that by expanding the query to include components that can be propagated through the medium, based on the component to be propagated, and adding components to be propagated from the target component, the range of system components whose medium parameters are consistent with those of the target component can be accurately determined, thereby improving the accuracy of system components propagated through the medium.

[0053] Figure 2 This is a flowchart of a physical model media update method provided by an embodiment of the present invention. Based on the above embodiments, this embodiment of the present invention obtains system components in the physical model that have the output ports of each of the first connectors, and determines them as components to be propagated corresponding to each of the first connectors. Specifically, this involves: obtaining port attribute information of the system components in the physical model; and determining that the system component is a component to be propagated corresponding to each of the first connectors when the port attribute information of the system component corresponds to the output port of at least one first connector.

[0054] It should be noted that for parts not described in detail in the embodiments of the present invention, please refer to the descriptions in other embodiments.

[0055] See Figure 2 The physical model medium update method shown includes:

[0056] S201. Receive the target medium parameters of the target component selected by the user in the physical model, and update the current medium parameters of the target component, wherein the physical model includes at least one system component and connectors between system components that are connected.

[0057] S202, Identify at least one first connector to which the target component is connected.

[0058] S203. Obtain the port attribute information of the system components in the physical model.

[0059] Port attribute information can refer to the attribute information of ports on system components. Port attribute information may include at least one of the following: the identifier of the port on the system component, the port orientation, and the port type.

[0060] S204. When the port attribute information of the system component corresponds to the output port of at least one first connector, the system component is determined to be the component to be propagated corresponding to each first connector.

[0061] The information of the output port of the first connector may include at least one of the following: the identifier of the output port, the direction of the port, and the type of the port. In some embodiments, the correspondence between the port attribute information of the system component and the output port of the first connector may mean that the identifier of the port connected to the system component is the same as the identifier of a certain output port of the first connector, and among the two ports with the same identifier, the direction of the port connected to the system component is input, and the direction of the output port of the first connector is output. In some embodiments, the correspondence between the port attribute information of the system component and the output port of the first connector may mean that the identifier of the port connected to the system component is the same as the identifier of a certain output port of the first connector. In fact, the port attribute information of the system component may include multiple ports, the first connector may connect to multiple output ports, and there may be multiple first connectors. As long as there is one port of the system component that corresponds to the output port of a certain first connector, the system component can be identified as the component to be propagated.

[0062] In some embodiments, the port attribute information includes: port A, with the direction being an input port. The output port information of the first connector includes: port A, with the direction being an output port. For example, if the port attribute information includes port A, and the output port includes port A, it can be determined that the port attribute information of the system component corresponds to the output port of at least one first connector. As another example, if the port attribute information includes port A, with the direction being input, and the output port includes port A, with the direction being output, it can be determined that the port attribute information of the system component corresponds to the output port of at least one first connector.

[0063] S205. Update the current medium parameters of each of the components to be propagated according to the target medium parameters.

[0064] This invention matches the port attribute information of system components in the physical model with the output port information of each first connector. When the port attribute information of a system component corresponds to the information of a certain output port of a first connector, the system component is identified as the component to be propagated. This can accurately identify the system component connected to the port of the first connector and improve the identification accuracy of the component to be propagated.

[0065] In an optional embodiment, identifying at least one first connector connected to the target component includes: obtaining port attribute information of the target component; obtaining port attribute information of the connector in the physical model; and determining each connector as a first connector connected to the target component when the port attribute information of the target component corresponds to the port attribute information of at least one connector.

[0066] In some embodiments, the correspondence between the port attribute information of the target component and the port attribute information of the connector may mean that the output port information of the target component corresponds to the input port information of the connector, or that the identifier of a port of the target component is the same as the identifier of a certain port of the connector, and that the port direction in the port attribute information of the target component is output, while the port direction of the connector is input. In some embodiments, the correspondence between the port attribute information of the target component and the port attribute information of the connector may mean that the output port information of the target component corresponds to the input port information of the connector, or that the identifier of a port of the target component is the same as the identifier of a certain port of the connector.

[0067] If a connector corresponding to the port attribute information exists, that connector is identified as the first connector connected to the target component. The target component is connected to at least one first connector. Alternatively, the target component may not have a connected first connector.

[0068] As can be seen, by matching the port attribute information of the target component in the physical model with the port attribute information of each connector, when the port attribute information of the target component corresponds to the port attribute information of a certain connector, the connector is identified as the first connector connected to the target component. This can accurately identify the first connector connected to the port of the target component and improve the identification accuracy of the first connector.

[0069] In an optional embodiment, updating the current medium parameters of each of the components to be propagated according to the target medium parameters includes: when the component to be propagated is a nested component, obtaining the port attribute information of the system component in the nested component; when the port attribute information of the system component in the nested component corresponds to the output port of at least one first connector, determining that the system component is the component to be propagated corresponding to each of the first connectors; and updating the current medium parameters of each of the components to be propagated according to the target medium parameters.

[0070] Nested components refer to a system formed by multiple interconnected system components and connectors. A nested component includes multiple system components. Externally, a nested component appears as a single system component. When the nested component is expanded, the topology of the system components and connectors within it is displayed. Externally, the nested component appears as a component to be propagated. Simultaneously, there is a path within the nested component connecting to the external first connector; therefore, at least one system component within the nested component is a component to be propagated. If the port attribute information of a system component within the nested component corresponds to the output port of at least one first connector, that system component is determined to be the component to be propagated corresponding to that first connector. In practice, for the internal system components of a nested component, internal system components whose media parameters are consistent with those of the target component can be detected and used as components to be propagated. This allows for the detection of components to be propagated even with complex hierarchical nested components.

[0071] In some embodiments, a nested component contains multiple system components. Within the nested component, fluid can flow from the component to be propagated to other system components. Therefore, the component to be propagated, directly determined by the target component, may not be the endpoint of the medium parameter transmission, but rather an intermediate node. Based on the component to be propagated, it can be further determined whether there are any indirect components to be propagated within the nested component.

[0072] Obtain at least one second connector connected to each component to be propagated within the nested component; for each component to be propagated, based on the output port of each second connector, obtain the system component with the output port of each second connector in the physical model, and determine it as the component to be propagated corresponding to each first connector.

[0073] It can iterate through each component to be propagated within a nested component, processing each component individually. For each component to be propagated, the same method used to determine the target component determines the second connector connected to it. The input ports of each system component are obtained, and system components with input ports matching the output ports of each second connector are identified. These are then designated as components to be propagated within the target component, as components corresponding to the second connector, and as components corresponding to the first connector forming the target component, thus increasing the number of components to be propagated within the target component. This process is repeated.

[0074] As can be seen, by targeting nested component scenarios, the system components inside the nested components can be port-matched with the first connector to obtain the components to be propagated inside the nested components, and the media parameters of the components to be propagated inside can be updated. This allows for media updates for components with complex hierarchies, improving the accuracy of media updates.

[0075] In an optional embodiment, updating the current media parameters of the target component includes: querying the model identifier corresponding to the sub-model corresponding to the target component based on the identification information of the target component; querying the model attribute information of the sub-model based on the model identifier corresponding to the sub-model; and updating the current media parameters of the target component when it is determined that the model attribute information of the sub-model includes a redeclarable field.

[0076] In this context, the target component can refer to an instantiated sub-model. The physical model includes multiple sub-models. Sub-models are instantiated to form system components. Connectors are instantiated from sub-models to form connectors. The model identifier differs from the component identifier of the system component. The model identifier identifies uninstantiated models, while the component identifier identifies instantiated models, i.e., system components. Model attribute information is typically immutable. Port attribute information can be configured by the user and is modifiable. Redeclarable fields indicate that the sub-model can redeclare the definition of the system component. When a sub-model has redeclarable fields, it indicates that the medium parameters in that sub-model can be updated. When a sub-model does not have redeclarable fields, it indicates that the medium parameters in that sub-model cannot be updated. When the sub-model corresponding to the target component has redeclarable fields, the current medium parameters of the target component can be updated. When the sub-model corresponding to the target component does not have redeclarable fields, the current medium parameters of the target component cannot be updated.

[0077] In some implementation sets, for the component to be propagated, the model identifier corresponding to the sub-model of the component to be propagated is queried based on the identifier information of the component to be propagated; the model attribute information of the sub-model of the component to be propagated is queried based on the model identifier corresponding to the sub-model of the component to be propagated; when it is determined that the model attribute information of the sub-model of the component to be propagated includes a field that can be redeclared, the current medium parameters of the component to be propagated are updated.

[0078] As can be seen, by updating the current medium parameters of the target component to the target medium parameters when the sub-model of the target component has redeclarable fields, the redeclarable fields can be used to control whether the medium parameters can be updated, thereby achieving fine-grained control over the transmission of medium parameters, avoiding illegal updates and modifications to the physical model, and improving the security of the physical model.

[0079] In an optional embodiment, identifying at least one first connector connected to a target component includes: obtaining a key of the target component; and identifying at least one first connector connected to the target component when the key of the target component satisfies an existence condition. The existence condition is used to determine whether the target component exists. For example, the existence condition is that the key is not 0; when the key is not 0, it is determined that the key of the target component satisfies the existence condition; when the key is 0, it is determined that the key of the target component does not satisfy the existence condition.

[0080] In one scenario, the physical model is the Modelica model. Users can select target components within the Modelica model's graphical interface. The configuration panel for the target component's parameters is as follows: Figure 3 As shown, users select the target medium parameter from the medium parameter dropdown menu to update the current medium parameter of the target component. Specifically, when a user selects the target medium parameter in the component parameter panel, medium transfer can be triggered. First, medium transfer path identification is performed: all connectors connected to the target component and the components to be propagated connected to the connectors are automatically identified, and Modelica semantics is used to determine which components to be propagated have the ability to redeclare the medium attribute. Second, automatic medium type transfer is performed: all connected components are traversed along the connection path, and their medium types are uniformly updated to the new medium type to ensure the consistency of the medium in the physical model. Third, a recursive transfer mechanism is performed: based on the Modelica modeling specification, it supports cross-component and cross-level medium transfer, suitable for system models with complex topologies. Fourth, a medium transfer switch mechanism is performed: based on the Modelica specification, an automatic medium transfer switch is designed, which can be used to quickly control whether the medium of the entire system is automatically transferred by toggling the MediumTransfer parameter in the top-level Package (folder) of the Modelica model.

[0081] Figure 4This is a flowchart illustrating a physical model media update method provided in an embodiment of the present invention. Specifically, it addresses... Figure 5 The physical model shown includes system components and connectors. Each system component has ports (triangles) connected to connectors (wires). The directions of the ports and the transmission directions of the connectors are indicated by arrows; the port at the tail of the arrow represents the output, and the port at the head of the arrow represents the input. Specifically, the physical model media update method may include:

[0082] S401, Received that the user has manually changed the media parameters of the target component.

[0083] The function retrieves the media replacement and propagation information, extracting the identifier of the selected component, the identifier of the redeclared sub-model, and the type of the replaced media. It also retrieves the identifier of the target component, the identifier of its corresponding sub-model (i.e., the identifier of the redeclared sub-model), and the target medium parameter of the target component (which is the type of the replaced media).

[0084] S402. Determine whether the redeclared sub-model can be redeclared. If yes, execute S403; otherwise, return.

[0085] If a submodel has fields that can be redeclared, then the submodel being redeclared is determined to be redeclarable. If a submodel does not have fields that can be redeclared, then the submodel being redeclared is determined not to be redeclarable.

[0086] S403, Redeclare the media type of the sub-model of the target component.

[0087] Redeclaring the media type actually updates the current media parameters of the target component to the target media parameters.

[0088] S404. Obtain the component key based on the identification information of the target component.

[0089] The component key is used to determine whether the component exists.

[0090] S405. Check if the component key is not 0. If it is not 0, execute S406; otherwise, return.

[0091] S406. In the physical model, obtain all connectors.

[0092] S407. Check if the connector list is not empty. If it is, execute S408; otherwise, return.

[0093] An empty connector list indicates that no connectors exist in the physical model, and no further checks are needed when no connectors are present. A non-empty connector list indicates that connectors exist in the physical model.

[0094] S408. Traverse all connectors in the physical model and obtain the connector's attribute information. If the port identifier in the connector's attribute information matches the port identifier in the target component's port attribute information, save this connector to the list of connectors to be propagated and use it as the first connector.

[0095] S409. Check if the list of connectors to be propagated is not empty. If it is, execute S410; otherwise, return.

[0096] An empty connector list indicates that the first connector of the target component does not exist in the physical model, and no further judgment is needed when the first connector of the target component does not exist. A non-empty connector list indicates that the first connector of the target component exists in the physical model.

[0097] S410. Based on the list of connectors to be propagated, obtain all ports connected to these connectors and store them in the port list.

[0098] S411. Obtain the system component corresponding to the port based on the port list and store it in the list of components to be propagated.

[0099] S412. Iterate through the list of components to be propagated in the previous step, and execute S413 for each element.

[0100] For each component to be propagated, determine whether it can be redeclared. If the component can be redeclared, update its current media parameters to the target media parameters. If the component cannot be redeclared, do not update its current media parameters. Based on the component to be propagated, further determine whether the component exists, and recursively propagate the media parameters accordingly.

[0101] S413. Determine if the traversal has ended. If yes, return; otherwise, execute S402 again for each traversed element (i.e., the component to be propagated).

[0102] The physical model media update method provided in this invention can automatically transfer media, greatly simplifying the steps of modifying media content in complex Modelica physical models. In this method, the physical model can be loaded and any media container can be found. The type of media in the container can be switched via a parameter panel, and all corresponding media associated with the selected component in the physical model automatically complete the media switching. This invention achieves media transfer based on a connection graph: automatically transferring media types using a component connection graph; it uses a dynamic replacement mechanism for redeclarable models: identifying and replacing redeclarable media classes in the model at runtime; it ensures the semantic integrity and consistency of the system model during media transfer through recursive traversal and consistency maintenance, achieving high efficiency and consistency: avoiding omissions or errors caused by manually setting media, ensuring system media consistency; it offers strong usability: users only need to modify one media, and the system automatically completes the global transfer; it achieves semantic compliance: strictly following the Modelica language specification and compatible with existing model libraries; and it achieves scalability: supporting complex system structures with multiple levels and branches.

[0103] Figure 6 This is a schematic diagram of a physical model media update device provided in an embodiment of the present invention. The present invention is applicable to situations where the media of components in a physical model are updated. This device can execute a physical model media update method and can be implemented in hardware and / or software. The device can be configured in an electronic device, which may be a server.

[0104] See Figure 6 The physical model media update device shown includes:

[0105] The target medium update module 601 is used to receive the target medium parameters of the target component selected by the user in the physical model, and update the current medium parameters of the target component. The physical model includes at least one system component and connectors between system components that are connected.

[0106] Connector identification module 602 is used to identify at least one first connector connected to the target component;

[0107] The propagation component determination module 603 is used to obtain system components that have the output ports of each of the first connectors in the physical model based on the output ports of each of the first connectors, and determine them as the propagation components corresponding to each of the first connectors.

[0108] The media transmission update module 604 is used to update the current media parameters of each of the components to be propagated according to the target media parameters.

[0109] The technical solution of this invention updates the current medium parameters of the target component when the user specifies the medium parameters of the target component as the target medium parameters, and queries the components with output ports by identifying the connectors of the target medium and the output ports of the connectors, and uses these components as the components to be propagated, updating the current medium parameters of the components to be propagated to the target medium parameters. This achieves the transmission and updating of the medium parameters of the components to be propagated connected to the target component, solving the problems of low efficiency and high error rate of manually setting medium parameters one by one in the prior art. It can improve the update efficiency and accuracy of medium parameters in the physical model and ensure the consistency of the updated medium parameters.

[0110] Optionally, the propagation component determination module 603 is specifically used for:

[0111] Obtain the port attribute information of the system components in the physical model;

[0112] When the port attribute information of the system component corresponds to the output port of at least one first connector, the system component is determined to be the component to be propagated corresponding to each first connector.

[0113] Optionally, the connector identification module 602 is specifically used for:

[0114] Obtain the port attribute information of the target component;

[0115] Obtain the port attribute information of the connector in the physical model;

[0116] When the port attribute information of the target component corresponds to the port attribute information of at least one connector, each connector is determined to be the first connector connected to the target component.

[0117] Optionally, the media transfer update module 604 is specifically used for:

[0118] When the component to be propagated is a nested component, obtain the port attribute information of the system component in the nested component;

[0119] When the port attribute information of the system component in the nested component corresponds to the output port of at least one first connector, the system component is determined to be the component to be propagated corresponding to each first connector;

[0120] The current medium parameters of each component to be propagated are updated according to the target medium parameters.

[0121] Optionally, the target media update module 601 is specifically used for:

[0122] Based on the identification information of the target component, query the model identifier corresponding to the sub-model of the target component;

[0123] Based on the model identifier corresponding to the sub-model, query the model attribute information of the sub-model;

[0124] When it is determined that the model attribute information of the sub-model includes fields that can be redeclared, the current media parameters of the target component are updated.

[0125] Optionally, the physical model media update device also includes: an extended propagation module, used for:

[0126] After determining the component to be propagated corresponding to each of the first connectors, at least one second connector connected to each of the components to be propagated is obtained.

[0127] For each of the components to be propagated, based on the output port of each of the second connectors, the system components with the output ports of each of the second connectors are obtained in the physical model and determined as the components to be propagated corresponding to each of the first connectors.

[0128] Optionally, the physical model includes: a simulation model of the physical system of fluid transport, and the target medium parameters include: the fluid type after switching.

[0129] The physical model media update device provided in this embodiment of the invention can execute the physical model media update method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.

[0130] The acquisition, storage, and application of data involved in the technical solutions of this invention comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0131] Figure 7 A schematic diagram of an electronic device 700 that can be used to implement embodiments 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 processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0132] like Figure 7As shown, the electronic device 700 includes at least one processor 701 and a memory, such as a read-only memory (ROM) 702 and a random access memory (RAM) 703, communicatively connected to the at least one processor 701. The memory stores computer programs executable by the at least one processor. The processor 701 can perform various appropriate actions and processes based on the computer program stored in the ROM 702 or loaded into the RAM 703 from storage unit 708. The RAM 703 can also store various programs and data required for the operation of the electronic device 700. The processor 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0133] Multiple components in electronic device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of displays, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows electronic device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0134] Processor 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 701 performs the various methods and processes described above, such as the physical model media update method.

[0135] In some embodiments, the physical model media update method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by processor 701, one or more steps of the physical model media update method described above may be performed. Alternatively, in other embodiments, processor 701 may be configured to perform the physical model media update method by any other suitable means (e.g., by means of firmware).

[0136] 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-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0137] Computer programs used to implement 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, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0138] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0139] To provide interaction with a user, the systems and techniques described herein can 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 pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0140] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0141] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability.

[0142] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0143] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A physical model medium updating method characterized by comprising: The method comprises: receiving a target medium parameter of a target component selected by a user in a physical model, and updating a current medium parameter of the target component, wherein the physical model comprises at least one system component and connectors between system components having a connection relationship; identifying at least one first connector connected to the target component; acquiring, according to an output port of each first connector, a system component having the output port of each first connector in the physical model, and determining a to-be-propagated component corresponding to each first connector; updating a current medium parameter of each to-be-propagated component according to the target medium parameter.

2. The method of claim 1, wherein, The acquiring, according to an output port of each first connector, a system component having the output port of each first connector in the physical model, and determining a to-be-propagated component corresponding to each first connector, comprises: acquiring port attribute information of a system component in the physical model; when the port attribute information of the system component corresponds to an output port of at least one first connector, determining that the system component is the to-be-propagated component corresponding to each first connector.

3. The method of claim 1, wherein, The identifying at least one first connector connected to the target component comprises: acquiring port attribute information of the target component; acquiring port attribute information of a connector in the physical model; when the port attribute information of the target component corresponds to the port attribute information of at least one connector, determining that each connector is the first connector connected to the target component.

4. The method of claim 1, wherein, The updating a current medium parameter of each to-be-propagated component according to the target medium parameter comprises: when the to-be-propagated component is a nested component, acquiring port attribute information of a system component in the nested component; when the port attribute information of the system component in the nested component corresponds to an output port of at least one first connector, determining that the system component is the to-be-propagated component corresponding to each first connector; updating a current medium parameter of each to-be-propagated component according to the target medium parameter.

5. The method of claim 1, wherein, The updating a current medium parameter of the target component comprises: querying a model identifier corresponding to a sub-model corresponding to the target component according to identification information of the target component; querying model attribute information of the sub-model according to the model identifier corresponding to the sub-model; when it is determined that the model attribute information of the sub-model comprises a redeclarable field, updating the current medium parameter of the target component.

6. The method of claim 1, wherein, After determining the to-be-propagated component corresponding to each first connector, the method further comprises: acquiring at least one second connector connected to each to-be-propagated component; for each to-be-propagated component, acquiring, according to an output port of each second connector, a system component having the output port of each second connector in the physical model, and determining the to-be-propagated component corresponding to each first connector.

7. The method of claim 1, wherein, The physical model comprises a simulation model of a physical system of fluid transmission, and the target medium parameter comprises a switched fluid type.

8. A physical model medium updating apparatus characterized by comprising: The device comprises: The target medium updating module is configured to receive a target medium parameter of a target component selected by a user in a physical model, and update a current medium parameter of the target component, wherein the physical model comprises at least one system component and a connector between system components having a connection relationship; The connector identifying module is configured to identify at least one first connector connected to the target component; The propagation component determining module is configured to, according to an output port of each first connector, acquire, in the physical model, a system component having the output port of each first connector, and determine a to-be-propagated component corresponding to each first connector; The medium transmission updating module is configured to update a current medium parameter of each to-be-propagated component according to the target medium parameter.

9. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected to the at least one processor in communication; 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 to enable the at least one processor to execute the physical model medium updating method in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, and the computer instructions are used to enable the processor to implement the physical model medium updating method in any one of claims 1-7 when executed.