Simulation model data processing method and device, electronic equipment and program product

By obtaining the reference attributes and dependency links of modeling elements in the simulation model and detecting circular dependencies using the stack query method, the waste of computing resources and software crashes caused by circular dependencies in simulation modeling are solved, and a more stable simulation modeling process is achieved.

CN119645811APending Publication Date: 2025-03-18CHENGDU GONGDING TECHNOLOGY CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411810499.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In simulation modeling, there may be circular dependencies in the dependency chain of modeling elements, resulting in waste of computing resources and software crashes.

Method used

By obtaining the reference attributes of the first modeling element in the simulation model, determining the dependency link, and storing the dependency objects into the stack step by step, determining whether the same modeling element exists in the stack to determine the existence of circular dependencies.

Benefits of technology

This method can accurately detect the circular dependencies in the dependent link in the simulation model, avoid waste of computing resources and software crashes, and improve the stability of simulation modeling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645811A_ABST
    Figure CN119645811A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device for a simulation model, electronic equipment and a program product, and the method comprises the steps: obtaining a first reference attribute of a first modeling element in the simulation model, the first reference attribute being used for indicating a dependency relationship between the first modeling element and other modeling elements in the simulation model; modeling elements on a first dependency link are determined according to the first reference attribute, the first dependency link takes the first modeling element as a starting point, and the modeling elements in the first dependency link are sequentially connected end to end; storing the first modeling element into a stack, and sequentially storing the dependency object of each modeling element on the first dependency link into the stack by taking the first modeling element as a starting point; in the process of sequentially storing the dependent object of each modeling element into the stack, determining whether the stack contains the modeling element which is the same as the to-be-stored dependent object or not; and if the stack contains the modeling element which is the same as the to-be-stored dependency object, determining that the first dependency link has cyclic dependency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and more specifically, to a data processing method and device, electronic equipment, and program product for a simulation model. Background Art

[0002] In simulation modeling, each modeling element has its own independent properties and relies on other modeling elements to form a complete modeling element entity. However, circular dependencies may exist in the dependency chain of modeling elements, resulting in wasted computing resources and even software crashes. Summary of the Invention

[0003] The embodiments of the present application provide a data processing method and device for a simulation model, an electronic device, and a program product. The following introduces various aspects of the embodiments of the present application.

[0004] In a first aspect, a method for processing data of a simulation model is provided, comprising: obtaining a first reference attribute of a first modeling element in a simulation model, the first reference attribute being used to indicate a dependency relationship between the first modeling element and other modeling elements in the simulation model; determining a modeling element on a first dependency link based on the first reference attribute, the first dependency link starting with the first modeling element, and the modeling elements in the first dependency link being connected end to end in sequence; storing the first modeling element in a stack, and starting with the first modeling element, storing the dependent object of each modeling element on the first dependency link in sequence in the stack; in the process of storing the dependent object of each modeling element in sequence in the stack, determining whether the stack contains the same modeling element as the dependent object to be stored; if the stack contains the same modeling element as the dependent object to be stored, determining that a circular dependency exists in the first dependency link.

[0005] As a possible implementation manner, the first reference attribute is a first-class reference attribute, and the first-class reference attribute is used to indicate the modeling element referenced by the first modeling element; determining the modeling element on the first dependency link based on the first reference attribute includes: determining the modeling element on the first dependency link based on the first-class reference attribute, and the modeling element in the first dependency link is located downstream of the first modeling element.

[0006] As a possible implementation manner, the first reference attribute is a second-type reference attribute, and the second-type reference attribute is used to indicate a modeling element that references the first modeling element; determining the modeling element on the first dependency link based on the first reference attribute includes: determining the modeling element on the first dependency link based on the first-type reference attribute, the modeling element in the first dependency link being located upstream of the first modeling element.

[0007] As a possible implementation manner, the method further includes: if the second modeling element in the stack is the same as the dependency object to be stored, determining the type of circular dependency existing in the first dependency link based on the position of the second modeling element in the stack; wherein the type of circular dependency includes at least one of direct self-circular dependency, indirect self-circular dependency, and branch self-circular dependency.

