Dynamic memory management method and product of thermal hydraulic system analysis software

Through dynamic memory management methods, the storage space of hydraulic components in thermal hydraulic system analysis software is monitored and adjusted in real time, which solves the memory shortage caused by fixed modeling, and realizes the software's memory controllable and stable operation.

CN118981374APending Publication Date: 2024-11-19CHINA NUCLEAR POWER TECH RES INST CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411012990.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-11-19

AI Technical Summary

Technical Problem

When thermal hydraulic system analysis software adopts fixed modeling, the large system established by users will lead to insufficient memory and there is a risk of memory overflow, especially when a large number of components need to be added.

Method used

Using a dynamic memory management method, the hydraulic components are stored through the first storage space and their changes are monitored in real time, a second storage space is established to match the changed storage space size, and the storage space is dynamically adjusted to avoid memory overflow.

Benefits of technology

The memory controllable of thermal hydraulic system analysis software is achieved, avoiding the risk of memory overflow, and ensuring that the software can operate stably when adding or deleting components.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981374A_ABST
    Figure CN118981374A_ABST
Patent Text Reader

Abstract

The invention provides a dynamic memory management method and product of thermal hydraulic system analysis software, and relates to the field of communication software. The method comprises the steps that hydraulic components are stored through the first storage space; monitoring the hydraulic component; under the condition that the hydraulic component is changed, a second storage space is established, and the size of the second storage space is matched with the size of the storage space required by the changed hydraulic component; storing the target hydraulic component through the second storage space; under the condition that the first hydraulic component is added, the target hydraulic component is the hydraulic component and the first hydraulic component; under the condition that the second hydraulic component is deleted, the target hydraulic component is the hydraulic component except the second hydraulic component in the hydraulic components. Therefore, the dynamic management of the memory of the thermal hydraulic system analysis software can be realized by monitoring the change condition of the hydraulic component and adjusting the storage space in a targeted manner according to different change conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication and software, and in particular to a method and product for dynamic memory management of thermal hydraulic system analysis software. Background Art

[0002] Since thermal hydraulic analysis programs started early, some programs use a fixed modeling method for program analysis. Existing modeling methods generally store all data in a memory pool called fast, and access the memory through the control body or the number of the takeover. And when the fast memory pool is opened, the size of the memory pool is directly specified. If the system established by the user is too large, the program will prompt that there is insufficient memory and cannot run. Therefore, for thermal hydraulic system analysis software, if modeling is performed using a fixed modeling method, then when a large number of components need to be added, it will cause insufficient memory in the software and there is a risk of memory overflow. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a method and product for dynamic memory management of thermal-hydraulic system analysis software, so that the thermal-hydraulic system analysis software can implement dynamic memory management.

[0004] In a first aspect, an embodiment of the present application provides a method for dynamic memory management of thermal hydraulic system analysis software, the method comprising:

[0005] The hydraulic components in the thermal hydraulic system analysis software are stored in the first storage space;

[0006] Monitor hydraulic components in thermal hydraulic system analysis software;

[0007] In the case where the hydraulic components in the thermal hydraulic system analysis software are changed, a second storage space is established, wherein the size of the second storage space matches the size of the storage space required by the changed hydraulic components in the thermal hydraulic system analysis software;

[0008] storing the target hydraulic component via the second storage space;

[0009] Among them, when the change is to add the first hydraulic component, the target hydraulic component is the hydraulic component stored in the first storage space and the first hydraulic component; when the change is to delete the second hydraulic component, the target hydraulic component is the hydraulic component stored in the first storage space except the second hydraulic component.

[0010] In some embodiments, after monitoring the hydraulic components in the thermal-hydraulic system analysis software, the method further comprises:

[0011] In the case where the hydraulic components in the thermal hydraulic system analysis software are changed, the index of the second type of hydraulic components corresponding to the first type of hydraulic components in the thermal hydraulic system analysis software is updated, wherein in the thermal hydraulic system analysis software, the first type of hydraulic components need to be linked to the second type of hydraulic components;

[0012] Traversing the serial numbers of the second-category hydraulic components in the thermal hydraulic system analysis software, and determining whether there is a serial number having a value equal to the index of the second-category hydraulic component corresponding to the third hydraulic component, wherein the third hydraulic component is any hydraulic component of the first-category hydraulic components;

[0013] When there is no number equal to the index value of the second-category hydraulic component corresponding to the third hydraulic component in the numbering of the second-category hydraulic components in the thermal-hydraulic system analysis software, an error prompt message is output, and the error prompt message is used to prompt that the third hydraulic component has not successfully established a link with the second-category hydraulic component.

[0014] In some embodiments, updating the index of the second type of hydraulic components corresponding to the first type of hydraulic components in the thermal hydraulic system analysis software includes:

[0015] Obtaining a first serial number of a second-category hydraulic component corresponding to an i-th hydraulic component in the first-category hydraulic component, wherein i is a natural number;

[0016] Obtaining the second serial number of the i-th hydraulic component in the second type of hydraulic components;

