Modeling application primitive collision data processing method and system

By establishing collision data for target primitives and performing automatic collision calculations, the inefficiency caused by primitive overlap in modeling applications is solved, generating concise and intuitive model diagrams and reducing design costs and error risks.

CN120893039AActive Publication Date: 2025-11-04NUCLEAR POWER INSTITUTE OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510742843.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-11-04
Estimated Expiration
2045-06-05

AI Technical Summary

Technical Problem

Overlapping primitives in modeling applications leads to low modeling efficiency, increases design costs and error risks, and makes it difficult to generate clear, concise, and easily maintainable model diagrams.

Method used

By establishing collision data for target primitives, calculating the operational range during model editing, updating the collision data of colliding primitives, performing automatic collision calculations for return-type primitives, finding the optimal position, and finally updating the graphics, the integrity and accuracy of the model display are ensured.

Benefits of technology

Automatically calculates the editing range and collision of primitives, improving modeling efficiency, reducing human error, generating concise and intuitive model diagrams, and reducing design costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120893039A_ABST
    Figure CN120893039A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a modeling application primitive collision data processing method and system, and the method can calculate an operation range during model editing according to collision data after the collision data of a target primitive is established, thereby updating the collision data of a collision primitive according to the operation range, and improving the efficiency of model editing. And then performing return primitive automatic collision calculation based on the collision primitive, searching an optimal position according to real-time collision data in the primitive automatic collision calculation, and performing graph updating on the target primitive according to the optimal position. Wherein the automatic primitive collision calculation comprises boundary collision calculation with the model display integrity as the target and inter-primitive collision calculation with the model display accuracy as the target. According to the method, the primitive editing range can be automatically calculated, the primitive collision calculation can be automatically performed, and the optimal position can be searched, so that graph updating is completed, and the problem of low modeling efficiency caused by primitive overlapping in modeling application can be relieved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of instrument control technology of nuclear power plants, and in particular to a modeling application graph element collision data processing method and system. BACKGROUND

[0002] The application running in the processing unit of a nuclear power plant is a high-safety application. For such a high-safety application, a modeling application (tool) that has been verified by an authoritative organization is used in engineering design to complete graphical model design, and then automatically generated and compiled into an execution program. The execution program that has been verified is safe and reliable, so as to run in a distributed control system (DCS) environment.

[0003] The output of the modeling application directly interacting with the designer is in the form of a model graph. For a high-safety DCS system, the model graph after the application logic conversion is complex. In order to facilitate later VV, testing, and maintenance, etc., the generated model graph is required to have the characteristics of accuracy, intuitiveness, simplicity, and readability. In the engineering design process of the DCS system, the model graph is designed on a drawing, and dozens to thousands of model graph elements are often laid out on a drawing, and the designer will frequently edit and design on the model graph, so there is a lot of graph element position editing work. In the graph element position editing process, the requirement that the graph element objects do not overlap each other and are reasonably laid out needs to be met.

[0004] However, the modeling application allows model graph elements to overlap in model editing, which makes it difficult for the output model graph to meet the requirements of clarity, simplicity, and easy maintenance. Therefore, the layout of the model graph needs to be adjusted manually by the designer, which not only increases the risk of model design errors, but also sharply increases the cost of model design, resulting in low modeling efficiency. SUMMARY

[0005] Therefore, the modeling application graph element collision data processing method and system are provided to solve the problem of low modeling efficiency caused by the overlap of graph elements in the modeling application.

[0006] According to one aspect of the present application, a modeling application graph element collision data processing method is provided, which comprises: establishing collision data of a target graph element, the target graph element being a graph element that has a position change in the modeling space of the modeling application; the collision data being a parameter combination having an association relationship with the target graph element; the parameter combination comprising an identification ID, position information, and a graph element type of the target graph element; According to the operation range of the model editing according to the collision data, the operation range is an effective model operation range determined based on a scope; and the scope is determined according to the model editing instruction corresponding to the change of the primitive type and the position. According to the operation range, the collision data of the collision primitive is updated, the collision primitive is a primitive at a stop point position specified by the model editing instruction, and the primitive has a range overlap with the target primitive. Based on the collision primitive, return type primitive automatic collision calculation is performed, and an optimal position is found according to real-time collision data in the primitive automatic collision calculation, the primitive automatic collision calculation includes boundary collision calculation aiming at model display integrity and inter-primitive collision calculation aiming at model display accuracy; and the real-time collision data includes a collision point and a collision direction. According to the optimal position, graphic update is performed on the target primitive.

[0007] In some embodiments, according to the operation range of the model editing according to the collision data, the operation range includes: In response to the model editing instruction, the operation type of the model editing instruction and the target primitive selected by the model editing instruction are obtained; According to the primitive type of the target primitive, a target scope of the target primitive is determined, the target scope includes at least one of a page scope, a conditional block scope and a state machine scope; Based on the target scope, an effective model operation range is determined; The primitive data in the target scope is read, and the collision data is updated according to the data format corresponding to the parameter combination.

[0008] In some embodiments, according to the operation range, the collision data of the collision primitive is updated, including: According to the operation type of the model editing instruction, an operation object base point is determined, wherein if the operation type is a copy operation, the operation object base point is a center point determined according to the operation range; and if the operation type is a new operation or a move operation, the operation object base point is an operation point of the model editing instruction; A straight line distance method is used to determine an operation object stop point; According to the operation object base point and the operation object stop point, position information of the target primitive is calculated; According to the position information, the collision data is updated according to the data format corresponding to the parameter combination.