[0008] In a second aspect, a data processing device for a simulation model is provided, comprising: an acquisition module for acquiring a first reference attribute of a first modeling element in a simulation model, wherein the first reference attribute is used to indicate a dependency relationship between the first modeling element and other modeling elements in the simulation model; a first determination module for determining a modeling element on a first dependency link based on the first reference attribute, wherein the first dependency link takes the first modeling element as a starting point, and the modeling elements in the first dependency link are connected end to end in sequence; a storage module for storing the first modeling element into a stack, and starting from the first modeling element, storing the dependent objects of each modeling element on the first dependency link into the stack in sequence; a second determination module for determining whether the stack contains the same modeling element as the dependent object to be stored in the process of storing the dependent object of each modeling element into the stack in sequence; and a third determination module for determining that a circular dependency exists in the first dependency link if the stack contains the same modeling element as the dependent object to be stored.

[0009] As a possible implementation method, the first reference attribute is a first-class reference attribute, and the first-class reference attribute is used to indicate the modeling element referenced by the first modeling element; the first determination module is used to: determine the modeling element on the first dependency link based on the first-class reference attribute, and the modeling element in the first dependency link is located downstream of the first modeling element.

[0010] As a possible implementation method, the first reference attribute is a second-type reference attribute, and the second-type reference attribute is used to indicate a modeling element that references the first modeling element; the first determination module is used to: determine the modeling element on the first dependency link based on the first-type reference attribute, and the modeling element in the first dependency link is located upstream of the first modeling element.

[0011] As a possible implementation manner, the device also includes: a fourth determination module, which is used to determine the type of circular dependency existing in the first dependency link based on the position of the second modeling element in the stack if the second modeling element in the stack is the same as the dependency object to be stored; wherein the type of circular dependency includes at least one of direct self-circular dependency, indirect self-circular dependency and branch self-circular dependency.

[0012] In a third aspect, an electronic device is provided, comprising: a memory for storing code; and a processor for executing the code stored in the memory to perform the method as described in the first aspect or any implementation of the first aspect.

[0013] According to a fourth aspect, a computer program product is provided, comprising a program code, wherein the program code is configured to execute the method according to the first aspect or any one of the implementations of the first aspect.

[0014] The present application provides a data processing method for a simulation model, comprising: obtaining a first reference attribute of a first modeling element in a simulation model, the first reference attribute being used to indicate a dependency relationship between the first modeling element and other modeling elements in the simulation model; determining a modeling element on a first dependency link according to the first reference attribute, the first dependency link starting from the first modeling element, and the modeling elements in the first dependency link being connected end to end; storing the first modeling element in a stack, and starting from the first modeling element, storing the dependent objects of each modeling element on the first dependency link in the stack in sequence; in the process of storing the dependent objects of each modeling element in the stack in sequence, determining whether the stack contains the same modeling element as the dependent object to be stored; if the stack contains the same modeling element as the dependent object to be stored, determining that there is a circular dependency in the first dependency link. This solution stores the dependent objects of each modeling element on the dependency link in the stack in sequence, and then compares them with the modeling elements stored in the stack. If the stack already contains the same modeling element as the dependent object to be stored, it indicates that there is a circular dependency in the dependency link. This solution helps to accurately query the circular dependency in the dependency link of the modeling element by combining the query method of stack with nested recursion (i.e., querying the dependent objects in the dependency link step by step). BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a schematic diagram of circular dependencies of recursive query modeling elements provided by related technologies.

[0016] Figure 2 It is a flowchart of a data processing method of a simulation model provided in one embodiment of the present application.

[0017] Figure 3It is a structural diagram of the attributes of the first modeling element provided in an embodiment of the present application.

[0018] Figure 4 This is a schematic diagram of the upstream and downstream dependency link layer relationship of modeling elements provided in an embodiment of the present application.

[0019] Figure 5 This is a schematic diagram of the downstream dependency link layer relationship of the modeling elements provided in one embodiment of the present application.

[0020] Figure 6 This is a schematic diagram of the upstream dependency link layer relationship of the modeling elements provided in one embodiment of the present application.

[0021] Figure 7 This is a schematic diagram of the upstream dependency link layer relationship of the modeling elements provided in another embodiment of the present application.

