Data model modeling system, simulation analysis platform and method of power distribution network

The data modeling system and method provide flexible and standardized model creation and sharing for distribution networks, addressing limitations in existing platforms by enabling easy custom model development and efficient simulation.

CN119167585APending Publication Date: 2024-12-20CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411002342.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

Existing distribution network modeling and simulation platforms lack flexibility in creating new device or custom module models, require high technical expertise, and lack standardized support for model sharing and reuse, leading to increased costs and workload.

Method used

A data modeling system and method that constructs basic component, module terminal, and module encapsulation data models using nested multi-level packaging modules, generating standardized files to facilitate flexible and standardized model creation and sharing, with a dynamic symbolic simulation analysis platform for efficient simulation.

Benefits of technology

Enhances user flexibility and reduces the technical threshold for model creation, enables easy sharing and reuse of models, and improves the versatility and reusability of distribution network simulations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119167585A_ABST
    Figure CN119167585A_ABST
Patent Text Reader

Abstract

The invention provides a data model modeling system of a power distribution network, a simulation analysis platform and a method, which are applied to the technical field of power distribution network simulation. The system comprises a basic component construction unit used for constructing a basic component data model based on basic circuit elements of a target network in the power distribution network; the module terminal construction unit is used for constructing a module terminal data model based on the connection relationship between the basic circuit elements; the module encapsulation construction unit is used for constructing a corresponding module encapsulation data model based on the physical equipment in the target network; the module encapsulation data model comprises multiple layers of encapsulation modules which are mutually nested, the encapsulation module nested in the inner layer in the multiple layers of encapsulation modules is used as an internal component of the outer layer encapsulation module, and one data model correspondingly generates one standardized file. According to the method, the problems of low flexibility, high technical threshold and lack of standardized support in the modeling simulation process of the power distribution network are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power distribution network simulation, and in particular to a data modeling system, a simulation analysis platform and a method for a power distribution network. Background Art

[0002] With the increasing prominence of energy issues and the popularization of renewable energy, the modeling and simulation technology of distribution networks has attracted much attention. Especially on a global scale, due to the growth of energy demand and the requirements of environmental protection, the demand for distribution network modeling and simulation technology is increasing. The existing distribution network modeling and simulation platforms include PSCAD (Power Systems Computer Aided Design), DIgSILENT (DIgital SimuLation and Electrical NeTwork Calculation Program), PSS / E (Power System Simulator / Engineering), Andes, etc. These platforms have some shortcomings in dynamically establishing new equipment or custom module models, which are specifically manifested in the following aspects:

[0003] (1) Lack of flexibility: There is insufficient flexibility in supporting the dynamic creation of new device or custom module models. Users may be limited to predefined device models and cannot freely add or modify models to meet specific needs.

[0004] (2) High technical threshold: The establishment of a custom module model usually requires a high level of programming skills and expertise in the power system field, which makes it difficult for general users to develop and integrate custom models, limiting the diversity and flexibility of the model.

[0005] (3) Lack of standardized support: Lack of standardized support for new equipment or custom module models makes it difficult for different users to share and exchange models. This limits the versatility and reusability of the model and increases the cost and workload of repeated modeling. Summary of the invention

[0006] In order to overcome the problems of low flexibility, high technical threshold and lack of standardization support in the above-mentioned distribution network modeling and simulation process, the present invention provides a data modeling system, simulation analysis platform and method for distribution network.

[0007] In one aspect, the present invention provides a data modeling system for a power distribution network, the system comprising:

[0008] A basic component construction unit, used to construct a basic component data model corresponding to the basic circuit element based on the basic circuit element of the target network in the distribution network;

[0009] A module terminal construction unit, used to construct a module terminal data model based on the connection relationship between the basic circuit elements;

[0010] A module encapsulation construction unit, used to construct a corresponding module encapsulation data model based on the physical devices in the target network;

[0011] Among them, the module packaging data model includes mutually nested multi-level packaging modules, and the packaging modules nested in the inner layer of the multi-level packaging module serve as internal components of the outer layer packaging module. One basic component data model, one module terminal data model or one module packaging data model generates a corresponding standardized file.

[0012] Optionally, the standardized file is a Json file.

[0013] Optionally, the basic component data model includes a component parameter sub-model, a component variable sub-model, a component relationship sub-model and a component variable position sub-model; and the basic component construction unit includes:

[0014] A component parameter construction sub-unit, used to construct the basic component parameter sub-model by defining the input parameters and corresponding values ​​of the component;

[0015] A component variable construction sub-unit, used to construct the basic component variable sub-model by defining the variables to be determined and the initial values ​​of the variables of the component; the variables to be determined of the component include the voltage and the injected current of each terminal of the basic circuit element in the target network;

[0016] A component relationship construction sub-unit, used for constructing the basic component relationship sub-model by defining a relationship between the variables to be determined of the component and the input parameters of the component;

[0017] The component variable position construction sub-unit is used to construct the component variable position sub-model by defining the position of the variable to be requested of the component obtained externally within the basic component data model.

[0018] Optionally, the input parameters of the component include terminals of basic circuit elements corresponding to the component, and the values ​​of the terminals are used to indicate the connection relationship of the terminals;

[0019] The component variable construction subunit is used to place the same type of variables to be determined in the same basic component data model in priority, and the same type of variables to be determined in the basic component data model are sorted according to the connection relationship sequence of the terminals.

[0020] Optionally, the module terminal data model includes a module terminal parameter sub-model, a module terminal variable sub-model, a module terminal relationship sub-model and a module terminal variable position sub-model; the module terminal construction unit includes:

[0021] A module terminal parameter construction sub-unit is used to construct the module terminal parameter sub-model by defining input parameters and corresponding values ​​of the terminals, wherein the input parameters of the terminals include module terminals, and the values ​​of the module terminals include two elements, wherein one element is used to indicate an external terminal of the module, and the other element is used to indicate an internal terminal of the module;