[0009] In some embodiments, the straight line distance method is used to determine the operation object stop point, including: An operation release point of the model editing instruction is obtained; According to the operation release point setting operation model area of the stop point; The operation object is calculated, and the moving distance of the operation object is the coordinate difference between the operation object base point and the operation model area stop point; Traverse the operation range of the operation object; Calculate the difference between the vertex position of the operation object and the moving distance to obtain the new stop point of the operation object.

[0010] In some embodiments, the return type of the primitive automatic collision calculation is executed based on the collision primitive, and the optimal position is found according to the real-time collision data in the primitive automatic collision calculation, including: Get the constituent elements of the target primitive, including the wire, pin and core primitive; According to the principle of integrity of the graph, boundary collision calculation is performed on the constituent elements respectively to obtain the collision result; the boundary collision calculation includes pin boundary collision calculation, wire boundary collision calculation and primitive boundary collision calculation; If the collision result represents the collision boundary of the constituent elements, update the collision data according to the collision result to obtain the real-time collision data, and find the optimal position according to the real-time collision data; If the collision result represents the non-collision boundary of the constituent elements, execute the model editing operation corresponding to the model editing instruction.

[0011] In some embodiments, the return type of the primitive automatic collision calculation is executed based on the collision primitive, and the optimal position is found according to the real-time collision data in the primitive automatic collision calculation, including: Select the reference point in the operation range of the target primitive and the collision primitive; Determine the collision point by comparing the reference point coordinates of the target primitive and the collision primitive, the collision point being the reference point in the target primitive within the operation range of the collision primitive; Determine the collision edge according to the collision point.

[0012] In some embodiments, the return type of the primitive automatic collision calculation is executed based on the collision primitive, and the optimal position is found according to the real-time collision data in the primitive automatic collision calculation, including: Get the collision point of the target primitive and the collision direction corresponding to the collision point; Record the direction axis corresponding to the collision direction; Move the collision point along the direction axis in the opposite direction by a preset number of pixels to obtain the collision return base point; According to the collision return base point, a new parking point is obtained by moving a return distance in the reverse direction of the direction axis, the return distance being 1 / 2 of the size of the operation range of the target graphic element in the direction axis; The return type graphic element automatic collision calculation is re-executed according to the new parking point, and the optimal position is found according to the real-time collision data after the re-executed return type graphic element automatic collision calculation.

[0013] In some embodiments, after the collision point of the target graphic element and the collision direction corresponding to the collision point are obtained, the method further comprises: Collision history data of the target graphic element is obtained; A collision order is determined by extracting collision records in the collision direction from the collision history data; If the collision order is the first collision, the step of recording the direction axis corresponding to the collision direction is executed; If the collision order is non-first collision, a same direction secondary search closed loop algorithm is used to find the optimal position.

[0014] In some embodiments, the same direction secondary search closed loop algorithm used to find the optimal position comprises: Position type data is defined according to the collision direction; Recorded data of the last collision is obtained, the recorded data including a recorded direction, the recorded direction being used to represent the collision direction of the last collision; If the collision direction is consistent with the recorded direction, the target graphic element is restored to the original position according to the position information; If the collision direction is inconsistent with the recorded direction, the recorded data is initialized, and the optimal position is continuously searched.

[0015] According to another aspect of the present application, a modeling application graphic element collision data processing system is provided, the system comprising: A collision data establishing module is configured to establish collision data of a target graphic element, the target graphic element being a graphic element in a modeling space of a modeling application that has a position change; the collision data being a parameter combination having an association relationship with the target graphic element; the parameter combination including an identification ID, position information and a graphic element type of the target graphic element; An operation range calculation module is configured to calculate an operation range during model editing according to the collision data, the operation range being an effective model operation range determined based on a scope; the scope being determined according to a model editing instruction corresponding to the graphic element type and the position change; a collision data updating module, configured to update collision data of a collision primitive according to the operation range, the collision primitive being a primitive at a stop point position specified by the model editing instruction and having a range overlap with the target primitive; a collision executing module, configured to perform a return type primitive automatic collision calculation based on the collision primitive, and find an optimal position according to real-time collision data in the primitive automatic collision calculation, the primitive automatic collision calculation including a boundary collision calculation aiming at model display integrity and an inter-primitive collision calculation aiming at model display accuracy, and the real-time collision data including a collision point and a collision direction; a graphic updating module, configured to perform a graphic update on the target primitive according to the optimal position.

[0016] According to still another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, the processor implementing the modeling application primitive collision data processing method when executing the program.

[0017] According to still another aspect of the present application, a storage medium is provided, having a computer program stored thereon, the program being executable on a processor to implement the modeling application primitive collision data processing method.

[0018] According to the above technical solution, the present application provides a modeling application primitive collision data processing method and system, which can calculate an operation range during model editing according to collision data after establishing collision data of a target primitive, update collision data of a collision primitive according to the operation range, perform a return type primitive automatic collision calculation based on the collision primitive, find an optimal position according to real-time collision data in the primitive automatic collision calculation, and perform a graphic update on the target primitive according to the optimal position. The primitive automatic collision calculation includes a boundary collision calculation aiming at model display integrity and an inter-primitive collision calculation aiming at model display accuracy. The method can automatically calculate a primitive editing range, automatically perform a collision calculation of a primitive, find an optimal position, and thus complete a graphic update, thereby alleviating the problem of low modeling efficiency caused by primitive overlap in modeling applications.

[0019] The above description is only a summary of the technical solution of the present application. In order to more clearly understand the technical means of the present application, the following detailed description can be implemented according to the content of the description, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the following detailed description of the specific embodiments of the present application is provided. BRIEF DESCRIPTION OF DRAWINGS