[0017] comparing the first number and the second number;

[0018] When the first number and the second number are the same, the value of the index of the second type of hydraulic component corresponding to the i-th hydraulic component in the first type of hydraulic components is updated to the value of the second number.

[0019] In some embodiments, updating the index of the second type of hydraulic components corresponding to the first type of hydraulic components in the thermal hydraulic system analysis software includes:

[0020] Obtain the first name of the second-category hydraulic component corresponding to the i-th hydraulic component in the first-category hydraulic component, where i is a natural number;

[0021] Obtain the third number and the second name of the i-th hydraulic component in the second category of hydraulic components;

[0022] comparing the first name to the second name;

[0023] When the first name and the second name are the same, the value of the index of the second-category hydraulic component corresponding to the i-th hydraulic component in the first-category hydraulic component is updated to the value of the third number.

[0024] In some embodiments, the first type of hydraulic component is a nozzle or a thermal member, and the second type of hydraulic component is a control body;

[0025] In the case where the first type of hydraulic components are nozzles, the second type of hydraulic components corresponding to the i-th hydraulic component in the first type of hydraulic components include: an upstream control body and a downstream control body of the i-th nozzle of the thermal hydraulic system analysis software;

[0026] In the case where the first type of hydraulic components are thermal components, the second type of hydraulic components corresponding to the i-th hydraulic component in the first type of hydraulic components include: a left boundary control volume and a right boundary control volume of the i-th thermal component of the thermal-hydraulic system analysis software.

[0027] In some implementations, after establishing the second storage space, the method further includes:

[0028] In the case where the change is to add a first hydraulic component, constructing a first structure corresponding to the first hydraulic component;

[0029] storing component information of the first hydraulic component and component information of the linked component of the first hydraulic component in a first structure;

[0030] The first structure is stored in the second storage space.

[0031] In some embodiments, after storing the target hydraulic component in the second storage space, the method further includes:

[0032] Release the memory of the first storage space.

[0033] In a second aspect, an embodiment of the present application provides a device for dynamic memory management of thermal hydraulic system analysis software, the device comprising:

[0034] A first storage space storage module is used to store hydraulic components in the thermal hydraulic system analysis software through the first storage space;

[0035] Hydraulic component monitoring module, used to monitor hydraulic components in thermal hydraulic system analysis software;

[0036] A second storage space establishment module, used to establish a second storage space when a hydraulic component in the thermal hydraulic system analysis software is changed, wherein the size of the second storage space matches the storage space size required by the changed hydraulic component in the thermal hydraulic system analysis software;

[0037] The second storage space storage module is used to store target hydraulic components through the second storage space; wherein, in the case of changing to adding the first hydraulic component, the target hydraulic components are the hydraulic components stored in the first storage space and the first hydraulic components; wherein, in the case of changing to deleting the second hydraulic component, the target hydraulic components are the hydraulic components stored in the first storage space except the second hydraulic components.

[0038] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0039] a memory configured to store instructions; and

[0040] The processor is configured to call the instructions from the memory and to implement the method for dynamic memory management of thermal-hydraulic system analysis software provided in the first aspect of the embodiment of the present application when executing the instructions.

[0041] In a fourth aspect, an embodiment of the present application provides a machine-readable storage medium having instructions stored thereon, the instructions being used to enable a machine to execute the method for dynamic memory management of thermal-hydraulic system analysis software provided in the first aspect of the embodiment of the present application.

[0042] In the embodiment of the present application, first, the hydraulic components in the thermal hydraulic system analysis software are stored in the first storage space. The hydraulic components in the thermal hydraulic system analysis software are monitored in real time; when the hydraulic components in the thermal hydraulic system analysis software are changed, a second storage space is established, and the size of the second storage space matches the size of the storage space required by the changed hydraulic components in the thermal hydraulic system analysis software. Finally, the target hydraulic components are stored in the second storage space. Among them, when the change is to add the first hydraulic component, the target hydraulic components are the hydraulic components stored in the first storage space and the first hydraulic components; when the change is to delete the second hydraulic component, the target hydraulic components are the hydraulic components stored in the first storage space except the second hydraulic components. In this way, by monitoring the changes of the hydraulic components in the thermal hydraulic system analysis software in real time and adjusting the storage space of the thermal hydraulic system analysis software in a targeted manner according to different changes, the dynamic management of the memory of the thermal hydraulic system analysis software can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a flowchart of a method for dynamic memory management of thermal hydraulic system analysis software provided in an embodiment of the present application;

[0044] Figure 2 It is a flowchart of a method for dynamic memory management of thermal hydraulic system analysis software provided in a specific embodiment of the present application;

[0045] Figure 3 It is a schematic diagram of a user modeling node provided by a specific embodiment of the present application;

[0046] Figure 4 is a schematic diagram of data storage provided by a specific embodiment of the present application;

[0047] Figure 5 It is a structural schematic diagram of a device for dynamic memory management of thermal hydraulic system analysis software provided in an embodiment of the present application;

