A model simulation data storage method, device, equipment and storage medium

By converting the Modelica model simulation data table format and storing it in a distributed database, the problems of insufficient storage efficiency and real-time performance of a single server are solved, and efficient data storage and reading are achieved.

CN117891400BActive Publication Date: 2025-10-21SUZHOU TONGYUAN SOFT CONTROL INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311842462.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2025-10-21
Estimated Expiration
2043-12-28

AI Technical Summary

Technical Problem

When existing Modelica model simulation data is stored in the cloud, a single user triggering concurrent simulation occupies all disk IO of a single server, resulting in insufficient data storage efficiency and real-time performance.

Method used

The simulation data of the Modelica model is converted into a table format and stored in a distributed database, especially the Apache Cassandra database. By transferring the fields of the column dimension to the row dimension and taking advantage of Cassandra's row-oriented storage, distributed storage of data is achieved.

Benefits of technology

It improves the efficiency and real-time performance of data storage, avoids the single-server disk IO bottleneck, and realizes the real-time storage and reading of massive simulation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117891400B_ABST
    Figure CN117891400B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a model simulation data storage method, device, equipment and storage medium, wherein the method comprises: obtaining a target simulation data table of a Modelica model; converting a table attribute format of the target simulation data table to obtain a target storage data table; and storing the target storage data table in a preset distributed database. The technical scheme of the embodiments of the present application solves the problem that in the prior art, single storage occupies a large amount of disk IO of a single server, and the efficiency and real-time performance of data storage are insufficient, and can store the model simulation data table in a distributed database after format conversion, thereby improving the efficiency and real-time performance of data storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of software engineering technology, and in particular to a model simulation data storage method, apparatus, device and storage medium. Background Art

[0002] Industrial software has long since evolved beyond standalone client-based systems. Major industrial software platforms now offer online cloud platforms, allowing users to access industrial software anytime, anywhere. However, current online Modelica modeling and simulation cloud platforms utilize traditional single-server file system storage. In cloud-based simulation scenarios, a single user triggering concurrent simulations will occupy all of a single server's disk I / O (input and output), leaving room for improvement in data storage efficiency and real-time performance. Summary of the Invention

[0003] The embodiments of the present invention provide a model simulation data storage method, apparatus, device and storage medium, which can convert the format of a model simulation data table and store it in a distributed database, thereby improving the efficiency and real-time performance of data storage.

[0004] In a first aspect, an embodiment of the present invention provides a model simulation data storage method, the method comprising:

[0005] Get the target simulation data table of the Modelica model;

[0006] Converting the table attribute format of the target simulation data table to obtain a target storage data table;

[0007] The target storage data table is stored in a preset distributed database.

[0008] In a second aspect, an embodiment of the present invention provides a model simulation data storage device, the device comprising:

[0009] A simulation data table acquisition module is used to obtain the target simulation data table of the Modelica model;

[0010] A storage data table generating module is used to convert the table attribute format of the target simulation data table to obtain a target storage data table;

[0011] The data table storage module is used to store the target storage data table in a preset distributed database.

[0012] In a third aspect, an embodiment of the present invention provides a computer device, the computer device comprising:

[0013] one or more processors;

[0014] a memory for storing one or more programs;

[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the model simulation data storage method described in any embodiment.

[0016] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the model simulation data storage method described in any embodiment.

[0017] The technical solution provided by an embodiment of the present invention obtains a target simulation data table from a Modelica model; converts the table attribute format of the target simulation data table to obtain a target storage data table; and stores the target storage data table in a preset distributed database. This technical solution addresses the problem of existing Modelica model simulation data storage technology, where a single storage operation consumes a large amount of disk I / O on a single server, resulting in insufficient data storage efficiency and real-time performance. By converting the model simulation data table format and storing it in a distributed database, the efficiency and real-time performance of data storage are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 This is a flow chart of a model simulation data storage method provided by an embodiment of the present invention;

[0019] Figure 2 This is a flow chart of another model simulation data storage method provided by an embodiment of the present invention;

[0020] Figure 3 This is a structural diagram of a model simulation data storage device provided by an embodiment of the present invention;

[0021] Figure 4 It is a structural diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0023] Figure 1This is a flow chart of a model simulation data storage method provided by an embodiment of the present invention. The embodiment of the present invention is applicable to scenarios where simulation data generated by a Modelica model is stored. The method can be executed by a model simulation data storage device, which can be implemented by software and / or hardware.