[0020] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings: Figure 1 A modeling application graph primitive collision data processing method flowchart is provided for the embodiments of the application; Figure 2 A modeling application graph primitive collision data processing flowchart is provided for the embodiments of the application; Figure 3 A scope-based operation range calculation flowchart is provided for the embodiments of the application; Figure 4 A whole business flowchart is provided for the embodiments of the application; Figure 5 A collision data calculation flowchart of a collision primitive is provided for the embodiments of the application; Figure 6 An inter-graph primitive collision calculation flowchart is provided for the embodiments of the application; Figure 7 A state boundary collision effect diagram is provided for the embodiments of the application; Figure 8 A state moving effect diagram is provided for the embodiments of the application; Figure 9 A state automatic collision effect diagram is provided for the embodiments of the application; Figure 10 A modeling application graph primitive collision data processing system structure diagram is provided for the embodiments of the application. DETAILED DESCRIPTION

[0021] The application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that the embodiments in the application and the features in the embodiments can be combined with each other without conflict.

[0022] In the embodiments of the application, the modeling application is a computer application specially used for creating, editing, analyzing and verifying models. The modeling application can be applied in engineering, science, business and other fields to realize simulation of field data and understanding of behaviors of complex systems or processes.

[0023] Taking the instrument control system of a nuclear power plant as an example, the modeling application can be used in the system design stage, system debugging stage and operation and maintenance stage of the nuclear power plant. In the system design stage, the modeling application can be used to simulate and verify the functions of a large number of sensors, controllers and actuators and the like, and to assist in device selection. In the system debugging stage, the modeling application can perform fault injection and diagnosis testing and parameter optimization adjustment. In the operation and maintenance stage, the modeling application can perform device performance monitoring and prediction, and can also assist in operation training and exercises and the like.

[0024] The modeling application can construct and edit models, where a model is an abstract representation of a real-world system or process, which can be a mathematical model, a physical model, a logical model, etc. These models are created, modified, simulated and analyzed through modeling tools to help users better understand the characteristics, behavior and performance of the system, and to make predictions and optimizations.

[0025] For example, the application running in the processing unit of a nuclear power plant is a high-safety application. For such high-safety application, an authority-recognized modeling application (tool) is used in engineering design to complete graphical model design, and then automatically generated and compiled into an execution program. The execution program after verification can prove to be safe and reliable, so as to run in a distributed control system (DCS) environment.

[0026] The model represented by a graphical representation can be referred to as a graphic element. A graphic element is a graphical component or symbol used to construct a model. The graphic element is a basic building block in a graphical modeling tool, and by combining these graphic elements, users can create more complex system models. Different modeling software and fields can have different graphic element types. For example, according to geometric shape classification, graphic elements can include rectangular graphic elements, circular graphic elements, line graphic elements, etc. According to function classification, graphic elements can include sensor graphic elements, controller graphic elements and actuator graphic elements, etc.

[0027] The output of the modeling application directly interacting with the designer is in the form of a model diagram. For a high-safety DCS system, the model diagram after conversion of the application logic is complex. In order to facilitate later VV, testing and maintenance and the like, the generated model diagram is required to have the characteristics of accuracy, intuitiveness, simplicity and easy-to-read. In the DCS system engineering design process, the model diagram is designed onto a drawing, and a page of drawing often has tens to thousands of model graphic elements laid out, and the designer will frequently edit and design on the model diagram, so there will be a large amount of graphic element position editing work. In the graphic element position editing process, the requirement of not overlapping each other and reasonable layout of the graphic element objects is to be met.

[0028] However, the modeling application allows model primitives to overlap in model editing, resulting in the output model diagram being difficult to achieve clarity, simplicity and maintainability. Therefore, the layout of the model diagram needs to be adjusted manually by the designer, which not only increases the risk of model design errors, but also dramatically increases the cost of model design, resulting in low modeling efficiency.

[0029] To solve the problem of low modeling efficiency caused by the overlap of primitives in the modeling application, based on the actual design and requirements of the current nuclear power plant DCS system, combined with the high safety and high reliability requirements of the running application in the DCS system, and the characteristics of the high-frequency editing of the running logic model, aiming at the requirement of the nuclear power plant DCS system that needs to design a model diagram with high utilization value, low design cost, accuracy, simplicity and easy maintenance, a modeling application primitive collision data processing method is provided in some embodiments of the present application, as shown in Figure 1 、 Figure 2 The method comprises the following steps: S101, collision data of a target primitive is established.

[0030] The modeling application can execute model establishment, modification, deletion and other editing operations in response to user input control instructions, wherein some editing operations will cause the position or shape of the loaded model primitive in the modeling space to change. The control instructions corresponding to these editing operations can be referred to as model editing instructions. The primitive targeted by the model editing instruction is referred to as the target primitive, i.e. the target primitive is the primitive whose position changes in the modeling space of the modeling application.

[0031] In response to the editing operation performed on the model primitive in the modeling space of the modeling application, the processing system running the modeling application will establish collision data. The collision data is a parameter combination having an association relationship with the target primitive; the parameter combination includes the identification ID, position information and primitive type of the target primitive. The processing system can construct the collision data based on the three-simultaneous principle, i.e. the principle of simultaneous generation, simultaneous disappearance and simultaneous update. When constructing the collision data, the collision data can be arranged and stored according to the parameter combination of the preset format. The collision data and the target primitive can be designed according to strict correspondence, i.e. each primitive corresponds to a set of collision data, and the collision data can be stored in the corresponding graph page of the primitive.