[0022] Figure 8 It is a flowchart of a data processing method for a simulation model provided in another embodiment of the present application.

[0023] Figure 9 It is a flowchart of a data processing method of a simulation model provided in another embodiment of the present application.

[0024] Figure 10 It is a structural diagram of a data processing device for a simulation model provided in one embodiment of the present application.

[0025] Figure 11 It is a structural diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention should fall within the scope of protection of the present invention.

[0027] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0028] Before introducing the embodiments of the present application, the terms in the embodiments of the present application are first explained.

[0029] Circular Dependency

[0030] A circular dependency refers to a mutual dependency relationship between multiple modules or components, where A depends on B, which in turn depends on A, or a longer dependency chain exists, ultimately resulting in a direct or indirect dependency relationship between A and B. This type of dependency is generally considered a bad practice in software engineering because it makes code difficult to understand and maintain, increases code coupling, and complicates code modification and testing.

[0031] In programming, circular dependencies can lead to the following problems:

[0032] 1. Compilation errors: In some programming languages, if circular dependencies between modules are not properly handled, compilation errors may occur.

[0033] 2. Runtime errors: Even if the compilation passes, circular dependencies may cause runtime errors because the order of dependencies may cause some objects to not be fully initialized when needed.

[0034] 3. Code is difficult to understand: Circular dependencies make it difficult to read and understand the code because developers need to track the dependencies between multiple modules.

[0035] 4. Difficult to test: Circularly dependent modules are difficult to test individually because they depend on each other, which makes unit testing more complicated.

[0036] 5. Difficult to refactor: Due to the strong coupling between modules, refactoring the code becomes more difficult because modifying one module may affect other modules that depend on it.

[0037] The embodiments of the present application mainly relate to the field of simulation model technology. When performing simulation modeling, each modeling element has its own independent attributes and will rely on references to other modeling elements in order to form a complete modeling element entity. For example, certain attributes of a modeling element (such as location and orientation) are affected by the calculation results of other modeling elements that it references. In the process of calculating the attribute value, due to the circular dependency in the dependency chain of the modeling element, the calculation will fall into an infinite loop, causing the software to crash and waste computing resources.

[0038] The related art proposes to determine whether there is a circular dependency by setting a target modeling element and then using the target to use nested recursive query modeling element reference attributes to determine whether there is a modeling element that depends on the target modeling element. Figure 1 Give an example.

[0039] See also Figure 1 In existing solutions, the target modeling element is detected in the dependency chain of all referenced attributes. In this dependency chain, there may be situations where the target directly depends on the target modeling element itself, such as the target modeling element depending on the target modeling element, which can be called a direct self-circular dependency. There may also be situations where the target modeling element depends on the target modeling element through multiple levels, such as modeling element B depending on the target modeling element, which can be called an indirect self-circular dependency. Related technologies use nested recursive queries through target setting to detect the existence of direct and indirect self-circular dependencies, but cannot detect branch circular dependencies that appear on the dependency level chain, such as the case where modeling element B depends on modeling element A. As a result, circular dependencies still exist in the dependency chain of modeling elements, which in turn leads to wasted computing resources and even software crashes.

[0040] In response to the above problems, the present application provides a data processing method for a simulation model, comprising: obtaining a first reference attribute of a first modeling element in the simulation model, the first reference attribute being used to indicate a dependency relationship between the first modeling element and other modeling elements in the simulation model; determining a modeling element on a first dependency link based on the first reference attribute, the first dependency link starting with the first modeling element, and the modeling elements in the first dependency link being connected end to end; storing the first modeling element in a stack, and starting with the first modeling element, storing the dependent objects of each modeling element on the first dependency link in sequence in the stack; in the process of storing the dependent objects of each modeling element in sequence in the stack, determining whether the stack contains the same modeling element as the dependent object to be stored; if the stack contains the same modeling element as the dependent object to be stored, determining that a circular dependency exists in the first dependency link. This solution stores the dependent objects of each modeling element on the dependency link in sequence in the stack, and then compares them with the modeling elements stored in the stack. If the stack already contains the same modeling element as the dependent object to be stored, it indicates that a circular dependency exists in the dependency link. This solution uses a query method that combines stacking with nested recursion (i.e., querying dependent objects in a dependency link level by level) to help accurately query cyclic dependencies in dependency links of modeling elements.