[0024] like Figure 1 As shown, the model simulation data storage method includes the following steps:

[0025] S110 , obtaining a target simulation data table of the Modelica model.

[0026] The target simulation data table may be a table of simulation data generated by a Modelica model. The technical solution of the embodiments of the present invention requires real-time storage of the target simulation data table. The data simulation variables generate corresponding simulation data in real time. In other words, the target simulation data table records the real-time simulation data for all data simulation variables.

[0027] S120: Convert the table attribute format of the target simulation data table to obtain a target storage data table.

[0028] Among them, the table attribute format can be the table row and column attribute data of the target simulation data table. Specifically, since the column data storage capacity of the distributed database is relatively weak, the row and column data of the target simulation data table can be converted to finally obtain a table that can be stored in real time in the distributed database. Among them, the target storage data table can be the storage data table corresponding to the target simulation data table finally determined. Specifically, the simulation variables in the target simulation data table can be determined respectively, and then the mapping position corresponding to each simulation variable can be determined respectively. Finally, the simulation data of each simulation variable can be mapped to the corresponding mapping position to obtain the target storage data table.

[0029] S130: Store the target storage data table in a preset distributed database.

[0030] The preset distributed database may be a preset database capable of distributed storage. Optionally, the preset distributed database may be an Apache Cassandra database. Apache Cassandra is an open source distributed and decentralized storage system (database) used to manage large amounts of structured data distributed around the world. It provides high availability services with no single point of failure. Its features include: a single table can store 100 billion data items; a single database can contain no more than 100 tables; and the maximum number of fields in a single table is limited to 20 to 60.

[0031] Apache's cloud-based real-time simulation technology, through the design of a reasonable data model, transfers fields from the column dimension to the row dimension, and rationally utilizes the advantages of Cansandra's row-oriented storage capabilities. It also supports scenarios with a large number of Modelica model variables. The distributed storage architecture makes disk I / O no longer a bottleneck for accessing large-scale simulation results, making it possible to store and read the massive simulation result data generated by cloud-based Modelica models in real time during the simulation process.

[0032] The technical solution provided by an embodiment of the present invention obtains a target simulation data table from a Modelica model; converts the table attribute format of the target simulation data table to obtain a target storage data table; and stores the target storage data table in a preset distributed database. This technical solution addresses the problem of existing Modelica model simulation data storage technology, where a single storage operation consumes a large amount of disk I / O on a single server, resulting in insufficient data storage efficiency and real-time performance. By converting the model simulation data table format and storing it in a distributed database, the efficiency and real-time performance of data storage are improved.

[0033] Figure 2 This is another flow chart of a model simulation data storage method provided by an embodiment of the present invention. The embodiment of the present invention can be applied to scenarios where simulation data generated by a Modelica model is stored. Based on the above embodiment, this embodiment further explains how to convert the table attribute format of a target simulation data table to obtain a target storage data table and how to store the target storage data table in a preset distributed database. The device can be implemented by software and / or hardware and integrated into a computer device with application development capabilities.

[0034] like Figure 2 As shown, the model simulation data storage method includes the following steps:

[0035] S210 , obtaining a target simulation data table of a Modelica model, and determining at least one data simulation variable according to the target simulation data table, and numbering each of the data simulation variables to obtain a simulation variable number.

[0036] The target simulation data table may be a table of simulation data generated by the Modelica model. The technical solution of the embodiment of the present invention requires real-time storage of the target simulation data table. For example, the specific format of the target simulation data table is shown in Table 1 below:

[0037] Table 1 Simulation result data format

[0038] Time varName 2 varName 3 … varName n 0 value 12 value 13 … value 1n 0.002 value 22 value 23 … value 2n … … … … … m value m2 value m3 … value mn

[0039] Data simulation variables generate corresponding simulation data in real time. That is, the target simulation data table records the real-time simulation data for all data simulation variables. Specifically, the header of the target guarantee data table contains the names of all data simulation variables, so all data simulation variables can be determined based on the header of the target simulation data table.

[0040] Furthermore, the simulation variable number can be the number of each data simulation variable. After determining the data simulation variables, each data simulation variable can be numbered separately to obtain the simulation variable number corresponding to each data simulation variable. By determining the simulation variable number, it can be used as identification information of the data control variable and the storage location of the simulation data can be subsequently determined based on the simulation variable number.

[0041] Optionally, at least one data simulation variable is determined based on the target simulation data table, and each data simulation variable is numbered to obtain a simulation variable number, including: identifying the header data of the target simulation data table to determine at least one data simulation variable; mapping the data simulation variables to a preset linear set in sequence to obtain a target variable linear set; and determining the simulation variable number of each data simulation variable based on the arrangement order of the variables in the target variable linear set.

[0042] Among them, the header data can be the variable name data in the header of the target simulation data table. Specifically, the name of each simulation variable in the header data can be identified, and then at least one data simulation variable can be obtained. Further, the preset linear set can be a preset linear set of storage variable names. The target variable linear set can be a set containing all data simulation variables in the target simulation data table. Specifically, after determining each data simulation variable in the target simulation data table, the data simulation variables can be mapped to the preset linear set in sequence, and then the target variable linear set can be obtained. Further, the simulation variable number corresponding to each data simulation variable can be determined according to the arrangement order of each simulation variable in the target variable linear set.

[0043] S220 : Determine the data mapping position of each data simulation variable based on the simulation variable number and the preset row variable threshold.

[0044] The preset row variable threshold may be a threshold for the number of simulation variables in a row. Specifically, due to the limited column storage capabilities of distributed data repositories, a preset row variable threshold can be set to limit the number of variables in a row of a data table. The data mapping location may be the storage location of the simulation variable data in the storage table. Specifically, the data mapping location may be determined based on both the simulation variable number and the preset row variable threshold.

[0045] Optionally, based on the simulation variable number and the preset row variable threshold, the data mapping position of each data simulation variable is determined separately, including: rounding up the simulation variable number with respect to the preset row variable threshold to obtain the data mapping row position; taking the remainder of the simulation variable number with respect to the preset row variable threshold to obtain the data mapping column position; determining the data mapping position according to the data mapping row position and the data mapping column position.

[0046] The data mapping row position may be the row position of the simulation variable data in the storage table. Specifically, the simulation variable number may be rounded up by a preset row variable threshold to obtain the data mapping row position. Furthermore, the data mapping column position may be the column position of the variable data in the data table. Specifically, the simulation variable number may be modulo a preset row variable threshold to obtain the data mapping column position. Furthermore, the data mapping row position and the data mapping column position may be combined to determine the data mapping position.

[0047] S230 , mapping the simulation data of each data simulation variable to a data mapping position to obtain a target storage data table.

[0048] The target storage data table may be a storage data table corresponding to the target simulation data table finally determined. Specifically, the simulation data of each simulation variable may be mapped to the corresponding data mapping position according to the data mapping position determined in the above steps to obtain the target storage data table.

[0049] Optionally, the simulation data of each data simulation variable is mapped to a data mapping position to obtain a target storage data table, including: obtaining an initial storage data table; determining at least one data mappable position in the initial storage data table based on the data mapping position; and mapping the simulation data of the data simulation variables to the data mappable positions in sequence to obtain a target storage data table.