[0032] The collision data can be arranged and stored according to the pre-set parameter combination format. For example, the parameter combination format is: int ID_Item, <QList <qpoint>iPontList, QList <qpoint>`nPontList, int typeItem>`. In the above parameter combination format, `ID_Item` represents the identification ID of the target graphic element. A unique ID is automatically generated when the `ID_Item` object is created, serving as the data key. `iPontList` stores the original position data before the object was edited; `nPontList` stores the new position data after the object was edited; `typeItem` stores the type of the graphic element. Collision data can be represented by different graphic element types using `typeItem`: 0 for invalid, 1 for point, 2 for line, 3 for triangle, 4 for rectangle, 5 for rhombus, 6 for circle, and 7 for others.

[0033] S102. Calculate the operating range when editing the model based on the collision data.

[0034] After establishing collision data, the processing system can respond to model editing commands, edit model primitives, and synchronously update the collision data. During model editing, the operation range can be accurately calculated based on the scope. The operation range is the effective model operation range determined by the scope; the scope is determined according to the model editing commands corresponding to the primitive type and position changes.

[0035] like Figure 3 As shown, in some embodiments, when the processing system executes the operation range for calculating model editing based on the collision data, it can receive a model editing instruction and, in response to the instruction, obtain the operation type and the target primitive selected by the instruction. Then, it determines the target scope of the target primitive based on its primitive type. The target scope includes at least one of a page scope, a conditional block scope, and a state machine scope. Based on the target scope, it determines the effective model operation range and updates the collision data according to the data format corresponding to the parameter combination by reading the primitive data within the target scope.

[0036] To accurately calculate the scope of operations when model primitives are edited, the processing system can initiate model editing based on triggering patterns. These triggering patterns include collisions during the regeneration of copied and pasted primitives, collisions upon the initial creation of primitives, and collisions when primitive positions change. The system iterates through various collision scenarios, including collisions between primitives, collisions between primitives and page borders, and collisions between primitives and the borders of bounded primitives.

[0037] Further based on the scope, the effective model operation range is determined, i.e. for the condition block, state machine, basic operator, custom operator, etc. graph element type, the data flow thereof can be the entire graph page, thus these graph elements jointly form the graph page scope which is bounded by the graph page border. For the condition node and the condition node connection line which belong to the condition block internal graph elements, they jointly form the condition block scope which is bounded by the condition block border. For the state, branch, and transition which belong to the state internal graph elements, they jointly form the state machine scope which is bounded by the state machine border. Among them, the editing of the graph elements is only supported to be completed within the same scope, and the system only processes the events of one scope at a time. When the user issues an editing instruction, the system reads the scope in which the last selected graph element is located as the target scope, and automatically invalidates the selection of the objects in the non-target scope.

[0038] According to the determined effective model operation range, the processing system can read the graph element data in the target scope, and arrange and update the collision data according to the custom format. For example, through the model editing instruction, when the position of the target graph element is modified, the processing system can modify the nPontList in the collision data according to the modified position data after obtaining the modified position data, to realize the update of the collision data.

[0039] S103, updating the collision data of the collision graph element according to the operation range.

[0040] After the operation range is calculated, the processing system can calculate and determine the collision data of the collision graph element based on the operation range, and update the collision data of the collision graph element according to the operation range. Among them, the collision graph element is the graph element at the specified stop point position of the model editing instruction, and the graph element has a range overlap with the target graph element.

[0041] For example, when the model editing instruction is to perform a position change operation on the graph element A, the position data after the position change can be determined according to the model editing instruction. Among them, the position data after the change can be represented by a stop point, indicating that the graph element A is moved to the position corresponding to the stop point according to the stop point. Then, after the graph element A is moved to the position corresponding to the stop point, if there is an overlap region between the operation range corresponding to the graph element A and the operation range corresponding to the graph element B, it can be determined that the graph element B is a collision graph element.

[0042] It should be noted that due to the relativity of position movement, the target graph element and the collision graph element have a relative relationship, i.e. for the same model editing instruction, the graph element A is the target graph element, and the graph element B is the collision graph element; while the graph element B is the target graph element, the graph element A is the collision graph element.

[0043] As Figure 4 In some embodiments, when updating the collision data of the collision primitives according to the operation range, the processing system can determine the operation object base point according to the operation type of the model editing instruction. If the operation type is a copy operation, the operation object base point is a center point determined according to the operation range, i.e., the range center method is used to determine the operation object base point of the copy operation.

[0044] For example, the processing system can extract the position data of all selected primitives, calculate the maximum and minimum values of each primitive in the horizontal direction and the vertical direction, and calculate the maximum and minimum values of all primitives in the horizontal direction and the vertical direction. Then, the center point is calculated based on the maximum and minimum values of the entire range in the horizontal direction and the vertical direction, and the obtained point is the base point of the operation object.

[0045] If the operation type is a new operation or a move operation, the operation object base point is the operation point of the model editing instruction. For example, when the user inputs the model editing instruction corresponding to the new operation and the move operation on the target primitive based on the external input device such as a mouse, the processing system can take the mouse press point as the operation object base point.

[0046] After determining the operation object base point, the processing system can determine the operation object docking point by using the straight line distance method. In some embodiments, when determining the operation object docking point by using the straight line distance method, the processing system can first obtain the operation release point of the model editing instruction, and set the docking point of the operation model region according to the operation release point. Then, the movement distance of the operation object is calculated. The movement distance is the coordinate difference between the operation object base point and the docking point of the operation model region. By traversing a plurality of operation objects in the operation range, the difference between the vertex position of the operation object and the movement distance is calculated to obtain a new docking point of the operation object.

[0047] For example, when the mouse release point is the docking point of the operation model region, the distance calculated by subtracting the operation object base point from the docking point of the operation model region can be used as the movement distance of each object. By traversing each operation object, each vertex position is subtracted by the movement distance, and the obtained point is a new set of docking points of each operation object, and the data is recorded.

[0048] After determining the operation object base point and the operation object docking point, the processing system can calculate the position information of the target primitive according to the operation object base point and the operation object docking point, and update the collision data according to the data format corresponding to the parameter combination according to the position information.