[0041] Combined with the following Figure 2 The data processing method of the simulation model in the embodiment of the present application is described in detail. Figure 2 As shown, the data processing method 200 of the simulation model may include steps: S210 to S250.

[0042] In step S210, a first reference attribute of a first modeling element in the simulation model is obtained. The first reference attribute is used to indicate a dependency relationship between the first modeling element and other modeling elements in the simulation model.

[0043] In this application, the first reference properties may include successor properties and predecessor properties. Successor properties may be used to indicate the modeling element referenced by the first modeling element, and predecessor properties may be used to indicate the modeling element that references the first modeling element, see Figure 3 .

[0044] It should be noted that the referenced attributes in the simulation model may also be referred to as attribute expressions. In some implementations, attribute expressions may also refer to special modeling elements dedicated to calculating and managing dependencies between modeling elements in the simulation model.

[0045] In this application, a modeling element referenced by a first modeling element can be referred to as a successor object of the first modeling element; a modeling element that references the first modeling element can be referred to as a predecessor object. It should be understood that a successor object can be any type of modeling element entity object, and a predecessor object can also be any type of modeling element entity object.

[0046] As an example, see Figure 4 , the modeling elements referenced by modeling element 1 include modeling element 2 and modeling element 3. Therefore, modeling element 2 and modeling element 3 are successor objects of modeling element 1. The modeling elements that reference modeling element 1 include modeling element 4 and modeling element 5. Therefore, modeling element 4 and modeling element 5 are predecessor objects of modeling element 1.

[0047] It's understandable that a modeling element can be referenced by multiple modeling elements, so a modeling element can have multiple predecessor attribute expressions and corresponding predecessor objects. An attribute expression can only contain the content of a certain attribute of a certain modeling element, so an attribute expression corresponds to only one predecessor modeling element.

[0048] The dependency relationships between modeling elements in a simulation model may include downstream dependency link layer relationships of the modeling elements and upstream dependency link layer relationships of the modeling elements. Starting from the current modeling element, the upstream layer relationships and downstream layer relationships of the modeling element can be traced back.

[0049] As an example, starting with Modeling Element 1, Figure 5 The following is a diagram of the downstream dependency link layer relationship of modeling element 1. In the downstream dependency link layer relationship, the successor objects of the current modeling element can be queried level by level.

[0050] As an example, starting with Modeling Element 1, Figure 6The figure is a schematic diagram of the upstream dependency link layer relationship of modeling element 1. In the upstream dependency link layer relationship, the predecessor objects of the current modeling element can be queried level by level.

[0051] This application does not impose any specific restrictions on the types of modeling elements in the simulation model. For example, the modeling elements can be parts, markers, joints, forces, bushings, etc.

