A Visual Encoding System and Method for Safety Design Intent
By introducing a visual coding system with security design intention in the field of engineering design, and using graph database to store and query the topological relationships of component objects, the accuracy and communication cost of security design constraint expression in traditional methods is solved, and more efficient and accurate design review is achieved.
Patent Information
- Application Number
- CN202211261243.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-14
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2042-10-14
AI Technical Summary
Traditional hard-coded and semantic web representation methods have problems with accuracy and communication costs when representing security design constraints, especially in collaboration in different technical fields.
It provides a visual coding system for security design intent, including buffer definition module, query intent definition module, execution query module, statistics module and evaluation module. Through the graph database, it automatically assembles code fragments to achieve accurate expression of security constraints.
The system can ensure accurate expression of safety constraints, reduce the cost of design review, improve the ability of architectural designers to independently code safety design specifications, and improve the efficiency and reusability of design safety constraint coding.
Smart Images

Figure CN115525658B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of engineering design, and particularly to a visualization coding system and method for safety design intent. Background Art
[0002] The review of design safety is crucial for the safe and reliable operation of a substation. Automatically checking compliance with safety constraints depends to a large extent on the correct representation of safety constraints.
[0003] Since computers cannot fully and accurately understand the architectural design specifications originally written in natural language, there are many difficulties with traditional hard-coding and semantic web representation methods. The hard-coding method requires close collaboration between software engineers and architectural designers. Although it can ensure the accuracy rate of safety constraint expressions, due to the fact that communication between people from different technical fields is usually challenging, a huge cost is required. When writing design specifications in natural language, a large amount of background knowledge is often omitted, resulting in the semantic web or semantic triple knowledge graph formed based on natural language processing to understand the design specifications being unable to guarantee the accuracy rate of safety constraint expressions. Summary of the Invention
[0004] The embodiments of this application provide a visualization coding system and method for safety design intent, which can ensure the accuracy rate of safety constraint expressions, thereby reducing the cost of design review.
[0005] The first aspect of this application provides a visualization coding system for safety design intent. The system includes: a buffer definition module, a query intent definition module, an execution query module, a statistics module, and an evaluation module;
[0006] The execution query module is connected to the statistics module; the statistics module is connected to the evaluation module;
[0007] The buffer definition module is used to define a buffer, obtain a buffer graph formed by the envelope box expansion of the component object graph, and calculate the topological relationship between the buffer graph and the component object graph; store the buffer graph and the topological relationship in a graph database;
[0008] The query intent definition module is used to define a query intent according to an intent description block, and convert the query intent into a corresponding code snippet according to a preset query intent description table;
[0009] The execution query module is used to query component objects and attribute information of the component objects in the graph database according to the code snippet to obtain a query result;
[0010] The statistics module is used to perform statistical operations on the query result according to a preset statistical rule to obtain an operation result;
[0011] The evaluation module is used to perform a security evaluation on the operation result according to a preset security constraint.
[0012] Optionally, the buffer definition module is specifically configured to define an envelope box of the component object graph, and expand along each surface of the envelope box to obtain the buffer.
[0013] Optionally, the query intent definition module is specifically configured to generate a plurality of intent description blocks according to the query intent description table, and input the query intent into the plurality of intent description blocks to obtain a Gremlin code segment of the graph database query language corresponding to the query intent.
[0014] Optionally, the query intent definition module is further configured to store the code segment in a temporary file.
[0015] Optionally, the execution query module is specifically configured to read the code segment in the temporary file, assemble the code segment to obtain a complete query code;
[0016] Query the component object and the attribute information of the component object in the graph database according to the complete query code to obtain a query result, where the query result includes the number of component objects, the spatial positions between the component objects, the graphic parameters of the component objects, the buffer, and the engineering attributes of the component objects.
[0017] Optionally, the system further includes: a connection module, and the connection module is connected to the execution query module;
[0018] The connection module is configured to receive login data input by a user, generate a connection string for connecting to the graph database according to the login data, and send the connection string to the execution query module.
[0019] Optionally, the execution query module is further configured to send the connection string to the graph database to establish a session connection between the execution query module and the graph database.
[0020] A second aspect of the present application provides a visualization encoding method for a security design intent, and the method includes:
[0021] Define a buffer to obtain a buffer graph formed by expanding an envelope box of a component object graph, and calculate a topological relationship between the buffer graph and the component object graph; store the buffer graph and the topological relationship in a graph database;
[0022] Define a query intent according to the intent description block, and convert the query intent into a corresponding code snippet according to a preset query intent description table;
[0023] Query component objects and attribute information of the component objects in the graph database according to the code snippet to obtain a query result;
[0024] Perform statistical operations on the query result according to a preset statistical rule to obtain an operation result;
[0025] Perform a security assessment on the operation result according to a preset security constraint.
[0026] Optionally, the method further includes:
[0027] Receive login data input by a user, and generate a connection string for connecting to a graph database according to the login data;
[0028] Send the connection string to the graph database.
[0029] A third aspect of the present application provides a computer storage medium for storing a program, which when executed is used to implement the visual encoding method for a security design intent as described in any one of the above.
[0030] The embodiment of the present application discloses a visual coding system for safety design intent. In this system, it includes: a buffer definition module, a query intent definition module, an execution query module, a statistics module, and an evaluation module; the execution query module is connected to the statistics module; the statistics module is connected to the evaluation module; the execution query module is connected to the statistics module; the statistics module is connected to the evaluation module; the buffer definition module is used to define a buffer, obtain a buffer graph distributed outside the bounding box of the component object graph, and calculate the topological relationship between the buffer graph and the component object graph; store the buffer graph and the topological relationship in the graph database; the query intent definition module is used to define a query intent according to the intent description block, and convert the query intent into a corresponding code snippet according to a preset query intent description table; the execution query module is used to query the component object and the attribute information of the component object in the graph database according to the code snippet to obtain a query result; the statistics module is used to perform statistical operations on the query result according to a preset statistical rule to obtain an operation result; the evaluation module is used to perform a safety evaluation on the operation result according to a preset safety constraint. It can be seen that by defining the buffer, it is no longer necessary to describe the corresponding graph and parameters of the buffer in the intent description, thus greatly simplifying the intent description. Through visual coding by multiple modules such as the buffer definition module, the query intent definition module, the execution query module, the statistics module, and the evaluation module, the architectural designer can independently perform the intent coding of the safety design specification without relying on the software designer, improving the efficiency and reusability of the coding of the design safety constraint; by setting up a query intent description table to convert the query intent into a corresponding code snippet, the computer can automatically assemble the code snippet to understand the query intent, thereby ensuring the accuracy of the safety constraint expression. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings described below are only some embodiments recorded in the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0032] Figure 1 FIG. is an exemplary application scenario diagram provided by the embodiment of the present application;
[0033] Figure 2 FIG. is a structural diagram of a visual coding system for safety design intent provided by the embodiment of the present application;
[0034] Figure 3 FIG. is an application diagram of a visual coding system for safety design intent provided by the embodiment of the present application;
[0035] Figure 4 It is a schematic flowchart of a visual encoding method for safety design intent provided by an embodiment of the present application;
[0036] Figure 5 It is a schematic application diagram of a visual encoding method for safety design intent provided by an embodiment of the present application. Specific embodiments
[0037] The embodiment of the present application provides a visual encoding system and method for safety design intent, which can ensure the accuracy rate of the representation of safety constraints and reduce the design review cost.
[0038] For ease of understanding, the application scenario of the embodiment of the present application is introduced first.
[0039] It can be understood in combination with Figure 1 for understanding, Figure 1 It is a schematic diagram of an exemplary application scenario provided by an embodiment of the present application.
[0040] As Figure 1 shown, taking the safety constraints specified in Article 5.4.8 of GB 50140-2005 as an example for illustration. This safety clause stipulates that when the fire risk level of the production building is C, D, or E, when the outer wall is within 5 m of the boundary of the outer contour of the outdoor oil-immersed transformer, there should be no doors, windows, or ventilation holes within a certain range on the outer wall. The above-mentioned spatial range where there should be no doors, windows, or ventilation holes refers to below the horizontal line 3 m above the height of the transformer and within the 3 m vertical lines on both sides of the boundary.
[0041] See Figure 2 , this figure is a schematic structural diagram of a visual encoding system for safety design intent provided by an embodiment of the present application.
[0042] The visual encoding system for safety design intent provided by the embodiment of the present application includes: a buffer definition module 201, a query intent definition module 202, an execution query module 203, a statistics module 204, and an evaluation module 205.
[0043] The buffer definition module 201 is used to define a buffer, obtain a buffer graph distributed outside the bounding box of the component object graph, and calculate the topological relationship between the buffer graph and the component object graph; store the buffer graph and the topological relationship in the graph database.
[0044] In the embodiments of the present application, safety constraints involve various spatial limitations, such as work areas, protected areas, and envelope spaces. The implementation of these spatial constraints can be described as the topological relationship between the physical body shape and various buffer graphics. To clearly describe the spatial requirements for protecting / enclosing electrical equipment or operators, various buffer graphics are first modeled, and then the topological relationship between the buffer graphics and the component object graphics is calculated. It should be noted that in the embodiments of the present application, there is no specific limitation on the modeling of buffer graphics, and the buffer graphics can be modeled through geometric functions provided by the application programming interface of design CAD software (such as Revit, Rhino, or AutoCAD, etc.).
[0045] Specifically, the safety constraints mainly include the operating environment, electromagnetic field safety buffer area, fire prevention, fire protection space, protection space, and maintenance area. For the operating environment, production equipment, such as transformers, circuit breakers, and switches, should be installed in appropriate positions to ensure their safe operation. Specifically, the surrounding environment should meet the safety requirements of high-voltage devices. For the electromagnetic field safety buffer area, a strong electric field may break through the dielectric around it. Therefore, a sufficient distance should be maintained between the live parts of electrical equipment and the facilities nearby to prevent potential short circuits, fires, and explosion accidents. For fire prevention, the layout of electrical equipment should meet the fire protection requirements. For the fire protection space, buildings should be equipped with necessary facilities or tools at appropriate positions for fire prevention. For the protection space, a certain distance of space should be reserved around high-voltage electrical equipment to prevent personnel from contacting or approaching dangerous objects. For the maintenance space, sufficient working space should be reserved between electrical equipment, between electrical equipment and buildings or facilities to meet the safety requirements of maintenance work.
[0046] The query intention definition module 202 is used to define the query intention according to the intention description block, and convert the query intention into a corresponding code segment according to the preset query intention description table.
[0047] In the embodiments of the present application, Building Information Modeling (BIM) technology has been applied in the power industry for many years. The obtained design models often use the Industry Foundation Classes (IFC) or Grid Information Model (GIM) format for delivery and sharing. These formats are open and standardized exchange formats, which can achieve interoperability between multiple design software tools. The data in the BIM model file can be further imported into the graph database for convenient association and query. In this way, the data in the graph database of the substation model should be verified according to the safety constraints. Therefore, the embodiments of the present application represent the safety constraints from the perspective of query intention.
[0048] Safety constraints can be equivalently described as a combination of multiple data retrieval problems. Each retrieval problem contains multiple basic query intents for retrieving model objects such as building functional systems, component objects, devices / equipment, and various graphics. These model objects are restricted by attribute values and various types of relationships. Common associations between model objects include three types of relationships: hierarchical relationships, associative relationships, and spatial relationships.
[0049] As shown in Table 1, in a feasible embodiment of the present application, 6 general intents are defined. The first column lists the common basic intents for finding functional systems, various types of components and devices, attribute values, spatial locations, or graphic parameters. The second column lists the code snippets corresponding to each basic query intent.
[0050] Table 1 General Query Intent Description Table
[0051]
[0052] The execution query module 203 is used to query component objects and attribute information of component objects in the graph database according to the code snippet to obtain a query result.
[0053] In the embodiment of the present application, the execution query module 203 queries component objects and attribute information of component objects in the graph database according to the code snippet. The query result includes the number of component objects (such as the number of doors, windows, vents, etc.), the spatial locations between component objects, the graphic parameters of component objects (such as the length, width, height, and volume of concrete columns, the enclosure box of transformers, etc.), the buffer zone (a protection area for ensuring electromagnetic safety around high-voltage equipment), and the engineering attributes of component objects (fire protection grade, surface coating material, etc.). Among them, component objects include structural components, building components, pipeline system components, ventilation system components, etc., and also include elements such as equipment, switch cabinets, cables, and connectors that constitute different building functional systems.
[0054] The statistical module 204 is used to perform statistical operations on the query result according to a preset statistical rule to obtain an operation result.
[0055] In the embodiment of the present application, when it is necessary to process the query result obtained from the execution query module 203, the statistical module 204 can perform statistical operations on the query result according to a preset statistical rule. Specifically, the processing functions of the statistical module 204 mainly include summation, finding the maximum and minimum values, finding the average value, finding the standard deviation, etc. For example, when the input terminal of the statistical module 204 is the area attribute of multiple "window" objects, the total area of these "windows" can be obtained by using "summation".
[0056] The evaluation module 205 is used to perform a safety evaluation on the operation result according to a preset safety constraint.
[0057] In the embodiments of the present application, when it is necessary to evaluate the operation result, the operation result can be safely evaluated according to a preset safety constraint. For example, in order to meet the fire prevention requirements, it is not allowed to have too large holes in a wall. The total area of doors, windows, and ventilation holes can be obtained from the operation result, and the above total area is evaluated by the evaluation module 205. If the above total area is 0, the requirements of the safety constraint are met.
[0058] In a possible implementation manner, the buffer definition module 201 is specifically configured to define the bounding box of the component object, and expand along each surface of the bounding box to obtain a buffer.
[0059] In a possible implementation manner, the query intent definition module 202 is specifically configured to generate multiple intent description blocks according to the query intent description table, and obtain the Gremlin code snippet corresponding to the query intent by inputting the query intent into the multiple intent description blocks.
[0060] In the embodiments of the present application, Gremlin is a query language on a graph database.
[0061] Specifically, complex safety constraint expressions usually contain multiple basic query intents. Therefore, the combination of basic intents should be considered, and different combinations may have different meanings. Since each basic intent can be mapped to a basic query condition expressed in Gremlin language, the embodiments of the present application adopt a declarative representation method to express the code snippet. Accordingly, the ability of the Gemlin query engine can be used to automatically assemble the Gremlin code snippets obtained from the conversion of basic intents. The following is an example of a Gremlin statement representing a query intent:
[0062]
[0063] As shown in the above query statement, the second to sixth lines are the Gremlin code snippets corresponding to the basic intents. The order of appearance of these code snippets does not affect the query intent represented by the entire statement, that is, it represents querying for "windows" in the "wall" where the "door" is located. A reference variable with the prefix "rfv" is assigned to each relevant component object. For example, the reference variables "rfvWall", "rfv Door", and "rfv Window" respectively represent the component types of "wall", "door", and "window" being queried. In this way, the implicit association between basic intents is realized by referring to this reference variable. The declarative representation method can save the time spent by the user in planning the execution order of basic queries, and can also use the performance analyzer of the Gremlin engine to generate better query code. According to the different data volumes of different objects in the graph database, the query code generated for the same query intent is not unique.
[0064] In a possible implementation, the query intent definition module 202 is further configured to store the code snippet in a temporary file.
[0065] In the embodiment of the present application, the Gremlin code generated by the query intent definition module 202 is automatically stored in a temporary file, and the execution query module 203 directly reads the Gremlin code in the temporary file, thereby avoiding connecting each intent description block to the execution query module 203, greatly reducing the workload of manual connection, and making the visual programming interface more concise and easy to read.
[0066] In a possible implementation, the above system further includes: a connection module, configured to receive login data input by a user, generate a connection string for connecting to the graph database according to the login data, and send the connection string to the execution query module 203.
[0067] In the embodiment of the present application, the connection module receives the login data input by the user. The login data includes data necessary for connecting to the graph database and obtaining user permissions, such as username, password, and database name. A connection string is generated according to the login data, and the connection string is encrypted. The encrypted connection string is sent to the execution query module 203. The execution query module 203 decrypts the encrypted connection string to obtain the decrypted connection string, and sends the decrypted connection string to the graph database, thereby activating the session connection between the execution query module 203 and the graph database.
[0068] In the embodiment of the present application, the connection module is further configured to send the encrypted connection string to the buffer definition module 201. The buffer definition module 201 decrypts the encrypted connection string to obtain the decrypted connection string, and sends the decrypted connection string to the graph database, thereby activating the session connection between the buffer definition module 201 and the graph database, and further obtaining the graph database operation permission. The buffer graph of the defined buffer and the topological relationship between the buffer graph and the surrounding component object graphs are stored in the graph database.
[0069] Now in combination with Figure 3 For example:
[0070] Each processing module in the visualization encoding program can be implemented through secondary development using the GH plugin of Rhino's visual programming language. The above visualization processing module is called a battery block in GH. An object type and a reference variable prefixed with "rfv" are assigned to the corresponding "object" block of each building function system and component object. For example, "rfvTransformer" represents an oil-immersed transformer. Then, the "Property" block is used to visually encode the filtering conditions for the properties of these component objects. The building system or element should be represented by its reference variable to the "object" terminal. At the same time, the names and value ranges of these building function systems, component objects, and engineering properties are also input to the terminal of the "Property" block. Subsequently, the constraint description block is used to visually encode the constraints on the hierarchical relationship of system combinations, the associations between component objects, and the topological relationships between various graphical spaces, as follows:
[0071] Figure 3 3(a) in it represents the definition of the buffer area. Among them, the "HasSpace" battery block is to define the outer envelope box of the component object, and the "GenerateBuffer" battery block is to define the buffer area graph of the component object's graph. The buffer area graph is a new area obtained by expanding along the six faces of "front, back, left, right, up, and down" based on the envelope box. Figure 3 (a) defines the envelope box of the transformer, and then defines the buffer area of the transformer. Specifically, the parameter sequence 5000, 0, 3000, 3000, 3000, 0 in the figure represents the buffer area graph 5000 millimeters in front of the square envelope box of the transformer's outer profile, 3000 millimeters on the left and right, and 3000 millimeters above.
[0072] Figure 3 3(b) in it represents the definition of the query intent with the properties of the component object as the filtering condition. The input terminal "RefVar" represents the object to be queried, the input terminal "PropertyKey" represents the name of the property, the input terminal "PropertyValue" represents the value of the property, and the input terminal "Logical Rel." represents the relationship between the property name and the value. The relationships between the property name and the value include: contains, equals, greater than, etc. The output terminal "GremlinQuery" represents the Gremlin code snippet corresponding to this battery block. As shown in the figure, the first battery block represents querying "substation buildings with fire protection grades including C, D, and E"; the second battery block represents querying "walls with the location type of exterior wall"; the third battery block represents querying "transformers with the location type of outdoor and the equipment type of oil-immersed".
[0073] Figure 33(c) in it represents defining the query intent with the hierarchical relationship between objects as the filtering condition. The input terminal "RefVar1" represents the upper-level object 1 of the query, the input terminal "RefVar2" represents the lower-level object 2 of the query, and the input terminal "Direction" represents the directionality of the hierarchy between object 1 and object 2. The directionality of the hierarchy includes: the upper-level object 1 contains the lower-level object 2, and the lower-level object 2 contains the upper-level object 1. The output terminal "GremlinQuery" represents the Gremlin code snippet corresponding to this battery block. In the figure, the first battery block represents querying "walls contained in the substation"; the second battery block represents querying "transformers contained in the substation"; the third battery block represents querying "doors contained in the wall"; the fourth battery block represents querying "windows contained in the wall"; the fifth battery block represents querying "ventilation holes contained in the wall".
[0074] Figure 3 3(d) in it represents defining the query intent with the association relationship between objects as the filtering condition. The input terminal "RefVar1" represents the object 1 of the query, the input terminal "RefVar2" represents the object 2 of the query, and the input terminal "Association" represents the association relationship between object 1 and object 2. The association relationships include: object 1 embeds object 2, object 1 is connected to object 2, etc. The output terminal "GremlinQuery" represents the Gremlin query code corresponding to this battery block. As shown in the figure, the first battery block represents querying "all doors in the wall"; the second battery block represents querying "all windows in the wall"; the third battery block represents querying "all ventilation holes in the wall".
[0075] Figure 3 3(e) in it represents defining the query intent with the spatial topology relationship between objects as the filtering condition. The input terminal "Space1" represents a certain space 1 of the object to be queried, "Space2" represents a certain space 2 of the object to be queried, and "Topology" represents the topology relationship between space 1 and space 2, including overlap, containment, etc. "GremlinQuery" represents the Gremlin code snippet corresponding to this battery block. The spatial graph generally includes a "buffer zone" and an "envelope box", where the "HasSpace" battery block represents obtaining the space of the outer contour graph of the object. As shown in the figure, the first battery block in the first row is to obtain the square envelope box of the transformer; the second battery block in the first row represents the buffer area of the transformer. The three module identifiers in the lower left corner of this figure respectively obtain the square envelope boxes of the door, window, and ventilation hole; the three modules in the lower right corner represent the overlap relationship between the above envelope boxes and the buffer area of the transformer. It should be noted that the specific shape of the envelope box is not limited in the embodiments of this application. The envelope box can also be cylindrical, spherical, or other three-dimensional graphs defined by the user.
[0076] Figure 33(f) in it represents defining the query intent with the component object type as the filtering condition. The input terminal "RefVar" represents the object to be queried, and the input terminal "Label" represents the IFC class or GIM class corresponding to the object to be queried. Among them, the IFC classes include IfcBuilding, IfcWall, IfcDoor, etc., and the GIM classes include GimDevice, GimComponent, etc. The output terminal "GremlinQuery" represents the Gremlin code snippet corresponding to this battery block. As shown in the figure, the first battery block represents querying "the substation whose IFC class is IfcBuilding"; the second battery block represents querying "the wall whose IFC class is IfcWallStandard"; the third battery block represents "the door whose IFC class is IfcDoor"; the fourth battery block represents "the wall whose IFC class is IfcWindow"; the fifth battery block represents "the ventilation hole whose IFC class is IfcOpening"; the sixth battery block represents "the transformer whose GIM class is GimDevice".
[0077] It should be noted that Figure 3 the output terminal "GremlinQuery" in it is not an essential feature. In the embodiments of the present application, the output terminal "GremlinQuery" is for the convenience of designers to check the obtained code snippets. In actual applications, the output terminal "GremlinQuery" can be not set.
[0078] See Figure 4 , which is a schematic flowchart of a visualization encoding method for a security design intent provided by the embodiments of the present application. It can be implemented through the following steps S401-405.
[0079] S401: Define a buffer and store the defined buffer data in the graph database.
[0080] Specifically, define a buffer to obtain a buffer graph formed by expanding the bounding box distributed on the component object graph, and calculate the topological relationship between the buffer graph and the component object graph; store the buffer graph and the topological relationship in the graph database.
[0081] S402: Define the query intent according to the intent description block, and convert the query intent into a corresponding code snippet according to the preset query intent description table;
[0082] S403: Query the component object and the attribute information of the component object in the graph database according to the code snippet to obtain the query result;
[0083] S404: Perform statistical operations on the query result according to the preset statistical rules to obtain the operation result;
[0084] S405: Perform a security assessment on the operation result according to a preset security constraint.
[0085] Now, in combination with Figure 5 Illustrate the above method with an example:
[0086] Figure 5 The connected battery block represents establishing an activation session connection through data such as username, password, and database name. This session connection is input into the execution query battery block, thereby activating the session connection between the execution query battery block and the graph database. The execution query battery block represents running a query command, thereby outputting the result "Result".
[0087] It should be noted that the execution query battery block reads the Gremlin code snippet corresponding to the query intent stored in the temporary file. The method of realizing data exchange through the temporary file avoids establishing numerous connections between each query intent battery block and the execution query battery block, greatly reducing the workload of manual wiring. At the same time, it makes the visual programming interface more concise and easy to read. The statistical battery block represents performing statistical operations on the query result through various statistical functions. The evaluation battery block represents evaluating the security compliance of the operation result obtained by the statistical battery block.
[0088] Since the above method corresponds to a method of a visual coding system for a security design intent provided by the above system embodiment, the implementation of each step of the above method is based on the same concept as the above system embodiment. Therefore, for the specific implementation of each step of the method, reference can be made to the description part of the visual coding system for the security design intent in the above system embodiment, which will not be elaborated here.
[0089] The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims, and the above drawings of the present application are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0090] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described system, device, and module can refer to the corresponding processes in the foregoing method embodiments, which will not be elaborated here.
[0091] In several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical service division. In actual implementation, there may be other division methods. For example, 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 displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms.
[0092] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0093] In addition, in each embodiment of this application, each service unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software service units.
[0094] If the integrated unit is implemented in the form of a software service unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0095] Those skilled in the art should be able to realize that in one or more of the above examples, the operations described in the present invention can be implemented by hardware, software, firmware, or any combination thereof. When implemented using software, these operations can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. A computer-readable medium includes computer storage media and communication media, where the communication media includes any medium that facilitates the transfer of a computer program from one place to another. The storage media can be any available medium accessible by a general-purpose or special-purpose computer.
[0096] The above specific implementation manners have further elaborated on the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above is only the specific implementation manner of the present invention.
[0097] The above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the various embodiments of the present application.
Claims
1. A visual encoding system for safety design intent, characterized in that, the system includes: a buffer definition module, a query intent definition module, an execution query module, a statistics module, and an evaluation module; the execution query module is connected to the statistics module; the statistics module is connected to the evaluation module; the buffer definition module is used to define a buffer, obtain a buffer graph distributed outside the bounding box of the component object graph, and calculate the topological relationship between the buffer graph and the component object graph; store the buffer graph and the topological relationship in a graph database; the query intent definition module is used to define a query intent according to an intent description block, and convert the query intent into a corresponding code snippet according to a preset query intent description table; wherein, the query intent definition module is further used to store the code snippet in a temporary file; the execution query module is used to query component objects and attribute information of the component objects in the graph database according to the code snippet, and obtain a query result; specifically, the execution query module is used to read the code snippet in the temporary file, assemble the code snippet, and obtain a complete query code; query the component objects and attribute information of the component objects in the graph database according to the complete query code, and obtain a query result, where the query result includes the number of component objects, the spatial position of the component objects, the graphic parameters of the component objects, the buffer, and various engineering attributes of the component objects; the statistics module is used to perform statistical operations on the query result according to a preset statistical rule, and obtain an operation result; the evaluation module is used to perform a safety evaluation on the operation result according to a preset safety constraint.
2. The system according to claim 1, characterized in that, specifically, the buffer definition module is used to define the bounding box of the component object graph, and expand along each surface of the bounding box to obtain the buffer graph.
3. The system according to claim 1, characterized in that, specifically, the query intent definition module is used to generate a plurality of intent description blocks according to the query intent description table, and input the query intent in the plurality of intent description blocks to obtain a Gremlin code snippet of the graph database query language corresponding to the query intent.
4. The system according to claim 1, characterized in that, the system further includes: a connection module, and the connection module is connected to the execution query module; the connection module is used to receive login data input by a user, generate a connection string for connecting to the graph database according to the login data, and send the connection string to the execution query module.
5. The system according to claim 4, characterized in that, specifically, the execution query module is further used to send the connection string to the graph database to establish a session connection between the execution query module and the graph database.
6. A visual encoding method for safety design intent, characterized in that, the method includes: Define a buffer to obtain a buffer graph formed by expanding the bounding box distributed in the component object graph, and calculate the topological relationship between the buffer graph and the component object graph; store the buffer graph and the topological relationship in a graph database; Query the intent according to the intent description block definition, and convert the query intent into a corresponding code snippet according to a preset query intent description table; Store the code snippet in a temporary file; Query the component object and the attribute information of the component object in the graph database according to the code snippet to obtain a query result; wherein, querying the component object and the attribute information of the component object in the graph database according to the code snippet to obtain a query result includes: reading the code snippet in the temporary file, assembling the code snippet to obtain a complete query code; querying the component object and the attribute information of the component object in the graph database according to the complete query code to obtain a query result, and the query result includes the number of component objects, the spatial position of the component object, the graphic parameters of the component object, the buffer, and various engineering attributes of the component object; Perform statistical operations on the query result according to a preset statistical rule to obtain an operation result; Perform a security assessment on the operation result according to a preset security constraint.
7. According to the method described in claim 6, it is characterized in that, the method further includes: Receive login data input by a user, and generate a connection string for connecting to a graph database according to the login data; Send the connection string to the graph database.
8. A computer-readable storage medium, it is characterized in that, for storing a program, when the program is executed, it is used to implement the method described in any one of claims 6-7 above.
Citation Information
Patent Citations
Equipment management method, device and system based on graph database and storage medium
CN114266516A
Translating functional graph traversal language to extended structured query language
US20210034615A1