Object-based modeling method
By using object-oriented modeling methods, dynamically configuring equipment models and supporting multiple communication protocols, the customized development problem of equipment data access and display in the informatization construction of coal mining enterprises is solved, and the convenience of unified maintenance and data query is realized.
Patent Information
- Application Number
- CN202411597995.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-11-11
Smart Images

Figure CN119537465B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of computer, and particularly relates to an object modeling method. BACKGROUND
[0002] In order to adapt to the development trend of informatization and implement the guiding policies of the state on the informatization of coal mine enterprises, various types of monitoring systems have been connected to the coal mine enterprises for many years. Various types of systems correspond to a variety of hardware devices, and in the process of informatization construction, the device data is usually collected for statistics or display. When a data platform needs to access multiple device data, custom development of each device data access and display is a huge workload and is not easy to maintain in the later period.
[0003] Therefore, it is necessary to propose an object modeling method to solve the problems of different device properties, high custom development cost and inconvenient maintenance in the later period. SUMMARY
[0004] The purpose of the application is to provide an object modeling method, which dynamically configures the model of the device to adapt to various devices, thereby reducing the workload of custom development and facilitating unified maintenance of the device.
[0005] The application proposes an object modeling method, which includes: creating an object model through a web form, configuring the classification, Chinese name, English name and remarks, organizing the form data into JSON format data when submitting, submitting to the backend server through the HTTP interface, dynamically creating the corresponding data table in the database according to the configuration, the basic properties in the data table are single fields, and a field is created to save all custom properties; after the object model is created, the custom properties of the object model are created through the form on the web, the JSON format data is submitted to the backend server through the HTTP interface, and all custom properties are sorted and saved to the custom property field of the object model table after the backend server parses and configures; after the model is selected on the web, the page dynamically generates the form according to the model configuration, and the JSON format data is submitted to the backend server through the HTTP interface after the form data is filled; part of the type data of the object can be manually maintained, and part of the type data can be maintained through multiple communication protocols.
[0006] The detailed steps of the object modeling method of the application are as follows:
[0007] (1) New object model is created through web form, and the category, Chinese name, English name and note are configured. The form data is organized into JSON format data when submitted, and is submitted to the backend server through HTTP interface. The backend server dynamically creates the corresponding data table in the database according to the English name of the object model. The basic attributes in the data table are single fields, and a field is created to save all custom attributes.
[0008] Specifically, the category selected when creating a new object model is preset data, including the following types: monitoring equipment, communication equipment, auxiliary transportation equipment, stoping equipment, tunneling equipment, main transportation equipment, power supply and distribution equipment, ventilation equipment, drainage equipment, reservoir, and roadway. Selecting different categories will make the object model contain different basic attributes.
[0009] When the selected category is auxiliary transportation, the following basic attributes are included: license plate number, vehicle number, speed limit value, department, and vehicle ownership.
[0010] When the selected category is other than auxiliary transportation, the following basic attributes are included: subsystem number, note, internal code, external code, S\N code, operation status, installation location, and factory date.
[0011] The Chinese name is used for display, and the English name is related to the creation of the database table. Considering the naming restrictions of the database itself and the reasonableness of the name, the English name should start with a letter, allow combination of letters, numbers and the character “_”, and have a length of 3-40.
[0012] (2) Select the already created model on the web, fill in the custom attribute information of the object model in the form, and submit the JSON format data to the backend server through HTTP interface. After parsing and configuration, the backend server organizes and saves all custom attributes to the custom attribute field of the object model table.
[0013] Specifically, the form content includes attribute name, attribute English name, attribute type and corresponding type configuration item. The English name is used as the basis for attribute access in subsequent logic, so the attribute English name should start with a letter, allow combination of letters, numbers and the character “_”, and have a length of 3-40.
[0014] The custom attribute type is divided into: String, int, decimal, bool, key-value pair, DateTime, reference point value, reference object, picture, automatically created point, and video channel.
[0015] The String type configuration item is read-write state and initial value. The read-write state can be read-write or read-only. The read-write state is used to configure whether the attribute is read-only or allows read-write. The initial value is used to configure the initial value of the attribute when the object is created.
[0016] int type configuration items are read-write status, initial value, attribute selection mode, maximum value and minimum value. The read-write status can be read-write or read-only; the initial value is used to configure the initial value of the attribute when the object is created; the attribute selection mode can be input box or drop-down selection, which is used to control whether the int attribute is displayed as an input box or a drop-down enumeration on the page; the maximum value and the minimum value limit the value range of the int type, and the user can only configure the value within the limited range;
[0017] decimal type configuration items are read-write status, initial value, decimal places, maximum value and minimum value. The read-write status can be read-write or read-only; the initial value is used to configure the initial value of the attribute when the object is created; the decimal places are used to control the decimal places of the attribute value, the maximum value and the minimum value limit the value range of the int type, and the user can only configure the value within the limited range.
[0018] bool type configuration items are attribute selection mode and initial value. The attribute selection mode can be checkbox or drop-down selection, which is used to control the display mode of the bool attribute on the page; the initial value is used to configure the initial value of the attribute when the object is created.
[0019] The key-value pair type configuration item is a row of key-value, and multiple key-value pairs can be added through the form button. The key is the interface display value, and the value is the submission value, which is displayed using a drop-down list.
[0020] DateTime type configuration items are read-write status, initial value and mode. The read-write status can be read-write or read-only; the initial value is used to configure the initial value of the attribute when the object is created; the mode can be date or date and time.
[0021] The referenced measurement point value type configuration items are measurement point properties, measurement point categories and value attributes, which are used to filter the referenceable measurement points.
[0022] The referenced object type configuration item is object type, which is used to filter the classification of the referenced object.
[0023] The picture type configuration items are read-write status and initial value. The read-write status can be read-write or read-only; the initial value is used to configure the initial value of the attribute when the object is created.
[0024] The automatically created measurement point configuration items are measurement point properties, measurement point categories and value attributes, which are used to define the related attributes of the automatically created measurement points.
[0025] The video channel attribute has no configurable items.
[0026] After creating the corresponding attribute, the related configuration of the attribute will be organized as JSON format data and stored in the custom attribute field of the object model.
[0027] (3) In the web end, select the object model that has been configured, create the object instance of the model, and dynamically generate the form according to the model configuration. After filling in the form data, submit the JSON format data to the backend server through the HTTP interface. At the same time, the object instance directly allows the creation of parent-child relationship to form a hierarchical structure, which can be applied to define strongly related devices, such as vehicle and vehicle terminal, vehicle and vehicle camera, substation and power supply, and area controller and power supply.
[0028] Specifically, the form attributes are divided into basic attributes and custom attributes. The basic attributes are automatically generated according to the object model classification. The model belongs to the following basic attributes: license plate number, vehicle number, speed limit value, department, and vehicle belonging.
[0029] When the selected category is other than auxiliary transportation, the following basic attributes are included: subsystem number, note, internal code, external code, S\N code, operation status, installation location, and factory date.
[0030] Custom attributes are automatically generated according to object model configuration. By reading the category of the attribute, the configuration item web end dynamically renders the required elements.
[0031] The string type is a text input box. According to the initial value configuration, the default value of the input box is configured. According to the read-only or read-write configuration, the input state of the input box is configured. If it is read-only, it cannot be input and only the default value is displayed. If it is read-write, it can be normally input.
[0032] The int type is rendered according to the attribute selection mode. If it is an input box, the page is rendered as a digital input box, the type is limited to integer, the default value of the digital input box is configured according to the initial value, the input state of the input box is configured according to the read-only or read-write, and the value range of the input box is displayed according to the maximum value and minimum value. If it is a drop-down selection, the page is rendered as a drop-down box component, and the drop-down item content is configured according to the maximum value and minimum value.
[0033] The decimal type is a digital input box. According to the decimal place configuration item, the decimal places of the component are limited. The value range of the input box is displayed according to the maximum value and minimum value.
[0034] The bool type is rendered according to the attribute selection mode. If it is a checkbox, the page is rendered as a checkbox component, and the default value of the component is set according to the initial value. If the initial value is true, the checkbox is checked by default. If the initial value is false, the checkbox is not checked. If the selection mode is a drop-down selection, the page is rendered as a drop-down box component, and the drop-down options are set to True and False.
[0035] DateTime type is a date display component, according to the read-write state configuration date component input state, according to the initial value configuration component default date, read-write state is read-only, then the initial value date cannot be modified, read-write state is read-write, then the initial value date can be modified normally. According to the mode configuration item, modify the display mode of the date component, mode is date, then the component only shows date, mode is date plus time, then the date component displays date and time and provides actual selection when selecting.
[0036] Reference point value type is a drop-down box, according to the point property, point category and value attribute in attribute configuration, filter the points, and use these points as the selectable content of the drop-down box.
[0037] Reference object type is a drop-down box, according to the object type in attribute configuration, filter all objects that meet the conditions, and use these objects as the selectable content of the drop-down box.
[0038] Picture type uses picture display component, default display initial value configuration picture, according to the read-write state configuration component whether can modify, read-write state is read-write, then allow to modify the picture, read-write state is read-only, then can't modify the picture.
[0039] Automatic creation of point type is a text box that cannot be edited, default value, after submitting the form, according to the point property, point category and value attribute in attribute configuration, a point will be dynamically created, and the ID of the point will be bound to the attribute.
[0040] Video channel type is a text box, default value.
[0041] After submitting the form, the corresponding object instance table will be created according to the object model configuration, the basic attributes are saved to the corresponding data table field, and the custom attributes are integrated into JSON format data saved in a field
[0042] (4) Manually maintain or assign values to object instance attributes through various communication protocols. Form text input box, number input box, drop-down box, check box, picture selection component can be maintained manually, or data can be maintained by calling HTTP interface. The automatic creation of point related configuration can query the point ID associated with the object attribute through HTTP interface, and then query or maintain the configuration of the automatically created point through the ID. The real-time value and state value of the automatically created point can be maintained through various communication protocols, such as modbus protocol, mqtt protocol, text protocol and OPC protocol, etc.
[0043] (5) According to the actual demand, the object data is queried and displayed or statistically summarized and displayed. When a certain type of device is needed, the device can be queried by its English name through the HTTP interface, and the obtained device object attributes are associated with the English name.
[0044] When the device external code needs to be acquired, the attribute can be accessed through Device.DeviceCode, and other attribute acquisition methods are similar.
[0045] The whole object tree can be acquired through the http interface, and a device or its child device at a certain time can be accessed through the hierarchical structure.
[0046] The real-time values and attribute values of the associated measuring points of all objects can be acquired through the http interface.
[0047] The object modeling method has the beneficial effects that: the object modeling method can establish models of different devices through dynamic configuration, thereby reducing the workload of customized development through the configuration method, supporting maintenance of device data in multiple methods, providing an HTTP interface for data query for large-screen display or data statistics, returning fixed-format JSON data through the interface, and facilitating use of data consumers. BRIEF DESCRIPTION OF DRAWINGS
[0048] Figure 1 The object modeling method of the present application is shown in the flowchart. DETAILED DESCRIPTION
[0049] The preferred embodiments of the present application are described in detail below with reference to the accompanying drawings, so that the advantages and features of the present application can be more easily understood by those skilled in the art, and the protection scope of the present application is more clearly and definitely defined.
[0050] As shown in Figure 1 The present application provides a modeling method, which comprises:
[0051] Object model creation: a new object model is created through a web-side form, the classification, Chinese name, English name and remarks are configured, the form data is organized into JSON format data when submitted, and is submitted to a backend server through an HTTP interface; the backend server dynamically creates a corresponding data table in the database according to the configuration, that is, creates basic attributes, the basic attributes in the data table are single fields, and a field is created to save all custom attributes; after the object model is created, the custom attributes of the object model are created through a form on the web side, and the JSON format data is submitted to the backend server through an HTTP interface; the backend server parses the configuration, and saves all custom attributes to the custom attribute field of the object model table after arrangement, that is, creates custom attributes.
[0052] Object instance creation: select the object model configured on the web side, create the object instance of the model, and the web page dynamically generates a form according to the model configuration, fills in the basic attributes and custom attributes, and submits the JSON format data to the backend server through the HTTP interface after filling in the form data; meanwhile, the object instance directly allows the creation of parent-child relationship, forming a hierarchical structure;
[0053] Object instance data assignment: maintained manually or by parsing third-party data sources;
[0054] Use data: according to actual needs, the object data is displayed on a large screen or statistically summarized; when a certain type of device is needed, a report can be queried through the HTTP interface with the device English name, and the obtained device object attributes are associated with the English name, which is used for abnormal analysis and data alarm.
[0055] The detailed steps of the application are as follows:
[0056] (1) Create an object model through a web form, configure the classification, Chinese name, English name and remarks, organize the form data into JSON format data when submitting, and submit it to the backend server through the HTTP interface; the backend server dynamically creates a corresponding data table in the database according to the English name of the object model, and the basic attributes in the data table are single fields, and a field is created to save all custom attributes.
[0057] Specifically, the classification selected when creating a new object model is preset data, including the following types: monitoring equipment, communication equipment, auxiliary transportation equipment, backfilling equipment, tunneling equipment, main transportation equipment, power supply and distribution equipment, ventilation equipment, drainage equipment, reservoir, and roadway; selecting different classifications will make the object model contain different basic attributes;
[0058] When the selected category is auxiliary transportation, the following basic attributes are included: license plate number, vehicle number, speed limit value, department, and vehicle ownership;
[0059] When the selected category is other than auxiliary transportation, the following basic attributes are included: subsystem number, remarks, internal code, external code, S\N code, operation status, installation location, and factory date;
[0060] The Chinese name is used for display, and the English name is related to the creation of the database table; considering the naming restrictions of the database itself and the reasonableness of the name, the English name needs to start with a letter, allowing combinations of letters, numbers and characters "_", and the length is 3-40.
[0061] (2) In the web end, select the model that has been created, fill in the custom attribute information of the object model, submit the JSON format data to the backend server through the HTTP interface, and after the backend server parses the configuration, sort and save all custom attributes to the custom attribute field of the object model table.
[0062] Specifically, the form content includes attribute name, attribute English name, attribute type, and configuration item corresponding to the type. The English name is used as the basis for attribute access in subsequent logic, so the attribute English name needs to start with a letter, allow combination of letters, numbers, and character "_", and the length is 3-40.
[0063] The custom attribute type is divided into: String, int, decimal, bool, key-value pair, DateTime, reference point value, reference object, picture, automatically created point, and video channel.
[0064] The String type configuration item is read-write state and initial value. The read-write state can be read-write or read-only, and the read-write state is used to configure whether the attribute is read-only or allows read-write, and the initial value is used to configure the initial value of the attribute when the object is created.
[0065] The int type configuration item is read-write state, initial value, attribute selection mode, maximum value, and minimum value. The read-write state can be read-write or read-only; the initial value is used to configure the initial value of the attribute when the object is created; the attribute selection mode can be an input box or a drop-down selection, and this configuration is used to control whether the int attribute uses an input box or a drop-down enumeration in page display mode; the maximum value and the minimum value limit the value range of the int type, and the user can only configure values within the limited range;
[0066] The decimal type configuration item is read-write state, initial value, decimal place, maximum value, and minimum value. The read-write state can be read-write or read-only; the initial value is used to configure the initial value of the attribute when the object is created; the decimal place is used to control the decimal place of the attribute value, the maximum value and the minimum value limit the value range of the int type, and the user can only configure values within the limited range.
[0067] The bool type configuration item is attribute selection mode and initial value. The attribute selection mode can be a check box or a drop-down selection, and this configuration is used to control the display mode of the bool attribute on the page; the initial value is used to configure the initial value of the attribute when the object is created.
[0068] The key-value pair type configuration item is a row of key-value, and multiple key-value pairs can be added through the form button. The key is the interface display value, the value is the submission value, and the drop-down list is used for display.
[0069] DateTime type configuration item is read-write state, initial value and mode. Read-write state can be read-write or read-only; initial value is used to configure the initial value of the property when the object is created; mode can be date or date plus time.
[0070] Reference point value type configuration item is point property, point category and value attribute, three configuration items are used to filter referenceable points.
[0071] Reference object type configuration item is object type, which is used to filter reference object classification.
[0072] Picture type configuration item is read-write state and initial value. Read-write state can be read-write or read-only; initial value is used to configure the initial value of the property when the object is created.
[0073] Automatic creation of point configuration item is point property, point category and value attribute, three configuration items are used to define the related attributes of automatically created points.
[0074] Video channel attribute has no configurable item.
[0075] After creating the corresponding attribute, the related configuration of the attribute will be stored as JSON format data in the custom attribute field of the object model.
[0076] (3) Select the object model that has been configured on the web side, create the object instance of the model, and the web page dynamically generates the form according to the model configuration. After filling in the form data, JSON format data is submitted to the back-end server through the HTTP interface; at the same time, object instances directly allow the creation of parent-child relationship to form a hierarchical structure, which can be applied to define strongly related devices, such as vehicle and vehicle terminal, vehicle and vehicle camera, substation and power supply, area controller and power supply.
[0077] Specifically, the form attribute is divided into basic attribute and custom attribute, wherein the basic attribute is automatically generated according to the object model classification, and the model belongs to the following basic attributes: license plate number, vehicle number, speed limit value, department, vehicle belongs to.
[0078] When the selected category is other categories except auxiliary transportation, the following basic attributes are included: subsystem number, remarks, internal code, external code, S\N code, operation status, installation location, factory date.
[0079] Custom attributes are automatically generated according to object model configuration, and the required elements are dynamically rendered on the web side by reading the category and configuration item of the attribute.
[0080] string type is a text input box, which configures the default value of the input box according to the initial value, and configures the input state of the input box according to read-only or read-write. If it is read-only, it cannot be input and only the default value is displayed; if it is read-write, it can be normally input.
[0081] int type renders different page elements according to attribute selection mode. If it is an input box, the page is rendered as a numerical input box, the limit type is an integer, the default value of the numerical input box is configured according to the initial value, the input state of the input box is configured according to read-only or read-write, and the value range of the input box is displayed according to the maximum value and the minimum value. If it is a drop-down selection, the page is rendered as a drop-down box component, and the drop-down item content is configured according to the maximum value and the minimum value.
[0082] decimal type is a numerical input box, the number of decimal places of the component is configured according to the number of decimal places, and the value range of the input box is displayed according to the maximum value and the minimum value.
[0083] bool type renders different page elements according to attribute selection mode. If it is a checkbox, the page is rendered as a checkbox component, and the default value of the component is set according to the initial value. If the initial value is true, the checkbox is checked by default, and if the initial value is false, the checkbox is not checked. If the selection mode is a drop-down selection, the page is rendered as a drop-down box component, and the drop-down options are set to True and False.
[0084] DateTime type is a date display component, the input state of the date component is configured according to the read-write state, the default date of the component is configured according to the initial value, and the initial value date cannot be modified if the read-write state is read-only. The read-write state is read-write, and the initial value date can be modified normally. The display mode of the date component is modified according to the mode configuration item. If the mode is date, the component only displays date, and if the mode is date plus time, the date component displays date and time and provides actual selection when selected.
[0085] Reference point value type is a drop-down box, and the points are filtered according to the point property, point category and value attribute in the attribute configuration, and these points are used as the selectable content of the drop-down box.
[0086] Reference object type is a drop-down box, and all objects that meet the conditions are filtered according to the object type in the attribute configuration, and these objects are used as the selectable content of the drop-down box.
[0087] Picture type uses a picture display component to display the picture configured by default, and whether the component can be modified is configured according to the read-write state. If the read-write state is read-write, the picture can be modified, and if the read-write state is read-only, the picture cannot be modified.
[0088] Auto-create point type is a text box that cannot be edited, and has no value by default. After submitting the form, a point is dynamically created according to the point property, point category and value attribute configured by the attribute, and the ID of the point is bound to the attribute.
[0089] Video channel type is a text box, and has no value by default.
[0090] After the form is submitted, a corresponding object instance table will be created based on the object model configuration. Basic attributes will be saved to the corresponding data table fields, while custom attributes will be integrated into JSON format data and stored in a single field.
[0091] (4) Manually maintain or assign values to object instance attributes via various communication protocols. Text input boxes, numeric input boxes, dropdown lists, checkboxes, and image selection components in forms can be maintained manually or by calling HTTP interfaces. Automatically created measurement point configurations can be queried via HTTP interfaces to find the measurement point IDs associated with object attributes, and then the configurations for automatically created measurement points can be queried or maintained using these IDs. The real-time values and status values of automatically created measurement points can be maintained via various communication protocols, such as Modbus, MQTT, text protocols, and OPC protocols.
[0092] (5) Query and display the object data or perform statistical summary display according to actual needs. When a specific type of device is needed, a query can be performed using the device's English name via the HTTP interface. The obtained device object attributes are associated with their English names. The JSON structure of the object data is as follows: {
[0093] "Data":{
[0094] "UID":2082196274826240,
[0095] "ObjectTypeId":1902835322596353,
[0096] "IsDeleted":0,
[0097] "DeviceID":2082196274826240,
[0098] "DeviceCode":"84",
[0099] "DeviceType":0,
[0100] "DeviceModel":null,
[0101] "SystemID":1881778480344065,
[0102] "DeviceName":"03 Return air 2300 meters @84",
[0103] "DeviceSN":"0",
[0104] "ProvidePoints":null,
[0105] "DeviceRunState": 1,
[0106] "ParentDeviceID": 0,
[0107] "BelongChannelIDs": "1916858319821825",
[0108] "PositionID": 1980685864399873,
[0109] "ManufactureDate": "2024-01-07T15:55:48+08:00", "PrivateAttr": null,
[0110] "CreateTime": "2024-01-07T15:56:41+08:00", "UpdateTime": "2024-01-07T15:56:41+08:00", "Remark": null,
[0111] "KID": 0,
[0112] "StatusDioPointID": "2082196274838529_2",
[0113] "JsonCols": "",
[0114] "SystemIDs": "",
[0115] "CarOverTime": 0,
[0116] "CarNoEntry": "1",
[0117] "UpDownMineJudge": "0",
[0118] "LocationStationState": "2082196274848769_2",
[0119] "LocatePosition": "2",
[0120] "LocateMode": "1",
[0121] "ObjectTypeEnName": "LocationStation"
[0122] },
[0123] "IsSuccessful": 1,
[0124] "Message": "Call successful",
[0125] "Error": null
[0126] When it is necessary to obtain the external code of the device, this property can be accessed through the method of Device.DeviceCode. The methods for obtaining other properties are similar.
[0127] The entire object tree can be obtained through the http interface, and a certain device or its sub-devices can be accessed through the hierarchical structure.
[0128] The real-time values and property values of the associated measurement points of all objects can be obtained through the http interface.
[0129] Taking the creation of a positioning base station object as an example, the first step is to create a positioning base station model. The Chinese name of the model is positioning base station, and the English name is LocationStation. Select the classification monitoring device. The data submitted through the HTTP interface is {
[0130] "CategoryId": 10,
[0131] "ObjectTypeName": "Positioning base station",
[0132] "ObjectTypeEnName": "LocationStation",
[0133] "ChildrenObjectTypes": [],
[0134] "Remark": null,
[0135] "FixedObjectTypes": []
[0136] }
[0137] The second step is to create the custom properties of the positioning base station model. The custom properties of the positioning base station include
[0138] Locate mode, English name LocateMode, type key-value pair, including two key-value pairs. Key 1 is precise positioning, and value 1 is 1. Key 2 is area positioning, and value 2 is 2.
[0139] Base station location, English name LacatePosition, type key-value pair, including four key-value pairs. Key 1 is above ground, value 1 is 1. Key 2 is underground, value 2 is 2. Key 3 is ground yard, value 3 is 3. Key 4 is bottom yard, value 4 is 4.
[0140] Base station communication status, English name LocationStationState, type: automatically created measurement point, measurement point nature: digital quantity, measurement point category: locating base station, measurement point value: real-time value.
[0141] Vehicle entry is prohibited. The English name is CarNoEntry. It is a key-value pair, containing two key-value pairs: key 1 is no and value 1 is 1, and key 2 is yes and value 2 is 2.
[0142] Vehicle dwell time, English name CarOverTime, type int, initial value 0, attribute selection mode input box, maximum value 65535, minimum value 0.
[0143] Up-downMineJudge is a key-value pair algorithm containing three pairs: key 1 is empty and value 1 is 0; key 2 is the wellhead base station and value 2 is 1; and key 3 is the well bottom base station and value 3 is 2.
[0144] Taking vehicle dwell time as an example, here's an example of data submission via HTTP interface:
[0145] {
[0146] InitialValue:"0" / / Initial value
[0147] IsContainTime:0
[0148] IsMainProp:0
[0149] IsRangeMode:0
[0150] IsReadOnly:0
[0151] KeyValues:"string"
[0152] MaximalValue: 65535 / / Maximum value
[0153] MinimalValue: 0 / / Minimum value
[0154] ObjectTypeID:1902835322596353
[0155] PointValueDecimalDigits:0
[0156] PropDataType:1
[0157] PropEnName:"CarOverTime" / / Attribute name (English)
[0158] PropName: "Vehicle Dwell Time Exceedance" / / Attribute Chinese Name
[0159] PropSort:0
[0160] RefObjectTypeId:0
[0161] SelectMode:1 / / Mode selection
[0162] StateGroupID:"string"
[0163] TrueOrFalseShow:"string"
[0164] }
[0165] The third step is to create a positioning base station object. The object name is "Test Positioning Base Station," the object type is the positioning base station created in the first step, the subsystem is "Test Subsystem," the external code is 1, the S / N code is 0, the operational status is "In Use," the installation location is 03 Jiaoyun 12 Lianxiang, the manufacturing date is November 6, 2024, the associated channel is "Test Channel," the vehicle dwell timeout is 0, the positioning method is "Precise Positioning," the base station location is above the well, vehicle access is prohibited (No), and access to / from the well is not allowed. Example of HTTP interface data submission:
[0166] {"MainJsonData":"
[0167] {"DeviceName":"Test Base Station", / / Device Name
[0168] \"SystemID\":1881778480344065,
[0169] "DeviceID":0,
[0170] "DeviceCode": "1", / / External encoding
[0171] "DeviceSN": "0", / / S / N code
[0172] "DeviceRunState": 1, / / Operation status, 1 indicates it is in use.
[0173] \"PositionID\":2046674277952513,
[0174] "ManufactureDate": "2024-11-06T05:50:21.200Z", / / Manufacture date
[0175] "BelongChannelIDs":"2128606561760257",
[0176] "Remark":"", "SystemIDs":""
[0177] "CustomerJsonData":"{
[0178] "CarOverTime":0, / / vehicle stay timeout
[0179] "LocateMode":"1", / / location mode
[0180] "LocatePosition":"1", / / base station location
[0181] "CarNoEntry":"1", / / vehicle ban
[0182] "UpDownMineJudge":"0" / / up and down mine judge
[0183] "}"
[0184] The fourth step can manually modify the saved part of the attribute, such as external code, vehicle stay time, location mode, base station location and vehicle ban, and update the state point value of the base station object after obtaining the base station state by other means.
[0185] The fifth step can obtain the current base station state through the object real-time state interface, and the return value of the real-time state interface is as follows:
[0186] {
[0187] ID:"2136032646009857_2"
[0188] PointName:"test base station$$ location base station" / / point name
[0189] PointState:{
[0190] StateGroupID:0
[0191] StateID:0
[0192] StateImageUrl: / / state corresponding image
[0193] "data:image / png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YV jAAAABGdBTMjUwOTIwMTA3MDIzXzYyX1swXXsq+B4AAAAASUVORK5CYII="
[0194] StateText: "Normal" / / Text corresponding to the state
[0195] StateValue: 0 / / Current state value
[0196] UID:0}
[0197] PointTypeName: "Location Base Station" / / Measurement Point Category Name
[0198] PointUnit:""
[0199] PointValueTypeName: "Digital Quantity"
[0200] S:1
[0201] S2:0
[0202] S3:0
[0203] SystemName: "Test Subsystem" / / Subsystem Name
[0204] T:"0001-01-01T00:00:00+08:00" / / Measurement point value update time
[0205] T2:"0001-01-01T00:00:00+08:00" / / Data acquisition time
[0206] V:"0
[0207] ValueStringShow:""
[0208] }
[0209] Finally, it should be noted that the above examples are merely specific embodiments of the present application, and are used to illustrate the technical solutions of the present application, but are not intended to limit the present application. The protection scope of the present application is not limited thereto. Although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that any person skilled in the art can still modify or easily think of changes to the technical solutions recorded in the foregoing examples, or make equivalent replacements to some of the technical features, within the technical range disclosed by the present application. These modifications, changes or replacements do not cause the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. An object-oriented modeling method, characterized in that, Includes the following steps: (1) Create a new object model through the web form, configure the category, Chinese name, English name and remarks. When the form data is submitted, it is organized into JSON format and submitted to the backend server through the HTTP interface. The backend server dynamically creates the corresponding data table in the database according to the English name of the object model. The basic attributes in the data table are separate fields, and a field is also created to store all custom attributes. (2) On the web, select the model that has been created, fill in the form with the custom attribute information of the object model, and submit the JSON data to the backend server through the HTTP interface. After the backend server parses the configuration, it organizes all the custom attributes and saves them to the custom attribute field of the object model table. (3) Select the pre-configured object model on the web, create an object instance of the model, and the web page dynamically generates a form according to the model configuration. After filling in the form data, submit the JSON format data to the backend server through the HTTP interface. At the same time, the object instance can directly create parent-child relationships to form a hierarchical structure. (4) Manually maintain or assign values to the attributes of object instances through various communication protocols; text input boxes, number input boxes, drop-down boxes, check boxes, and image selection components in forms can be maintained manually or by calling the HTTP interface for data maintenance; the configuration related to the automatic creation of measurement points can be queried through the HTTP interface to find the measurement point ID associated with the object attributes, and then the configuration of the automatic creation of measurement points can be queried or maintained through the ID; the real-time value and status value of the automatic creation of measurement points can be maintained through various communication protocols; (5) Query and display object data or perform statistical summary display according to actual needs; when a certain type of device is needed, query the device by its English name through the HTTP interface, and associate the obtained device object attributes with their English names.
2. The object-oriented modeling method according to claim 1, characterized in that, In step (1), the category selected when creating a new object model is the preset data, which includes the following types: monitoring equipment, communication equipment, auxiliary transportation equipment, mining equipment, tunneling equipment, main transportation equipment, power supply and distribution equipment, ventilation equipment, drainage equipment, reservoir, and roadway.
3. The object-oriented modeling method according to claim 2, characterized in that, When the selected category is auxiliary transportation, the following basic attributes are included: license plate number, vehicle number, speed limit, department, and vehicle ownership. When the selected category is other than auxiliary transportation, the following basic attributes are included: subsystem number, remarks, internal code, external code, S / N code, commissioning status, installation location, and manufacturing date.
4. The object-oriented modeling method according to claim 1, characterized in that, In step (2), the form content includes the attribute name, the English name of the attribute, the attribute type, and the configuration items of the corresponding type.
5. The object-oriented modeling method according to claim 4, characterized in that, In step (2), the custom attribute types are: String, int, decimal, bool, key-value pair, DateTime, reference test point value, reference object, image, automatically created test point, and video channel.
6. The object-oriented modeling method according to claim 1, characterized in that, In step (3), the form attributes are divided into basic attributes and custom attributes. The basic attributes are automatically generated according to the object model classification. When the model belongs to the auxiliary transportation category, it includes the following basic attributes: license plate number, vehicle number, speed limit value, department, and vehicle ownership. When the selected category is other than auxiliary transportation, it includes the following basic attributes: subsystem number, remarks, internal code, external code, S / N code, commissioning status, installation location, and manufacturing date. Custom attributes are automatically generated according to the object model configuration. The web client dynamically renders the required elements by reading the attribute category and configuration items.
7. The object-oriented modeling method according to claim 1, characterized in that, In step (4), various communication protocols are used, including Modbus, MQTT, text, and OPC.
8. The object-oriented modeling method according to claim 1, characterized in that, In step (5), when it is necessary to obtain the device external code, the attribute is accessed through Device.DeviceCode. Other attributes are obtained in a similar way. The entire object tree is obtained through the HTTP interface, and a device or its sub-devices are accessed through the hierarchical structure. The real-time values and attribute values of the associated measurement points of all objects are obtained through the HTTP interface.
Citation Information
Patent Citations
Model maintenance dynamic self-adaption method, device and system based on regulation and control cloud and storage medium
CN111626444A
Extensible form configuration method and system based on object-oriented thought
CN115659932A