[0050] The initial storage data table may be a raw data table without data mapping. The data-mappable locations may be locations in the initial storage data table where simulation data can be mapped. Specifically, since each data simulation variable may have multiple simulation data, multiple mapping locations having the same data mapping location format as the data simulation variable can be sequentially determined based on the data mapping location format corresponding to the data simulation variable. Finally, the simulation data of the data simulation variable is mapped to the data-mappable locations, thereby obtaining the target storage data table.

[0051] S240: Obtain a storage table memory value of the target storage data table.

[0052] The storage table memory value may be the memory value occupied by the target storage data table. Specifically, after determining the target data table, the memory data of the target storage data table may be analyzed to determine the storage table memory value.

[0053] S250: When the storage table memory value is greater than a preset storage threshold, split the target storage data table into at least one target storage data sub-table.

[0054] Among them, the preset storage threshold can be the storage memory threshold of a single distributed storage partition. By setting the preset storage threshold, the memory size of the table stored in a single distributed partition can be limited. Furthermore, the target storage data indicator can be a partial data table of the target storage data table. When the storage table memory value is greater than the preset storage threshold, it means that the memory usage of the target storage data target is too large and cannot be stored in one distributed partition. Therefore, the target storage data table can be disassembled into multiple target storage data sub-tables, so that the memory value of each target storage data sub-table is less than the preset storage threshold.

[0055] S260: Store the target storage data sub-tables in data partition libraries of a preset distributed database.

[0056] The preset distributed database may be a preset database capable of distributed storage. Optionally, the preset distributed database may be an Apache Cassandra database. Apache Cassandra is an open source distributed and decentralized storage system (database) used to manage large amounts of structured data distributed around the world. It provides high availability services with no single point of failure. Its features include: a single table can store 100 billion data items; a single database can contain no more than 100 tables; and the maximum number of fields in a single table is limited to 20 to 60.

[0057] The data partition library can be a sub-database of a pre-set distributed database. After determining multiple target data storage sub-tables, each target data storage indicator can be stored in a corresponding data partition library. This allows for distributed storage of data tables while avoiding the problem of excessive memory usage in the data partition library.

[0058] Optionally, the target storage data sub-tables are respectively stored in data partition libraries of a preset distributed database, including: determining the number of partition libraries according to the number of target storage data sub-tables; determining at least one partition storage address according to the determined number of partition libraries and table attribute information of the target simulation data table; and storing each target storage data sub-table respectively in the partition storage address.

[0059] Among them, the number of partition libraries can be the number of data partition libraries used to store the target storage data sub-table. Specifically, the number of partition libraries is the same as the number of target storage data sub-tables. The table attribute information can be the relevant attribute information of the target simulation data table. Specifically, the table data information includes but is not limited to the generation time information of the table, the simulation variable type information, the identification information of the single simulation, etc. The partition storage address can be the storage address of the target storage data sub-table in the data partition library. Specifically, at least one partition storage address can be determined based on the number of partition libraries and the table attribute information of the target simulation data table. The number of partition storage addresses is the same as the number of partition libraries. That is, each target storage data sub-table has a corresponding partition storage address. Exemplarily, the partition storage address associated with the target storage data sub-table can be determined based on the table attribute information, and then each target storage data sub-table is stored in the corresponding partition storage address.

[0060] Apache's cloud-based real-time simulation technology, through the design of a reasonable data model, transfers fields from the column dimension to the row dimension, and rationally utilizes the advantages of Cansandra's row-oriented storage capabilities. It also supports scenarios with a large number of Modelica model variables. The distributed storage architecture makes disk I / O no longer a bottleneck for accessing large-scale simulation results, making it possible to store and read the massive simulation result data generated by cloud-based Modelica models in real time during the simulation process.

[0061] Exemplarily, the steps for data storage based on Cansandra technology are as follows:

[0062] (1) All variables are stored in an array:

[0063] varArr=[varName1,varName2,…,varName n]

[0064] (2) Build a data model:

[0065]