[0049] It can be seen that in the process of calculating and determining the collision data of the collision primitives, the processing system can determine the copy operation object base point by using the range center method, and use the operation point as the operation object base point for the new operation and the moving operation. The operation object stop point is determined by using the straight line distance method, and the position data of the operation primitive is calculated, so that the collision data is arranged and updated according to the pre-set parameter combination format, and the automatic arrangement and updating of the collision data is realized, so as to maintain the timeliness of the collision data.

[0050] S104, based on the collision primitive, perform return type primitive automatic collision calculation, and find the optimal position according to the real-time collision data in the primitive automatic collision calculation.

[0051] After determining the collision primitives and updating the collision data, the processing system can also perform automatic collision calculation of return type (spring type) primitives between the target primitives and the collision primitives, that is, perform return type primitive automatic collision calculation based on the collision primitives. The primitive automatic collision calculation includes boundary collision calculation aiming at model display integrity and inter-primitive collision calculation aiming at model display accuracy.

[0052] The return type primitive automatic collision refers to that in the process of moving the target primitives or the collision primitives, once the target primitives and the collision primitives contact, it is considered that collision occurs, at this time, the processing system reversely sets the position, so that the corresponding graphics of the target primitives or the collision primitives can return a certain distance, and the return process is like the reverse rebound of a spring, so it is also called spring type primitive automatic collision.

[0053] In the process of performing the primitive automatic collision, the processing system can read the collision data, perform boundary collision aiming at model display integrity, and / or inter-primitive collision aiming at model display accuracy. Then, the post-collision data is updated to the memory, and the graphics update interface is called.

[0054] As shown in Figure 5 In some embodiments, when performing boundary collision aiming at model display integrity, the processing system can first acquire the constituent elements of the target primitives when performing return type primitive automatic collision calculation based on the collision primitives, the constituent elements including wires, pins and core primitives. Then, boundary collision calculation is performed on the constituent elements respectively to obtain collision results, aiming at the integrity of the graphics. The boundary collision calculation includes pin boundary collision calculation, wire boundary collision calculation and primitive boundary collision calculation.

[0055] Since the elements related to the primitives mainly include three parts of wires, pins and core primitives, and the integrity of the graphics is an important principle of model display, therefore, based on this principle, the collision of the wires, pins and primitives can be performed respectively when performing boundary collision.

[0056] For pin boundary collision calculation, in the model graph, the operator pin is composed of two points of start point and end point; before calculating the collision, the pin data is obtained first, and then it is judged according to the coordinates of the start and end points of the pin whether the pin is a horizontal pin or a vertical pin; finally, it is judged whether the X (Y) axis value of the end point of the horizontal (vertical) pin is less than 0 or greater than the page width (height), if the above conditions are met, it means that the boundary has collided, otherwise it means that the boundary has not collided.

[0057] For line boundary collision calculation, in the model graph, a line can be composed of four points; before calculating the collision, the line data is obtained first, and all the nodes of the line data are sorted and stored in the data structure, and the attribute values of the collision boundary are taken out. For example, X_MIN=left boundary, X_MAX=right boundary, Y_MIN=upper boundary, Y_MAX=lower boundary. Then the corresponding coordinates of the corresponding points after sorting are taken out according to the attribute values, and finally it is judged whether the corresponding coordinate value is less than 0 or greater than the page width (height), if the above conditions are met, it means that the boundary has collided, otherwise it means that the boundary has not collided.

[0058] For primitive boundary collision calculation, before calculating the collision, the primitive data can be obtained first, and all the points of the primitive data are sorted and stored in the data structure, and the attribute values of the collision boundary are taken out. For example, X_MIN=left boundary, X_MAX=right boundary, Y_MIN=upper boundary, Y_MAX=lower boundary. Then the corresponding coordinates of the corresponding points after sorting are taken out according to the attribute values, and finally it is judged whether the corresponding coordinate value is less than 0 or greater than the page width (height), if the above conditions are met, it means that the boundary has collided, otherwise it means that the boundary has not collided.

[0059] After obtaining the collision result, the collision result can be read to determine whether the constituent element of the target primitive collides with the boundary. If the collision result represents that the constituent element collides with the boundary, the collision data is updated according to the collision result to obtain the real-time collision data. If the collision result represents that the constituent element does not collide with the boundary, the model editing operation corresponding to the model editing instruction is executed.

[0060] In the process of performing the return type primitive automatic collision calculation, the processing system can update the collision data in real time according to the calculation data generated in the collision process to obtain real-time collision data. The real-time collision data includes collision points and collision directions. Based on the real-time collision data, the processing system can find the optimal position, that is, after each collision calculation, the optimal position is found.

[0061] To find the optimal location, in some embodiments, when the processing system performs a return-based automatic collision calculation based on the colliding primitives, and searches for the optimal location based on real-time collision data from the automatic collision calculation, it can select a reference point within the corresponding operating range of the target primitive and the colliding primitives. By comparing the coordinates of the reference points of the target primitive and the colliding primitives, the collision point is determined, and then the collision edge is determined according to the collision point. The collision point is a reference point within the operating range of the colliding primitive in the target primitive.

[0062] For example, such as Figure 6 As shown, for the collision calculation between primitives aimed at improving model display accuracy, the processing system uses the lower left corner of the border as the base point of the coordinate system. When the primitives in this model are rectangular primitives, collisions between points and lines are not considered. Therefore, the target primitive (operational primitive) can be selected as impact primitive A, and the collision primitive can be selected as primitive B. Then, iteratively, it can be determined whether each point (impact point) of A is inside primitive B. The criteria for determination are: the x-axis coordinate of the impact point is greater than the x-axis coordinate of the left side of the B rectangle; the x-axis coordinate of the impact point is less than the x-axis coordinate of the right side of the B rectangle; the y-axis coordinate of the impact point is greater than the y-axis coordinate of the top of the B rectangle; and the y-axis coordinate of the impact point is less than the y-axis coordinate of the bottom of the B rectangle.