[0022] A module terminal variable construction sub-unit is used to construct the module terminal variable sub-model by defining variables to be determined for two terminals of the module terminals; the variables to be determined for the two terminals include voltages and injection currents of the two terminals;

[0023] A module-terminal relationship construction sub-unit, used to construct the module-terminal relationship sub-model by defining a relationship between the variables to be determined of the terminal and the input parameters of the terminal;

[0024] The module terminal variable position construction sub-unit is used to construct the module terminal variable position sub-model by defining the position of the variable to be obtained from the terminal externally within the module terminal data model.

[0025] Optionally, the module encapsulation data model includes a module parameter sub-model, a module device sub-model and a mapping sub-model, and the module encapsulation construction unit includes:

[0026] A module parameter construction sub-unit, used to construct the module parameter sub-model by defining the module input parameters and corresponding values, wherein the module input parameters include module terminals and external connection identifiers;

[0027] A module device construction subunit, used for defining a component dictionary constituting a module based on a key-value pair to form the module device submodel, wherein the key of the component dictionary is a component identifier, the value of the component dictionary is component data, and the component data includes a standardized file name of a used component;

[0028] The mapping construction subunit is used to form the mapping submodel by establishing a corresponding relationship between the input parameters of the module and the values ​​of the component dictionary of the module.

[0029] On the other hand, the present invention also provides a dynamic symbolic simulation analysis platform for a distribution network, the system comprising:

[0030] A data modeling system for a distribution network according to any of the foregoing items, used to construct a standardized file of a target network instance;

[0031] A code generation unit, configured to generate a corresponding target code file based on the standardized file of the target network instance;

[0032] The simulation solving unit is used to execute the target code file to solve the state variables of the target network instance to complete the simulation of the target network instance.

[0033] Optionally, the simulation solution unit includes:

[0034] A file reading subunit, configured to update an initial value of an independent variable based on a storage path of a standardized file of the target network instance;

[0035] An object creation subunit, configured to sequentially create a module object and a component object based on device data in the content of the standardized file of the target network instance, and put the key-value pairs of the module object and the component object into an ordered dictionary of an internal component;

[0036] The solving subunit is used to solve the state variables in each component and each module through an iterative algorithm based on the initial value of the independent variable.

[0037] On the other hand, the present invention also provides a data modeling method for a distribution network, comprising:

[0038] Based on basic circuit elements of a target network in a distribution network, constructing a basic component data model corresponding to the basic circuit elements;

[0039] Based on the connection relationship between the basic circuit elements, a module terminal data model is constructed;

[0040] Based on the physical devices in the target network, construct a corresponding module encapsulation data model;

[0041] Among them, the module packaging data model includes mutually nested multi-level packaging modules, and the packaging modules nested in the inner layer of the multi-level packaging module serve as internal components of the outer layer packaging module. One basic component data model, one module terminal data model or one module packaging data model generates a corresponding standardized file.

[0042] On the other hand, the present invention also provides a dynamic symbol simulation analysis method for a distribution network, comprising:

[0043] By calling the data modeling system of the distribution network described in the above one, a standardized file of the target network instance is constructed;

[0044] Generate a corresponding target code file based on the standardized file of the target network instance;

[0045] The target code file is executed to solve the state variables of the target network instance to complete the simulation of the target network instance.

[0046] On the other hand, the present invention also provides an electronic device, comprising: at least one processor and a memory; the memory and the processor are connected via a bus;

[0047] The memory is used to store one or more programs;

[0048] When the one or more programs are executed by the at least one processor, any one of the above methods is implemented.

[0049] On the other hand, the present invention further provides a readable storage medium having an execution program stored thereon, and when the execution program is executed, any one of the methods described above is implemented.

[0050] Compared with the prior art, the present invention has the following beneficial effects:

[0051] The present invention provides a data modeling system and method for a distribution network. On the one hand, a basic component construction unit is used to construct a basic component data model corresponding to the basic circuit element based on the basic circuit element of a target network in the distribution network; a module terminal construction unit is used to construct a module terminal data model based on the connection relationship between the basic circuit elements; and a module encapsulation construction unit is used to construct a corresponding module encapsulation data model based on the physical equipment in the target network. By designing component construction based on basic circuit elements and mutually nested multi-level encapsulation modules, the encapsulation modules nested in the inner layer of the multi-level encapsulation module are used as internal components of the outer encapsulation module, and element-based modeling and infinite-level component encapsulation are realized. Users only need to perform simple element modeling and module encapsulation to complete modeling, thereby improving user modeling flexibility and realizing on-demand modeling; and at the same time, the technical threshold for users to establish custom models is reduced. On the other hand, a basic component data model, a module terminal data model or a module encapsulation data model generates a standardized file corresponding to the basic component data model, and the distribution network equipment data standard is standardized by the standardized file to realize standardized support of the model, facilitate sharing and exchanging models between users, and improve the versatility and reusability of the model.

[0052] The present invention provides a dynamic symbolic simulation analysis platform and method for a distribution network. By calling a data model modeling system of the distribution network and constructing a standardized file of a target network instance, a corresponding target code file can be automatically generated and executed, all state variables of the target network instance can be solved, and the simulation process can be completed, thereby reducing the requirements of the simulation process on the user's professional level, lowering the threshold for simulation development, and improving the user's modeling flexibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A structural schematic diagram of a data modeling system for a power distribution network according to the present invention;

[0054] Figure 2 It is a structural schematic diagram of a dynamic symbol simulation analysis platform for a power distribution network of the present invention;

[0055] Figure 3 It is a schematic structural diagram of the electronic device of the present invention. DETAILED DESCRIPTION

[0056] The specific implementation modes of the present invention are further described in detail below with reference to the accompanying drawings.

[0057] Example 1

[0058] The present invention provides a data modeling system for a distribution network, the system schematic diagram is as follows Figure 1 As shown, including:

[0059] A basic component construction unit, used to construct a basic component data model corresponding to the basic circuit element based on the basic circuit element of the target network in the distribution network;

[0060] A module terminal construction unit, used to construct a module terminal data model based on the connection relationship between the basic circuit elements;

[0061] A module encapsulation construction unit, used to construct a corresponding module encapsulation data model based on the physical devices in the target network;

[0062] Among them, the module packaging data model includes mutually nested multi-level packaging modules, and the packaging modules nested in the inner layer of the multi-level packaging module serve as internal components of the outer layer packaging module. One basic component data model, one module terminal data model or one module packaging data model generates a corresponding standardized file.

[0063] In this example implementation, by constructing a basic component data model for basic circuit elements, a module terminal data model for basic circuit connection relationships, and a module encapsulation data model for each physical device in the distribution network, a data model of the target network is constructed. For example, corresponding basic component data models can be constructed for resistors, voltage sources, capacitors, inductors, controlled power supplies, etc. in the distribution network, and a collection library of various basic component data models forms a basic component data model of the target network. The target network can be the entire distribution network or a partial network of the distribution network. The Json data format can be used to describe each data model to form a standardized file, and each data model generates a Json file. A basic component data model corresponds to a basic component or component, and a module terminal data model corresponds to a component. The module encapsulation data model is obtained by encapsulating the basic component data model and the module terminal data model. A module encapsulation data model corresponds to a module, that is, a module is obtained by encapsulating multiple components, and the multiple components constituting the module are called internal components. Modules can be nested with each other, that is, the module itself can be used as an internal component of other modules, thereby realizing infinite levels of encapsulation of modules. The present invention realizes a flexible and convenient modeling method through three different data models, allowing users to dynamically establish new equipment or custom module models to meet specific needs. By studying the infinite modular component encapsulation technology and the modeling method based on modular elements, the technical threshold for users to establish custom models is lowered, allowing more users to easily perform modeling work. Through the standardized distribution network equipment data standards and modeling methods, standardized support for models is achieved, which facilitates the sharing and exchange of models between users and improves the versatility and reusability of models.

[0064] In an example implementation, the basic component data model includes a component parameter sub-model, a component variable sub-model, a component relationship sub-model, and a component variable position sub-model; the basic component construction unit includes:

[0065] A component parameter construction sub-unit, used to construct the basic component parameter sub-model by defining the input parameters and corresponding values ​​of the component;

[0066] A component variable construction sub-unit, used to construct the basic component variable sub-model by defining the variables to be determined and the initial values ​​of the variables of the component;

[0067] A component relationship construction sub-unit, used for constructing the basic component relationship sub-model by defining a relationship between the variables to be determined of the component and the input parameters of the component;

[0068] The component variable position construction sub-unit is used to construct the component variable position sub-model by defining the position of the variable to be requested of the component obtained externally within the basic component data model.

[0069] In this example implementation, the basic component data model includes a component parameter sub-model, a component variable sub-model, a component relationship sub-model, and a component variable position sub-model, that is, a basic component data model includes information such as component parameters, component variables, component relationships (such as arithmetic expressions and differential expressions), and component variable positions, and may also include other services, such as services that provide data acquisition, display, and storage. The parameters (Parameters) of a component are used to define the name and value of the component input parameters. The component input parameters mainly include type (Type), identification (ID), name (Name), and specific data (such as the voltage of a power supply, etc.); the component input parameters may also include the terminals of the component corresponding to the basic circuit elements, and the values ​​of the terminals are used to indicate the connection relationship of the terminals; for example, the value of the terminal is an array, and its value is the ID of the connection point, which is used to indicate the terminal connection relationship. The variables (Variables) of a component are used to define the name and initial value of the variable to be determined of the component. The variable to be determined of the component is usually the voltage and injection current of each terminal. Exemplarily, the component variable construction subunit is used to place the same type of required variables in the same basic component data model first, and the same type of required variables in the basic component data model are sorted according to the connection relationship order of the terminals. That is, variables of the same type are placed together first, and the order of variables of the same type corresponds to the terminal array, so as to facilitate the definition of variable positions later. Arithmetic expressions (AlgebraicEquations) are used to describe the direct arithmetic relationship between the variables and parameters of a component. Its key is the variable name, and its value is an arithmetic expression that Python can recognize. Differential expressions (DifferentialEquations) are used to describe the differential relationship between the variables and parameters of a component. For example, for the input form of y′=f(x), the key of the expression is y and the value is f(x). The variable position (VariablesIndex) of a component is used to externally obtain the position of the corresponding variable inside the component. Its key is the variable type and its value is the starting position.

[0070] Exemplarily, the resistor component data model is as follows:

[0071]

[0072] In the above resistor component data model, Parameters corresponds to the parameter information of the resistor component data model, VariablesIndex and Variables correspond to the variable information (including voltage and current) of the resistor component data model, and AlgebraicEquations corresponds to the arithmetic expressions between parameters and variables in the resistor component data model.

[0073] In an example implementation, the module terminal data model includes a module terminal parameter sub-model, a module terminal variable sub-model, a module terminal relationship sub-model and a module terminal variable position sub-model; the module terminal construction unit includes:

[0074] A module terminal parameter construction sub-unit is used to construct the module terminal parameter sub-model by defining input parameters and corresponding values ​​of the terminals, wherein the input parameters of the terminals include module terminals, and the values ​​of the module terminals include two elements, wherein one element is used to indicate an external terminal of the module, and the other element is used to indicate an internal terminal of the module;

[0075] A module terminal variable construction sub-unit is used to construct the module terminal variable sub-model by defining variables to be determined for two terminals of the module terminals; the variables to be determined for the two terminals include voltages and injection currents of the two terminals;

[0076] A module-terminal relationship construction sub-unit, used to construct the module-terminal relationship sub-model by defining a relationship between the variables to be determined of the terminal and the input parameters of the terminal;