[0048] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0050] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0051] In conjunction with the accompanying drawings, the method, device and electronic device for dynamic memory management of thermal-hydraulic system analysis software provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.

[0052] See also Figure 1 , is a flow chart of a method for dynamic memory management of thermal hydraulic system analysis software provided in an embodiment of the present application, and the method is applied to electronic equipment. Figure 1 As shown, the method for dynamic memory management of the thermal hydraulic system analysis software includes the following steps S100 to S400.

[0053] Step S100: storing hydraulic components in thermal hydraulic system analysis software in a first storage space.

[0054] In the embodiment of the present application, the thermal hydraulic system analysis software mainly takes the fluid of the reactor as the research object, and analyzes the flow, heat transfer and other characteristics of the reactor thermal hydraulics.

[0055] The first storage space may be understood as the current storage space of the thermal hydraulic system analysis software, and is used to store hydraulic components and related information of the components in the thermal hydraulic system analysis software.

[0056] In the embodiment of the present application, the hydraulic component can be understood as a virtual component, that is, a model constructed by a user for the hydraulic component. The hydraulic component can include but is not limited to a control body, a pipe, and a thermal component.

[0057] Step S200: monitoring hydraulic components in thermal hydraulic system analysis software.

[0058] Step S300: when the hydraulic components in the thermal-hydraulic system analysis software are changed, a second storage space is established, wherein the size of the second storage space matches the size of the storage space required by the changed hydraulic components in the thermal-hydraulic system analysis software.

[0059] In the embodiment of the present application, the thermal hydraulic system analysis software may be LOCUST 1.2. LOCUST 1.2 is a system analysis software developed based on a two-fluid six-equation model. The thermal hydraulic system analysis software can monitor the status of hydraulic components in the software through user input.

[0060] When it is detected that the user inputs / deletes hydraulic components (or constructs a hydraulic model), changes in the hydraulic components in the thermal-hydraulic system analysis software are detected, and a second storage space is established.

[0061] The second storage space is used to store the changed hydraulic components in the thermal hydraulic system analysis software. The memory size of the second storage space matches the storage space size required by the changed hydraulic components in the thermal hydraulic system analysis software, which can be specifically expressed as: the memory size of the second storage space is equal to the required storage space size.

[0062] The difference between the second storage space and the first storage space includes but is not limited to different memory sizes and different hydraulic components stored, etc. The specific memory size of the second storage space can be determined according to the storage space size required by the changed hydraulic component.

[0063] In some embodiments, when it is detected that a hydraulic component is added to the thermal-hydraulic system analysis software, a second storage space is established whose memory is larger than the first storage space and matches the storage space size required by the changed hydraulic component.

[0064] In other embodiments, when it is detected that a hydraulic component is deleted in the thermal-hydraulic system analysis software, a second storage space is established with a memory smaller than the first storage space and matching the storage space size required by the changed hydraulic component.

[0065] Step S400: storing the target hydraulic component in the second storage space. In the case of adding the first hydraulic component, the target hydraulic component is the hydraulic component stored in the first storage space and the first hydraulic component; in the case of deleting the second hydraulic component, the target hydraulic component is the hydraulic component stored in the first storage space except the second hydraulic component.

[0066] In the embodiment of the present application, the target hydraulic component can be understood as the changed hydraulic component. After the second storage space is established, the target hydraulic component is stored in the second storage space to complete the memory management of the changed hydraulic component.

[0067] In some embodiments, when the first hydraulic component is added, the target hydraulic component may be the hydraulic component stored in the first storage space and the first hydraulic component. The first hydraulic component may be understood as a newly added hydraulic component, and the first hydraulic component may include one hydraulic component or multiple hydraulic components.

[0068] In other embodiments, when the second hydraulic component is changed to be deleted, the target hydraulic component may be a hydraulic component other than the second hydraulic component among the hydraulic components stored in the first storage space. The second hydraulic component may be understood as the deleted hydraulic component, and the second hydraulic component may include one hydraulic component or multiple hydraulic components.

[0069] Through the above steps S100-S400, first, the hydraulic components in the thermal hydraulic system analysis software are stored in the first storage space. The hydraulic components in the thermal hydraulic system analysis software are monitored in real time; when the hydraulic components in the thermal hydraulic system analysis software are changed, a second storage space is established, and the size of the second storage space matches the size of the storage space required by the changed hydraulic components in the thermal hydraulic system analysis software. Finally, the target hydraulic components are stored in the second storage space. Among them, when the change is to add the first hydraulic component, the target hydraulic components are the hydraulic components stored in the first storage space and the first hydraulic components; when the change is to delete the second hydraulic component, the target hydraulic components are the hydraulic components stored in the first storage space except the second hydraulic components. In this way, by monitoring the changes of the hydraulic components in the thermal hydraulic system analysis software in real time and adjusting the storage space of the thermal hydraulic system analysis software in a targeted manner according to different changes, the software running memory can be controlled without the risk of overflow, thereby realizing the dynamic management of the memory of the thermal hydraulic system analysis software.