[0052] In some implementations, the simulation model in this application may refer to a simulation model established during object-oriented programming. The simulation model may be used to simulate the operating performance of a vehicle. The operating performance of the vehicle includes, but is not limited to, the operating performance of the powertrain (e.g., monitoring the operating performance of the transmission, drive shaft, and other transmission components), the operating performance of the engine (e.g., monitoring the engine's speed, temperature, pressure, and other performance), and the stress and deformation performance of the vehicle's hardware components.

[0053] In step S220, the modeling elements on the first dependency link are determined according to the first reference attribute. The first dependency link takes the first modeling element as a starting point, and the modeling elements in the first dependency link are connected end to end in sequence.

[0054] In the present application, the modeling element on the first dependency link can be determined by using the successor attribute in the first reference attribute. In this case, the first dependency link can also be called a successor dependency link.

[0055] As an example, the first reference attribute is a first-class reference attribute (such as a successor attribute), that is, the first-class reference attribute is used to indicate the modeling element referenced by the first modeling element. Then, the modeling element on the first dependency link can be determined based on the first-class reference attribute. At this time, the modeling element in the first dependency link is located downstream of the first modeling element.

[0056] For example, see again Figure 5 Taking modeling element 1 as the starting point, it can be determined that the successor objects of modeling element 1 are modeling elements 21 to 24, and the successor objects of modeling element 21 are modeling elements 31 to 33. Modeling elements 21 to 24 and modeling elements 31 to 33 are located downstream of modeling element 1.

[0057] In the present application, the predecessor attribute in the first reference attribute can be used to determine the modeling element on the first dependency link. In this case, the first dependency link can also be called a predecessor dependency link.

[0058] As an example, the first reference attribute is a second-class reference attribute (such as a predecessor attribute), that is, the second-class reference attribute is used to indicate the modeling element that references the first modeling element. Then, the modeling element on the first dependency link can be determined based on the first-class reference attribute, and the modeling element in the first dependency link is located upstream of the first modeling element.

[0059] For example, see again Figure 6 Taking modeling element 1 as the starting point, it can be determined that the predecessor objects of modeling element 1 are modeling elements 21 to 23, and the predecessor objects of modeling element 22 are modeling elements 31 to 33. Modeling elements 21 to 23 and modeling elements 31 to 33 are located upstream of modeling element 1.

[0060] In step S230 , the first modeling element is stored in a stack, and starting from the first modeling element, the dependent objects of each modeling element on the first dependency link are stored in the stack in sequence.

[0061] It should be noted that the dependent object of a first modeling element can refer to a modeling element object directly referenced by the first modeling element (successor object) or a modeling element object that directly references the first modeling element (predecessor object). Of course, the dependent object of a first modeling element can be the first modeling element itself (in which case a circular dependency will occur) or other modeling elements on the first dependency chain.

[0062] In step S240 , while storing the dependent objects of each modeling element in the stack in sequence, it is determined whether the stack contains the same modeling element as the dependent object to be stored.

[0063] In step S250 , if the stack contains the same modeling element as the dependency object to be stored, it is determined that a circular dependency exists in the first dependency link.

[0064] As an example, taking the predecessor dependency link as an example, see Figure 7 , assuming that the modeling elements on the first dependency link (e.g., link 1) are modeling element 1 and modeling element 21. Starting with modeling element 1, after storing modeling element 1 in the stack, the dependent objects of modeling element 1 can be queried to determine whether the stack contains the dependent objects of modeling element 1. If the dependent object of modeling element 1 is modeling element 21, it is determined that the stack does not contain the same modeling element as the dependent object (modeling element 21).

[0065] Furthermore, it is determined that the loop has not ended, and modeling element 21 (the dependent object of modeling element 1) is stored in the stack. After storing modeling element 21 in the stack, the dependent object of modeling element 21 can be queried, and it can be determined whether the stack contains the dependent object of modeling element 21. If the dependent object of modeling element 21 is modeling element 21, it is determined that the stack already contains the same modeling element as the dependent object (modeling element 21). At this time, it can be determined that there is a circular dependency in the first dependency link.

[0066] In some implementations, if the second modeling element in the stack is the same as the dependency object to be stored, the type of circular dependency existing in the first dependency link can be determined based on the position of the second modeling element in the stack; wherein the type of circular dependency includes at least one of a direct self-circular dependency, an indirect self-circular dependency, and a branch self-circular dependency.

[0067] It should be noted that if the first modeling element's dependent object can be the first modeling element itself and does not go through multiple dependency levels, it can be called a direct self-circular dependency. If the first modeling element's dependent object can be the first modeling element itself and goes through multiple dependency levels, it can be called an indirect self-circular dependency. If a circular dependency occurs between modeling elements other than the first modeling element, it can be called a branch circular dependency.

[0068] The following describes the embodiments of the present application in more detail with reference to specific examples. Figure 8 and Figure 9 The present invention is intended only to help those skilled in the art understand the embodiments of the present invention, and is not intended to limit the embodiments of the present invention to the specific numerical values ​​or specific scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or changes based on the examples given, and such modifications or changes also fall within the scope of the embodiments of the present invention.

[0069] Figure 8 This is a flow chart of another data processing method for a simulation model provided in an embodiment of the present application. Figure 8 The data processing method of the simulation model may include the following steps: S801 to S807.

[0070] It should be noted that Figure 8 The description is made by taking the case where the first dependency link is a predecessor dependency link as an example. Of course, the method in the present application is also applicable to cyclic dependency query of subsequent dependency links.

[0071] In step S801 : the stack of the first dependency link is initialized, and the first modeling element is stored in the stack, and the loop detection is started with the first modeling element as the starting point.

[0072] In step S802, the predecessor attribute expressions of the modeling elements in the first dependency link are obtained and traversed, and a determination is made based on the predecessor attribute expressions whether the current modeling element has a predecessor object. If a predecessor object exists, the process jumps to step S803; if not, the process jumps to step S807.

[0073] In step S803: determine whether the stack contains the same modeling element as the current predecessor object. If the stack does not contain the same modeling element as the current predecessor object, jump to step S804; if the stack contains the same modeling element as the current predecessor object, jump to step S805.

[0074] In step S804: the predecessor object (predecessor object of the current modeling element) without circular dependency is stored in the stack, and the process jumps to step S802.

[0075] It should be noted that the current predecessor object will be converted into the current modeling element, and the predecessor objects of the current modeling element will be recursively queried.

[0076] In step S805: the current predecessor object is popped from the stack, and the process returns recursively to determine whether a circular dependency exists in the first dependency link.

[0077] In step S806: determine whether the traversal of the first dependency link is completed. If the traversal of the first dependency link is completed, jump to step S807; otherwise, jump to step S804.

[0078] In step S807: the loop ends.

[0079] Figure 9 This is a flow chart of another data processing method for a simulation model provided in an embodiment of the present application. Figure 9 and Figure 7 The data processing method of the simulation model may include the following steps: S901 to S905.

[0080] It should be noted that Figure 9 The modeling elements in the dashed box represent the predecessor objects to be stored.

[0081] In step S901, modeling element 1 is stored in the stack. Circular dependency detection is performed starting with modeling element 1. The attribute expressions of modeling element 1 are traversed. If the predecessor object of modeling element 1 (modeling element 1) is in the stack, a direct self-circular dependency is determined. Traversal is not complete, and the dependency link 1 detection process begins.

[0082] In step S902, the predecessor of modeling element 1 (modeling element 21) is not in the stack, so modeling element 21 is pushed onto the stack. The predecessor of modeling element 21 (modeling element 21) is in the stack, so a branch loop dependency is determined. The traversal is not complete, so the process proceeds to dependency link 2 detection.

[0083] In step S903, the predecessor of modeling element 1 (modeling element 22) is not in the stack, so modeling element 22 is pushed onto the stack. The predecessor of modeling element 22 (modeling element 31) is not in the stack, so modeling element 31 is pushed onto the stack. Since the predecessor of modeling element 31 (modeling element 22) is in the stack, a branch circular dependency is determined. The traversal is not complete, so the process proceeds to dependency link 3 detection.

[0084] In step S904, the predecessor object of modeling element 1 (modeling element 22) is not in the stack, so modeling element 22 is pushed into the stack; the predecessor object of modeling element 22 (modeling element 32) is not in the stack, so modeling element 32 is pushed into the stack. Modeling element 32 has no predecessor object, so the traversal is not completed and the dependency link 4 detection is entered.

[0085] In step S905, the predecessor of modeling element 1 (modeling element 22) is not on the stack, so modeling element 22 is pushed onto the stack. Since the predecessor of modeling element 22 (modeling element 33) is not on the stack, modeling element 33 is pushed onto the stack. Since the predecessor of modeling element 33 (modeling element 1) is on the stack, an indirect self-circular dependency is determined. The traversal ends, the recursive loop returns, and the loop dependency check is exited.

[0086] As can be seen from the above, this solution sequentially stores the dependent objects of each modeling element in the dependency chain into a stack, then compares them with the modeling elements stored in the stack. If the stack already contains the same modeling element as the dependent object to be stored, it indicates that there is a circular dependency in the dependency chain. This solution combines a stack with a nested recursive query (i.e., querying the dependent objects in the dependency chain level by level), which helps accurately query circular dependencies in the dependency chains of modeling elements.

[0087] Combined with the above Figures 1 to 9 The method embodiment of the present application is described in detail. Figures 10 and 11 The device embodiment of the present application is described in detail. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment, so for parts not described in detail, reference can be made to the previous method embodiment.

[0088] Figure 10 FIG2 is a structural diagram of a data processing device for a simulation model provided by an embodiment of the present application. Figure 10 The data processing device 1000 of the simulation model may include an acquisition module 1010 , a first determination module 1020 , a storage module 1030 , a second determination module 1040 and a third determination module 1050 .

[0089] The acquisition module 1010 is configured to acquire a first reference attribute of a first modeling element in a simulation model, where the first reference attribute is used to indicate a dependency relationship between the first modeling element and other modeling elements in the simulation model.

[0090] The first determining module 1020 is configured to determine a modeling element on a first dependency link according to the first reference attribute, wherein the first dependency link takes the first modeling element as a starting point, and the modeling elements in the first dependency link are connected end to end in sequence.

[0091] The storing module 1030 is configured to store the first modeling element into a stack, and starting from the first modeling element, store the dependent objects of each modeling element on the first dependency link into the stack in sequence.

[0092] The second determining module 1040 is configured to determine whether the stack contains the same modeling element as the dependent object to be stored during the process of sequentially storing the dependent objects of each modeling element into the stack.

[0093] The third determining module 1050 is configured to determine that a circular dependency exists in the first dependency link if the stack contains the same modeling element as the dependency object to be stored.

[0094] Optionally, the first reference attribute is a first-class reference attribute, which is used to indicate the modeling element referenced by the first modeling element; the first determination module 1020 is used to: determine the modeling element on the first dependency link based on the first-class reference attribute, and the modeling element in the first dependency link is located downstream of the first modeling element.

[0095] Optionally, the first reference attribute is a second-class reference attribute, and the second-class reference attribute is used to indicate a modeling element that references the first modeling element; the first determination module 1020 is used to: determine the modeling element on the first dependency link based on the first-class reference attribute, and the modeling element in the first dependency link is located upstream of the first modeling element.

[0096] Optionally, the device 1000 also includes: a fourth determination module 1060, which is used to determine the type of circular dependency existing in the first dependency link according to the position of the second modeling element in the stack if the second modeling element in the stack is the same as the dependency object to be stored; wherein the type of circular dependency includes at least one of direct self-circular dependency, indirect self-circular dependency and branch self-circular dependency.

[0097] The following combination Figure 11The electronic device 1100 according to the embodiment of the present application is introduced. The electronic device 1100 can be used to implement the method described in the above method embodiment.

[0098] The electronic device 1100 may include one or more processors 1110. The processor 1110 may support the electronic device 1100 in implementing the method described in the foregoing method embodiment.

[0099] The processor 1110 may be a general-purpose processor or a special-purpose processor. For example, the processor may be a central processing unit (CPU). Alternatively, the processor may be another general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0100] The electronic device 1100 may further include one or more memories 1120. The memories 1120 may store programs that can be executed by the processor 1110 to control the electronic device 1100 to perform the methods described in the above method embodiments. The memories 1120 may be independent of the processor 1110 or integrated into the processor 1110.