[0066] In the model, we define v1, v2, …, v50, meaning that a row can store the values ​​of 50 variables, rowVarNum = 50. While a single Cansandra table can store a relatively limited number of fields, rows can store 100 billion rows. Using the varGroup and step fields, we can shift columns to rows: varGroup = variable position in varArr / rowVarNum. The actual variable in varArr maps to n in the data model (n = variable position in varArr / rowVarNum; if n == 0, then n = rowVarNum). The simulation task ID (taskId) and bucket serve as the primary partition key, dividing the large data partition into smaller partitions. Ideally, partition size should not exceed 100MB. By adding the bucket field to the partition key, we can easily keep partitions under 100MB. When acquiring data, we need to access these buckets and aggregate the data. Each day's simulation task is stored in a separate table, with 30 tables per month.

[0067] Below we assume that three variables, v1, v2, and v3, are defined in the data model. One simulation needs to store data for five variables and three steps of data for illustration:

[0068] Variable array: varArr = [var1, var2, var3, var4, var5]

[0069] The number of variables (5) exceeds the number of variables defined in the data model (3). Group the variables var1, var2, and var3 into one group, and var4 and var5 into two groups. After inserting the data, see Table 2 below:

[0070] Table 2 Example result data storage

[0071] taskId bucket step varGroup v1 v2 v3 1 1 1 1 0.1 0.2 0.3 1 1 1 2 0.6 0.7 / 1 1 2 1 0.11 0.21 0.31 1 1 2 2 0.61 0.71 / 1 1 3 1 0.1 0.22 0.3 1 1 3 2 0.6 0.73 /

[0072] Here, taskId represents the simulation identifier; bucket represents the storage partition corresponding to the data; step represents the number of data groups; and varGroup represents the number of rows in the same group. As Table 2 shows, there are three groups of data in the table, each containing two rows. The two rows in the same group are stored in different storage partitions.

[0073] The technical solution provided by the embodiment of the present invention obtains the target simulation data table of the Modelica model, determines at least one data simulation variable based on the target simulation data table, and numbers each data simulation variable to obtain a simulation variable number; determines the data mapping position of each data simulation variable based on the simulation variable number and a preset row variable threshold; maps the simulation data of each data simulation variable to the data mapping position to obtain a target storage data table; obtains the storage table memory value of the target storage data table; when the storage table memory value is greater than the preset storage threshold, decomposes the target storage data table into at least one target storage data sub-table; and stores the target storage data sub-tables in a data partition library of a preset distributed database. The technical solution of the embodiment of the present invention solves the problem that a single storage in the existing Modelica model simulation data storage technology will occupy more disk IO of a single server, resulting in insufficient data storage efficiency and real-time performance. The model simulation data table can be format-converted and stored in a distributed database, thereby improving data storage efficiency and real-time performance.

[0074] Figure 3 This is a structural diagram of a model simulation data storage device provided by an embodiment of the present invention. The embodiment of the present invention is applicable to scenarios where simulation data generated by Modelica models are stored. The device can be implemented by software and / or hardware and integrated into a computer device with application development capabilities.

[0075] like Figure 3 As shown, the model simulation data storage device includes: a simulation data table acquisition module 310, a storage data table generation module 320 and a data table storage module 330.

[0076] Among them, the simulation data table acquisition module 310 is used to obtain the target simulation data table of the Modelica model; the storage data table generation module 320 is used to convert the table attribute format of the target simulation data table to obtain the target storage data table; the data table storage module 330 is used to store the target storage data table in a preset distributed database.

[0077] The technical solution provided by an embodiment of the present invention obtains a target simulation data table from a Modelica model; converts the table attribute format of the target simulation data table to obtain a target storage data table; and stores the target storage data table in a preset distributed database. This technical solution addresses the problem of existing Modelica model simulation data storage technology, where a single storage operation consumes a large amount of disk I / O on a single server, resulting in insufficient data storage efficiency and real-time performance. By converting the model simulation data table format and storing it in a distributed database, the efficiency and real-time performance of data storage are improved.