[0077] The module terminal variable position construction sub-unit is used to construct the module terminal variable position sub-model by defining the position of the variable to be obtained from the terminal externally within the module terminal data model.

[0078] In this example implementation, the module terminal data model includes a module terminal parameter submodel, a module terminal variable submodel, a module terminal relationship submodel and a module terminal variable position submodel, that is, the module terminal data model includes the parameters of the module terminal, the variables of the module terminal, the relationship of the module terminal (such as arithmetic expressions), the variable position of the module terminal and other services. Among them, the parameters of the module terminal are used to define the input parameter name and value of the terminal, and its input parameters mainly include type, identification, name, terminal, and the value of the terminal is an array with two elements, one value is the external terminal of the module, and the other is the internal terminal of the module. The variables of the module terminal are the voltage and injection current of the two terminals. The arithmetic expression of the module terminal is used to describe the direct arithmetic relationship between the variables and parameters of the module terminal, and its key is the variable name, and the value is an arithmetic expression that Python can recognize. The variable position of the module terminal is used to externally obtain the position of the variable inside the component, and its key is the variable type value as the starting position.

[0079] Exemplarily, the module terminal data model is as follows:

[0080]

[0081]

[0082] In the above module terminal data model, Parameters corresponds to the input parameter information of the module terminal data model, VariablesIndex and Variables correspond to the variable information of the module terminal data model, and AlgebraicEquations corresponds to the arithmetic expressions between the variables and parameters of the module terminal data model.

[0083] In some example implementations, the module encapsulation data model includes a module parameter sub-model, a module device sub-model, and a mapping sub-model, and the module encapsulation construction unit includes:

[0084] A module parameter construction sub-unit, used to construct the module parameter sub-model by defining the module input parameters and corresponding values, wherein the module input parameters include module terminals and external connection identifiers;

[0085] A module device construction subunit, used for defining a component dictionary constituting a module based on a key-value pair to form the module device submodel, wherein the key of the component dictionary is a component identifier, the value of the component dictionary is component data, and the component data includes a standardized file name of a used component;

[0086] The mapping construction subunit is used to form the mapping submodel by establishing a corresponding relationship between the input parameters of the module and the values ​​of the component dictionary of the module.

[0087] In this example implementation, the module encapsulation data model includes a module parameter sub-model, a module device sub-model, and a mapping sub-model, that is, the module encapsulation data model includes module parameters, module devices, and module mapping. The module parameters are used to define the input parameter name and value of the module. The input parameters of the module mainly include type, identification, name, terminal, external connection identification (ExternalConnection) and specific data (settable internal component parameters), where the terminal is an array describing the external connection point of the module, and its value is the ID of the connection point, which is used to indicate the connection relationship. The external connection identification is an intermediate traversal, and its elements correspond to the terminals. An element of 1 indicates that there is an external connection, and an element of 0 indicates that there is no external connection.

[0088] Module devices (Devices) are used to define the component dictionary that constitutes the module. Its key is the component ID and its value is the component data. The component data includes type and parameters. Among them, the type (Class) is the same as the Json file name of the component used, and the parameters (Parameters) are a subset of the parameters of this type of component. It is usually necessary to set its Terminals value to indicate the connection relationship between the components inside the module. Generally, module devices contain module terminals, which are used to connect the inside and outside of the module and have the function of isolating the internal and external namespaces. Module mapping (Mapping) is used to define a dictionary that stores the correspondence between module parameters and internal component data; its key is the module parameter name and the value is an array, which describes the ID, parameter name and position of the corresponding internal component in turn. A module can be used as an internal component of its external nested module to achieve infinite levels of module encapsulation.

[0089] For example, a module encapsulation data model with a nested structure is as follows:

[0090]

[0091]

[0092] In the above module encapsulation data model with a nested structure, Parameters corresponds to the parameters of the module encapsulation data model, Devices corresponds to the devices of the module encapsulation data model, the devices include internal components tmnID1, tmnID2, mID1, rID2, and Mapping corresponds to the mapping of the module encapsulation data model.

[0093] The present invention aims at the problems of lack of flexibility, high technical threshold, lack of standardization support and insufficient model verification in the current distribution network modeling tools in dynamically establishing new equipment or custom module models. Insufficient model verification means that when dynamically establishing new equipment or custom module models, some tools lack sufficient model verification mechanism, which may cause errors or inaccuracies in the established models, which may affect the results of subsequent simulation analysis and reduce the reliability and accuracy of modeling. By introducing flexible model definition and integration mechanism, lowering technical threshold, providing standardization support and strengthening model verification, the problems of traditional modeling tools in dynamically establishing new equipment or custom module models are solved.

[0094] Example 2

[0095] Based on the same inventive concept, the present invention also provides a dynamic symbol simulation platform for a distribution network, comprising:

[0096] The data modeling system for the distribution network described in the aforementioned embodiment 1 is used to construct a standardized file of a target network instance;

[0097] A code generation unit, configured to generate a corresponding target code file based on the standardized file of the target network instance;

[0098] The simulation solving unit is used to execute the target code file to solve the state variables of the target network instance to complete the simulation of the target network instance.

[0099] In this example implementation, a standardized file of the target network instance is constructed by calling the aforementioned modeling system, such as a Json file or a Json data model. Figure 2 As shown, the data model may include a basic data model and a module data model, the basic data model includes a component data model and a module terminal data model, and the module data model includes multiple module data models, for example, module data model 1, ..., module data model n. The code generation unit model code automatically generates a Json file based on the data model, and then generates code files of components and modules in turn, such as a py file, which is a Python source file for developing network-based applications; finally, the state variables of each component and each module are solved through code execution to complete the simulation process, and the entire simulation process is convenient, fast and efficient.

[0100] Exemplarily, the py file generation process of the above components and modules includes the following steps:

[0101] (1) Building component base classes