[0101] The electronic device 1100 may further include a transceiver 1130. The processor 1110 may communicate with other devices via the transceiver 1130. For example, the processor 1110 may transmit and receive data with other devices via the transceiver 1130.

[0102] The present application also provides a chip in an embodiment, including a processor, which can be used to call and run a computer program from a memory, so that an electronic device equipped with the chip can perform the method described in the above method embodiment. It is understood that the processor can be any type of processor mentioned above. It is understood that the memory can be independent of the chip or integrated into the chip.

[0103] The present application also provides a machine-readable storage medium for storing a program, and the program enables a computer to execute the method in each embodiment of the present application.

[0104] The present application also provides a computer program product. The computer program product includes a program that enables a computer to execute the methods of the various embodiments of the present application.

[0105] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present disclosure is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a machine-readable storage medium or transmitted from one machine-readable storage medium to another machine-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The machine-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0106] Those skilled in the art will appreciate that the units and algorithm steps of the various examples described in conjunction with the embodiments of the present disclosure can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.

[0107] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0108] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0109] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0110] The above description is merely a specific embodiment of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this disclosure should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.

Claims

1. A data processing method for a simulation model, characterized in that: include: Acquire a first reference attribute of a first modeling element in a simulation model, where the first reference attribute is used to indicate a dependency relationship between the first modeling element and other modeling elements in the simulation model; Determine a modeling element on a first dependency link according to the first reference attribute, wherein the first dependency link takes the first modeling element as a starting point, and the modeling elements in the first dependency link are connected end to end in sequence; The first modeling element is stored in a stack, and starting from the first modeling element, the dependent objects of each modeling element on the first dependency link are stored in the stack in sequence; In the process of sequentially storing the dependent objects of each modeling element into the stack, determining whether the stack contains the same modeling element as the dependent object to be stored; If the stack contains the same modeling element as the dependency object to be stored, it is determined that a circular dependency exists in the first dependency link.