[0063] After the above judgment, the processing system also needs to swap primitive A and primitive B, and repeat the judgment according to the above-mentioned collision calculation method between primitives with the goal of model display accuracy, so as to obtain the collision point and the collision edge of the collided primitive.

[0064] After determining the collision edge, the processing system can perform a return-type automatic collision calculation based on the collision edge. In some embodiments, when the processing system performs a return-type automatic collision calculation based on the collision element and searches for the optimal position based on the real-time collision data in the automatic collision calculation, it can obtain the collision point of the target element and the collision direction corresponding to the collision point.

[0065] After acquiring the collision point of the target primitive and the corresponding collision direction, the processing system can also determine whether the current collision direction is the first collision. This involves acquiring the collision history data of the target primitive and extracting the collision records along the collision direction from the historical data to determine the collision order. If the collision order is the first collision, the processing system can record the direction axis corresponding to the collision direction and then move the collision point backward along the direction axis by a preset number of pixels to obtain the collision return point.

[0066] For example, in order to find the optimal position after collision, the processing system can obtain the point of collision and the direction of the point of collision after the collision occurs, and determine whether it is the first collision on the coordinate axis of the direction. If it is the first collision, the direction axis corresponding to the current collision direction can be recorded, and the collision point is moved 5 pixels in the reverse direction along the direction as the collision return base point.

[0067] Then, the return distance is moved in the reverse direction along the direction axis based on the collision return base point to obtain a new parking point. The return distance is 1 / 2 of the size of the target primitive operation range in the direction axis. Then, the return type primitive automatic collision calculation is re-executed according to the new parking point, and the optimal position is found according to the real-time collision data after the re-executed return type primitive automatic collision calculation. That is, the new parking point of the graphic region is obtained by moving the original width or height by half in the reverse direction based on the current base point, and the collision calculation is continued according to the new parking point until there is no overlapping region between the target primitive and the collision primitive.

[0068] If the collision order is not the first collision, the same direction twice finding closed loop algorithm can be used to find the optimal position. In some embodiments, when the processing system uses the same direction twice finding closed loop algorithm to find the optimal position, the position type data can be defined according to the collision direction, and the record data of the last collision can be obtained. The record data includes a record direction, which is used to represent the collision direction of the last collision. By comparing the collision direction and the record direction, if the collision direction is consistent with the record direction, the target primitive is restored to the original position according to the position information.

[0069] For example, for the non-first collision on the coordinate axis corresponding to the current collision direction, the processing system can use the same direction twice finding closed loop algorithm to prove that there is no optimal position at the current editing point, that is, after the second collision in the same direction, the position found by reverse search will return to the position of the first collision, which proves that there is no reasonable parking position at the current parking point. Therefore, the data that stores the direction of the collision can be defined as positionType, which records the data of the last collision, and the default is 0. The horizontal direction is represented by 1, and the vertical direction is represented by 2. When the collision occurs, the last positionType is obtained, and it is determined whether it is consistent with the current direction. If it is consistent, the collision is ended, which proves that there is no optimal position in the current editing operation process. At this time, the position data before the graphic editing can be restored, that is, restored to the original position.

[0070] If the collision direction is inconsistent with the recording direction, the optimal position is continued to be searched by initializing the recording data. That is, when the directions are inconsistent, the first collision in the direction is represented, and the positionType can be initialized to continue searching the position, as shown in the following formulas. Figure 7 、 Figure 8 、 Figure 9

[0071] S105, performing graphic update on the target graphics element according to the optimal position.

[0072] After the optimal position is obtained by real-time collision data calculation, the processing system can perform graphic update on the target graphics element according to the optimal position, so as to realize the update of the graphics after the collision. When performing the graphic update, the processing system can synchronize the graphic update with the model editing and the collision detection. In addition, the graphic update is divided into event execution process update and event end update.

[0073] For the update in the event execution process, the processing system can perform the event execution process update mainly in the moving operation. When the mouse is moved, the collision calculation is not performed. The point of the mouse movement is taken as the docking point, and the new position data of all operation objects is calculated. In addition, the position frame of the operation object is drawn in the form of a dashed line in real time. The graphic of the event execution process update is only used for the user to view the effect, and is not the final graphic. In addition, the graphics of the event execution process exist in the scenes that are not allowed to exist in the model graphics, such as overlapping and intersecting.

[0074] For the update at the end of the event, the processing system can perform the update at the end of the event in all operations. The graphic of the update at the end of the event is the final graphic, and does not exist in the scenes such as overlapping and intersecting. At the end of the event, the end point of the mouse is taken as the center point of the region, and the collision calculation interface is called. The post-collision data of the graphics element is read, and it is judged whether there is a collision. If there is no collision, the new position data is read, and the graphic is drawn. If there is a collision, the original data of the graphics element is read, the graphic is drawn, and the model graphics and the related information display are updated.