[0070] In some embodiments, after monitoring the hydraulic components in the thermal-hydraulic system analysis software, the method further comprises:

[0071] In the case where the hydraulic components in the thermal hydraulic system analysis software are changed, the index of the second type of hydraulic components corresponding to the first type of hydraulic components in the thermal hydraulic system analysis software is updated, wherein in the thermal hydraulic system analysis software, the first type of hydraulic components need to be linked to the second type of hydraulic components;

[0072] Traversing the serial numbers of the second-category hydraulic components in the thermal hydraulic system analysis software, and determining whether there is a serial number having a value equal to the index of the second-category hydraulic component corresponding to the third hydraulic component, wherein the third hydraulic component is any hydraulic component of the first-category hydraulic components;

[0073] When there is no number equal to the index value of the second-category hydraulic component corresponding to the third hydraulic component in the numbering of the second-category hydraulic components in the thermal-hydraulic system analysis software, an error prompt message is output, and the error prompt message is used to prompt that the third hydraulic component has not successfully established a link with the second-category hydraulic component.

[0074] In the embodiment of the present application, each hydraulic component has a structure corresponding to it. The structure corresponding to the hydraulic component can be used to store the component information of the hydraulic component, and further, it can also be used to store the component information of the linked component of the hydraulic component. The component information of the component may include but is not limited to the parameter information, number, index, etc. of the component.

[0075] In some embodiments, the control body structure may store parameters such as the upstream connection number, the downstream connection number, and the connection index. The connection structure may store parameters such as the connection upstream control body number, the connection downstream control body number, the connection upstream control body index, the connection downstream control body index, the connection upstream connection surface, and the connection downstream connection surface. The thermal component structure may store the left boundary control body number and the right boundary control body number.

[0076] In the embodiment of the present application, for the components that need to be linked in the thermal hydraulic system analysis software, the link query between the components can be realized by associating the component information corresponding to these components, such as the component information of the component itself, the component information of the linked component of the component, etc., so as to determine whether the link relationship of the components in the thermal hydraulic system analysis software is correct, and then determine whether the hydraulic model in the thermal hydraulic system analysis software is consistent with the hydraulic model input by the user, so as to ensure the correctness of the hydraulic model in the thermal hydraulic system analysis software. In one embodiment, the hydraulic model is the hydraulic component input by the user.

[0077] Based on this, when the hydraulic components in the thermal-hydraulic system analysis software are changed, the component information corresponding to the hydraulic components in the thermal-hydraulic system analysis software can be updated to perform link queries between components.

[0078] In this embodiment, the first-class hydraulic components and the second-class hydraulic components are components that need to be linked by the thermal-hydraulic system analysis software. The first-class hydraulic components are associated with the numbers of the second-class hydraulic components through the index of the corresponding second-class hydraulic components, but this does not limit the form of expression of the associated component information. Specifically, if the index of the second-class hydraulic component corresponding to the hydraulic component 1 in the first-class hydraulic components is equal to the number of the hydraulic component 2 in the second-class hydraulic components, it means that hydraulic component 1 and hydraulic component 2 are linked; if the index of the second-class hydraulic component corresponding to the hydraulic component 1 in the first-class hydraulic components is not equal to the numbers of all the second-class hydraulic components, it means that hydraulic component 1 is not linked to the second-class hydraulic components. Therefore, when the hydraulic components in the thermal-hydraulic system analysis software are changed, the index of the second-class hydraulic component corresponding to the first-class hydraulic component can be updated to perform link queries between components.

[0079] Specifically, the first type of hydraulic components may be pipes or thermal components, and the second type of hydraulic components may be control bodies.

[0080] In some embodiments, the first type of hydraulic components may include a take-over pipe, and the second type of hydraulic components may include a control body. The control body corresponding to the take-over pipe may include a take-over upstream control body and a take-over downstream control body. The index of the second type of hydraulic components corresponding to the first type of hydraulic components in the thermal hydraulic system analysis software is updated, that is, the index of the take-over upstream control body or the take-over downstream control body corresponding to the take-over pipe is updated.

[0081] In some embodiments, the first type of hydraulic components may include thermal components, and the second type of hydraulic components may include control volumes. The control volumes corresponding to the thermal components may include left boundary control volumes and right boundary control volumes. The index of the second type of hydraulic components corresponding to the first type of hydraulic components in the thermal hydraulic system analysis software is updated, i.e., the index of the left boundary control volume or the right boundary control volume corresponding to the thermal components is updated.

[0082] After the index update is completed, the numbers of the second-category hydraulic components in the thermal hydraulic system analysis software are traversed to determine whether there is a number equal to the value of the index of the second-category hydraulic component corresponding to the third hydraulic component. The third hydraulic component can be understood as any hydraulic component in the first-category hydraulic component. Taking the third hydraulic component as a takeover as an example, the numbers of each control body are traversed to determine whether there is a number equal to the value of the takeover upstream control body index or the takeover downstream control body index corresponding to the takeover.