2. The method according to claim 1, characterized in that: The first reference attribute is a first-type reference attribute, and the first-type reference attribute is used to indicate a modeling element referenced by the first modeling element; The determining the modeling element on the first dependency link according to the first reference attribute includes: A modeling element on the first dependency link is determined according to the first type of reference attributes, wherein the modeling element in the first dependency link is located downstream of the first modeling element.

3. The method according to claim 1, characterized in that: The first reference attribute is a second-type reference attribute, and the second-type reference attribute is used to indicate a modeling element that references the first modeling element; The determining the modeling element on the first dependency link according to the first reference attribute includes: A modeling element on the first dependency link is determined according to the first type of reference attribute, wherein the modeling element in the first dependency link is located upstream of the first modeling element.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: If the second modeling element in the stack is the same as the dependency object to be stored, determining the type of circular dependency existing in the first dependency link according to the position of the second modeling element in the stack; The type of the circular dependency includes at least one of a direct self-circular dependency, an indirect self-circular dependency and a branch self-circular dependency.

5. A data processing device for a simulation model, characterized in that: include: An acquisition module, used for acquiring a first reference attribute of a first modeling element in a simulation model, wherein the first reference attribute is used for indicating a dependency relationship between the first modeling element and other modeling elements in the simulation model; A first determining module, configured to determine a modeling element on a first dependency link according to the first reference attribute, wherein the first dependency link takes the first modeling element as a starting point, and the modeling elements in the first dependency link are connected end to end in sequence; a storage module, configured to store the first modeling element into a stack, and taking the first modeling element as a starting point, sequentially store the dependent objects of each modeling element on the first dependency link into the stack; A second determining module, configured to determine whether the stack contains the same modeling element as the dependent object to be stored in the process of storing the dependent object of each modeling element in the stack in sequence; The third determining module is configured to determine that a circular dependency exists in the first dependency link if the stack contains the same modeling element as the dependency object to be stored.