[0102] 1) Create component base class variables, including independent variables, Json data, and time change identifiers. Independent variables are ordered dictionaries, which initially contain values ​​such as simulation time, simulation step, rated frequency, and simulation duration; Json data stores the contents of the read-in Json file, and the time change identifier is used to describe whether to perform steady-state simulation or transient simulation.

[0103] 2) Create component objects with instance data. When initializing, first save the instance data, then use Json parameters to initialize the running data, and use the instance data to update the running data content. Initialize the object variables based on the variables of the generated model, add the variables of the component base class, and update the object variables with the instance data.

[0104] 3) The functions provided by the component base class include:

[0105] ① Calculate the Jacobian matrix of the component: Based on the Jacobian matrix expression array of the generative model, with expressions as rows and state variables as columns, the value of the expression is calculated based on the independent variables through Sympy (a symbolic computing library written in Python), and a triple consisting of row number, column number, and value array is returned.

[0106] ② Get the position of the state variable in the component based on the variable type and terminal ID: Search the terminal of the parameter, get the index position with the same terminal ID, and the sum of the index position and the starting position corresponding to the variable type is the position of the state variable in the component.

[0107] ③ Calculate the value of the equation expression: Based on the RHS (right hand side) expression array of the generated model, the value of the expression is calculated by Sympy based on the independent variables; the array of returned values ​​is obtained.

[0108] ④ Get the initial value of the variable: Based on the state variables of the generated model, get their values ​​in sequence and add them to the array.

[0109] ⑤Update the value of the independent variable: Based on the data passed from the previous level, update the corresponding value in the independent variable in the order of the state variables; and update the corresponding value in the independent variable based on the component base class variable data.

[0110] ⑥ Determine whether the component is time-varying: If the component has a differential expression, or the arithmetic expression contains time t, it is time-varying; otherwise, it is not time-varying.

[0111] ⑦Other basic functions: set and obtain parameter values, obtain the number of state variables and equations, set and obtain simulation time and simulation step, update simulation time, and obtain simulation duration.

[0112] (2) Building module base class

[0113] 1) Inherit the component base class and create a module base class; create module base class variables, including an ordered dictionary of the module's internal components.

[0114] 2) Create a component object with instance data. First save the instance data during initialization; call the parent class constructor for initialization, and then update the independent variables of all internal components based on the instance data.

[0115] 3) The functions provided by the module base class include:

[0116] ① Topological analysis: Establish an ordered dictionary of terminal mapping, whose key is the terminal ID and value is the list of components connected to the terminal. When topological analysis, traverse all internal components, extract their terminals, obtain the connected components of the terminal, and add the components to the connected components. Extract all internal submodules and obtain their terminals; then obtain the number of connected components of the terminal based on the ordered dictionary of terminal mapping. If it is greater than 1, it means external connection, and if it is equal to 1, it means no external connection. Set the partial connection identifier of the submodule parameters. Then perform topological analysis on the submodule.

[0117] ② Topology numbering: First, number the submodules. Use arrays to get the number of variables and equations of each internal component in turn; number the variables and equations respectively by accumulating the numbers in the order of the internal components, and record their starting positions; create an ordered dictionary of topology component numbers, whose key is the component ID and the value is a five-element array consisting of the component index, variable starting position, equation starting position, number of variables, and number of equations. Save the total number of variables and total number of equations of the internal components.

[0118] ③Calculate the connection Jacobian matrix:

[0119] First, calculate the connection Jacobian matrix of the submodules and initialize the number of connection equations to 0.

[0120] Establish voltage equations: traverse the ordered dictionary of terminal mappings, the voltages corresponding to the connected components should be equal; for n connected components, traverse n-1 independent component pairs; fill the rows, columns, and value vectors of the Jacobian matrix with the number of connection equations as rows, the sum of the position of the variable in its component and the starting position of the component variable as columns, one value of the component pair is -1, and the other is 1. After completing a component pair, the number of connection equations is incremented by 1.

[0121] Establish the current equation: traverse the ordered dictionary of terminal mapping. If the terminal is an external terminal with a connection, no processing is done. If it is an internal terminal or an external terminal without a connection, for all connected components, fill the rows, columns, and value vectors of the Jacobian matrix with the number of connection equations as rows, the sum of the position of the variable in its component and the starting position of the component variable as columns, and 1 as the value; the number of connection equations is automatically increased by 1.

[0122] Save the number of connection equations, the triplet of row, column, and value vectors of the connection Jacobian matrix, and construct and save the sparse connection Jacobian matrix.

[0123] ④ Calculate the Jacobian matrix triplet:

[0124] Create a triplet of the Jacobian's row, column, and value vectors and initialize it with a triplet of the concatenation Jacobian's row, column, and value vectors.

[0125] Traverse the internal components and obtain their Jacobian matrix triples in turn, add the sum of the number of connected equations and the starting position of the equation of the component to its rows, and add the starting position of the variable of the component to its columns; then concatenate the component triplets to the tail of the Jacobian matrix triples respectively.

[0126] ⑤ Get the position of the state variable in the component based on the variable type and terminal ID: Search the terminal of the parameter, get the index position with the same terminal ID, get the corresponding internal component ID based on the mapping, get the position of the variable in the internal component, and the sum of the position in the internal component and the starting position corresponding to the variable type is the position of the state variable in the component.

[0127] ⑥ Calculate the value of the equation expression: First, calculate the product of the connected Jacobian matrix and x, and use it as the initial array. Then traverse the internal components one by one, obtain the value of their equation expressions and splice them together, and return the spliced ​​array.

[0128] ⑦ Get the initial value of the variable: traverse the internal components in sequence, get the initial value of the variable and splice them together, save them in x and return the spliced ​​array.

[0129] ⑧Update the value of the independent variable: Based on the data passed from the previous level, extract the sub-array of the passed elements according to the starting position and number of variables in the order of the internal components, and call the component's update independent variable function with it as a parameter.

[0130] ⑨ Determine whether the component is time-varying: If the component has a differential expression, or the arithmetic expression contains time t, it is time-varying; otherwise, it is not time-varying.