[0075] ​It can be seen that the modeling application graph element collision processing method described in the above embodiments can adapt to the actual design and requirements of the current nuclear power plant DCS system, combine the high safety and high reliability requirements of the application running in the DCS system, and the characteristics of the high-frequency editing required by the running logic model, and design a model graph that is high in value, low in design cost, accurate, simple, and easy to maintain for the nuclear power plant DCS system. The method can use the three-simultaneous principle to define the format of the collision data when the model graph element is generated, and arrange and store the collision data. Based on the accurate calculation of the operation range of the scope, the calculation of the collision base point, the automatic collision calculation based on the search for the optimal position, the model graph drawing update performed synchronously with the collision, the automatic collision layout of the graph element in the complex model graph editing process can be completed, and the output model graph can be ensured to be simple and intuitive and accurate. Through the automatic calculation and automatic drawing technology, the human error caused by manual operation is reduced, the efficiency of model design is improved, and the modeling application graph element automatic collision method is realized, thereby bringing great economic value to the DCS system design.

[0076] By applying the technical solutions of the above embodiments, the method has been used in a certain supply project of a safety class DCS system. By controlling the algorithm model design graph element automatic collision related software, the model design of the DCS system engineering is realized. The design quality of the DCS system is improved, the system design cost is reduced, and the economic value of the system design is improved.

[0077] Through the above technical solutions, the embodiments of the present application provide a modeling application graph element collision data processing method and system. The method can calculate the operation range during model editing according to the collision data after establishing the collision data of the target graph element, update the collision data of the collision graph element according to the operation range, perform return type graph element automatic collision calculation based on the collision graph element, find the optimal position according to the real-time collision data in the graph element automatic collision calculation, and perform graph update on the target graph element according to the optimal position. The graph element automatic collision calculation includes boundary collision calculation targeting model display integrity and graph element collision calculation targeting model display accuracy. The method can automatically calculate the graph element editing range, automatically perform collision calculation of the graph element, find the optimal position, and thus complete the graph update, which can alleviate the problem of low modeling efficiency caused by graph element overlap in modeling application.

[0078] In some embodiments, as a specific implementation of the modeling application graph element collision data processing method described in the above embodiments, some embodiments of the present application also provide a modeling application graph element collision data processing system, as shown in Figure 10 The system comprises: The collision data establishing module is configured to establish collision data of a target primitive, the target primitive being a primitive with a changed position in a modeling space of a modeling application, and the collision data being a parameter combination associated with the target primitive, the parameter combination including an identification (ID) of the target primitive, position information, and a primitive type. The operation range calculating module is configured to calculate an operation range during model editing according to the collision data, the operation range being an effective model operation range determined based on a scope, and the scope being determined according to the model editing instruction corresponding to the primitive type and the position change. The collision data updating module is configured to update collision data of a collision primitive according to the operation range, the collision primitive being a primitive with a range overlap with the target primitive at a stop point position specified by the model editing instruction. The collision executing module is configured to perform return-type primitive automatic collision calculation based on the collision primitive, and find an optimal position according to real-time collision data in the primitive automatic collision calculation, the primitive automatic collision calculation including boundary collision calculation for a model display integrity and inter-primitive collision calculation for a model display accuracy, and the real-time collision data including a collision point and a collision direction. The graphic updating module is configured to perform graphic updating on the target primitive according to the optimal position.

[0079] It should be noted that other corresponding descriptions of the various functional units involved in the modeling application primitive collision data processing system provided by the embodiments of the present application can refer to the corresponding descriptions in the modeling application primitive collision data processing method provided by the above embodiments, which will not be described here.

[0080] The computer device can be a personal computer, a server, a network device, etc., and includes a bus, a processor, a memory, and a communication interface, and can further include an input / output interface and a display device. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store position information. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement the steps in each method embodiment.

[0081] Those skilled in the art can understand that the structure of the computer device described above is only part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. A specific computer device can include more or fewer components, or combine certain components, or have a different arrangement of components.

[0082] In an embodiment, a computer readable storage medium is also provided, which can be non-volatile or volatile, and has stored thereon a computer program which, when executed by a processor, implements the steps of any of the above method embodiments.

[0083] In an embodiment, a computer program product is also provided, comprising a computer program which, when executed by a processor, implements the steps of any of the above method embodiments.

[0084] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.

[0085] Those of ordinary skill in the art can understand that all or part of the processes in the above embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium and, when executed, can include the processes of the above embodiments.

[0086] Among them, any reference to memory, database or other medium used in each embodiment provided by the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc.

[0087] The volatile memory can include a random access memory (RAM), an external cache memory, etc. As an illustration and not a limitation, the RAM can be a single RAM, a dual RAM, a static RAM (SRAM), a dynamic RAM (DRAM), etc.

[0088] The database involved in each embodiment provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a blockchain, etc., without being limited thereto. The processor involved in each embodiment provided by the present application can be a general-purpose processor, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0089] Each technical feature of the above embodiments can be combined arbitrarily, and in order to make the description simple, each technical feature in the above embodiments is not described in all possible combinations, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.

[0090] The above embodiments only express several implementation manners of the present application, the description is more specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.< / qpoint> < / qpoint>

Claims

1. A method for processing primitive collision data in modeling applications, characterized in that, The method includes: Collision data for target primitives is established, wherein the target primitives are primitives whose positions change in the modeling space of the modeling application; the collision data are a combination of parameters that are associated with the target primitives; the parameter combination includes the identifier ID, position information, and primitive type of the target primitive; The operational range during model editing is calculated based on the collision data. The operational range is an effective model operational range determined based on the scope. The scope is determined according to the model editing instructions corresponding to the primitive type and position change. The collision data of the collision element is updated according to the operation range, wherein the collision element is the element that overlaps with the target element at the docking point position specified by the model editing instruction; The system performs a return-type automatic collision calculation based on the collision primitives, and finds the optimal position based on the real-time collision data in the automatic collision calculation. The automatic collision calculation includes boundary collision calculation with the goal of model display integrity and inter-primary collision calculation with the goal of model display accuracy. The real-time collision data includes collision points and collision directions. Perform a graphical update on the target primitive according to the optimal position.

