Dynamic modeling method and device based on RDF graph, computer equipment and medium
Through the dynamic modeling method based on RDF graph, object attributes and relationships are dynamically adjusted, and data models suitable for a variety of business scenarios are built, which solves the problem that traditional modeling methods are limited by relational databases, and achieves the improvement of flexibility and cost-effectiveness.
Patent Information
- Application Number
- CN202411902847.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-15
AI Technical Summary
Traditional data modeling methods are limited by relational databases, which lead to difficult data modeling, high development costs, high maintenance costs, and lack of flexibility and universality.
Using a dynamic modeling method based on RDF graph, we can set object types and relationship types of different business scenarios, dynamically adjust object attributes and their relationships, and build a data model suitable for multiple business scenarios without modifying the data table structure and code.
It realizes the flexibility and universality of data modeling, reduces the cost of repeated development and operation and maintenance, and solves the problem of being limited by relational databases in traditional modeling methods.
Smart Images

Figure CN119829686A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data modeling, and in particular to a dynamic modeling method, device, computer equipment and medium based on RDF graph. Background Art
[0002] In the field of intelligent manufacturing, industrial data is the core element in promoting the digital transformation of enterprises. Through data modeling, industrial data can be abstractly constructed into entities and their relationships according to application requirements and business logic to ensure the consistency, integrity and reliability of data. This lays a solid foundation for improving the overall efficiency and synergy of enterprise business processes and data integration. When establishing a data model, the traditional data modeling method of some enterprises usually converts the entities and relationships of a certain business scenario into the table structure of a relational database to achieve data storage and management. This solution has the following shortcomings:
[0003] 1. Due to the different organizational structures or data hierarchical relationships of different enterprises, a set of models still needs to be rebuilt in different enterprises under the same business scenario, which results in high development costs;
[0004] 2. This modeling method usually presets fixed attributes, which limits users from adding, removing, and adjusting attributes according to actual needs. If adjustments are required, it is often necessary to modify the database table structure and related codes, further increasing maintenance costs;
[0005] 3. It only supports limited association relationships and does not support users to flexibly add new relationships based on business needs. The steps to establish association relationships are cumbersome and the user experience is not friendly;
[0006] 4. The established model is limited to a specific business scenario and lacks universality. If a different scenario is needed, the data modeling module must be redeveloped, which increases development costs.
[0007] Therefore, there is an urgent need for a data modeling method that is applicable to different actual business scenarios and is not restricted by traditional relational databases. Summary of the invention
[0008] In view of this, the present invention provides a dynamic modeling method, apparatus, computer equipment and medium based on RDF graph to solve the problem of data modeling difficulties caused by the limitations of traditional relational databases in traditional modeling methods.
[0009] In a first aspect, the present invention provides a dynamic modeling method based on RDF graph, the method comprising:
[0010] Set the object type and relationship type corresponding to different business scenarios; the object type includes multiple object attributes and the attribute value corresponding to each attribute;
[0011] Obtain multiple entities and the relationships between entities in actual business scenarios, define each entity as an object, and obtain multiple objects and the relationships between objects;
[0012] Based on the actual business scenario, the relationship between each object and the object matches the corresponding object type and relationship type, and instantiates each object attribute and the attribute value corresponding to each attribute based on the object type;
[0013] A data model based on RDF graph is constructed based on the object type, relationship type, multiple objects, relationships between objects, object attributes, and attribute values corresponding to each attribute in actual business scenarios.
[0014] The dynamic modeling method based on RDF graph provided by the present invention sets object types and relationship types for various business scenarios, and allows dynamic adjustment of object attributes and relationships between objects according to actual business needs. It is applicable to various business scenarios, is not limited by traditional relational databases, and can achieve data modeling without complicated data table structure and code modification. The modeling method is simple and accurate, reduces repeated development costs and operation and maintenance costs, and solves the problem of difficulty in data modeling caused by the limitations of traditional relational databases in traditional modeling methods.
[0015] In an optional implementation, setting object types and relationship types corresponding to different business scenarios includes:
[0016] Set up multiple objects required according to different business scenarios and analyze the relationships between objects;
[0017] Analyze each object attribute and set the attribute value corresponding to each attribute;
[0018] Based on each object attribute and the corresponding attribute value, a data set arranged in sequence is formed according to the relationship attribute order and relationship attribute value. The data set arranged in sequence is used as the object type, and the relationship attributes and relationship attribute value set formed by the relationship between the objects are used as the relationship type.
[0019] The dynamic modeling method based on RDF graph provided by the present invention sets object attributes and attribute values corresponding to each attribute by considering objects involved in various scenarios and the relationships between objects, forming object type and relationship type templates with unified data formats, providing more efficient management and statistical methods for objects and relationships, and providing conditions for data modeling in subsequent actual business scenarios.
[0020] In an optional implementation, analyzing each object attribute and setting an attribute value corresponding to each attribute includes:
[0021] Analyze multiple attributes of each object and set the corresponding attribute value of each attribute to empty.
[0022] The RDF graph-based dynamic modeling method provided by the present invention analyzes multiple attributes of each object, sets the attribute value corresponding to each attribute to be empty, provides a unified object type data format template, and has the advantage of simple data processing.
[0023] In an optional implementation, the relationship type includes multiple relationship attributes and attribute values corresponding to each relationship attribute; the relationship attributes and relationship attribute value sets formed by the relationship between objects as the relationship type include:
[0024] Set the relationship in each object type to a single common relationship attribute, and the attribute value corresponding to the common relationship is empty.
[0025] The dynamic modeling method based on RDF graph provided by the present invention sets the relationship in each object type as a single common relationship attribute, and the attribute value corresponding to the common relationship is empty. The relationship is linked to the object to form a unified data format of the object type, which provides conditions for forming object types and relationship types.
[0026] In an optional embodiment, each object attribute includes an object name;
[0027] Based on the actual business scenario, the relationship between each object and the object matches the corresponding object type and relationship type, and instantiates each object attribute and the attribute value corresponding to each attribute based on the object type, including:
[0028] Based on the actual business scenario, each object name and the relationship between objects are matched with the corresponding object type and relationship type, and each attribute and the attribute value corresponding to each attribute are instantiated and assigned based on the object type and the actual business scenario data.
[0029] The dynamic modeling method based on RDF graph provided by the present invention matches the corresponding object type and relationship type based on the relationship between each object name and the object in the actual business scenario, thereby achieving the purpose of instantiating and assigning each attribute and the attribute value corresponding to each attribute based on the object type and the actual business scenario data. It has uniform applicability to different actual business scenarios, improves the efficiency of data modeling, and provides conditions for efficient modeling of subsequent data models.
[0030] In an optional implementation, the RDF graph-based dynamic modeling method further includes: when a new object or relationship is added to a certain object type, the new object or relationship automatically inherits the object properties of the corresponding object type or the relationship properties of the relationship type.
[0031] The dynamic modeling method based on RDF graph provided by the present invention achieves the purpose of eliminating the need for cumbersome data table structure and code modification by realizing that when a new object or relationship is added to a certain object type, the new object or relationship automatically inherits the object attribute of the object type or the relationship attribute of the relationship type, thereby reducing repeated development costs and operation and maintenance costs, and significantly reducing the development costs of repeatedly modifying table structures and codes due to changes in business requirements. This flexibility and scalability enable the data model to quickly adapt to new business scenarios without large-scale reconstruction.
[0032] In an optional implementation, the RDF graph-based dynamic modeling method further includes: visually displaying the RDF graph-based data model, where the visual display includes a text display mode and a graphic display mode.
[0033] The dynamic modeling method based on RDF graph provided by the present invention displays the data model in an intuitive way, so that users can understand complex data structures and business logic at a glance. In the graphical display mode, users can more intuitively understand the objects in the scene and the relationship between objects, which not only enhances the readability of the data, but also greatly improves the user experience.
[0034] In a second aspect, the present invention provides a dynamic modeling device based on an RDF graph, the device comprising:
[0035] The data storage template setting module is used to set the object type and relationship type corresponding to different business scenarios; the object type includes multiple object attributes and the attribute value corresponding to each attribute;
[0036] The actual business scenario entity and relationship acquisition module is used to obtain multiple entities and the relationships between entities in the actual business scenario, and define each entity as an object to obtain multiple objects and the relationships between objects;
[0037] The instantiated object and relationship module is used to match the corresponding object type and relationship type between each object and the relationship between objects based on the actual business scenario, and instantiate each object attribute and the attribute value corresponding to each attribute based on the object type;
[0038] The model building module is used to build a data model based on the RDF graph based on the object type, relationship type, multiple objects, relationships between objects, object attributes, and attribute values corresponding to each object attribute in the actual business scenario.
[0039] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the dynamic modeling method based on RDF graph of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0040] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the RDF graph-based dynamic modeling method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 is a schematic diagram of a flow chart of a dynamic modeling method based on an RDF graph according to an embodiment of the present invention;
[0043] Figure 2 is a flow chart of another RDF graph-based dynamic modeling method according to an embodiment of the present invention;
[0044] Figure 3 is a flow chart of another RDF graph-based dynamic modeling method according to an embodiment of the present invention;
[0045] FIG4( a ) is a schematic diagram of a visual display according to an embodiment of the present invention;
[0046] FIG4( b ) is a schematic diagram of another visual display according to an embodiment of the present invention;
[0047] Figure 5 is a structural block diagram of a dynamic modeling device based on an RDF graph according to an embodiment of the present invention;
[0048] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0050] The traditional modeling method is generally to use a relational database for storage. In different production sites, the same type of data model may have only minor differences. Taking the factory model as an example, the company attributes in the factory model in site A only need to store the name and code, while the company data of the factory model in site B also needs to store information such as level and registration code. The relational database used in the traditional factory model can only support one data structure, and it is necessary to design two data structures of the factory model in sites A and B. In addition, the association relationship between data in a data model is relatively complex, including belonging, inclusion, mutual exclusion, etc. The data stored in the relational database requires complex queries to display the data relationship.
[0051] The present invention proposes to store data models in a non-relational database. Before establishing the model, the entities and their associations in the business scenario are organized into the form of an RDF graph. Entities are defined as objects, and the associations between them are defined as relationships. Objects exist as resources in the form of nodes, and relationships are represented as predicates in the form of edges. In addition, the present invention proposes two concepts: object type and relationship type. Object types include specific instance objects, while relationship types include various relationships. The attributes of object types define the common attributes of all objects under this type. Similarly, the attributes of relationship types define the common attributes of all relationships under this type. By introducing the type level, a more efficient management and statistical method is provided for objects and relationships. The data model constructed by the method of the present invention is applicable to a variety of business scenarios, allowing users to dynamically adjust the attributes of objects and their mutual relationships according to actual business needs, without being restricted by traditional relational databases, without the need for cumbersome data table structures and code modifications, and reducing the effect of repeated development costs and operation and maintenance costs.
[0052] According to an embodiment of the present invention, an embodiment of a dynamic modeling method based on an RDF graph is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0053] In this embodiment, a dynamic modeling method based on RDF graph is provided, which can be used in computer terminals, such as central processing units, servers, etc., in which IoT data acquisition and monitoring software is installed. This software is used for operations such as client input and output data, including scene management page, object type management and relationship type management page, and model management page. Figure 1 is a flow chart of a dynamic modeling method based on RDF graph according to an embodiment of the present invention, such as Figure 1 As shown, the process includes the following steps:
[0054] Step S101, setting object types and relationship types corresponding to different business scenarios; an object type includes multiple object attributes and attribute values corresponding to each attribute.
[0055] Specifically, different business scenarios include, but are not limited to, factory business scenarios, smart manufacturing business scenarios, material business scenarios for production process optimization, and industrial Internet of Things business scenarios.
[0056] In the smart manufacturing business scenario, data modeling is not only a carrier of data, but also a powerful engine for the digital transformation of enterprises. Data modeling is a bridge connecting data and value, providing solid support and unlimited possibilities for enterprises to achieve digital transformation and intelligent upgrading in the era where data is king.
[0057] In the material business scenario of production process optimization, data modeling plays an important role. By adopting a flexible and adaptable data modeling method, enterprises can quickly adjust and optimize the model. After mounting production data under the model object, they can realize the ability to carry accurate and detailed production data. By analyzing production data and the flow between data, enterprises can quickly locate the key links that affect production efficiency. This capability enables enterprises to identify and solve bottlenecks in the production process, thereby providing the possibility for optimizing the production process. For example, building an accurate material model can help enterprises accurately track and display the flow of materials in the production process, so as to take targeted measures to optimize the key links with high material consumption. In the industrial Internet of Things business scenario, the data model can manage and analyze data from various devices and sensors, and better realize the interconnection between devices through a unified data model.
[0058] In addition, data models are the core of driving data-driven decision-making. By converting complex data into actionable insights, they help companies find certainty in uncertainty and improve the speed and quality of decision-making. Taking smart factories as an example, key object types such as "production line", "product", and "production parameters" are defined in the data model, and objects such as "temperature", "pressure", and "quality" are established under "production parameters". By mounting real-time data under parameter objects, companies can continuously track subtle changes in the production process. Using advanced data analysis technology, companies have the ability to predict uncertain results such as product quality, thereby formulating response strategies and bringing competitive advantages to companies.
[0059] For example, in a factory model scenario, when building a factory model, you can set elements such as company, factory, and workshop as objects, set the company's name, code, registration code, etc. as company attributes, set the factory's name, code, description, etc. as factory attributes, and set the workshop's name, code, and location as workshop attributes. Each object attribute corresponds to an attribute value. The relationship between the company, factory, and workshop objects is an inclusion relationship, that is, the workshop is included in the factory, and the factory is included in the company. The relationship between the company, factory, and workshop can be expressed as: Sets the relationship between objects to the relationship property of the relationship type and sets the pointer to the relationship property value of the relationship type.
[0060] The set object type is described as follows:
[0061] Company (attributes: name, code, registration code; attribute values: empty, empty, empty), factory (attributes: name, code, description; attribute values: empty, empty, empty), workshop (attributes: name, code, location; attribute values: empty, empty, empty).
[0062] The object types and relationship types set for different business scenarios are saved in the database of the IoT data collection and monitoring software to provide conditions for subsequent modeling.
[0063] Step S102, obtaining multiple entities and relationships between entities in an actual business scenario, and defining each entity as an object to obtain multiple objects and relationships between objects.
[0064] For example, in the factory model business scenario, three entities of Workshop A in Factory A of Company A are obtained, Company A, Factory A, and Workshop A are defined as three corresponding objects, and the relationship between Company A, Factory A, and Workshop A is an inclusion relationship.
[0065] Step S103, matching the corresponding object type and relationship type between each object and the relationship between objects based on the actual business scenario, and instantiating each object attribute and the attribute value corresponding to each attribute based on the object type.
[0066] Exemplarily, taking the factory business scenario as an example, based on the actual objects obtained, Company A, Factory A, and Workshop A, the object type is searched from the scenario management page of the IoT data acquisition and monitoring software database, and the matching object type is found from it, that is, the object types of company (attributes: name, code, registration code; attribute values: empty, empty, empty), factory (attributes: name, code, description; attribute values: empty, empty, empty), and workshop (attributes: name, code, location; attribute values: empty, empty, empty) are matched, and then the attribute values of each object are obtained according to the actual business scenario.
[0067] For example, Company A, Factory A, and Workshop A are instantiated and assigned values according to the matched object types and expressed as follows:
[0068] Company A (attributes: name, code, registration code; attribute value: Company A, compA, 10001), Factory A (attributes: name, code, description; attribute value: Factory A, facA, chemical fiber), Workshop A (attributes: name, code, location; attribute value: Workshop A, worA, 100m from the northeast entrance of Area A of Factory A).
[0069] Step S104, constructing a data model based on the RDF graph based on the object type, relationship type, multiple objects, relationships between objects, object attributes, and attribute values corresponding to each attribute in the actual business scenario.
[0070] Specifically, the RDF graph (Resource Description Framework) is a standard data model developed by the World Wide Web Consortium (W3C) for representing and exchanging machine-understandable information on the semantic World Wide Web. The RDF graph consists of triples, each of which consists of three parts: Subject (s): represents a resource or entity (i.e., an object). Predicate (p): represents the relationship or attribute between resources (i.e., a relationship). Object (o): represents the value of a relationship or attribute (i.e., an object attribute is and a relationship attribute value).
[0071] The attribute values instantiated in step S103 are filled in the corresponding object types in the scene management page of the IoT data acquisition and monitoring software database, stored in the graph database, and a data model based on the RDF graph is constructed.
[0072] The dynamic modeling method based on RDF graph provided in this embodiment sets object types and relationship types for various business scenarios, and allows dynamic adjustment of object attributes and relationships between objects according to actual business needs. It is applicable to various business scenarios, is not restricted by traditional relational databases, and can implement data modeling without complicated data table structures and code modifications. The modeling method is simple and accurate, reduces repeated development costs and operation and maintenance costs, and solves the problem of data modeling difficulties caused by the limitations of traditional relational databases in traditional modeling methods.
[0073] In this embodiment, a dynamic modeling method based on RDF graph is provided, which can be used in computer terminals, such as central processing units, servers, etc., in which IoT data acquisition and monitoring software is installed. This software is used for operations such as client input and output data, including scene management page, object type management and relationship type management page, and model management page. Figure 2 is a flow chart of a dynamic modeling method based on RDF graph according to an embodiment of the present invention, such as Figure 2 As shown, the process includes the following steps:
[0074] Step S201, setting object types and relationship types corresponding to different business scenarios; an object type includes multiple object attributes and attribute values corresponding to each attribute.
[0075] Specifically, the above step S201 includes:
[0076] Step S2011, setting multiple objects required according to different business scenarios, and analyzing the relationship between the objects.
[0077] Specifically, taking the industrial IoT business scenario as an example, to establish an IoT model, elements such as devices and sensor measurement points are involved, and the device and measurement point elements are set as an object respectively. The relationship between the two objects, the device and the measurement point, is analyzed as an inclusion relationship, that is, the sensor measurement point is included in the device.
[0078] Step S2012, analyzing each object attribute and setting the attribute value corresponding to each attribute.
[0079] Specifically, multiple attributes of each object are analyzed, and the attribute value corresponding to each attribute is set to be empty.
[0080] The name, code, type, shutdown status, description, etc. of the device are set as the device's attributes; the name, code, prefix, enable status, etc. of the sensor measurement point are set as the sensor measurement point's attributes; each object attribute corresponds to an attribute value "empty".
[0081] By analyzing multiple attributes of each object and setting the attribute value corresponding to each attribute to be empty, a unified object type data format template is provided, which has the advantage of simple data processing.
[0082] Step S2013, based on each object attribute and the corresponding attribute value, a data set arranged in sequence is formed according to the relationship attribute order and the relationship attribute value, the data set arranged in sequence is used as the object type, and the relationship attributes and relationship attribute value set formed by the relationship between the objects are used as the relationship type.
[0083] Specifically, the relationship type includes multiple relationship attributes and the attribute values corresponding to each relationship attribute; relationship attributes include inclusion, mutual exclusion, parallel, etc., and inclusion, mutual exclusion, and parallel are set as relationship attributes, and the attribute values of inclusion, mutual exclusion, and parallel are set as directional relationships. Directional relationships include pointing and being pointed to, where pointing means that the direction of data flow is from the object to its associated object; conversely, being pointed to means that the direction of data flow will flow from the associated object to the object itself. For example, pointing is expressed as:
[0084]
[0085] It should be noted that the relationship in each object type is set to a single common relationship attribute, and the attribute value corresponding to the common relationship is empty. For example, the common relationship between the device and the sensor measurement point is the included relationship attribute.
[0086] When establishing a relationship, the IoT data acquisition and monitoring software supports users to establish an association relationship between objects on the model management page. Select an object, the object to be associated, the association relationship to be established, and the direction (pointing / being pointed to), and directly establish the association relationship between the object and the selected object. If the selected direction is pointing, it means that the direction of data flow is from the object to its associated object. On the contrary, the direction of data flow will flow from the associated object to the object itself. The establishment of a relationship clearly defines the flow direction of data and the business process.
[0087] The dynamic modeling method based on RDF graph provided in this embodiment sets the relationship in each object type as a single common relationship attribute, and the attribute value corresponding to the common relationship is empty. The relationship is linked to the object to form a unified data format of the object type, which provides conditions for forming object types and relationship types.
[0088] Exemplarily, the object types obtained based on each attribute of the device and the sensor measurement point and each corresponding attribute value space and the contained relationship attributes and the directional relationship attribute values are:
[0089] "Device" (attributes: name, code, type, whether shut down, description; attribute values: empty, empty, empty, empty, empty) and "Sensor measurement point" (attributes: name, code, prefix, whether enabled; attribute values: empty, empty, empty, empty).
[0090] Step S202: Obtain multiple entities and the relationships between entities in the actual business scenario, and define each entity as an object to obtain multiple objects and the relationships between objects. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0091] Step S203, based on the actual business scenario, the relationship between each object and the object matches the corresponding object type and relationship type, and instantiates each object attribute and the attribute value corresponding to each attribute based on the object type. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0092] Step S204: construct a data model based on the RDF graph based on the object type, relationship type, multiple objects, relationships between objects, object attributes, and attribute values corresponding to each attribute in the actual business scenario. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.
[0093] The dynamic modeling method based on RDF graph provided in this embodiment considers the objects involved in various scenarios and the relationships between objects to set object attributes and the attribute values corresponding to each attribute, forming object type and relationship type templates with a unified data format, providing a more efficient management and statistical method for objects and relationships, and providing conditions for data modeling in subsequent actual business scenarios.
[0094] In this embodiment, a dynamic modeling method based on RDF graph is provided, which can be used in computer terminals, such as central processing units, servers, etc., in which IoT data acquisition and monitoring software is installed. This software is used for operations such as client input and output data, including scene management page, object type management and relationship type management page, and model management page. Figure 3 is a flow chart of a dynamic modeling method based on RDF graph according to an embodiment of the present invention, such as Figure 3 As shown, the process includes the following steps:
[0095] Step S301, set the object type and relationship type corresponding to different business scenarios; the object type includes multiple object attributes and the attribute value corresponding to each attribute. For details, please refer to Figure 2 Step S201 of the illustrated embodiment will not be described in detail here.
[0096] Step S302: Obtain multiple entities and the relationships between entities in the actual business scenario, and define each entity as an object to obtain multiple objects and the relationships between objects. Figure 2 Step S202 of the illustrated embodiment will not be described in detail here.
[0097] Step S303, matching the corresponding object type and relationship type between each object and the relationship between objects based on the actual business scenario, and instantiating each object attribute and the attribute value corresponding to each attribute based on the object type.
[0098] Specifically, the above step S303 includes:
[0099] Step a. Based on the actual business scenario, each object name and the relationship between objects are matched with the corresponding object type and relationship type, and each attribute and the attribute value corresponding to each attribute are instantiated and assigned based on the object type and the actual business scenario data.
[0100] For example, when building an IoT data model, specific instances can be created, i.e., the devices (objects) actually deployed in the enterprise, and the specific parameters (object attributes and object attribute values, relationship attributes and relationship attribute values) in these devices. For example, the instantiation assignment for the actual heavy asphalt device I, sensor measurement points CP_GQ5W_TT_30301 and CP_GQ5W_TT_30302 in the enterprise is expressed as follows:
[0101] Heavy asphalt unit I (attributes: name, code, type, whether shut down, description; attribute value: Heavy asphalt unit I, Z4XH0101, refinery, open, refinery unit).
[0102] Sensor measurement point CP_GQ5W_TT_30301 (properties: name, code, prefix, whether enabled; property value: sensor measurement point CP_GQ5W_TT_30301, CP_GQ5W_TT_30301, \CP\Z4XH0101, yes).
[0103] Sensor measurement point CP_GQ5W_TT_30302 (properties: name, code, prefix, whether enabled; property value: sensor measurement point CP_GQ5W_TT_30302, CP_GQ5W_TT_30302, \CP\Z4XH0101, yes).
[0104] When establishing the IoT data model, you can also directly establish a relationship between the device and the sensor. That is, the heavy asphalt device I includes the sensor measurement point CP_GQ5W_TT_30301 and the sensor measurement point CP_GQ5W_TT_30302. By mounting real-time data under the sensor measurement point CP_GQ5W_TT_30301 and the sensor measurement point CP_GQ5W_TT_30302, the enterprise can realize real-time monitoring of the data of multiple sensors or devices.
[0105] Step S304: construct a data model based on the RDF graph based on the object type, relationship type, multiple objects, relationships between objects, object attributes, and attribute values corresponding to each attribute in the actual business scenario. Figure 2 Step S204 of the illustrated embodiment will not be described in detail here.
[0106] Step S305: When a new object or relationship is added to a certain object type, the new object or relationship automatically inherits the object attributes of the corresponding object type or the relationship attributes of the relationship type.
[0107] Specifically, the IoT data acquisition and monitoring software supports users to enter scene names in the scene management page. Select a scene that has been entered in the object type management and relationship type management pages, and fill in the attributes and attribute values of the object type and relationship type accordingly. Select a certain object type that has been entered in the model management page. When adding new objects or relationships, the attributes of the corresponding object type or relationship type will be automatically inherited. For example, the attributes of the object type company: name, code, registration code. When creating the object A company, the three attributes of name, code, and registration code will be automatically brought out. You only need to fill in the attribute values: A company, compA, 10001. The attributes and attribute values of object types, relationship types, objects, and relationships all support dynamic modification to adapt to changing business needs. After completing the filling, the data will be stored in the graph database.
[0108] Step S306: Visually display the data model based on the RDF graph, and the visual display includes a text display mode and a graphic display mode.
[0109] Specifically, as shown in FIG4( a ), it is a text display mode, which retains the traditional list format, focusing on displaying the information of the object, and sorting the information in sequence, so that the information is clear at a glance and it is convenient for data updating and maintenance.
[0110] As shown in Figure 4(b), this is a graphical display mode, where users can more intuitively understand the objects in the scene and the relationships between them, which enhances the readability of the data and improves the user's interactive experience.
[0111] The dynamic modeling method based on RDF graph provided in this embodiment constructs a unified data model based on RDF graph, which is stored in the graph database through four core data structures, including object type, object, relationship type, and relationship. This model not only unifies the data representation method of different business scenarios, but also greatly simplifies the construction and management process of the data model. The data relationship is presented in an intuitive way, so that users can understand complex data structures and business logic at a glance. This graphical data display not only enhances the readability of the data, but also greatly improves the user experience. The unified modeling method under different scenarios is realized, which significantly reduces the development cost of repeatedly modifying the table structure and code due to changes in business requirements. This flexibility and scalability enable the data model to quickly adapt to new business scenarios without large-scale reconstruction. Allowing users to freely modify attributes and relationships in the model, this flexibility greatly reduces the operation and maintenance costs caused by attribute adjustments or relationship changes. Users can easily adjust the data model according to actual needs without complex database operations.
[0112] In this embodiment, a dynamic modeling device based on RDF graph is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0113] This embodiment provides a dynamic modeling device based on RDF graph, such as Figure 5 As shown, including:
[0114] The data storage template setting module 501 is used to set the object type and relationship type corresponding to different business scenarios; the object type includes multiple object attributes and the attribute value corresponding to each attribute.
[0115] The actual business scenario entity and relationship acquisition module 502 is used to acquire multiple entities and the relationships between entities in the actual business scenario, and define each entity as an object to obtain multiple objects and the relationships between objects.
[0116] The instantiate object and relationship module 503 is used to match the corresponding object type and relationship type between each object and the relationship between objects based on the actual business scenario, and instantiate each object attribute and the attribute value corresponding to each attribute based on the object type.
[0117] The model building module 504 is used to build a data model based on the RDF graph based on the object type, relationship type, multiple objects, relationships between objects, object attributes, and attribute values corresponding to each object attribute in the actual business scenario.
[0118] In some optional implementations, the data storage template setting module 501 includes:
[0119] The object and relationship analysis unit is used to set multiple objects required according to different business scenarios and analyze the relationships between objects.
[0120] The object attribute value analysis unit is used to analyze each object attribute and set the attribute value corresponding to each attribute.
[0121] The object type and relationship type establishment unit is used to form a data set arranged in sequence according to the relationship attribute order and relationship attribute value based on each object attribute and the corresponding attribute value, and use the data set arranged in sequence as the object type, and use the relationship attributes and relationship attribute value set formed by the relationship between objects as the relationship type.
[0122] In some optional implementations, the object attribute value analysis unit includes:
[0123] The object attribute value assignment subunit is used to analyze multiple attributes of each object and set the attribute value corresponding to each attribute to be empty.
[0124] In some optional implementations, the relationship type includes multiple relationship attributes and attribute values corresponding to each relationship attribute; the object type and relationship type establishment unit includes:
[0125] The relationship attribute value assignment subunit is used to set the relationship in each object type to a single common relationship attribute, and the attribute value corresponding to the common relationship is empty.
[0126] In some optional implementations, each object attribute includes an object name; the instantiated object and relationship module 503 includes:
[0127] The instantiation assignment unit is used to match the corresponding object type and relationship type based on each object name and the relationship between objects in the actual business scenario, and to instantiate and assign each attribute and the attribute value corresponding to each attribute based on the object type and the actual business scenario data.
[0128] In some optional implementations, the dynamic modeling device based on the RDF graph further includes:
[0129] A new object inheritance module is added, which is used to automatically inherit the object properties of the object type or the relationship properties of the relationship type when a new object or relationship is added to a certain object type.
[0130] The visualization display module is used to visualize the data model based on the RDF graph. The visualization display includes text display mode and graphic display mode.
[0131] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0132] The RDF graph-based dynamic modeling device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0133] The embodiment of the present invention also provides a computer device having the above Figure 5 The dynamic modeling device based on RDF graph is shown.
[0134] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0135] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0136] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0137] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0138] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0139] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0140] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0141] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0142] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A dynamic modeling method based on RDF graph, characterized in that: The method comprises: Set object types and relationship types corresponding to different business scenarios; the object type includes multiple object attributes and attribute values corresponding to each attribute; Obtain multiple entities and the relationships between entities in actual business scenarios, define each entity as an object, and obtain multiple objects and the relationships between objects; Based on the actual business scenario, the relationship between each object and the object matches the corresponding object type and relationship type, and instantiates each object attribute and the attribute value corresponding to each attribute based on the object type; A data model based on RDF graph is constructed based on the object type, relationship type, multiple objects, relationships between objects, object attributes, and attribute values corresponding to each object attribute in actual business scenarios.
2. The method according to claim 1, characterized in that The relationship type includes multiple relationship attributes and relationship attribute values corresponding to each relationship attribute; the object types and relationship types corresponding to different business scenarios are set as follows: Set up multiple objects required according to different business scenarios and analyze the relationships between objects; Analyze each object attribute and set the attribute value corresponding to each attribute; Based on each object attribute and the corresponding attribute value, a data set arranged in sequence is formed according to the relationship attribute order and relationship attribute value, the data set arranged in sequence is used as the object type, and the relationship attributes and relationship attribute value set formed by the relationship between the objects are used as the relationship type.
3. The method according to claim 2, characterized in that The analyzing each object attribute and setting the attribute value corresponding to each attribute includes: Analyze multiple attributes of each object and set the corresponding attribute value of each attribute to empty.
4. The method according to claim 2, characterized in that: The relationship attributes and relationship attribute value sets formed by the relationship between objects as relationship types include: The relationship in each object type is set to a single common relationship attribute, and the attribute value corresponding to the common relationship is empty.
5. The method according to claim 2, characterized in that: Each object attribute includes the object name; The matching of the corresponding object type and relationship type between each object and the relationship between the objects based on the actual business scenario, and instantiating each object attribute and the attribute value corresponding to each attribute based on the object type includes: Based on the actual business scenario, each object name and the relationship between objects are matched with the corresponding object type and relationship type, and each attribute and the attribute value corresponding to each attribute are instantiated and assigned based on the object type and the actual business scenario data.
6. The method according to claim 4, characterized in that The method further includes: when a new object or relationship is added to a certain object type, the new object or relationship automatically inherits the object attribute of the corresponding object type or the relationship attribute of the relationship type.
7. The method according to claim 1, characterized in that The method further includes: visually displaying the data model based on the RDF graph, wherein the visual display includes a text display mode and a graphic display mode.
8. A dynamic modeling device based on RDF graph, characterized in that: The device comprises: A data storage template setting module, used to set object types and relationship types corresponding to different business scenarios; the object type includes multiple object attributes and attribute values corresponding to each attribute; The actual business scenario entity and relationship acquisition module is used to obtain multiple entities and the relationships between entities in the actual business scenario, and define each entity as an object to obtain multiple objects and the relationships between objects; The instantiated object and relationship module is used to match the corresponding object type and relationship type between each object and the relationship between objects based on the actual business scenario, and instantiate each object attribute and the attribute value corresponding to each attribute based on the object type; The model building module is used to build a data model based on the RDF graph based on the object type, relationship type, multiple objects, relationships between objects, object attributes, and attribute values corresponding to each object attribute in the actual business scenario.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the dynamic modeling method based on RDF graph according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the dynamic modeling method based on RDF graph according to any one of claims 1 to 7.