[0131] ⑩Other basic functions: obtaining the number of variables, obtaining the number of equations, judging whether it is time-varying, etc. The implementation is relatively simple and will not be repeated here.

[0132] (3) Automatically generate component model files.

[0133] 1) Read the directories where the component Json files are located one by one.

[0134] 2) Create a folder output list, traverse the component data model Json files in the directory, and read the file content data.

[0135] 3) Create a result list.

[0136] 3-1) Add header content, mainly including OrderedDict, parse_expr, symbols, diff and component base classes.

[0137] 3-2) Add the inherited component base class to create the generated model statement and save the data into Json data.

[0138] 3-3) Generate a function to obtain the Parameters parameter.

[0139] 3-4) Extract the keys of Variables in sequence to construct state variables in array form; extract the parameters and variables in data and construct an ordered dictionary of independent variables.

[0140] 3-5) Construct an equation array: For AlgebraicEquations, rewrite it in the form of f(x)-y=0, where f(x) is the value of the differential equation at the current moment, x is the independent variable vector in the differential equation at the current moment, and y is the dependent variable value in the differential equation at the current moment; for DifferentialEquations, rewrite it in the differential form of {[f(x)+f(x_1)] / 2}*dt-y+y_1, and add x_1 and y_1 of the previous moment to the independent variables, where x_1 is the independent variable vector at the previous moment, f(x_1) is the value of the differential equation at the previous moment, dt is the time step, and y_1 is the dependent variable value at the previous moment.

[0141] 3-6) Generate the Jacobian matrix expression based on Sympy's diff function, with equations as rows and state variables as columns.

[0142] 3-7) Construct the initialization function and call the initialization function of the parent class.

[0143] 3-8) Convert the result list into a string and then write the string into the py file in the output path.

[0144] 4) Add the statement "from.{classname}import*" to the folder output list.

[0145] 5) After completing the variables, convert the folder output list into a string and write it to the __init__.py file of the output path.

[0146] (4) Automatically generate module model files.

[0147] 1) Read the directories where the module Json files are located one by one. If there are dependencies between modules, the dependent modules should be placed in the front directory.

[0148] 2) Create a folder output list, traverse the component data model Json files in the directory, and read the file content data.

[0149] 3) Create a result list.

[0150] 3-1) Add header content, mainly including OrderedDict, parse_expr, symbols, diff and other functions and module base classes, dependent components, and modules.

[0151] 3-2) Add the inheritance module base class to create the generated model statement and save the data into Json data.

[0152] 3-3) Create internal components in sequence and put them into the ordered dictionary of internal components.

[0153] 3-4) Construct the initialization function.

[0154] 3-5) Update mapping data: Set the value of the corresponding parameter of the internal component based on the parameter through the mapping relationship.

[0155] 3-6) and call the initialization function of the parent class.

[0156] 3-7) Convert the result list into a string and then write the string into the py file in the output path.

[0157] 4) Add the statement "from.{classname}import*" to the folder output list.

[0158] 5) After completing the variables, convert the folder output list into a string and write it to the __init__.py file of the output path.

[0159] In some example implementations, the simulation solving unit includes:

[0160] A file reading subunit, configured to update an initial value of an independent variable based on a storage path of a standardized file of the target network instance;

[0161] An object creation subunit, configured to sequentially create a module object and a component object based on device data in the content of the standardized file of the target network instance, and put the key-value pairs of the module object and the component object into an ordered dictionary of an internal component;

[0162] The solving subunit is used to solve the state variables in each component and each module through an iterative algorithm based on the initial value of the independent variable.

[0163] In this example implementation, the simulation solving unit completes the simulation process by importing the component class and module class under the specified path, inheriting the module base class, solving the state variables in all components and modules based on the Json data file of the network instance. The specific process includes the following steps:

[0164] (1) Based on the Json data file path, read the file content; save the parameters in it to the instance data, and update the independent variables.

[0165] (2) Create module and component instances: Obtain device data from the Json file content, where the key is the class name and the value is the corresponding instance data; create module objects and component objects in sequence, and put their IDs and the key-value pairs of the objects into the ordered dictionary of the internal component.

[0166] (3) Calculation initialization: Call topology analysis, topology numbering, calculation of connection Jacobian matrix and other functions in sequence for initialization.

[0167] (4) Simulation solution:

[0168] 1) Get the initial value of the variable.

[0169] 2) Determine whether the simulation is time-varying. If not, go to step 6), otherwise go to step 3).

[0170] 3) Is the simulation time less than the simulation duration? If so, go to step 4), otherwise go to step 7).

[0171] 4) Iterative solution: Calculate the Jacobian matrix triples and construct the Jacobian matrix A; calculate the value of the equation expression and assign its opposite to dy, where dy is the change in y; calculate the state variable correction value dx = A-1*dy, the new state variable x = x + dx, and update the value of the independent variable based on the new state variable. The convergence is determined by whether the quadratic generic of dx is less than the limit value. If converged, go to step 5), otherwise the number of iterations increases by 1 and continues with step 4) for iterative solution.

[0172] 5) Update the simulation time and the value of the independent variable based on x; go to step 3).

[0173] 6) Iterative solution: Calculate the Jacobian matrix triples and construct the Jacobian matrix A; calculate the value of the equation expression and assign its opposite to dy; calculate the state variable correction value dx = A-1*dy, the new state variable x = x + dx, and update the value of the independent variable based on the new state variable. The convergence is determined by whether the quadratic generic of dx is less than the limit value. If converged, go to step 7), otherwise the number of iterations increases by 1 and continues with step 6) for iterative solution.

[0174] 7) Complete the calculation, output and print the calculation results.