[0083] When the numbers of the second hydraulic components in the thermal hydraulic system analysis software are traversed, if there is no number in the second hydraulic component numbers that is equal to the index value of the second hydraulic component corresponding to the third hydraulic component, it means that the third hydraulic component and the second hydraulic component are not successfully linked. At this time, an error prompt message is output, and the error prompt message is used to prompt the user that the third hydraulic component has not successfully established a link with the second hydraulic component.

[0084] By updating the component index and establishing links between components when hydraulic components in the thermal hydraulic system analysis software are changed, the association between components can be enhanced. It can also find unreferenced control bodies and prompt users, improving the convenience of modeling error correction.

[0085] In some embodiments, updating the index of the second type of hydraulic components corresponding to the first type of hydraulic components in the thermal hydraulic system analysis software includes:

[0086] Obtaining a first serial number of a second-category hydraulic component corresponding to an i-th hydraulic component in the first-category hydraulic component, wherein i is a natural number;

[0087] Obtaining the second serial number of the i-th hydraulic component in the second type of hydraulic components;

[0088] comparing the first number and the second number;

[0089] When the first number and the second number are the same, the value of the index of the second type of hydraulic component corresponding to the i-th hydraulic component in the first type of hydraulic components is updated to the value of the second number.

[0090] The i-th hydraulic component in the first category of hydraulic components and the i-th hydraulic component in the second category of hydraulic components belong to different categories. In one example, the i-th hydraulic component in the first category of hydraulic components may be the i-th pipe or the i-th thermal component; the i-th hydraulic component in the second category of hydraulic components may be the i-th control body.

[0091] In this embodiment, when the index of the second type of hydraulic components corresponding to the first type of hydraulic components is updated, the update may be performed based on the serial number.

[0092] In a specific implementation, the first number of the second type of hydraulic components corresponding to the i-th hydraulic component in the first type of hydraulic components and the second number of the i-th hydraulic component in the second type of hydraulic components can be obtained respectively, wherein the first number and the second number are only used to distinguish the two numbers, and are not used to describe a specific order or sequence. The first number may include multiple numbers, for example, the first number may include the number of the upstream control body and the number of the downstream control body.

[0093] When the first number and the second number are the same, it means that the second-category hydraulic component corresponding to the i-th hydraulic component in the first-category hydraulic components and the i-th hydraulic component in the second-category hydraulic components are the same component. Therefore, the index value of the second-category hydraulic component corresponding to the i-th hydraulic component in the first-category hydraulic components can be updated to the value of the second number.

[0094] The first type of hydraulic components are taken as the takeover and the second type of hydraulic components are taken as the control body for explanation, but the representation forms of the first type and the second type of hydraulic components are not limited thereto. The first number corresponding to the i-th takeover, i.e., the takeover upstream control body number and the takeover downstream control body number, and the second number of the i-th control body are obtained respectively. When the second number is the same as any one of the takeover upstream control body number or the takeover downstream control body number, the index value of the takeover upstream control body or the takeover downstream control body corresponding to the i-th takeover is updated to the value of the second number. By splitting the control body number, the control body surface positioning and the judgment of the physical upstream and downstream control bodies of the special model can be realized.

[0095] In some embodiments, updating the index of the second type of hydraulic components corresponding to the first type of hydraulic components in the thermal hydraulic system analysis software includes:

[0096] Obtain the first name of the second-category hydraulic component corresponding to the i-th hydraulic component in the first-category hydraulic component, where i is a natural number;

[0097] Obtain the third number and the second name of the i-th hydraulic component in the second category of hydraulic components;

[0098] comparing the first name to the second name;

[0099] When the first name and the second name are the same, the value of the index of the second-category hydraulic component corresponding to the i-th hydraulic component in the first-category hydraulic component is updated to the value of the third number.

[0100] In this embodiment, when updating the second type of hydraulic components corresponding to the first type of hydraulic components, the updating may be performed based on the name.

[0101] In specific implementation, the first name of the second type of hydraulic component corresponding to the i-th hydraulic component in the first type of hydraulic component and the second name of the i-th hydraulic component in the second type of hydraulic component can be obtained respectively, wherein the first name and the second name are only used to distinguish the two names, and are not used to describe a specific order or sequence. The first name can include multiple names, for example, the first name can include the name of the upstream control body and the name of the downstream control body.

[0102] When the first name and the second name are the same, it means that the second-category hydraulic component corresponding to the i-th hydraulic component in the first-category hydraulic components and the i-th hydraulic component in the second-category hydraulic components are the same component. Therefore, the index value of the second-category hydraulic component corresponding to the i-th hydraulic component in the first-category hydraulic components can be updated to the value of the third number.

[0103] The first type of hydraulic components is taken as the takeover and the second type of hydraulic components is taken as the control body for explanation, but the representation forms of the first type and the second type of hydraulic components are not limited thereto. The first name corresponding to the i-th takeover, i.e., the takeover upstream control body name and the takeover downstream control body name, and the third number and the second name of the i-th control body are obtained respectively. When the second name is the same as any one of the takeover upstream control body name or the takeover downstream control body name, the index value of the takeover upstream control body or the takeover downstream control body corresponding to the i-th takeover is updated to the value of the third number. By comparing the names to update the component index, the links between components can be accurately performed.