[0078] In an optional embodiment, the storage data table generation module 320 is specifically used to: determine at least one data simulation variable according to the target simulation data table, and number each of the data simulation variables respectively to obtain a simulation variable number; based on the simulation variable number and a preset row variable threshold, determine the data mapping position of each data simulation variable respectively; map the simulation data of each data simulation variable to the data mapping position to obtain the target storage data table.

[0079] In an optional embodiment, the storage data table generation module 320 includes: a data mapping position determination unit, used to: round up the simulation variable number with respect to the preset row variable threshold to obtain the data mapping row position; take the remainder of the simulation variable number with respect to the preset row variable threshold to obtain the data mapping column position; determine the data mapping position according to the data mapping row position and the data mapping column position.

[0080] In an optional embodiment, the storage data table generation module 320 includes: a simulation data mapping unit, used to: obtain an initial storage data table; determine at least one data mappable position in the initial storage data table based on the data mapping position; and map the simulation data of the data simulation variables to the data mappable positions in sequence to obtain the target storage data table.

[0081] In an optional embodiment, the data table storage module 330 is specifically used to: obtain the storage table memory value of the target storage data table; when the storage table memory value is greater than a preset storage threshold, disassemble the target storage data table into at least one target storage data sub-table; and store the target storage data sub-tables respectively in the data partition library of the preset distributed database.

[0082] In an optional embodiment, the data table storage module 330 includes: a data sub-table storage unit, used to: determine the number of partition libraries based on the number of the target storage data sub-tables; determine at least one partition storage address based on the determined number of partition libraries and the table attribute information of the target simulation data table; and store each of the target storage data sub-tables in the partition storage address respectively.

[0083] In an optional embodiment, in an optional embodiment, the storage data table generation module 320 includes: a simulation variable number determination unit, used to: identify the header data of the target simulation data table and determine at least one data simulation variable; map the data simulation variables to a preset linear set in sequence to obtain a target variable linear set; and determine the simulation variable number of each of the data simulation variables according to the arrangement order of the variables in the target variable linear set.

[0084] The model simulation data storage device provided in the embodiment of the present invention can execute the model simulation data storage method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0085] Figure 4 A schematic structural diagram of a computer device provided in an embodiment of the present invention. Figure 4 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 4 The computer device 12 shown is only an example and should not limit the functionality and scope of use of the embodiments of the present invention. The computer device 12 can be any terminal device with computing capabilities and can be configured in a model simulation data storage device.

[0086] like Figure 4 As shown, computer device 12 is implemented as a general-purpose computing device. Components of computer device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 that connects various system components (including system memory 28 and processing unit 16).

[0087] The bus 18 may be one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0088] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0089] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 4 Not shown, often called a "hard drive"). Although Figure 4Not shown, a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.

[0090] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0091] The computer device 12 may also communicate with one or more external devices 14 (e.g., a keyboard, a pointing device, a display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may occur through an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 20. Figure 4 As shown, the network adapter 20 communicates with the other modules of the computer device 12 via the bus 18. Figure 4 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0092] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the model simulation data storage method provided by the embodiment of the present invention, which includes:

[0093] Get the target simulation data table of the Modelica model;

[0094] Converting the table attribute format of the target simulation data table to obtain a target storage data table;

[0095] The target storage data table is stored in a preset distributed database.

[0096] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the method for storing model simulation data provided in any embodiment of the present invention is implemented, including:

[0097] Get the target simulation data table of the Modelica model;

[0098] Converting the table attribute format of the target simulation data table to obtain a target storage data table;

[0099] The target storage data table is stored in a preset distributed database.

[0100] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0101] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0102] Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0103] The computer program code for performing the operations of the present invention can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0104] Those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using a general-purpose computing device. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computer device, which can then be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.

[0105] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will appreciate that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments, and substitutions are possible for those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of the present invention. The scope of the present invention is determined by the scope of the appended claims.

Claims