[0175] The present invention aims to solve the shortcomings of the existing distribution system modeling and simulation platform in dynamically establishing new equipment or custom module models, thereby promoting the development and application of distribution network modeling and simulation technology. Specifically, by introducing the equipment JSON data standard and symbolic calculation technology based on the Modelica principle, a flexible and convenient modeling method is achieved, which facilitates the rapid and flexible establishment of new equipment or custom module models, thereby improving modeling efficiency and flexibility. The use of infinite-level modular component packaging technology and a modeling method based on modular elements allows users to easily establish custom models without having to deeply understand the underlying technology, thereby lowering the technical threshold. Through the standardization of the distribution system equipment JSON data standard and modeling method, the platform provides standardized support, allowing users to easily share and exchange models, thereby improving the versatility and reusability of the models.

[0176] Example 3

[0177] Based on the same inventive concept, the present invention also provides a data modeling method for a distribution network, comprising:

[0178] Based on basic circuit elements of a target network in a distribution network, constructing a basic component data model corresponding to the basic circuit elements;

[0179] Based on the connection relationship between the basic circuit elements, a module terminal data model is constructed;

[0180] Based on the physical devices in the target network, construct a corresponding module encapsulation data model;

[0181] Among them, the module packaging data model includes mutually nested multi-level packaging modules, and the packaging modules nested in the inner layer of the multi-level packaging module serve as internal components of the outer layer packaging module. One basic component data model, one module terminal data model or one module packaging data model generates a corresponding standardized file.

[0182] In a possible implementation, the standardized file is a Json file.

[0183] In a possible implementation manner, the basic component data model includes a component parameter sub-model, a component variable sub-model, a component relationship sub-model and a component variable position sub-model, and the basic circuit element of the target network in the distribution network is based on the basic component data model corresponding to the basic circuit element, including:

[0184] By defining the input parameters and corresponding values ​​of the components, the basic component parameter sub-model is constructed;

[0185] The basic component variable sub-model is constructed by defining the variables to be determined and the initial values ​​of the variables of the component; the variables to be determined include the voltage and the injected current of each terminal of the basic circuit element in the target network;

[0186] Constructing the basic component relationship sub-model by defining the relationship between the variables to be determined of the component and the input parameters of the component;

[0187] The component variable position sub-model is constructed by defining the position of the variable to be requested of the component obtained externally within the basic component data model.

[0188] In a possible implementation manner, the input parameters of the component include terminals of the basic circuit elements corresponding to the component, and the values ​​of the terminals are used to indicate the connection relationship of the terminals; the method further includes:

[0189] The variables to be determined of the same type are preferentially placed in the same basic component data model, and the variables to be determined of the same type in the basic component data model are sorted according to the connection relationship sequence of the terminals.

[0190] In a possible implementation manner, the module terminal data model includes a module terminal parameter sub-model, a module terminal variable sub-model, a module terminal relationship sub-model and a module terminal variable position sub-model; the module terminal data model is constructed based on the connection relationship between the basic circuit elements, including:

[0191] Defining input parameters and corresponding values ​​of terminals to construct the module terminal parameter submodel, wherein the input parameters of the terminals include module terminals, and the values ​​of the module terminals include two elements, wherein one element is used to indicate an external terminal of the module, and the other element is used to indicate an internal terminal of the module;

[0192] The module terminal variable sub-model is constructed by defining variables to be determined for two terminals of the module terminals; the variables to be determined for the two terminals include voltages and injection currents of the two terminals;

[0193] Constructing the module terminal relationship sub-model by defining the relationship between the variables to be determined of the terminal and the input parameters of the terminal;

[0194] The module terminal variable position sub-model is constructed by defining the position of the variable to be obtained externally for the terminal within the module terminal data model.

[0195] In a possible implementation, the module encapsulation data model includes a module parameter sub-model, a module device sub-model and a mapping sub-model, and the corresponding module encapsulation data model is constructed based on the physical device in the target network, including:

[0196] The module parameter sub-model is constructed by defining input parameters and corresponding values ​​of the module, wherein the input parameters of the module include module terminals and external connection identifiers;

[0197] Defining a component dictionary constituting a module based on a key-value pair to form the module device sub-model, wherein the key of the component dictionary is a component identifier, the value of the component dictionary is component data, and the component data includes a standardized file name of the used component;

[0198] The mapping sub-model is formed by establishing a correspondence between the input parameters of the module and the values ​​of the component dictionary of the module.

[0199] Example 4

[0200] Based on the same inventive concept, the present invention also provides a dynamic symbol simulation analysis method for a distribution network, comprising:

[0201] By calling the data modeling system of the distribution network described in Example 1, a standardized file of the target network instance is constructed;

[0202] Generate a corresponding target code file based on the standardized file of the target network instance;

[0203] The target code file is executed to solve the state variables of the target network instance to complete the simulation of the target network instance.

[0204] In a possible implementation manner, executing the target code file to solve the state variable of the target network instance includes:

[0205] Based on the storage path of the standardized file of the target network instance, updating the initial value of the independent variable;

[0206] Based on the device data in the content of the standardized file of the target network instance, sequentially create a module object and a component object, and put the key-value pairs of the module object and the component object into an ordered dictionary of the internal component;

[0207] Based on the initial values ​​of the independent variables, the state variables in each component and each module are solved through an iterative algorithm.

[0208] Example 5

[0209] like Figure 3As shown, the present invention also provides an electronic device, which may be a computer device, a single-chip device, an intelligent mobile device, etc. The electronic device in this embodiment may include a processor, a memory, a transceiver component, etc. The memory, the processor, and the transceiver component are connected via a bus; the memory may be used to store an execution program, and an exemplary execution program may include instructions; the processor is used to execute the instructions stored in the memory. The memory may also be used to store data, which may be called and / or modified when the instructions are executed.

[0210] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in a storage medium to implement the corresponding method flow or corresponding functions, so as to implement the steps of a data modeling method for a distribution network in the above-mentioned embodiment.

[0211] Example 6