[0104] It should be noted that the updating of the index of the second type of hydraulic components corresponding to different components in the first type of hydraulic components can be implemented in the same way or in different ways, which can be set according to actual needs and is not limited in the embodiments of the present application.

[0105] In some embodiments, the first type of hydraulic component is a nozzle or a thermal member, and the second type of hydraulic component is a control body;

[0106] In the case where the first type of hydraulic components is a pipe connection, the second type of hydraulic components corresponding to the i-th hydraulic component in the first type of hydraulic components include: a pipe connection upstream control body and a pipe connection downstream control body of the i-th pipe connection of the thermal hydraulic system analysis software;

[0107] In the case where the third component is a thermal component, the second type of hydraulic components corresponding to the ith hydraulic component in the first type of hydraulic components include: a left boundary control volume and a right boundary control volume of the ith thermal component of the thermal-hydraulic system analysis software.

[0108] Specifically, the first type of hydraulic components may include a pipe or a thermal component, and the second type of hydraulic components may include a control body. In the case where the first type of hydraulic components are pipes, the control body corresponding to the i-th hydraulic component in the first type of hydraulic components, i.e., the i-th pipe, may include: a pipe upstream control body and a pipe downstream control body of the i-th pipe of the thermal hydraulic system analysis software;

[0109] When the first type of hydraulic components are thermal components, the control body corresponding to the i-th hydraulic component in the first type of hydraulic components, that is, the i-th thermal component, may include: the left boundary control body and the right boundary control body of the i-th thermal component of the thermal-hydraulic system analysis software.

[0110] In some implementations, after establishing the second storage space, the method further includes:

[0111] In the case where the change is to add a first hydraulic component, constructing a first structure corresponding to the first hydraulic component;

[0112] storing component information of the first hydraulic component and component information of the linked component of the first hydraulic component in a first structure;

[0113] The first structure is stored in the second storage space.

[0114] Specifically, when it is detected that the change of the thermal hydraulic system analysis software is to add a first hydraulic component, a first structure corresponding to the first hydraulic component is constructed. The first structure can be used to store component information of the hydraulic component. The storage space can be used to store the hydraulic component and the structure corresponding to the hydraulic component.

[0115] After the first structure is constructed, the component information of the first hydraulic component and the linked component information of the first hydraulic component are stored in the first structure, and the first structure is stored in the second storage space. Taking the first hydraulic component as the takeover and the component linked to the first hydraulics as the control body as an example, when a new takeover is detected, a structure corresponding to the new takeover is constructed. The new takeover and the components linked to the takeover are stored in the structure. At the same time, the structure is stored in the storage space. By constructing a structure to store component information and storing the structure in the storage space, hierarchical storage of information can be achieved, the overall readability of the code can be improved, and the memory management of the thermal hydraulic system analysis software is facilitated.

[0116] In some embodiments, after storing the target hydraulic component in the second storage space, the method further includes:

[0117] Release the memory of the first storage space.

[0118] Specifically, after the target hydraulic component is stored in the second storage space, the hydraulic components stored in the first storage space except the second hydraulic component are stored in the second storage space. At the same time, the memory of the first storage space is released to release the first storage space. By releasing the memory of the original storage space after storing the hydraulic component in the new storage space, memory space can be saved and dynamic memory management can be achieved.

[0119] It should be noted that the various embodiments and implementation methods introduced in the embodiments of the present application can be implemented independently or in combination without conflicting with each other. The specific implementation can be determined according to actual needs, and the embodiments of the present application are not limited to this.

[0120] For easier understanding, see Figure 2 , is a flowchart of a method for dynamic memory management of thermal hydraulic system analysis software provided in a specific embodiment of the present application. Figure 2 As shown, the method may include:

[0121] Step S201: Read input parameters.

[0122] Step S202: Count the number (n) of input control bodies, connecting pipes, and thermal components, and number the control bodies, connecting pipes, and thermal components in the order of input (serial numbers: iv, ij, ihts).

[0123] Step S203: define a structure template (defined as a) for initializing new elements, and a structure pointer for storing the original memory address.

[0124] Step S204: save the original memory address information (a=vol); update the element number information (n++); open a new memory according to the number of elements; transfer the original memory address information to the new memory; initialize the newly opened memory.

[0125] Step S205: Determine whether the memory allocation is completed; if so, proceed to step S206, if not, return to step S203.

[0126] Step S206: Link the control unit, the thermal component and the control unit.

[0127] Step S207: For the control body number of the upstream and downstream of the takeover, if the control body number is upstream of the takeover (ij), the takeover upstream control body index (kvindex) is assigned the control body number (iv), and the control body surface is assigned the upstream surface.

