A method and device for making a nuclear reaction database based on HDF5 format
By converting the ACE format nuclear reaction database to HDF5 format, the ACE format database data structure is fixed, the user's difficulty in expanding, and the large storage space is large, and more efficient data access and storage is achieved.
Patent Information
- Application Number
- CN202210832197.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-15
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2042-07-15
AI Technical Summary
The ACE format nuclear reaction database has problems such as fixed data structure, difficulty in expanding users, lack of human readability, low data access efficiency and large storage space.
The HDF5 format database is generated by reading the directory files of the ACE format database, parsing and formatting the directory files, reading the target data files, parsing and writing them to the HDF5 format files.
Solve the problems of fixed and difficult to expand the data structure of ACE format database, not human readability, low data access efficiency and large storage space. The generated HDF5 format database is more hierarchical, clear physical meaning, easy to expand and storage space High efficiency.
Smart Images

Figure CN115374079B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data processing, and in particular to a method and device for preparing a nuclear reaction database based on the HDF5 format, an electronic device and a storage medium. Background Art
[0002] Traditional Monte Carlo databases are mainly in ACE format, which stores nuclear reaction data of different nuclides in text files in the form of one-dimensional arrays, so that these text files form an ACE format database.
[0003] When using the ACE format database, the nuclear reaction Monte Carlo program first needs to read in the database directory file, and read the nuclear data into the program under the specified path according to the database path given in the directory file and the starting position and number of nuclear data in the corresponding data text file. Since the one-dimensional array is read in, it contains a wide variety of nuclear data (for example, the continuous energy neutron database, its nuclear data includes nuclear reaction cross-section data, energy distribution data, angular distribution data, and for fissionable nuclides, it also includes fission neutron data and probability tables), the Monte Carlo program needs to use a complex indexing method to find the corresponding data in the one-dimensional array before using these data, so the data access efficiency is low.
[0004] Since the ACE format database is processed using the NJOY program, and the ACE format database lists a large amount of nuclear data indiscriminately in a text file, and there are no corresponding labels in front of each type of data, the ACE format database has a fixed data structure, and users cannot easily expand the database according to their needs, and it is basically not human-readable. Summary of the invention
[0005] The present invention provides a method and device for making a nuclear reaction database based on the HDF5 format, an electronic device and a storage medium. The main purpose is to solve the problems of the ACE format database, such as the fixed data structure, the inability of users to easily expand the database according to their own needs, the lack of human readability, the low data access efficiency and the large storage space occupied.
[0006] According to a first aspect of the present disclosure, a method for preparing a nuclear reaction database based on the HDF5 format is provided, comprising:
[0007] Read the directory file of the ACE format database based on the first preset class method;
[0008] Parsing and formatting the directory file based on a second preset class method to obtain a first dictionary, wherein the second preset class method includes a parsing function and a formatting function, and the first dictionary uses a first data table identification string and a first storage data table parameter as a key-value pair;
[0009] By looping through the first dictionary, obtaining a second storage data table parameter in the first dictionary according to a second data table identification string, wherein the second storage data table parameter corresponds to the second data table identification string;
[0010] Transmitting the second storage data table parameters to a third preset class method;
[0011] Calling a corresponding fourth preset class method according to the database type and the second storage data table parameter through a third preset class method to read the target data file from the ACE format database for parsing, and obtaining a second dictionary, wherein the second dictionary uses the second data table identification string and the storage core data class as key-value pairs;
[0012] Loop through the second dictionary based on a preset function to obtain a storage core data class, wherein the preset function is a function in a third preset class method, and the storage core data class corresponds to a second data table identification string;
[0013] The storage core data class is written into a file in HDF5 format to obtain a database in HDF5 format. The file written into the storage core data class is named with an identification prefix name of the corresponding second data table identification string.
[0014] Optionally, the method of reading the directory file of the ACE format database based on the first preset class method includes:
[0015] Based on a preset input method, input a first absolute path of the directory file;
[0016] Based on the preset input method, input a second absolute path, where the second absolute path is a generation path and a storage path of a database in an HDF5 format;
[0017] According to the first absolute path, a first preset class method is used to read the directory file of the ACE format database.
[0018] Optionally, before looping through the first dictionary and acquiring the second storage data table parameter in the first dictionary according to the second data table identification string, the method further includes:
[0019] Based on a preset input method, the second data table identification character string is input.
[0020] Optionally, the method of calling a corresponding fourth preset class method according to the database type and the second storage data table parameter by the third preset class method to read the target data file from the ACE format database for parsing to obtain the second dictionary includes:
[0021] Determining a database type based on an identification suffix of the second data table identification string;
[0022] Calling a corresponding fourth preset class method according to the database type and the second storage data table parameter through the third preset class method;
[0023] The target data file is read from the ACE format database based on the second storage data table parameters through the fourth preset class method for parsing to obtain a second dictionary. The second storage data table parameters include the relative path of the ACE format database, the starting position of the data file where the data table is located, and the data table length.
[0024] Optionally, the method is applied to the production of a continuous energy neutron database, a continuous energy photogen database, a continuous energy photonuclear database, a neutron thermalization database, a multi-group database, and a continuous energy electron database.
[0025] According to a second aspect of the present disclosure, there is provided a nuclear reaction database preparation device based on the HDF5 format, comprising:
[0026] A reading unit, used for reading a directory file of an ACE format database based on a first preset class method;
[0027] A first parsing unit, configured to parse and format the directory file based on a second preset class method to obtain a first dictionary, wherein the second preset class method includes a parsing function and a formatting function, and the first dictionary uses a first data table identification string and a first storage data table parameter as a key-value pair;
[0028] A first acquisition unit, configured to acquire a second storage data table parameter in the first dictionary according to a second data table identification string by traversing the first dictionary in a loop, wherein the second storage data table parameter corresponds to the second data table identification string;
[0029] A transmission unit, used for transmitting the second storage data table parameter to a third preset class method;
[0030] A second parsing unit is used to call a corresponding fourth preset class method according to the database type and the second storage data table parameter through a third preset class method to read the target data file from the ACE format database for parsing, and obtain a second dictionary, wherein the second dictionary uses the second data table identification string and the storage core data class as key-value pairs;
[0031] A second acquisition unit, configured to loop through the second dictionary based on a preset function to acquire a storage core data class, wherein the preset function is one of the functions in the third preset class method, and the storage core data class corresponds to the second data table identification string;
[0032] The writing unit is used to write the storage core data class into a file in HDF5 format to obtain a database in HDF5 format. The file written by the storage core data class is named with the identification prefix name of the corresponding second data table identification string.
[0033] Optionally, the reading unit includes:
[0034] A first input module, used for inputting a first absolute path of the directory file based on a preset input method;
[0035] A second input module, used to input a second absolute path based on a preset input method, where the second absolute path is a generation path and a storage path of a database in an HDF5 format;
[0036] A reading module is used to read the directory file of the ACE format database according to the first absolute path using a first preset class method.
[0037] Optionally, the device further comprises:
[0038] The second input unit is used to input the second data table identification character string based on a preset input method.
[0039] Optionally, the second parsing unit includes:
[0040] A determination module, configured to determine a database type based on an identification suffix of the second data table identification string;
[0041] A calling module, used for calling a corresponding fourth preset class method according to the database type and the second storage data table parameter through a third preset class method;
[0042] A parsing module is used to read the target data file from the ACE format database and parse it based on the second storage data table parameter through the fourth preset class method to obtain a second dictionary. The second storage data table parameter includes the relative path of the ACE format database, the starting position of the data file where the data table is located, and the length of the data table.
[0043] Optionally, the device is used to produce a continuous energy neutron database, a continuous energy photon database, a continuous energy photon database, a neutron thermalization database, a multi-group database, and a continuous energy electron database.
[0044] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0045] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect above.
[0046] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect.
[0047] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described in the first aspect above.
[0048] The present disclosure provides a method and device for making a nuclear reaction database based on the HDF5 format, an electronic device, and a storage medium. The method reads a directory file of an ACE format database based on a first preset method; the directory file is parsed and formatted based on a second preset method to obtain a first dictionary, wherein the second preset method includes a parsing function and a formatting function, and the first dictionary uses a first data table identification string and a first storage data table parameter as a key-value pair; the first dictionary is traversed in a loop, and a second storage data table parameter in the first dictionary is obtained according to the second data table identification string, and the second storage data table parameter corresponds to the second data table identification string; the second storage data table parameter is transmitted to a third preset method. Method; calling the corresponding fourth preset class method according to the database type and the second storage data table parameter through the third preset class method to read the target data file from the ACE format database for parsing to obtain a second dictionary, wherein the second dictionary uses the second data table identification string and the storage core data class as key-value pairs; looping through the second dictionary based on a preset function to obtain the storage core data class, wherein the preset function is one of the functions in the third preset class method, and the storage core data class corresponds to the second data table identification string; writing the storage core data class into a file in HDF5 format to obtain an HDF5 format database, wherein the file written by the storage core data class is named with the identification prefix name of the corresponding second data table identification string. Compared with the related art, based on the parsing of the ACE format database directory file, a first dictionary is obtained, based on the input second data table identification string, a second storage data table parameter corresponding to the second data table identification string is traversed and queried in the first dictionary, based on the second storage data table parameter, a target data file of the ACE format database is indexed and read, the data file is parsed, and written into a file in HDF5 format to obtain an HDF5 format database, and the problem that the ACE format database has a fixed data structure and is difficult to expand, is not human readable, has low data access efficiency, and occupies a large storage space is solved by changing the database format.
[0049] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0051] Figure 1 A flowchart of a method for preparing a nuclear reaction database based on the HDF5 format provided in an embodiment of the present disclosure;
[0052] Figure 2A flowchart of another method for preparing a nuclear reaction database based on the HDF5 format provided in an embodiment of the present disclosure;
[0053] Figure 3A A schematic diagram of a partial structure of a NeutronACEParser class design provided in an embodiment of the present disclosure;
[0054] Figure 3B A schematic diagram of another part of the structure of a NeutronACEParser class design provided in an embodiment of the present disclosure;
[0055] Figure 4A A schematic diagram of a partial structure of a PhotoNuclearACEParser class design provided in an embodiment of the present disclosure;
[0056] Figure 4B A schematic diagram of another part of the structure of a PhotoNuclearACEParser class design provided in an embodiment of the present disclosure;
[0057] Figure 5 A schematic diagram of the design structure of a ThermalNeutronACEParser class provided in an embodiment of the present disclosure;
[0058] Figure 6 A schematic diagram of a partial structure of a PhotoAtomicACEParser class design provided by an embodiment of the present disclosure;
[0059] Figure 7 A schematic diagram of a MultigroupACEParser class design structure provided by an embodiment of the present disclosure;
[0060] Figure 8 A schematic diagram of the design structure of the ElectronACEParser class provided in the embodiment of the present disclosure;
[0061] Fig. 9 A schematic diagram of the structure of a nuclear reaction database preparation device based on the HDF5 format provided in an embodiment of the present disclosure;
[0062] Fig.10 A schematic diagram of the structure of another nuclear reaction database preparation device based on the HDF5 format provided in an embodiment of the present disclosure;
[0063] Fig.11 FIG. 3 is a schematic block diagram of an exemplary electronic device 300 according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0064] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0065] The following describes the method and device for preparing a nuclear reaction database based on the HDF5 format, electronic equipment, and storage medium according to an embodiment of the present disclosure with reference to the accompanying drawings.
[0066] Figure 1 The following is a flow chart of a method for preparing a nuclear reaction database based on the HDF5 format provided by an embodiment of the present disclosure. Figure 1 As shown, the method comprises the following steps:
[0067] Step 101, read the directory file of the ACE format database based on the first preset class method.
[0068] The first preset method is an algorithm designed in advance for reading data.
[0069] In order to obtain the directory file of the ACE format database, based on the input directory file absolute path, the directory file of the ACE format database is obtained through the first preset class method, and then the next step is performed.
[0070] Step 102, parse and format the directory file based on a second preset class method to obtain a first dictionary, wherein the second preset class method includes a parsing function and a formatting function, and the first dictionary uses a first data table identification string and a first storage data table parameter as key-value pairs.
[0071] The first storage data table parameters include nuclide atomic mass ratio, relative path of the data file where the data table is located, the starting line of the nuclear data in the data file and the number of data, and for certain types of databases, the temperature at which the database is created.
[0072] In order to obtain the content of the first storage data table parameter, the directory file is parsed into a first dictionary of key-value pairs including the first data table identification string and the first storage data table parameter based on the second preset class method, thereby realizing the use of the preset class method to call the value corresponding to the input key, wherein the key refers to the first data table identification string, and the value is the first storage data table parameter, and the two form a key-value pair, thereby realizing the input of the first data table identification string to call the corresponding first storage data table parameter.
[0073] Step 103 , by looping through the first dictionary, obtain a second storage data table parameter in the first dictionary according to a second data table identification string, wherein the second storage data table parameter corresponds to the second data table identification string.
[0074] In order to obtain the target content in the first storage data table parameter, the corresponding storage data table parameter, i.e., the second storage data table parameter, is matched and queried in the first dictionary through the input second data table identification string; the implementation process is, based on the formed key-value pair first dictionary, the value matched by the input key is queried in the first dictionary and outputted.
[0075] The first dictionary refers to a data set of key-value pairs, the second data table identification string is an index field input by a user in order to obtain target content in the first storage data table parameter, and the second storage data table parameter is the target content.
[0076] Step 104: Transmit the second storage data table parameters to a third preset class method.
[0077] Based on the second storage data table parameters, a third preset class method performs subsequent processing of database production.
[0078] Step 105, calling the corresponding fourth preset class method according to the database type and the second storage data table parameters through the third preset class method to read the target data file from the ACE format database for parsing to obtain a second dictionary, wherein the second dictionary uses the second data table identification string and the storage core data class as key-value pairs.
[0079] The third preset class method is a written algorithm. The third preset class method calls the corresponding fourth preset class method through the database type combined with the second storage data table parameter content analysis. The target data file is read from the ACE format database by the fourth preset class method for parsing to obtain the second dictionary. The fourth preset class method is one of the preset class methods included in the third preset class method.
[0080] Since the ACE format database is converted into the HDF5 format database, the data in the ACE format database needs to be obtained and then imported into the HDF5 format database designed based on the ACE format database structure. When obtaining the data files in the ACE format database, different types of preset class methods need to be designed to call different types of data files. Therefore, the third preset class method needs to determine the preset class method to be called based on the database type and the second storage data table parameter, that is, first determine the data file that the user aims to obtain, and select the preset class method to be called according to the type of the data file. Specifically, the present disclosure embodiment does not limit the calling method of the preset class method.
[0081] After selecting to call the preset class method, it is also necessary to parse the target data file obtained based on the preset class method and parse it into a second dictionary with the second data table identification string and the storage core data class as key-value pairs, so that the parsed data can be imported into the HDF5 format database by the preset class method.
[0082] Step 106, looping through the second dictionary based on a preset function to obtain a storage core data class, wherein the preset function is a function in a third preset class method, and the storage core data class corresponds to the second data table identification string.
[0083] In order to import the target data files in the ACE format database processed by step 106 into the HDF5 format database, it is necessary to traverse and query the second dictionary to obtain all the target data files. The user inputs the second data table identification string to search the corresponding storage core data class in the second dictionary, thereby realizing the search of the target data file.
[0084] Step 107, writing the storage core data class into a file in HDF5 format to obtain a database in HDF5 format, wherein the file written by the storage core data class is named with an identification prefix name of the corresponding second data table identification string.
[0085] The storage core data class is written into a file in HDF5 format through the preset class method to obtain a database in HDF5 format. In order to realize data sorting and classification, different types of storage core data classes will be stored in corresponding folders.
[0086] The method for making a nuclear reaction database based on the HDF5 format provided by the present disclosure comprises the following steps: reading a directory file of an ACE format database based on a first preset method; parsing and formatting the directory file based on a second preset method to obtain a first dictionary, wherein the second preset method comprises a parsing function and a formatting function, wherein the first dictionary respectively uses a first data table identification string and a first storage data table parameter as a key-value pair; obtaining a second storage data table parameter in the first dictionary according to a second data table identification string by looping through the first dictionary, wherein the second storage data table parameter corresponds to the second data table identification string; transmitting the second storage data table parameter to a third preset method; and formatting the first dictionary through the third preset method. The preset class method calls the corresponding fourth preset class method according to the database type and the second storage data table parameters to read the target data file from the ACE format database for parsing to obtain a second dictionary, wherein the second dictionary uses the second data table identification string and the storage core data class as key-value pairs; based on the preset function, the second dictionary is traversed in a loop to obtain the storage core data class, wherein the preset function is one of the functions in the third preset class method, and the storage core data class corresponds to the second data table identification string; the storage core data class is written into a file in HDF5 format to obtain a HDF5 format database, and the file written by the storage core data class is named with the identification prefix name of the corresponding second data table identification string. Compared with the related art, based on the parsing of the ACE format database directory file, a first dictionary is obtained, based on the input second data table identification string, a second storage data table parameter corresponding to the second data table identification string is traversed and queried in the first dictionary, based on the second storage data table parameter, a target data file of the ACE format database is indexed and read, the data file is parsed, and written into a file in HDF5 format to obtain an HDF5 format database, and the problem that the ACE format database has a fixed data structure and is difficult to expand, is not human readable, has low data access efficiency, and occupies a large storage space is solved by changing the database format.
[0087] To explain the process of making a HDF5 format database in more detail, Figure 2 A flowchart of another method for preparing a nuclear reaction database based on the HDF5 format provided in an embodiment of the present disclosure. Figure 2 As shown, the method comprises the following steps:
[0088] First, read the ACE format database directory file "xsdir" according to the path entered by the user, parse and format it through the paser() function and format() function in the XSDIRParser class, obtain the absolute path (abs_path) of the entire database stored therein, and parse the data table parameters into a nested dictionary (xsdir_contents) with the data table identification string (ZAID.xxx) and the stored data table parameters as key-value pairs, where the data table parameters include the nuclide atomic mass ratio (AWR), the relative path (path) of the data file where the data table is located, the row where the nuclear data starts in the data file, and the number of data (number), and for some types of databases, the temperature (temp) at which the database is made. Then, the necessary parameters for parsing the data table are obtained from xsdir_contents through the data table identification string entered by the user. If the data table identification string entered by the user is "none", the necessary parameters for parsing each data table are obtained by looping through xsdir_contents. Then the obtained parameters are passed into the ACEParser class. The ACEParser class calls the corresponding data parsing class according to the database type, the absolute path of the database obtained, and the relative path of the data file where the data table is located to read the data file from the ACE database for parsing, and parse the core data in each data table into a dictionary (ace_contents) with the data table identifier string and the class storing the core data as key-value pairs. Finally, the to_hdf5 function constructed in the ACEParser class is used to loop through ace_contents to write the core data corresponding to all data table identifiers into an h5 file named with the prefix of the data table identifier. For different types of databases, since they contain different data, the design of the classes called during the parsing process is different, so the structure of the generated HDF5 format database is also different. NeutronACEParser class, PhotoAtomicACEParser class, PhotoNuclearACEParser class, ThermalNeutronACEParser class, MultigroupACEParser class, ElctronACEParser class are designed for the six types of databases in ACE format, namely, continuous energy neutron database, continuous energy photogen database, continuous energy photonuclear database, neutron thermalization database, multigroup database, and continuous energy electron database. During the database parsing process, the type of database to be parsed is identified according to the data table identifier suffix and which class to call for parsing and generating the HDF5 format database is determined. The storage path of the generated HDF5 format nuclear database is the path (path ofHDF5) entered by the user.
[0089] As a refinement of an embodiment of the present disclosure, when executing step 101 to read the directory file of the ACE format database based on the first preset class method, the following implementation methods can be adopted but not limited to, for example: based on the preset input method, input the first absolute path of the directory file; based on the preset input method, input the second absolute path, the second absolute path is the generation path and storage path of the HDF5 format database; according to the first absolute path, use the first preset class method to read the directory file of the ACE format database.
[0090] As a refinement of the above embodiment, before executing the step 103 of looping through the first dictionary and obtaining the second storage data table parameter in the first dictionary according to the second data table identification string, the method can also adopt but is not limited to the following implementation methods, for example: based on a preset input method, inputting the second data table identification string.
[0091] As a refinement of the above embodiment, in step 105, the target data file is read from the ACE format database for parsing by calling the corresponding fourth preset class method according to the database type and the second storage data table parameter through the third preset class method to obtain the second dictionary. The following implementation methods may be adopted but are not limited to, for example: determining the database type based on the identification suffix of the second data table identification string; calling the corresponding fourth preset class method according to the database type and the second storage data table parameter through the third preset class method; reading the target data file from the ACE format database for parsing based on the second storage data table parameter through the fourth preset class method to obtain the second dictionary, wherein the second storage data table parameter includes the relative path of the ACE format database, the starting position of the data file where the data table is located, and the data table length.
[0092] As a refinement of the above embodiment, the method can be applied to the production of a continuous energy neutron database, a continuous energy photogen database, a continuous energy photonuclear database, a neutron thermalization database, a multi-group database, and a continuous energy electron database.
[0093] In order to introduce the NeutronACEParser class designed for the ACE format continuous energy neutron database in detail, Figure 3A A schematic diagram of a partial structure of the NeutronACEParser class design provided in an embodiment of the present disclosure. Figure 3B Another structural diagram of a NeutronACEParser class design provided by the present disclosure embodiment. Figure 3A and Figure 3B As shown, the NeutronACEParser class design structure includes:
[0094] In the ACE format database, all core data is stored in the XSS array, and data indexing is required through two integer arrays, NXS and JXS. Figure 3A As shown in the figure, five data blocks are designed for the data contained in the ACE format continuous energy neutron database: energy, nu, precursors, probability_table, and reactions. All data blocks are parsed from the XSS array and written into the h5 file through the to_hdf5() function in each python class. The energy data block contains the main energy grid points at different temperatures, which are parsed into the energy list in the NeutronACEParser class. When generating a nuclear database in HDF5 format, the corresponding data set will be created in the energy directory according to the temperature attribute value in the NeutronACEParser class and the main energy grid points will be written into it. Therefore, when batch parsing the continuous energy neutron ACE database, the energy grid points of the data tables of different temperatures corresponding to the same nuclide in the database will be written to the same directory of the same h5 file, realizing data integration.
[0095] The nu data block appears in the fissile nuclide nuclear database, which contains the number of prompt, delayed neutrons and total fission neutrons generated by the fission reaction, and is parsed into the dictionary nu in the NeutronACEParser class. Therefore, when generating a nuclear database in HDF5 format, the nu_prompt, nu_delayed and nu_total directories will be created in the nu directory according to the key values in the dictionary nu in the NeutronACEParser class. There are two possible storage methods for the number of fission neutrons: table format and polynomial. Therefore, two classes are designed for parsing: NU_TableForm and NU_PolynomialForm, and the storage method will be written into the attributes of the above three directories. The values stored in the table storage method are energy points, the corresponding number of fission neutrons and the interpolation parameters (break_points, interpolation). When generating a nuclear database in HDF5 format, the energy points and the corresponding number of fission neutrons are written into the energy and nu data sets in the above three directories respectively. If the interpolation parameters exist, the attributes written into the above three directories are used, otherwise the default is linear interpolation. The values stored in the polynomial storage method are only the polynomial coefficients. When generating the kernel database in HDF5 format, the coefficients are written to the coefficients data set in the above three directories.
[0096] The precursors data block also appears in the fissile nuclide database, which generally contains six sets of precursor nuclear data, parsed into the list precursor in the NeutronACEParser class. Each set of precursor nuclear data contains energy points, decay probability, interpolation parameters and decay constants, corresponding to energy, probability, break_points, interpolation, and decayed_constant in the Precursor class. When generating a nuclear database in HDF5 format, the precursor list will be traversed to generate the corresponding number of precursor directories, and the corresponding energy and probability data sets will be written to each directory. Break_points and interpolation are written into the energy attribute as interpolation parameters of decay probability (if they do not exist, linear interpolation is used by default), and decayed_constant is written into the attributes of the corresponding directory.
[0097] The probability_table data block contains the energy points of the given probability table at different temperatures, the corresponding probability tables, the interpolation parameters between tables, the inelastic scattering competition flag, the other absorption flag, and the cross-section factor flag, which correspond to energy, probability_table, interpolation, inelastic_competition_flag, other_absorption_flag, and multiply_smooth_flag in the ProbabilityTable class. When generating a nuclear database in HDF5 format, a directory named after the temperature attribute value is created under the probability_table directory, and then the energy and probability_table data sets are written to the corresponding directory, and interpolation, inelastic_competition_flag, other_absorption_flag, and multiply_smooth_flag are written as attributes of the directory. Therefore, when batch parsing the continuous energy neutron ACE database, the probability tables of the data tables of different temperatures corresponding to the same nuclide in the database will be written to the probability_table directory of the same h5 file, realizing data integration.
[0098] The reactions data block is the largest and most complex. It contains all the reaction channel information of the neutron nuclear reaction, which is parsed into the dictionary reactions in the NeutronACEParser class. The key-value pairs of the dictionary reactions are the ENDF reaction channel number and the NeutronReaction class that stores the reaction channel information. When generating a nuclear database in HDF5 format, a directory named after each reaction channel name will be created under the reactions directory according to the key values in the dictionary reactions, the ENDF reaction channel number and the reaction channel name. At the same time, the ENDF reaction channel number will also be written into the attribute MT of the directory. Then the data in the corresponding NeutronReaction class is written into each reaction channel directory. The Q and coordinate in the NeutronReaction class represent the energy release corresponding to the reaction channel and the coordinate system of the emitted particle information given in the reaction channel, respectively. These two data are also written into the attributes of the corresponding reaction channel directory. The two lists energy and xs in the NeutronReaction class store the energy points and corresponding nuclear reaction cross-section values given by the reaction channel respectively. The values in these two lists change with the temperature of the database. Therefore, when generating a nuclear database in HDF5 format, a directory named after the temperature attribute value is created under each reaction channel directory, and then the energy and cross-section values are written into the energy and xs data sets under the corresponding directory. Therefore, when batch parsing the continuous energy neutron ACE database, the probability tables of the data tables corresponding to different temperatures of the same nuclide in the database will be written into the unified directory of the same h5 file, realizing data integration.
[0099] The dictionary productions in the NeutronReaction class stores the information of secondary particles generated by the reaction. The key-value pairs of the dictionary are the serial number of the product particle and the class that stores the product particle information. The secondary product particles in the continuous energy neutron ACE database only include neutrons and photons, so the NeutronProduct and PhotonProduct classes are designed for parsing. Both classes contain particle_type and emission_mode parameters, which respectively indicate the type of product particles and the emission mode (instantaneous, slow). When generating a nuclear database in HDF5 format, a directory is created for each product particle. For neutron products, either the number of neutrons generated, particle_number (for fission reactions, this part of the data is placed in the nu directory), or the yield data is given. For photon products, either the cross-section data of the photon is given, or the yield data is given. The yield data is stored in the yields list of the NeutronProduct and PhotonProduct classes, and the cross-section data is stored in the xs list of the PhotonProduct class. The emitted particle energy that the yield data and cross-section data depend on is stored in the energy list. Break_points and interpolation are their corresponding interpolation parameters. When generating a nuclear database in HDF5 format, write particle_type, emission_mode, particle_number, break_points, and interpolation into the attributes of the corresponding product particle directory, and write energy, yields, and xs into the data set under the corresponding product particle directory.
[0100] For each product particle, there is a corresponding emission angle distribution and energy distribution, which are stored in the Distribution class. Figure 3AAs can be seen in the figure, the Distribution class contains three dictionaries: angle, energy, and angle_energy, which represent angular distribution, energy distribution, and angle-energy coupling distribution, respectively. When the distribution type is angle-energy coupling, there will be no angular distribution and energy distribution. Therefore, when generating a kernel database in HDF5 format, the three distribution directories will not appear at the same time. The angular distribution data is stored in the Angle class, where energy represents the energy point that gives the angular distribution, and the dictionary mu represents the emission angle distribution corresponding to each energy point. The key-value pairs of the dictionary are the energy point sequence number and the Mu class that stores the emission angle cosine information. When generating a kernel database in HDF5 format, create the Angle directory, and write energy and the emission angle cosine corresponding to each energy point in energy into the data set under this directory. When the angular distribution is isotropic, there will be no relevant data. At this time, the angular distribution type type needs to be written into the properties of the Angle directory. Since the number of cosines of the emission angle given at different energies may be different, or not given at all (i.e. isotropic), it is necessary to create a separate dataset for the cosines of the emission angle corresponding to each energy point. If a dataset is empty, its properties must indicate that it is isotropic.
[0101] Energy distribution and angle-energy coupling distribution data are relatively complex because there are many types of distributions, so corresponding laws are designed for each distribution. Each law contains the probability probability of the distribution and the corresponding energy energy_for_probability and interpolation parameters interpolationfor_probability. Since each emitted particle may contain more than one type of emitted energy distribution, the above parameters are the parameters required by the Monte Carlo procedure to sample different energy distributions.
[0102] In order to introduce the PhotoNuclearACEParserr class designed for the ACE format continuous energy photon database, Figure 4A A schematic diagram of a partial structure of the PhotoNuclearACEParser class design provided in an embodiment of the present disclosure. Figure 4B Another structural diagram of a PhotoNuclearACEParser class design provided in an embodiment of the present disclosure. Figure 4A and Figure 4B As shown, the PhotoNuclearACEParser class design structure includes:
[0103] Three data blocks are designed for the data contained in the ACE format continuous energy photonuclide database: energy, secondary_particles, and reactions. The data contained in the reactions data block include the energy points corresponding to each reaction channel, the photonuclide reaction cross-section value, and the heat release of the reaction. The design of this part of the data structure is the same as that of the continuous energy neutron database, so it will not be repeated here.
[0104] Different from the continuous energy neutron database, the secondary particles of the continuous energy photonuclear database include electrons, protons, deuterons, helium nuclei, and tritium nuclei in addition to neutrons and photons. The key-value pairs of the dictionary secondary_particles in the PhotoNuclearACEParser class are the secondary particle number and the SecondaryParticles class that stores the secondary particle data. When generating the photonuclear database in HDF5 format, a directory will be created for each secondary particle and the name of the secondary particle will be written into the attributes of the directory. Since there may be multiple reaction channels that can produce the secondary particle, the ENDF reaction channel number will also be written into the attributes of the secondary particle directory. The energy, xs, and heating in the SecondaryParticles class represent the energy point, the cross section of the reaction to generate the secondary particle, and the heat deposition number, respectively. All these data are written into the data set under the secondary particle directory. Since there may be multiple reaction channels that can produce the secondary particle, the SecParProduceReaction class is designed to parse all the reaction channel data that produce the secondary particle. The corordinate in the SecParProduceReaction class represents the coordinate system where the reaction channel data is located. xs, yileds, and energy represent the cross-section, yield, and corresponding energy point of the particle produced by the reaction channel, respectively. Of course, xs and yileds will not be given at the same time. If yileds is given, the corresponding interpolation parameters break_points and interpolation may also be given (if not given, linear interpolation is used by default).
[0105] In order to introduce the ThermalNeutronACEParser class designed for the ACE format neutron thermalization library in detail, Figure 5 The present disclosure provides a schematic diagram of the ThermalNeutronACEParser class design structure. Figure 5 As shown, the ThermalNeutronACEParser class design structure includes:
[0106] For the data contained in the ACE format continuous energy neutron thermal nuclear database, only one data block is designed: reactions, which is parsed into the dictionary reactions in the ThermalNeutronACEParser class. The key-value pairs of this dictionary are the reaction channel name and the class storing the reaction channel data. For the thermal library, there are only three reaction channels: incoherent inelastic scattering, coherent elastic scattering, and coherent inelastic scattering. The IncoherentInelastic, CoherentElastic, and IncoherentElastic classes are designed for parsing. Since the reaction channel data contained in the thermal library at different temperatures are different, when generating the HDF5 format neutron thermal nuclear database, the corresponding temperature directory will be created according to the temperature attribute value in the ThermalNeutronACEParser class, and then the IncoherentInelastic, CoherentElastic, and IncoherentElastic directories will be created under the temperature directory according to the key value in the reactions dictionary. The CoherentElastic and IncoherentElastic classes are relatively simple. The CoherentElastic class only contains energy and xs, which represent the energy point and the corresponding cross-section value of coherent elastic scattering respectively. The IncoherentElastic class contains angular distribution data mu in addition to energy and xs. The IncoherentInelastic class contains secondary neutron distribution data in addition to energy and xs, which is stored in the distributions dictionary. Secondary neutron distributions are all angle-energy coupled distributions, which are divided into continuous and discrete types, and are parsed by the AngleEnergyContinuous and AngleEnergyDiscrete classes respectively. Both classes contain the type attribute, which will be written into the attributes of the corresponding reaction channel directory when generating the continuous energy thermalization library in HDF5 format. The AngleEnergyDiscrete class only contains energy and mu, which represent the energy and angular distribution of secondary neutrons respectively. The angle_energy dictionary in the AngleEnergyContinuous class is used to store the outgoing neutron distribution data corresponding to each energy point given by energy in the IncoherentInelastic class. The key-value pairs of the angle_energy dictionary are the energy point sequence number in energy and the corresponding AngleEnergy class that stores the outgoing neutron distribution data.The AngleEnergy class contains emission energy points and the corresponding emission angle distribution data. The emission angle distribution data corresponding to each emission energy point is parsed by the Mu class and stored in the dictionary Mu in the AngleEnergy class.
[0107] In order to introduce the PhotoAtomicACEParser class designed for the ACE format continuous energy photon database, Figure 6 A schematic diagram of a partial structure of the PhotoAtomicACEParser class design provided in the embodiment of the present disclosure. Figure 6 As shown, the PhotoAtomicACEParser class design structure includes:
[0108] Three data blocks are designed for the data contained in the ACE format continuous energy photogenic nuclear database: energy, heating, reactions, and shells. Energy and heating represent the main energy grid points of the photogenic reaction and the corresponding heat deposition number, respectively. When generating the HDF5 format photogenic reaction nuclear database, they are parsed into the energy and heating data sets. Reactions in the PhotoAtomicACEParser class is a dictionary that stores the reaction channel data of the photogenic reaction. The key-value pairs of the dictionary are the reaction channel name string and the corresponding class that stores the reaction channel data. There are five types of photogenic reactions: incoherent scattering, coherent scattering, photoelectric effect, electron pair effect, and fluorescence effect, corresponding to five classes: Incoherent, Coherent, PhotoElectric, Pairproduction, and Fluorescence. When generating the HDF5 format photogenic reaction nuclear database, the data stored in the above five classes are written into the directory named by the dictionary key value by traversing the dictionary reactions. The shells in the PhotoAtomicACEParser class is a list that stores atomic shell data. The atomic shell data includes the reaction probability interpolation_probability, electron number electron_number, binding energy binding_energy, Compton profile compton_profile and its interpolation parameter interpolation of each shell. When generating the photogenic reaction nuclear database in HDF5 format, the list shells is traversed to write the data of each shell to the corresponding directory, interpolation_probability is written into the directory's attributes, and interpolation is written into the compton_profile's attributes.
[0109] In order to introduce the MultigroupACEParser class designed for multigroup databases in ACE format, Figure 7 A schematic diagram of the design structure of a MultigroupACEParser class provided in an embodiment of the present disclosure. Figure 7 As shown, the MultigroupACEParser class design structure includes:
[0110] The ACE format multi-group database is divided into a multi-group neutron database and a multi-group photon database. The data formats of the two are exactly the same, so the MultigroupACEParser class is designed to parse the entire multi-group database. Eight data blocks are designed for the data contained in the ACE format multi-group database: particle_mass, group_center, group_width, fission_fraction, stopping_power, nu, secondary_particles, and reactions. Among them, fission_fraction and nu represent the fission fraction of each group and the number of fission neutrons produced by each group, respectively, and only exist for fissionable nuclides. Particle_mass represents the mass of the incident particle corresponding to each energy group. This data is only given for particles other than neutrons and photons. Stopping_power only exists for charged particles, indicating the stopping power of the nuclide for the incident particles under each energy group. Group_center and group_width represent the central energy value and energy group width of each group. The reactions data block stores the cross-section and heat release data of each reaction channel. The cross-section and heat release data correspond to the energy group. When generating a multi-group nuclear database in HDF5 format, a reactions directory will be created, and then each reaction channel subdirectory will be generated by traversing the reactions dictionary under the reactions directory. The directory is named after the reaction channel name, and then the cross-section and heat release data are written into the data set under the reaction channel directory. The ENDF reaction channel number is written into the attributes of the reaction channel directory. The secondary_particles data block stores the secondary particle data. The secondary particle data is parsed by the MultigroupSecondaryParticle class. particle_type indicates the type of secondary particle. xs_P0 is a two-dimensional array, which indicates the cross-section of each incident energy group scattering to each outgoing energy group. group_center and group_width indicate the secondary particle energy group center and energy group width. angle is a dictionary whose key-value pairs are the incident energy group number and the MultigroupAngle class that stores the secondary particle angular distribution data. The type in the MultigroupAngle class represents the type of distribution. The dictionary to_group is a dictionary whose key-value pairs are the emission energy group number and the class ToGroup that stores the secondary particle angular distribution data. The id in the ToGroup class represents the emission energy group number, mu represents the cosine of the angle at which a certain incident energy group emits to the emission energy group, and type represents the distribution type.When generating a multi-group nuclear database in HDF5 format, a secondary_particle directory will be created. Then, by traversing the secondary_particles dictionary, a directory for each secondary particle will be created. xs_P0, group_center, and group_width will be written into the data set under the directory, and particle_type will be written into the attributes of the directory. Then, by traversing the dictionary angle, an angular distribution directory will be created for each incident energy group. If type is "isotropic", it will be written into the angular distribution directory attribute, and the directory will be an empty directory. Otherwise, the to_group dictionary will be traversed to create an angular distribution data set for each secondary particle energy group under the angular distribution directory. The data set attributes will indicate the type of angular distribution ("isotropic" or "equiprobable_cosine_bins" (i.e., equiprobable cosine bins)).
[0111] In order to introduce the ElectronACEParser class designed for the continuous energy electron database in ACE format, Figure 8 The present disclosure provides a schematic diagram of the design structure of the ElectronACEParser class. Figure 8 As shown, the ElectronACEParser class design structure includes:
[0112] Two data blocks are designed for the data contained in the ACE format continuous energy electronic database: reactions and shells. The shells data block contains the data of each atomic shell, which has been explained in the previous photoproto-nuclear database and will not be repeated here. The reactions in the ElectronACEParser class is a dictionary that stores electronic reaction channel data. The key-value pairs of the dictionary are the reaction channel name string and the corresponding class that stores the reaction channel data. There are five types of photogenic reactions: incoherent scattering, coherent scattering, photoelectric effect, electron pair effect, and fluorescence effect, which correspond to four classes: AugerEffect, MottScattering, RileyScattering, and Bremsstrahlung, which represent Auger effect, Mott scattering, Rayleigh scattering, and Bremsstrahlung, respectively. When generating the electronic reaction nuclear database in HDF5 format, the data stored in the above four classes are written into the directory named by the dictionary key value by traversing the dictionary reactions.
[0113] In summary, the embodiments of the present application can achieve the following effects:
[0114] 1. The disclosed embodiment generates a set of nuclear databases in a completely new format. The data structure is hierarchical and more physically meaningful, clear and easy to understand, and solves the problem that the traditional ACE format nuclear database is unreadable by humans.
[0115] 2. By integrating the nuclear data at different temperature points, a large amount of redundant data in the ACE format nuclear database is reduced. In addition, since the generated HDF5 format nuclear database is a binary file, the storage space occupied is also greatly reduced, solving the problem of large storage space occupied by the traditional ACE format.
[0116] 3. Researchers can easily write the data they need into the HDF5 format core database and apply it in the program, which effectively solves the problem that the traditional ACE core database is difficult to expand.
[0117] Corresponding to the above-mentioned method for making a nuclear reaction database based on the HDF5 format, the present invention also proposes a device for making a nuclear reaction database based on the HDF5 format. Since the device embodiment of the present invention corresponds to the above-mentioned method embodiment, the details not disclosed in the device embodiment can be referred to the above-mentioned method embodiment, and will not be repeated in the present invention.
[0118] Fig. 9 The structure diagram of a nuclear reaction database preparation device based on HDF5 format provided by an embodiment of the present disclosure is shown in FIG. Fig. 9 As shown, the device comprises:
[0119] A reading unit 21, configured to read a directory file of an ACE format database based on a first preset class method;
[0120] A first parsing unit 22 is used to parse and format the directory file based on a second preset class method to obtain a first dictionary, wherein the second preset class method includes a parsing function and a formatting function, and the first dictionary uses a first data table identification string and a first storage data table parameter as a key-value pair;
[0121] A first acquisition unit 23, configured to acquire a second storage data table parameter in the first dictionary according to a second data table identification string by traversing the first dictionary in a loop, wherein the second storage data table parameter corresponds to the second data table identification string;
[0122] A transmission unit 24, configured to transmit the second storage data table parameters to a third preset class method;
[0123] A second parsing unit 25 is used to read the target data file from the ACE format database and parse it according to the database type and the second storage data table parameter through a third preset class method to obtain a second dictionary, wherein the second dictionary uses the second data table identification string and the storage core data class as key-value pairs;
[0124] A second acquisition unit 26, configured to loop through the second dictionary based on a preset function to acquire a storage core data class, wherein the preset function is one of the functions in the third preset class method, and the storage core data class corresponds to the second data table identification string;
[0125] The writing unit 27 is used to write the storage core data class into a file in HDF5 format to obtain a database in HDF5 format. The file written by the storage core data class is named with the identification prefix name of the corresponding second data table identification string.
[0126] The nuclear reaction database making device based on HDF5 format provided by the present disclosure reads the directory file of the ACE format database based on the first preset class method; parses and formats the directory file based on the second preset class method to obtain a first dictionary, the second preset class method includes a parsing function and a formatting function, the first dictionary uses the first data table identification string and the first storage data table parameter as a key-value pair respectively; by looping through the first dictionary, the second storage data table parameter in the first dictionary is obtained according to the second data table identification string, and the second storage data table parameter corresponds to the second data table identification string; the second storage data table parameter is transmitted to the third preset class method; through the third The preset class method calls the corresponding fourth preset class method according to the database type and the second storage data table parameters to read the target data file from the ACE format database for parsing to obtain a second dictionary, wherein the second dictionary uses the second data table identification string and the storage core data class as key-value pairs; based on the preset function, the second dictionary is traversed in a loop to obtain the storage core data class, wherein the preset function is one of the functions in the third preset class method, and the storage core data class corresponds to the second data table identification string; the storage core data class is written into a file in HDF5 format to obtain a HDF5 format database, and the file written by the storage core data class is named with the identification prefix name of the corresponding second data table identification string. Compared with the related art, based on the parsing of the ACE format database directory file, a first dictionary is obtained, based on the input second data table identification string, a second storage data table parameter corresponding to the second data table identification string is traversed and queried in the first dictionary, based on the second storage data table parameter, a target data file of the ACE format database is indexed and read, the data file is parsed, and written into a file in HDF5 format to obtain an HDF5 format database, and the problems of the ACE format database having a fixed data structure and being difficult to expand, being unreadable by humans, having low data access efficiency, and occupying a large storage space are solved by changing the database structure and format.
[0127] Fig.10 This is a schematic diagram of the structure of another nuclear reaction database preparation device based on HDF5 format provided by the embodiment of the present disclosure. Fig.10 As shown, the reading unit 21 includes:
[0128] A first input module 211, used to input a first absolute path of the directory file based on a preset input method;
[0129] A second input module 212, configured to input a second absolute path based on a preset input method, wherein the second absolute path is a generation path and a storage path of a database in an HDF5 format;
[0130] The reading module 213 is used to read the directory file of the ACE format database according to the first absolute path using a first preset class method.
[0131] Furthermore, in a possible implementation of this embodiment, as Fig.10 As shown, the device also includes:
[0132] The second input unit 28 is used to input the second data table identification character string based on a preset input method.
[0133] Furthermore, in a possible implementation of this embodiment, as Fig.10 As shown, the second parsing unit 25 includes:
[0134] A determination module 251, configured to determine a database type based on an identification suffix of the second data table identification string;
[0135] A calling module 252, configured to call a corresponding fourth preset method according to the database type and the second storage data table parameters through a third preset method;
[0136] The parsing module 253 is used to read the target data file from the ACE format database based on the second storage data table parameter through the fourth preset class method to parse and obtain a second dictionary. The second storage data table parameter includes the relative path of the ACE format database, the starting position of the data file where the data table is located, and the data table length.
[0137] It should be noted that the above explanation of the method embodiment is also applicable to the device of this embodiment, and the principle is the same, which is not limited in this embodiment.
[0138] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0139] Fig.11 A schematic block diagram of an example electronic device 300 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0140] like Fig.11As shown, the device 300 includes a computing unit 301, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 302 or a computer program loaded from a storage unit 308 to a RAM (Random Access Memory) 303. In the RAM 303, various programs and data required for the operation of the device 300 can also be stored. The computing unit 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An I / O (Input / Output) interface 305 is also connected to the bus 304.
[0141] A number of components in the device 300 are connected to the I / O interface 305, including: an input unit 303, such as a keyboard, a mouse, etc.; an output unit 307, such as various types of displays, speakers, etc.; a storage unit 308, such as a disk, an optical disk, etc.; and a communication unit 309, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 309 allows the device 300 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0142] The computing unit 301 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 301 performs the various methods and processes described above, such as a method for making a nuclear reaction database based on the HDF5 format. For example, in some embodiments, the method for making a nuclear reaction database based on the HDF5 format may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 308. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 300 via the ROM 302 and / or the communication unit 309. When the computer program is loaded into the RAM 303 and executed by the computing unit 301, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 301 may be configured to execute the aforementioned HDF5 format-based nuclear reaction database preparation method in any other appropriate manner (eg, by means of firmware).
[0143] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0144] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0145] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0146] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball), through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0147] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
[0148] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0149] It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0150] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0151] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for preparing a nuclear reactor database based on HDF5 format, characterized in that: include: Reading a directory file of an ACE format database based on a first preset method, wherein the first preset method is an algorithm designed in advance for reading data; Parsing and formatting the directory file based on a second preset class method to obtain a first dictionary, the second preset class method includes a parsing function and a formatting function, the first dictionary uses a first data table identification string and a first storage data table parameter as a key-value pair, wherein the second preset class method includes a parsing function and a formatting function, the key is the first data table identification string, and the value is the first storage data table parameter, and the two form a key-value pair; By looping through the first dictionary, searching for a second storage data table parameter in the first dictionary according to a second data table identification string, wherein the second storage data table parameter corresponds to the second data table identification string; Transmitting the second storage data table parameter to a third preset method, wherein the third preset method is a writing algorithm; The target data file is read from the ACE format database and parsed by calling the corresponding fourth preset class method according to the database type and the second storage data table parameter through the third preset class method to obtain a second dictionary, wherein the second dictionary uses the second data table identification string and the storage core data class as key-value pairs; the fourth preset class method is one of the preset class methods included in the third preset class method; Loop through the second dictionary based on a preset function to obtain a storage core data class, wherein the preset function is a function in a third preset class method, and the storage core data class corresponds to a second data table identification string; The storage core data class is written into a file in HDF5 format to obtain a database in HDF5 format. The file written into the storage core data class is named with an identification prefix name of the corresponding second data table identification string.
2. The method according to claim 1, characterized in that: The method of reading the directory file of the ACE format database based on the first preset class method includes: Based on a preset input method, input a first absolute path of the directory file; Based on the preset input method, input a second absolute path, where the second absolute path is a generation path and a storage path of a database in an HDF5 format; According to the first absolute path, a first preset class method is used to read the directory file of the ACE format database.
3. The method according to claim 1, characterized in that: Before looping through the first dictionary and acquiring the second storage data table parameter in the first dictionary according to the second data table identification string, the method further includes: Based on a preset input method, the second data table identification character string is input.
4. The method according to claim 1, characterized in that: The method of calling the corresponding fourth preset class method according to the database type and the second storage data table parameter by the third preset class method reads the target data file from the ACE format database for parsing, and obtains the second dictionary including: Determining a database type based on an identification suffix of the second data table identification string; Calling a corresponding fourth preset class method according to the database type and the second storage data table parameter through the third preset class method; The target data file is read from the ACE format database based on the second storage data table parameters through the fourth preset class method for parsing to obtain a second dictionary. The second storage data table parameters include the relative path of the ACE format database, the starting position of the data file where the data table is located, and the data table length.
5. The method according to any one of claims 1 to 4, characterized in that: The method is applied to making a continuous energy neutron database, a continuous energy photogen database, a continuous energy photonuclear database, a neutron thermalization database, a multi-group database, and a continuous energy electron database.
6. A nuclear reactor database production device based on HDF5 format, characterized in that: include: A reading unit, configured to read a directory file of an ACE format database based on a first preset method, wherein the first preset method is an algorithm designed in advance for reading data; A first parsing unit is used to parse and format the directory file based on a second preset class method to obtain a first dictionary, the second preset class method includes a parsing function and a formatting function, the first dictionary uses a first data table identification string and a first storage data table parameter as a key-value pair, wherein the second preset class method includes a parsing function and a formatting function, the key is the first data table identification string, and the value is the first storage data table parameter, and the two form a key-value pair; A first acquisition unit, configured to query a second storage data table parameter in the first dictionary according to a second data table identification string by traversing the first dictionary in a loop, wherein the second storage data table parameter corresponds to the second data table identification string; A transmission unit, used for transmitting the second storage data table parameter to a third preset type method, wherein the third preset type method is a writing algorithm; A second parsing unit is used to call a corresponding fourth preset class method according to the database type and the second storage data table parameter through a third preset class method to read the target data file from the ACE format database for parsing, and obtain a second dictionary, wherein the second dictionary uses the second data table identification string and the storage core data class as key-value pairs; the fourth preset class method is one of the preset class methods included in the third preset class method; A second acquisition unit, configured to loop through the second dictionary based on a preset function to acquire a storage core data class, wherein the preset function is one of the functions in the third preset class method, and the storage core data class corresponds to the second data table identification string; The writing unit is used to write the storage core data class into a file in HDF5 format to obtain a database in HDF5 format. The file written by the storage core data class is named with the identification prefix name of the corresponding second data table identification string.
7. The manufacturing device according to claim 6, characterized in that: The reading unit comprises: A first input module, used for inputting a first absolute path of the directory file based on a preset input method; A second input module, used to input a second absolute path based on a preset input method, where the second absolute path is a generation path and a storage path of a database in an HDF5 format; A reading module is used to read the directory file of the ACE format database according to the first absolute path using a first preset class method.
8. The manufacturing device according to claim 7, characterized in that: The device also includes: The second input unit is used to input the second data table identification character string based on a preset input method.
9. The manufacturing device according to claim 7, characterized in that: The second parsing unit comprises: A determination module, configured to determine a database type based on an identification suffix of the second data table identification string; A calling module, used for calling a corresponding fourth preset class method according to the database type and the second storage data table parameter through a third preset class method; A parsing module is used to read the target data file from the ACE format database and parse it based on the second storage data table parameter through the fourth preset class method to obtain a second dictionary. The second storage data table parameter includes the relative path of the ACE format database, the starting position of the data file where the data table is located, and the length of the data table.
10. The manufacturing device according to any one of claims 6 to 9, characterized in that: The device is used to prepare a continuous energy neutron database, a continuous energy photogen database, a continuous energy photonuclear database, a neutron thermalization database, a multi-group database, and a continuous energy electronic database.
11. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-5.
13. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Model file generation method and device
CN112579151A
Method, device and equipment for generating kernel data cross section library and storage medium
CN114625731A