[0212] Based on the same inventive concept, the present invention also provides a readable storage medium, specifically an electronic device readable storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It can be understood that the storage medium here can include both built-in storage media in electronic devices and, of course, extended storage media supported by electronic devices. The storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more execution programs (including program codes). It should be noted that the storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor loads and executes one or more instructions stored in the storage medium, which can implement the steps of a data modeling method for a distribution network in the above embodiment.

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

[0214] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0215] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0216] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0217] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit its protection scope. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that after reading the present invention, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the application, but these changes, modifications or equivalent substitutions are all within the protection scope of the claims to be approved.

Claims

1. A data modeling system for a distribution network, characterized in that: include: A basic component construction unit, used to construct a basic component data model corresponding to the basic circuit element based on the basic circuit element of the target network in the distribution network; A module terminal construction unit, used to construct a module terminal data model based on the connection relationship between the basic circuit elements; A module encapsulation construction unit, used to construct a corresponding module encapsulation data model based on the physical devices in the target network; Among them, the module packaging data model includes mutually nested multi-level packaging modules, and the packaging modules nested in the inner layer of the multi-level packaging module serve as internal components of the outer layer packaging module. One basic component data model, one module terminal data model or one module packaging data model generates a corresponding standardized file.

2. The system according to claim 1, characterized in that The standardized file is a Json file.

3. The system according to claim 1, characterized in that The basic component data model includes a component parameter sub-model, a component variable sub-model, a component relationship sub-model and a component variable position sub-model; The basic component building unit includes: A component parameter construction sub-unit, used to construct the basic component parameter sub-model by defining the input parameters and corresponding values ​​of the component; A component variable construction sub-unit, used to construct the basic component variable sub-model by defining the variables to be determined and the initial values ​​of the variables of the component; the variables to be determined of the component include the voltage and the injected current of each terminal of the basic circuit element in the target network; A component relationship construction sub-unit, used for constructing the basic component relationship sub-model by defining a relationship between the variables to be determined of the component and the input parameters of the component; The component variable position construction sub-unit is used to construct the component variable position sub-model by defining the position of the variable to be requested of the component obtained externally within the basic component data model.

4. The system according to claim 3, characterized in that The input parameters of the component include terminals of the component corresponding to basic circuit elements, and the values ​​of the terminals are used to indicate the connection relationship of the terminals; The component variable construction subunit is used to place the same type of variables to be determined in the same basic component data model in priority, and the same type of variables to be determined in the basic component data model are sorted according to the connection relationship sequence of the terminals.

5. The system according to claim 1, characterized in that The module terminal data model includes a module terminal parameter sub-model, a module terminal variable sub-model, a module terminal relationship sub-model and a module terminal variable position sub-model; The module terminal building unit comprises: A module terminal parameter construction sub-unit is used to construct the module terminal parameter sub-model by defining input parameters and corresponding values ​​of the terminals, wherein the input parameters of the terminals include module terminals, and the values ​​of the module terminals include two elements, wherein one element is used to indicate an external terminal of the module, and the other element is used to indicate an internal terminal of the module; A module terminal variable construction sub-unit is used to construct the module terminal variable sub-model by defining variables to be determined for two terminals of the module terminals; the variables to be determined for the two terminals include voltages and injection currents of the two terminals; A module-terminal relationship construction sub-unit, used to construct the module-terminal relationship sub-model by defining a relationship between the variables to be determined of the terminal and the input parameters of the terminal; The module terminal variable position construction sub-unit is used to construct the module terminal variable position sub-model by defining the position of the variable to be obtained from the terminal externally within the module terminal data model.

6. The system according to claim 5, characterized in that The module encapsulation data model includes a module parameter sub-model, a module device sub-model and a mapping sub-model, and the module encapsulation construction unit includes: A module parameter construction sub-unit, used to construct the module parameter sub-model by defining the module input parameters and corresponding values, wherein the module input parameters include module terminals and external connection identifiers; A module device construction subunit, used for defining a component dictionary constituting a module based on a key-value pair to form the module device submodel, wherein the key of the component dictionary is a component identifier, the value of the component dictionary is component data, and the component data includes a standardized file name of a used component; The mapping construction subunit is used to form the mapping submodel by establishing a corresponding relationship between the input parameters of the module and the values ​​of the component dictionary of the module.

7. A dynamic symbolic simulation analysis platform for distribution network, characterized in that: include: The data modeling system for the distribution network according to any one of claims 1 to 6, used to construct a standardized file of a target network instance; A code generation unit, configured to generate a corresponding target code file based on the standardized file of the target network instance; The simulation solving unit is used to execute the target code file to solve the state variables of the target network instance to complete the simulation of the target network instance.

8. The platform according to claim 7, characterized in that The simulation solution unit comprises: A file reading subunit, configured to update an initial value of an independent variable based on a storage path of a standardized file of the target network instance; An object creation subunit, configured to sequentially create a module object and a component object based on device data in the content of the standardized file of the target network instance, and put the key-value pairs of the module object and the component object into an ordered dictionary of an internal component; The solving subunit is used to solve the state variables in each component and each module through an iterative algorithm based on the initial value of the independent variable.

9. A data modeling method for a distribution network, characterized in that: include: Based on basic circuit elements of a target network in a distribution network, constructing a basic component data model corresponding to the basic circuit elements; Based on the connection relationship between the basic circuit elements, a module terminal data model is constructed; Based on the physical devices in the target network, construct a corresponding module encapsulation data model; Among them, the module packaging data model includes mutually nested multi-level packaging modules, and the packaging modules nested in the inner layer of the multi-level packaging module serve as internal components of the outer layer packaging module. One basic component data model, one module terminal data model or one module packaging data model generates a corresponding standardized file.

10. A dynamic symbol simulation analysis method for a distribution network, characterized in that: include: By calling the data modeling system of the distribution network according to any one of claims 1 to 6, a standardized file of the target network instance is constructed; Generate a corresponding target code file based on the standardized file of the target network instance; The target code file is executed to solve the state variables of the target network instance to complete the simulation of the target network instance.