[0128] Step S208: If the control body number is downstream of the takeover (ij), the takeover downstream control body index (kvindex) is assigned the control body number (iv), and the control body surface is assigned the downstream surface.

[0129] Step S209: Search and take over through the control body: vol[iv].jindex[i]==ij; search and take over through the control body: jun[ij].kvindex[i]==iv.

[0130] Step S210: Function implementation.

[0131] In the embodiment of the present application, the number and index of the component can be determined based on a type of component.

[0132] Specifically, for a component under a certain type of component, its number can be determined based on the input order of the components, and its index can be determined based on the storage position of the component information of the component in the structure.

[0133] The specific implementation can be found in the above description and will not be repeated here.

[0134] See also Figure 3 , is a schematic diagram of a user modeling node provided by a specific embodiment of the present application. Figure 4 , is a schematic diagram of data storage provided by a specific embodiment of the present application. Figure 3 Taking the simple model shown as an example, there are 6 control bodies and 5 takeovers. The information of each takeover / control body is stored in its own structure, and multiple structures constitute a structure array. Since it is a free modeling, it is assumed that the user enters the control body information in the order of 4, 3, 1, 6, 5, 2, and the takeover information in the order of 2, 1, 4, 3, 5. Then for control body 4, its control body index is 0 (vol[0]), and the takeover indexes are 0, 3, and 2 respectively.

[0135] like Figure 4 As shown, the program records the following:

[0136] vol[0].nj=3; / / Control body 4 is connected to the three connections j2, j3 and j4.

[0137] vol[0].jindex[0] = 0; / / The first receiver of control body 4 is j2. The 0 on the right side of the equal sign indicates the storage location of j2.

[0138] vol[0].jindex[1]=3; / / The second receiver of control body 4 is j3. The 3 on the right side of the equal sign indicates the storage location of j3.

[0139] vol[0].jindex[2]=2; / / The third node of control body 4 is j4. The 2 on the right side of the equal sign indicates the storage location of j4.

[0140] For takeover 3, its takeover index is 3 (jun[3]), and the memory location index relationship of its associated control body is:

[0141] jun[3].kvindex=1; / / The upstream control body number of control body 3 is 3, and the index order of control body 3 is 1

[0142] jun[3].lvindex=0; / / The downstream control body number of control body 3 is 4, and the index order of control body 4 is 0.

[0143] In some embodiments, links and connections may be interchangeable.

[0144] See also Figure 5 , is a schematic diagram of the structure of a device for dynamic memory management of thermal hydraulic system analysis software provided in an embodiment of the present application. A second aspect of an embodiment of the present application provides a device 50 for dynamic memory management of thermal hydraulic system analysis software, and the device 50 includes:

[0145] A first storage module 51 is used to store hydraulic components in the thermal hydraulic system analysis software through a first storage space;

[0146] Monitoring module 52, used to monitor hydraulic components in thermal hydraulic system analysis software;

[0147] Establishing module 53, used for establishing a second storage space when a hydraulic component in the thermal hydraulic system analysis software is changed, wherein the size of the second storage space matches the storage space size required by the hydraulic component after the change in the thermal hydraulic system analysis software;

[0148] The second storage module 54 is used to store the target hydraulic components through the second storage space; wherein, when the change is to add the first hydraulic component, the target hydraulic components are the hydraulic components and the first hydraulic components stored in the first storage space; when the change is to delete the second hydraulic component, the target hydraulic components are the hydraulic components stored in the first storage space except the second hydraulic component.

[0149] The device 50 for dynamic memory management of thermal-hydraulic system analysis software provided in the second aspect of the embodiment of the present application can implement each process implemented in the above-mentioned method embodiment and achieve the same beneficial effects. To avoid repetition, it will not be described here.

[0150] See also Figure 6 , is a structural diagram of an electronic device provided in an embodiment of the present application. The third aspect of the embodiment of the present application provides an electronic device 6000, including a processor 6100 and a memory 6200. The memory 6200 stores machine executable instructions that can be executed by the processor 6100. The processor 6100 can execute the machine executable instructions to implement the above-mentioned method of dynamic memory management of thermal-hydraulic system analysis software.

[0151] An embodiment of the present application also provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor implements the method of dynamic memory management of the above-mentioned thermal-hydraulic system analysis software.

[0152] In some embodiments, the embodiments of the present application further provide a computer program product, including a computer program, which, when executed by a processor, implements the method for dynamic memory management of thermal-hydraulic system analysis software according to the above-mentioned embodiments.

[0153] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0154] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0155] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0156] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0157] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0158] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0159] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

[0160] In addition, various embodiments of the present invention may be arbitrarily combined, and as long as they do not violate the concept of the present invention, they should also be regarded as the contents disclosed by the present invention.

Claims

