A data dictionary change synchronization method, device, and equipment and a storage medium
By establishing a data dictionary in a graphical simulation modeling platform and using a backreference index table to automatically synchronize variable data, the management chaos and inconsistency caused by scattered storage of variable data are solved, ensuring the accuracy and efficiency of simulation results.
Patent Information
- Application Number
- CN202611412318.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-11
- Publication Date
- 2026-11-27
AI Technical Summary
In existing graphical simulation modeling platforms, variable data is stored in the attribute panels of various graphical modules, which leads to cumbersome data management and inconsistencies, affecting the accuracy of simulation results and development efficiency.
Establish a data dictionary for the graphical simulation modeling platform, centrally store multiple target variables, and automatically synchronize to all graphical modules that reference the variable when the data value changes by querying the backreference index table through the data name.
Centralized management of variable data was achieved, avoiding data inconsistency, ensuring that the data values used by each graphical module are consistent, and preventing simulation errors.
Smart Images

Figure CN123179702A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for synchronizing changes in a data dictionary. Background Technology
[0002] In recent years, graphical simulation modeling technology has been widely used in fields such as control system design and automotive electronics development. In graphical simulation modeling platforms, engineers build simulation models by dragging and dropping graphical modules, and each graphical module typically involves a large amount of variable data.
[0003] However, in existing graphical simulation modeling platforms, variable data is usually stored in the property panels of various graphical modules, requiring engineers to set and modify parameters for each module individually. When a large simulation project contains hundreds of graphical modules and thousands of variables, data management becomes extremely cumbersome and prone to inconsistencies.
[0004] Therefore, how to achieve centralized management of variable data and automatically synchronize it to all graphical modules that reference the variable when the variable data changes has become an urgent technical problem to be solved. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for synchronizing changes in a data dictionary, which enables the data values used by each graphical module to be consistent, effectively avoiding simulation errors caused by data inconsistency.
[0006] In a first aspect, embodiments of this application provide a method for synchronizing changes to a data dictionary, the method comprising: A data dictionary is established for a graphical simulation modeling platform. The data dictionary stores multiple target variables, each of which has a data type, a data value, and a unique data name. When the data value corresponding to the target variable in the data dictionary changes, the data name corresponding to the target variable is extracted; Based on the data name corresponding to the target variable, query the preset backreference index table, obtain the graphical module that references the target variable, and send a refresh command to the graphical module; In response to the refresh command, the graphical module rereads the data value corresponding to the target variable from the data dictionary based on the stored data name.
[0007] In one feasible implementation, the backreference index table is used to store the correspondence between the data name corresponding to the target variable and the graphical module referencing the target variable.
[0008] One feasible implementation involves extracting the data name corresponding to the target variable when the data value corresponding to the target variable in the data dictionary changes, including: Monitor the data values corresponding to the target variables in the data dictionary to determine the target variables whose data values have changed, wherein the change is triggered by the user's direct operation; Based on the target variable whose data value has changed, extract the data name corresponding to the target variable.
[0009] One feasible implementation of the method further includes: When the graphical module references the target variable, obtain the project name of the simulation project to which the graphical module belongs; Compare the project name of the simulation project to which the graphical module belongs with the project name authorized by the target variable; If the project name authorized by the target variable is consistent with the project name of the simulation project to which the graphical module belongs, then the target variable is in an editable state; If the project name authorized by the target variable is inconsistent with the project name of the simulation project to which the graphical module belongs, then the target variable is in a read-only state.
[0010] One feasible implementation of the method further includes: The data dictionary is configured with storage segments and storage classes, and the storage segments are used to define the first code generation configuration attributes; The storage class is used to define a second code generation configuration attribute and to inherit the first code generation configuration attribute from the storage segment; The target variable inherits the second code generation configuration attribute in the storage class and the first code generation configuration attribute in the storage segment; The first code generation configuration attribute includes a memory region attribute, and the second code generation configuration attribute includes a code declaration attribute.
[0011] One feasible implementation includes querying a preset backreference index table based on the data name corresponding to the target variable to obtain the graphical module referencing the target variable, and sending a refresh command to the graphical module, comprising: Use the data name corresponding to the target variable as an index to query the preset reverse reference index table; Based on the correspondence between the data name corresponding to the target variable and the graphical module referencing the target variable stored in the reverse reference index table, the graphical module referencing the target variable is obtained, and a refresh command is sent to the graphical module.
[0012] One possible implementation is that the data type includes at least one of global parameters, observations, interpolation tables, enumerations, and structures.
[0013] Secondly, embodiments of this application provide a data dictionary change synchronization device, comprising: The dictionary creation module is used to create a data dictionary for the graphical simulation modeling platform. The data dictionary stores multiple target variables, each of which has a data type, a data value, and a unique data name. The numerical change module is used to extract the data name corresponding to the target variable when the data value corresponding to the target variable in the data dictionary changes; The instruction refresh module is used to query a preset backreference index table based on the data name corresponding to the target variable, obtain the graphical module that references the target variable, and send a refresh instruction to the graphical module. A numerical reading module is used to respond to the refresh command, wherein the graphical module rereads the data value corresponding to the target variable from the data dictionary based on the stored data name.
[0014] Thirdly, embodiments of this application provide an electronic device, the device including: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store a program, the program including instructions, which, when executed by the processor, cause the processor to perform any of the implementation steps of the data dictionary change synchronization method described above.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium for storing a computer program, which, when executed by a terminal device, implements any of the implementation steps of the above-described data dictionary change synchronization method.
[0016] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: As can be seen from the above technical solution, this application provides a method, apparatus, device, and storage medium for synchronizing changes in a data dictionary. First, a data dictionary for a graphical simulation modeling platform is established. This data dictionary stores multiple target variables, each with a data type, data value, and a unique data name. Then, when the data value corresponding to a target variable in the data dictionary changes, the corresponding data name is extracted. Next, based on the data name corresponding to the target variable, a preset backreference index table is queried to obtain the graphical module referencing the target variable, and a refresh command is sent to the graphical module. Finally, in response to the refresh command, the graphical module rereads the data value corresponding to the target variable from the data dictionary based on the stored data name.
[0017] As can be seen, this solution establishes a data dictionary, centrally storing all variable data involved in each graphical module, thus avoiding the management chaos and data inconsistency problems caused by scattered data storage. Furthermore, by storing only the data names of the target variables referenced by each graphical module, a name-based reference relationship is established between the graphical module and the target variables in the data dictionary, eliminating the need to store data copies within the graphical modules. When the data value of the target variable changes, by extracting the data name of the target variable and querying the inverse reference index table based on the data name, all graphical modules referencing the target variable can be accurately identified, and refresh commands can be sent to these modules. Each graphical module responds to the refresh command by rereading the current data value of the target variable from the data dictionary according to its stored data name. In other words, this solution can automatically synchronize the data value of the target variable in the data dictionary to all graphical modules referencing the target variable when the data value of the target variable changes, ensuring consistency in the data values used by each graphical module and effectively avoiding simulation errors caused by data inconsistency. Attached Figure Description
[0018] Figure 1 A flowchart illustrating a method for synchronizing changes to a data dictionary, as provided in an embodiment of this application; Figure 2 A schematic diagram of a data dictionary provided for an embodiment of this application; Figure 3 A schematic diagram illustrating project permission management in a shared mode, provided as an embodiment of this application; Figure 4 This application provides a schematic diagram of a three-level inheritance chain for code generation configuration attributes. Figure 5 A schematic diagram of the core data flow of a data dictionary change synchronization method provided in an embodiment of this application; Figure 6This is a schematic diagram of a data dictionary change synchronization device provided in an embodiment of this application. Detailed Implementation
[0019] As mentioned earlier, in existing graphical simulation modeling platforms, variable data is typically stored in the property panels of various graphical modules, requiring engineers to set and modify parameters module by module. When a large simulation project contains hundreds of graphical modules and thousands of variables, data management becomes extremely cumbersome and prone to inconsistencies. For example, the same variable may be configured with different data values in different modules, or when modifying the data value of a variable, some modules that reference that variable may be overlooked, leading to data asynchrony in the simulation model and severely impacting the accuracy of simulation results and development efficiency.
[0020] To address the aforementioned problems, this application provides a method, apparatus, device, and storage medium for synchronizing changes in a data dictionary. First, a data dictionary for a graphical simulation modeling platform is established. This data dictionary stores multiple target variables, each with a data type, a data value, and a unique data name. Then, when the data value corresponding to a target variable in the data dictionary changes, the corresponding data name is extracted. Next, based on the data name, a pre-defined backreference index table is queried to obtain the graphical module referencing the target variable, and a refresh command is sent to the graphical module. Finally, in response to the refresh command, the graphical module rereads the data value corresponding to the target variable from the data dictionary based on the stored data name.
[0021] As can be seen, this solution establishes a data dictionary, centrally storing all variable data involved in each graphical module, thus avoiding the management chaos and data inconsistency problems caused by scattered data storage. Furthermore, by storing only the data names of the target variables referenced by each graphical module, a name-based reference relationship is established between the graphical module and the target variables in the data dictionary, eliminating the need to store data copies within the graphical modules. When the data value of the target variable changes, by extracting the data name of the target variable and querying the inverse reference index table based on the data name, all graphical modules referencing the target variable can be accurately identified, and refresh commands can be sent to these modules. Each graphical module responds to the refresh command by rereading the current data value of the target variable from the data dictionary according to its stored data name. In other words, this solution can automatically synchronize the data value of the target variable in the data dictionary to all graphical modules referencing the target variable when the data value of the target variable changes, ensuring consistency in the data values used by each graphical module and effectively avoiding simulation errors caused by data inconsistency.
[0022] It should be noted that the implementation subject of the data dictionary change synchronization method in this application is not limited. For example, the data dictionary change synchronization method in this application can be applied to information processing devices such as servers or terminal devices. The server can be a standalone server, a cluster server, or a cloud server. The terminal device can be an electronic device such as a smartphone, computer, personal digital assistant (PDA), or tablet computer.
[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0024] Figure 1 This is a flowchart illustrating a data dictionary change synchronization method provided in an embodiment of this application. Figure 1 As shown, it may include steps S101-S104.
[0025] S101: Establish the data dictionary for the graphical simulation modeling platform. The data dictionary stores multiple target variables, each of which has a data type, data value, and a unique data name.
[0026] In this embodiment, a data dictionary for the graphical simulation modeling platform is first established. A data dictionary is a centralized data repository used to store multiple target variables involved in the simulation model. Each target variable has a data type, a data value, and a unique data name.
[0027] Specifically, data types are used to define the kind or format of the target variable. For example, the data types of the target variable include, but are not limited to, global parameters, observations, interpolation tables, enumerations, and structures. Data values are the specific data content currently stored in the target variable. Data names are unique identifiers for each target variable in the data dictionary.
[0028] Figure 2 This is a schematic diagram of a data dictionary provided in an embodiment of this application. (In conjunction with...) Figure 2 As shown, the data dictionary stores multiple target variables, which are categorized according to their data type. For example, taking a simulation model of a new energy vehicle battery management system (BMS) as an example, the data dictionary can store the following target variables.
[0029] The target variable can be a global parameter, such as battery capacity and voltage limit, with the battery capacity value being 100Ah and the voltage limit value being 4.2V. Other target variables can be observations, such as battery state of charge (SOC) and battery temperature, with SOC and temperature values recorded in real time. Target variables can also be interpolated tables, such as the open circuit voltage (OCV)-SOC curve, where the OCV-SOC curve represents a lookup table containing the relationship between open circuit voltage and state of charge. Furthermore, target variables can be enumerated, such as operating status, where the operating status represents predefined enumerated constants such as idle, charging, or fault. Finally, target variables can be structures, such as cell information, where the cell information represents composite data including voltage, temperature, and SOC.
[0030] Furthermore, different types of target variables in the data dictionary have different core storage fields to meet the data management needs of different engineering scenarios. For example, for a target variable whose data type is a global parameter, its core storage fields include data name, data type, data value, storage class, storage segment, key, sharing mode, and project name, used for configurable parameters shared across modules; for a target variable whose data type is an observation, its core storage fields include data name, data type, data value, sampling time, initial value, dimension, and physical quantity type, used for signals that need to be observed and recorded in the simulation; for a target variable whose data type is an interpolation table, its core storage fields include data name, data type, data value, dimension type, breakpoint vector, interpolation method, and extrapolation method, with the dimension type including... The data types include at least one of one-dimensional, two-dimensional, N-dimensional, irregular, scattered, and hysteresis curves, used to provide globally reusable lookup table data. For target variables with enumerated data types, their core storage fields include data name, data type, data value, and member list. The member list includes at least one enumerated constant and its corresponding value, used to represent state machine or mode selection. For target variables with structure data types, their core storage fields include data name, data type, data value, and member list. The member list includes at least one member, each member having a member name, member type, and member dimension, used to define a composite data bus structure. It is understood that the above-described core storage fields for target variables are merely illustrative examples, and those skilled in the art can add, subtract, or adjust the above fields according to actual engineering needs, all of which fall within the scope of protection of this application.
[0031] In addition, the data type of the target vector in this embodiment may also include a type alias. For a target variable whose data type is a type alias, its core storage fields include data name, data type, data value and original type name, which are used to implement platform-independent type mapping.
[0032] Therefore, this application establishes a data dictionary for a graphical simulation modeling platform, which centrally stores multiple target variables involved in the simulation model. Each target variable has a data type, data value, and a unique data name, thereby achieving centralized management of variable data. This avoids the data redundancy and inconsistency problems caused by the traditional method of storing variable data in the attribute panels of various graphical modules, and provides a data foundation for automatic synchronization when the data values of target variables change in the future.
[0033] S102: When the data value corresponding to the target variable in the data dictionary changes, extract the data name corresponding to the target variable.
[0034] In this embodiment, the data values corresponding to each target variable in the data dictionary are continuously monitored. When a change in the data value of a target variable is detected, the target variable whose data value has changed is identified. This change can be triggered by a direct user action. After identifying the target variable that has changed, the corresponding data name is extracted. Specifically, each target variable in the data dictionary is stored as a data record, and each data record contains the data type, data value, data name, and other extended storage fields of the target variable. When a change in the data value of a target variable is detected, its data name field is read from the data record of that target variable.
[0035] by Figure 2 Taking the data dictionary shown as an example, when a user changes the data value of the target variable "Battery Capacity" of the global parameter type from 100Ah to 105Ah, by monitoring the data values of each target variable in the data dictionary, if the data value of "Battery Capacity" is detected to have changed from 100Ah to 105Ah, then the target variable that has changed is determined to be "Battery Capacity", and its corresponding data name "Battery_Capacity" is extracted from the data record of "Battery Capacity".
[0036] In the above manner, when the data value of the target variable in the data dictionary changes, the embodiment of this application can quickly locate the changed target variable and extract its data name, so that subsequent steps can use the data name to find all graphical modules that reference the target variable.
[0037] S103: Based on the data name corresponding to the target variable, query the preset backreference index table, obtain the graphical module that references the target variable, and send a refresh command to the graphical module.
[0038] In this embodiment, after extracting the data name corresponding to the target variable, the data name is used as an index to query a pre-defined backreference index table. Specifically, the backreference index table is pre-established to store the correspondence between the data names of the target variable and the graphical modules that reference the target variable. That is, the backreference index table records which graphical modules reference the target variable corresponding to the data name, using the data name as an index. When any graphical module references a target variable in the data dictionary in the simulation model, the correspondence between the data name of the target variable and the graphical module is recorded in the backreference index table, thereby providing a search basis for subsequent data change synchronization.
[0039] Specifically, the extracted data names are used as query indexes to search the inverse reference index table to obtain all graphical modules that reference the target variable. After obtaining all graphical modules that reference the target variable, refresh commands are sent to these modules. The refresh commands notify each graphical module that the data value of the target variable it references has changed and that it needs to retrieve the latest data value.
[0040] For example, with Figure 2 Taking the data dictionary shown as an example, the extracted data name for the changed target variable "Battery Capacity" is "Battery_Capacity". Using this data name "Battery_Capacity" as an index, the inverse reference index table is queried to obtain all graphical modules that reference the target variable named "Battery_Capacity", such as the charging control module, discharging control module, and SOC estimation module. Subsequently, refresh commands are sent to each of these graphical modules to notify them that the data value of the target variable they reference has changed.
[0041] S104: In response to the refresh command, the graphical module rereads the data value corresponding to the target variable from the data dictionary based on the stored data name.
[0042] In this embodiment of the application, in response to the refresh command described above, the graphical module obtains the data name of the target variable stored in its own memory, and uses the data name as an index to reread the data value of the target variable from the data dictionary.
[0043] Specifically, when each graphical module references a target variable in the data dictionary, it only stores the data name of the target variable, not a copy of its data value. Therefore, when a graphical module receives a refresh command, it initiates a read request to the data dictionary based on the stored data name. The data dictionary then locates the corresponding target variable based on that name and returns its data value. Upon receiving the returned data value, the graphical module updates its internal calculation parameters and the interface display.
[0044] For example, with Figure 2 Taking the data dictionary shown as an example, after receiving the refresh command, the charging control module, discharging control module, and SOC estimation module each obtain their own stored data name "Battery_Capacity" and request the data dictionary to read the current data value of the target variable "Battery Capacity" using this data name. The data dictionary finds the corresponding target variable "Battery Capacity" based on the data name "Battery_Capacity" and returns its current data value of 105Ah to each module, which then updates its internal calculation parameters accordingly.
[0045] In this way, when the data value of the target variable in the data dictionary changes, all graphical modules that reference the target variable can automatically obtain the latest data value after the change, thereby realizing global automatic synchronization after data change.
[0046] Thus, this embodiment of the application establishes a centralized and unified data dictionary to centrally store the target variable data. When the data value changes, it achieves automatic synchronization of all reference modules after the target variable data value in the data dictionary changes by extracting the data name, querying the reverse reference index table to locate the reference module, sending a refresh command to the reference module, and the module rereading the latest data value. This effectively avoids simulation errors caused by data inconsistency.
[0047] Based on the steps S101-S104 above, this application provides a method, apparatus, device, and storage medium for synchronizing changes in a data dictionary. First, a data dictionary for a graphical simulation modeling platform is established. This data dictionary stores multiple target variables, each with a data type, data value, and a unique data name. Then, when the data value corresponding to a target variable in the data dictionary changes, the corresponding data name is extracted. Next, based on the data name, a pre-defined backreference index table is queried to obtain the graphical module referencing the target variable, and a refresh command is sent to the graphical module. Finally, in response to the refresh command, the graphical module rereads the data value corresponding to the target variable from the data dictionary based on the stored data name. It is evident that this solution, by establishing a data dictionary, centrally stores the variable data involved in each graphical module, avoiding the management chaos and data inconsistency problems caused by scattered data storage. Simultaneously, by storing only the data names of the target variables referenced by the graphical module, a name-based reference relationship is established between the graphical module and the target variables in the data dictionary, eliminating the need to save data copies within the graphical module. When the data value of the target variable changes, by extracting the data name of the target variable and querying the backreference index table based on the data name, all graphical modules referencing the target variable can be accurately identified, and refresh commands can be sent to these graphical modules. Each graphical module responds to the refresh command by rereading the current data value of the target variable from the data dictionary according to its stored data name. In other words, this solution can automatically synchronize the changes in the data value of the target variable in the data dictionary to all graphical modules referencing the target variable, ensuring consistency in the data values used by each graphical module and effectively avoiding simulation errors caused by data inconsistency.
[0048] Furthermore, there are scenarios where multiple simulation projects share the same data dictionary. For example, in the automotive electronics industry, OEMs define enterprise-level parameter libraries, and multiple suppliers reference this data dictionary in their own simulation projects. OEMs need read and write permissions to the target variables in the data dictionary to configure and update parameters, while suppliers only need read-only permissions to reference the parameters, preventing accidental modification.
[0049] to this end, Figure 3 This is a schematic diagram of project permission management in a shared mode provided in an embodiment of this application, combined with... Figure 3 As can be seen, in this embodiment of the application, the target variable is set with the authorized project name Proj_A.
[0050] When the graphical module references the target variable, it retrieves the project name of the simulation project to which the graphical module belongs, for example, Proj_A, and then compares this project name with the project name Proj_A authorized by the target variable. Since the project name Proj_A authorized by the target variable matches the project name Proj_A of the simulation project to which the graphical module belongs, the simulation project to which the graphical module belongs is determined to be the authorized project of the target variable. The target variable is then configured to be editable, i.e., granted read and write permissions, allowing users to modify the data value of the target variable.
[0051] When the graphical module references the target variable, it obtains the project name of the simulation project to which the graphical module belongs, for example, Proj_B, and then compares this project name with the authorized project name Proj_A of the target variable. Since the authorized project name Proj_A of the target variable is inconsistent with the project name Proj_B of the simulation project to which the graphical module belongs, the simulation project to which the graphical module belongs is determined to be an unauthorized project. The target variable is then configured to read-only status, i.e., only read-only reference permissions are granted, and the editing controls of the target variable are automatically locked in the graphical simulation modeling platform, preventing users from modifying the data value of the target variable.
[0052] Furthermore, Figure 4 This application provides a schematic diagram of a three-level inheritance chain for code generation configuration attributes, combined with... Figure 4 As can be seen, the data dictionary is configured with storage segments and storage classes. For example... Figure 4 As shown, the data dictionary pre-configured storage segments (level 1) and storage classes (level 2) to provide the source of inheritance for code generation configuration attributes of the target variable. The target variable (level 3) automatically inherits the code generation configuration attributes of the storage class and storage segment by associating with the storage class.
[0053] Specifically, the storage segment is used to define first code generation configuration attributes. For example, the first code generation configuration attributes include memory region attributes, used to define the physical memory partition where the target variable is stored when generating code, such as a calibration area, flash memory area, or RAM area. The storage class is used to define second code generation configuration attributes and inherits the first code generation configuration attributes from the storage segment. For example, the second code generation configuration attributes include code declaration attributes, such as default storage type, sharing mode (enabled / disabled), and authorized project name. In addition to its own defined second code generation configuration attributes, the storage class automatically inherits the first code generation configuration attributes (i.e., memory region attributes) defined by the storage segment, enabling the storage class to possess both first and second code generation configuration attributes.
[0054] For example, with Figure 4Taking variables A, B, and C at the third level as an example, when variable A is associated with a storage class, it automatically inherits all code generation configuration attributes of the storage class (including the storage class's own second code generation configuration attributes and the first code generation configuration attributes inherited from the storage segment). Variable B, in addition to inheriting all code generation configuration attributes of the storage class, is also allowed to independently override preset personalized attributes, such as adding the keyword "volatile". Variable C, in addition to inheriting all code generation configuration attributes of the storage class, is also allowed to independently override preset personalized attributes, such as adding the keyword "const". Similarly, each target variable can also independently override personalized attributes such as header file paths.
[0055] It should be noted that the target variable's inherited attribute fields (i.e., attributes inherited from storage segments and / or storage classes) are set to read-only in the user interface to maintain consistency in inheritance; however, the user is allowed to edit the personalized attribute fields that are independently overridden by the target variable.
[0056] With the above three-level attribute inheritance chain, when it is necessary to modify the code generation configuration attributes of the storage segment or storage class, only the configuration in the storage segment or storage class needs to be modified, and all related target variables can be automatically updated in batches without the need to manually configure each target variable one by one, thereby greatly improving the configuration efficiency of code generation attributes.
[0057] Furthermore, Figure 5 This is a schematic diagram of the core data flow of a data dictionary change synchronization method provided in an embodiment of this application, combined with... Figure 5 As shown in the embodiments of this application, the data dictionary change synchronization method involves three core participants: engineers, the data dictionary, and a graphical module. Engineers perform operations such as creating, editing, referencing, and modifying target variables through the graphical simulation modeling platform. The data dictionary stores multiple target variables and provides functions such as adding, searching by name, registering references, and updating data values for target variables. When an engineer creates or edits a target variable in the data dictionary, the data dictionary calls the add or edit interface to process the target variable accordingly. When an engineer references a target variable through the graphical module, the data dictionary calls the register reference interface to record the correspondence between the graphical module and the data name of the target variable in the reverse reference index table. When an engineer modifies the data value of a target variable in the data dictionary, the data dictionary calls the update interface to modify the data value of the target variable and triggers a change notification.
[0058] The graphical module includes constants, gain, and lookup tables, which use data values stored in the data dictionary by referencing the data names of the target variables. Figure 5For example, the constant module references the target variable "battery capacity", the gain module references the target variable "voltage limit", and the lookup table module references the target variable "OCV-SOC curve". Each graphical module only stores the data name of the target variable it references, not the data value.
[0059] When the value of a target variable in the data dictionary changes, the data dictionary queries the backreference index table based on the target variable's data name to obtain all graphical modules that reference that target variable, and sends a refresh command to these graphical modules. Each graphical module responds to the refresh command by rereading the target variable's value from the data dictionary based on its stored data name.
[0060] Therefore, this application establishes a unified data dictionary, in which engineers centrally manage multiple target variables. Each graphical module references the target variables in the data dictionary by name without storing the data values of the target variables. When the data value of a target variable changes, the data dictionary locates all graphical modules referencing that target variable through a reverse reference index table and notifies them to reread the latest data value, forming a complete change synchronization link. This effectively solves the technical problem of scattered variable data management and the inability to automatically synchronize after changes in the prior art.
[0061] Furthermore, Figure 6 A schematic diagram of the structure of the data dictionary change synchronization device provided in this application embodiment. (In conjunction with...) Figure 6 As shown, the data dictionary change synchronization device 600 provided in this application embodiment may include: The dictionary creation module 601 is used to create a data dictionary for the graphical simulation modeling platform. The data dictionary stores multiple target variables, each of which has a data type, a data value, and a unique data name. The numerical change module 602 is used to extract the data name corresponding to the target variable when the data value corresponding to the target variable in the data dictionary changes; The instruction refresh module 603 is used to query a preset backreference index table based on the data name corresponding to the target variable, obtain the graphical module that references the target variable, and send a refresh instruction to the graphical module. The numerical reading module 604 is used to respond to the refresh command, wherein the graphical module rereads the data value corresponding to the target variable from the data dictionary based on the stored data name.
[0062] Optionally, the backreference index table is used to store the correspondence between the data name corresponding to the target variable and the graphical module referencing the target variable.
[0063] Optionally, the numerical change module 602 is specifically used for: Monitor the data values corresponding to the target variables in the data dictionary to determine the target variables whose data values have changed, wherein the change is triggered by the user's direct operation; Based on the target variable whose data value has changed, extract the data name corresponding to the target variable.
[0064] Optionally, the data dictionary change synchronization device 600 may include: The name acquisition module is used to acquire the project name of the simulation project to which the graphical module belongs when the graphical module references the target variable; The name comparison module is used to compare the project name of the simulation project to which the graphical module belongs with the project name authorized by the target variable; The status editing module is used to make the target variable editable if the project name authorized by the target variable is consistent with the project name of the simulation project to which the graphical module belongs; The read-only status module is used to make the target variable read-only if the project name authorized by the target variable is inconsistent with the project name of the simulation project to which the graphical module belongs.
[0065] Optionally, the data dictionary change synchronization device 600 may include: The first attribute module is used to configure storage segments and storage classes in the data dictionary, wherein the storage segment is used to define the first code generation configuration attribute; The second attribute module is used by the storage class to define a second code generation configuration attribute and to inherit the first code generation configuration attribute from the storage segment; An inheritance attribute module is used for the target variable to inherit the second code generation configuration attribute in the storage class and the first code generation configuration attribute in the storage segment; The first code generation configuration attribute includes a memory region attribute, and the second code generation configuration attribute includes a code declaration attribute.
[0066] Optionally, the instruction refresh module 603 is specifically used for: Use the data name corresponding to the target variable as an index to query the preset reverse reference index table; Based on the correspondence between the data name corresponding to the target variable and the graphical module referencing the target variable stored in the reverse reference index table, the graphical module referencing the target variable is obtained, and a refresh command is sent to the graphical module.
[0067] Optionally, the data type includes at least one of global parameters, observations, interpolation tables, enumerations, and structures.
[0068] Furthermore, embodiments of this application also provide an electronic device, including: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, the one or more programs including instructions that, when executed by the processor, cause the processor to perform any of the implementation steps of the above-described data dictionary change synchronization method.
[0069] Furthermore, embodiments of this application also provide a computer-readable storage medium for storing a computer program, which, when executed by a terminal device, implements any of the implementation steps of the above-described data dictionary change synchronization method.
[0070] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application. It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on describing the differences from other embodiments. The same or similar parts between the various embodiments can be referred to mutually.
[0071] The system disclosed in the embodiments is described simply because it corresponds to the method disclosed in the embodiments; relevant details can be found in the method section.
[0072] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0073] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for synchronizing changes in a data dictionary, characterized in that, The method includes: A data dictionary is established for a graphical simulation modeling platform. The data dictionary stores multiple target variables, each of which has a data type, a data value, and a unique data name. When the data value corresponding to the target variable in the data dictionary changes, the data name corresponding to the target variable is extracted; Based on the data name corresponding to the target variable, query the preset backreference index table, obtain the graphical module that references the target variable, and send a refresh command to the graphical module; In response to the refresh command, the graphical module rereads the data value corresponding to the target variable from the data dictionary based on the stored data name.
2. The method according to claim 1, characterized in that, The reverse reference index table is used to store the correspondence between the data name corresponding to the target variable and the graphical module that references the target variable.
3. The method according to claim 1, characterized in that, When the data value corresponding to the target variable in the data dictionary changes, the data name corresponding to the target variable is extracted, including: Monitor the data values corresponding to the target variables in the data dictionary to determine the target variables whose data values have changed, wherein the change is triggered by the user's direct operation; Based on the target variable whose data value has changed, extract the data name corresponding to the target variable.
4. The method according to claim 1, characterized in that, The method further includes: When the graphical module references the target variable, obtain the project name of the simulation project to which the graphical module belongs; Compare the project name of the simulation project to which the graphical module belongs with the project name authorized by the target variable; If the project name authorized by the target variable is consistent with the project name of the simulation project to which the graphical module belongs, then the target variable is in an editable state; If the project name authorized by the target variable is inconsistent with the project name of the simulation project to which the graphical module belongs, then the target variable is in a read-only state.
5. The method according to claim 1, characterized in that, The method further includes: The data dictionary is configured with storage segments and storage classes, and the storage segments are used to define the first code generation configuration attributes; The storage class is used to define a second code generation configuration attribute and to inherit the first code generation configuration attribute from the storage segment; The target variable inherits the second code generation configuration attribute in the storage class and the first code generation configuration attribute in the storage segment; The first code generation configuration attribute includes a memory region attribute, and the second code generation configuration attribute includes a code declaration attribute.
6. The method according to claim 2, characterized in that, The step of querying a preset backreference index table based on the data name corresponding to the target variable, obtaining the graphical module referencing the target variable, and sending a refresh command to the graphical module includes: Use the data name corresponding to the target variable as an index to query the preset reverse reference index table; Based on the correspondence between the data name corresponding to the target variable and the graphical module referencing the target variable stored in the reverse reference index table, the graphical module referencing the target variable is obtained, and a refresh command is sent to the graphical module.
7. The method according to claim 1, characterized in that, The data types include at least one of global parameters, observations, interpolation tables, enumerations, and structures.
8. A data dictionary change synchronization device, characterized in that, include: The dictionary creation module is used to create a data dictionary for the graphical simulation modeling platform. The data dictionary stores multiple target variables, each of which has a data type, a data value, and a unique data name. The numerical change module is used to extract the data name corresponding to the target variable when the data value corresponding to the target variable in the data dictionary changes; The instruction refresh module is used to query a preset backreference index table based on the data name corresponding to the target variable, obtain the graphical module that references the target variable, and send a refresh instruction to the graphical module. A numerical reading module is used to respond to the refresh command, wherein the graphical module rereads the data value corresponding to the target variable from the data dictionary based on the stored data name.
9. An electronic device, characterized in that, The device includes: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store a program, the program including instructions that, when executed by the processor, cause the processor to perform the steps of the data dictionary change synchronization method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program, which, when executed by a terminal device, implements the steps of the data dictionary change synchronization method according to any one of claims 1-7.