6. The device according to claim 5, characterized in that: The first reference attribute is a first-type reference attribute, and the first-type reference attribute is used to indicate a modeling element referenced by the first modeling element; The first determining module is used for: A modeling element on the first dependency link is determined according to the first type of reference attributes, wherein the modeling element in the first dependency link is located downstream of the first modeling element.

7. The device according to claim 5, characterized in that: The first reference attribute is a second-type reference attribute, and the second-type reference attribute is used to indicate a modeling element that references the first modeling element; The first determining module is used for: A modeling element on the first dependency link is determined according to the first type of reference attribute, wherein the modeling element in the first dependency link is located upstream of the first modeling element.

8. The device according to any one of claims 5 to 7, characterized in that The device also includes: a fourth determination module, configured to determine, if the second modeling element in the stack is the same as the dependency object to be stored, a type of circular dependency existing in the first dependency link according to a position of the second modeling element in the stack; The type of the circular dependency includes at least one of a direct self-circular dependency, an indirect self-circular dependency and a branch self-circular dependency.

9. An electronic device, characterized in that: include: A memory for storing codes; A processor, configured to execute the code stored in the memory to perform the method according to any one of claims 1 to 4.

10. A computer program product, characterized in that The method comprises a program code for executing the method according to any one of claims 1 to 4.