1. A method for dynamic memory management of thermal hydraulic system analysis software, characterized in that: The method comprises: Storing hydraulic components in the thermal hydraulic system analysis software through the first storage space; Monitoring hydraulic components in the thermal hydraulic system analysis software; In the case where the hydraulic components in the thermal-hydraulic system analysis software are changed, a second storage space is established, wherein the size of the second storage space matches the size of the storage space required by the changed hydraulic components in the thermal-hydraulic system analysis software; storing the target hydraulic component through the second storage space; Among them, when the change is to add the first hydraulic component, the target hydraulic component is the hydraulic component stored in the first storage space and the first hydraulic component; when the change is to delete the second hydraulic component, the target hydraulic component is the hydraulic component stored in the first storage space except the second hydraulic component.

2. The method according to claim 1, characterized in that After monitoring the hydraulic components in the thermal-hydraulic system analysis software, the method further comprises: When a hydraulic component in the thermal-hydraulic system analysis software is changed, updating the index of the second-category hydraulic component corresponding to the first-category hydraulic component in the thermal-hydraulic system analysis software, wherein in the thermal-hydraulic system analysis software, the first-category hydraulic component needs to establish a link with the second-category hydraulic component; Traversing the serial numbers of the second-category hydraulic components in the thermal-hydraulic system analysis software, and determining whether there is a serial number having a value equal to the index of the second-category hydraulic component corresponding to a third hydraulic component, wherein the third hydraulic component is any hydraulic component of the first-category hydraulic components; When there is no number equal to the value of the index of the second-category hydraulic component corresponding to the third hydraulic component in the numbering of the second-category hydraulic components in the thermal-hydraulic system analysis software, an error prompt message is output, wherein the error prompt message is used to prompt that the third hydraulic component has not successfully established a link with the second-category hydraulic component.

3. The method according to claim 2, characterized in that The updating of the index of the second type of hydraulic components corresponding to the first type of hydraulic components in the thermal hydraulic system analysis software includes: Obtaining a first serial number of the second-category hydraulic component corresponding to the i-th hydraulic component in the first-category hydraulic component, where i is a natural number; Obtaining a second serial number of the i-th hydraulic component in the second type of hydraulic components; comparing the first number and the second number; When the first number is the same as the second number, the value of the index of the second-category hydraulic component corresponding to the ith hydraulic component in the first-category hydraulic component is updated to the value of the second number.

4. The method according to claim 2, characterized in that: The updating of the index of the second type of hydraulic components corresponding to the first type of hydraulic components in the thermal hydraulic system analysis software includes: Obtaining a first name of the second-category hydraulic component corresponding to the i-th hydraulic component in the first-category hydraulic component, where i is a natural number; Obtaining the third number and the second name of the i-th hydraulic component in the second type of hydraulic components; comparing the first name to the second name; When the first name and the second name are the same, the value of the index of the second-category hydraulic component corresponding to the ith hydraulic component in the first-category hydraulic component is updated to the value of the third serial number.

5. The method according to claim 3 or 4, characterized in that: The first type of hydraulic components are pipes or thermal components, and the second type of hydraulic components are control bodies; In the case where the first type of hydraulic components is a pipe connection, the second type of hydraulic components corresponding to the i-th hydraulic component in the first type of hydraulic components include: a pipe connection upstream control body and a pipe connection downstream control body of the i-th pipe connection of the thermal hydraulic system analysis software; In the case where the first type of hydraulic components are thermal components, the second type of hydraulic components corresponding to the ith hydraulic component in the first type of hydraulic components include: the left boundary control volume and the right boundary control volume of the ith thermal component of the thermal-hydraulic system analysis software.

6. The method according to claim 1, characterized in that After the second storage space is established, the method further includes: In the case where the change is to add a first hydraulic component, constructing a first structure corresponding to the first hydraulic component; storing component information of the first hydraulic component and component information of a linked component of the first hydraulic component in the first structure; The first structure is stored in the second storage space.

7. The method according to claim 1, characterized in that After storing the target hydraulic component in the second storage space, the method further includes: The memory of the first storage space is released.

8. A device for dynamic memory management of thermal hydraulic system analysis software, characterized in that: The device comprises A first storage module, used for storing hydraulic components in the thermal hydraulic system analysis software through a first storage space; A monitoring module, used to monitor hydraulic components in the thermal hydraulic system analysis software; An establishing module, used for establishing a second storage space when a hydraulic component in the thermal-hydraulic system analysis software is changed, wherein the size of the second storage space matches the storage space size required by the changed hydraulic component in the thermal-hydraulic system analysis software; A second storage module is used to store target hydraulic components through the second storage space; wherein, when the change is to add the first hydraulic component, the target hydraulic components are the hydraulic components stored in the first storage space and the first hydraulic component; wherein, when the change is to delete the second hydraulic component, the target hydraulic components are the hydraulic components stored in the first storage space except the second hydraulic component.

9. An electronic device, characterized in that: include: a memory configured to store instructions; as well as A processor is configured to call the instructions from the memory and implement the method for dynamic memory management of thermal-hydraulic system analysis software according to any one of claims 1 to 7 when executing the instructions.

10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions for causing a machine to execute the method for dynamic memory management of thermal-hydraulic system analysis software according to any one of claims 1 to 7.