1. A model simulation data storage method, characterized in that: include: Get the target simulation data table of the Modelica model; Converting the table attribute format of the target simulation data table to obtain a target storage data table, wherein the table attribute format is table row and column attribute data of the target simulation data table; Storing the target storage data table in a preset distributed database; The converting of the table attribute format of the target simulation data table to obtain the target storage data table includes: Determine at least one data simulation variable according to the target simulation data table, and number each of the data simulation variables to obtain a simulation variable number; Determining the data mapping position of each data simulation variable based on the simulation variable number and a preset row variable threshold; the preset row variable threshold is a threshold value for the number of simulation variables in the same row; Mapping the simulation data of each data simulation variable to a data mapping position to obtain the target storage data table; The step of determining the data mapping position of each data simulation variable based on the simulation variable number and the preset row variable threshold comprises: Rounding up the simulation variable number to the preset row variable threshold to obtain a data mapping row position; Taking the modulus of the simulation variable number and the preset row variable threshold value to obtain a data mapping column position; Determine the data mapping position according to the data mapping row position and the data mapping column position; The step of determining at least one data simulation variable according to the target simulation data table and numbering each of the data simulation variables to obtain a simulation variable number includes: Identifying header data of the target simulation data table and determining at least one data simulation variable; Mapping the data simulation variables to the preset linear sets in sequence to obtain the target variable linear set; According to the arrangement order of the variables in the linear set of target variables, the simulation variable number of each of the data simulation variables is determined respectively.

2. The method according to claim 1, characterized in that Mapping the simulation data of each data simulation variable to a data mapping position to obtain the target storage data table includes: Get the initial storage data table; Determine at least one data mappable position in the initial storage data table according to the data mapping position; The simulation data of the data simulation variables are sequentially mapped to the data mappable positions to obtain the target storage data table.

3. The method according to claim 1, characterized in that The storing the target storage data table in a preset distributed database includes: Obtaining a storage table memory value of the target storage data table; When the storage table memory value is greater than a preset storage threshold, the target storage data table is split into at least one target storage data sub-table; The target storage data sub-tables are respectively stored in the data partition libraries of the preset distributed database.

4. The method according to claim 3, characterized in that The step of storing the target storage data sub-tables in data partition libraries of a preset distributed database includes: Determine the number of partition libraries according to the number of the target storage data sub-tables; Determining at least one partition storage address according to the number of the predetermined partition libraries and table attribute information of the target simulation data table; Each of the target storage data sub-tables is stored in the partition storage address respectively.

5. A model simulation data storage device, characterized in that: The device comprises: A simulation data table acquisition module is used to obtain the target simulation data table of the Modelica model; A storage data table generating module is used to convert the table attribute format of the target simulation data table to obtain a target storage data table, wherein the table attribute format is the table row and column attribute data of the target simulation data table; A data table storage module, configured to store the target storage data table in a preset distributed database; The storage data table generation module is specifically configured to determine at least one data simulation variable according to the target simulation data table, and number each of the data simulation variables to obtain a simulation variable number; determine a data mapping position for each data simulation variable based on the simulation variable number and a preset row variable threshold; the preset row variable threshold is a threshold for the number of simulation variables in the same row; and map the simulation data of each data simulation variable to the data mapping position to obtain the target storage data table; The storage data table generating module includes: a data mapping position determining unit, configured to round up the simulation variable number by the preset row variable threshold to obtain a data mapping row position; modulo the simulation variable number by the preset row variable threshold to obtain a data mapping column position; and determine the data mapping position according to the data mapping row position and the data mapping column position; The simulation variable number determination unit is used to identify the header data of the target simulation data table and determine at least one data simulation variable; map the data simulation variables to the preset linear set in sequence to obtain the target variable linear set; and determine the simulation variable number of each data simulation variable according to the arrangement order of the variables in the target variable linear set.

6. A computer device, characterized in that: The computer device comprises: one or more processors; a memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the model simulation data storage method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the model simulation data storage method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Simulation data storage method and device, electronic equipment and storage medium

    CN113407533A