2. The method according to claim 1, characterized in that, The scope of operations during model editing is calculated based on the collision data, including: In response to a model editing command, the operation type of the model editing command and the target primitive selected by the model editing command are obtained; The target scope of the target graphic element is determined according to the graphic element type of the target graphic element. The target scope includes at least one of the page scope, condition block scope, and state machine scope. Determine the effective model operation range based on the target scope; Read the graph data within the target scope, and update the collision data according to the data format corresponding to the parameter combination based on the graph data.

3. The method according to claim 1, characterized in that, Update the collision data of the collision primitives according to the operation range, including: The base point of the operation object is determined according to the operation type of the model editing instruction. If the operation type is a copy operation, the base point of the operation object is the center point determined according to the operation range. If the operation type is a new operation or a move operation, the base point of the operation object is the operation point of the model editing instruction. The straight-line distance method is used to determine the stopping point of the operation object; Calculate the position information of the target graphic element based on the base point and docking point of the operation object; The collision data is updated according to the location information and the data format corresponding to the parameter combination.

4. The method according to claim 3, characterized in that, The straight-line distance method is used to determine the docking point of the operation object, including: Obtain the operation release point of the model editing command; Set the docking point of the operation model area according to the operation release point; Calculate the movement distance of the manipulated object, where the movement distance is the coordinate difference between the base point of the manipulated object and the docking point of the operation model area; Traverse multiple operation objects within the operation range; Calculate the difference between the vertex position of the manipulated object and the moving distance to obtain the new stopping point of the manipulated object.

5. The method according to claim 1, characterized in that, Performing a return-based automatic collision calculation based on the colliding primitives, and finding the optimal position based on real-time collision data from the automatic collision calculation, includes: Obtain the constituent elements of the target graphic element, the constituent elements including connections, pins and core graphic elements; Based on the principle of graphic integrity, boundary collision calculations are performed on each of the constituent elements to obtain collision results; the boundary collision calculations include pin boundary collision calculations, connection boundary collision calculations, and primitive boundary collision calculations. If the collision result represents the collision boundary of the constituent element, the collision data is updated according to the collision result to obtain the real-time collision data, and the optimal position is found according to the real-time collision data; If the collision result indicates that the constituent element did not collide with the boundary, the model editing operation corresponding to the model editing instruction is executed.

6. The method according to claim 1, characterized in that, Performing a return-based automatic collision calculation based on the colliding primitives, and finding the optimal position based on real-time collision data from the automatic collision calculation, includes: Select the reference points within the corresponding operation range of the target graphic element and the collision graphic element; The collision point is determined by comparing the reference point coordinates of the target graphic element and the collision graphic element. The collision point is the reference point of the target graphic element that is located within the operation range of the collision graphic element. The collision edge is determined according to the collision point.

7. The method according to claim 1, characterized in that, Performing a return-based automatic collision calculation based on the colliding primitives, and finding the optimal position based on real-time collision data from the automatic collision calculation, includes: Obtain the collision point of the target primitive and the collision direction corresponding to the collision point; Record the direction axis corresponding to the collision direction; The collision point is moved in the opposite direction along the direction axis by a preset number of pixels to obtain the collision return base point; Using the collision return base point as a reference, move the return distance in the opposite direction along the direction axis to obtain a new docking point. The return distance is 1 / 2 of the target graphic element's operating range in the direction axis dimension. The automatic collision calculation of returnable elements is re-executed according to the new stopping point, and the optimal position is found based on the real-time collision data after the automatic collision calculation of returnable elements is re-executed.

8. The method according to claim 7, characterized in that, After obtaining the collision point of the target primitive and the collision direction corresponding to the collision point, the method further includes: Obtain the collision history data of the target primitive; The collision order is determined by extracting collision records in the collision direction from the collision history data. If the collision sequence is the first collision, execute the step of recording the direction axis corresponding to the collision direction; If the collision sequence is not the first collision, the optimal position is found using a quadratic search closed-loop algorithm in the same direction.

9. The method according to claim 8, characterized in that, The optimal position is found using a quadratic search closed-loop algorithm in the same direction, including: Position type data is defined based on the collision direction; Acquire the recorded data of the previous collision, the recorded data including the recording direction, the recording direction being used to characterize the collision direction of the previous collision; If the collision direction is consistent with the recording direction, the target primitive is restored to its original position according to the position information; If the collision direction is inconsistent with the recording direction, the optimal position is searched by initializing the recording data.

10. A modeling application primitive collision data processing system, characterized in that, The system includes: The collision data establishment module is used to establish collision data for target primitives, wherein the target primitives are primitives whose positions change in the modeling space of the modeling application; the collision data are a combination of parameters that are associated with the target primitives; the parameter combination includes the identifier ID, position information, and primitive type of the target primitives; The operation range calculation module is used to calculate the operation range during model editing based on the collision data. The operation range is an effective model operation range determined based on the scope. The scope is determined according to the model editing instructions corresponding to the primitive type and position change. The collision data update module is used to update the collision data of the collision elements according to the operation range. The collision elements are elements that overlap with the target element at the docking point position specified by the model editing instruction. The collision execution module is used to perform return-type automatic collision calculation based on the collision primitives, and to find the optimal position based on the real-time collision data in the automatic collision calculation. The automatic collision calculation includes boundary collision calculation with the goal of model display integrity and inter-primary collision calculation with the goal of model display accuracy. The real-time collision data includes collision points and collision directions. The graphics update module is used to perform graphics update on the target primitive according to the optimal position.

Citation Information

Patent Citations

  • Collision detection method and device, electronic equipment and storage medium

    CN118873941A

  • Apparatus and method for sensing collision

    KR100718157B1