Objective modeling method
Through the object modeling method, the equipment model is dynamically configured, which solves the problem of custom development of data access and display of multiple equipment in coal mine enterprises, and achieves the effect of reducing development workload and improving maintenance capabilities.
Patent Information
- Application Number
- CN202411597995.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-11
AI Technical Summary
In the information construction of coal mine enterprises, the data access and display of multiple equipment need to be customized and developed, resulting in huge workload and inconvenient maintenance.
The object modeling method is adopted to dynamically configure the equipment model, reduce the workload of customized development and support unified maintenance of equipment data. The specific steps include creating a new object model through the web-end form, configuring basic attributes and custom attributes, dynamically generating forms and submitting JSON format data to the backend server, and dynamically creating data tables and saving custom attributes.
It has achieved the reduction of customized development workload, simplified the access and display of equipment data, improved the unified maintenance capability of equipment data, and supported multiple communication protocols for data maintenance.
Smart Images

Figure CN119537465A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computers, and in particular relates to an object-oriented modeling method. Background Art
[0002] In order to adapt to the development trend of informatization and implement the various guiding policies of the state on the informatization of coal mining enterprises, coal mining enterprises have connected to various types of monitoring systems over the years. Various types of systems correspond to a wide variety of hardware devices. In the process of informatization construction, it is usually necessary to collect equipment data for statistics or display. When a data platform needs to access data from multiple devices, custom development of data access and display for each device is a huge workload and difficult to maintain in the later stage.
[0003] Therefore, it is necessary to propose an object-oriented modeling method to solve the problems of different properties of multiple devices, high customized development costs, and inconvenient later maintenance. Summary of the invention
[0004] The purpose of the present invention is to provide an object-oriented modeling method, which can adapt to various different devices by dynamically configuring the model of the device, thereby reducing the workload of customized development and being more conducive to unified maintenance of the equipment.
[0005] The present invention proposes an object-oriented modeling method, comprising: creating a new object model through a web-side form, configuring the category, Chinese name, English name and remarks, organizing the form data into data in JSON format when submitting, submitting it to a back-end server through an HTTP interface, and the back-end server dynamically creating a corresponding data table in a database according to the configuration, wherein the basic attributes in the data table are separate fields, and creating a field to save all custom attributes at the same time; after the object model is created, creating custom attributes of the object model through a form on the web side, submitting the data in JSON format to the back-end server through the HTTP interface, and after the back-end server parses the configuration, collating all the custom attributes and saving them in the custom attribute field of the object model table; after the web side selects the model, the page dynamically generates a form according to the model configuration, and after filling in the form data, submitting the data in JSON format to the back-end server through the HTTP interface; some types of data of the object can be maintained manually, and some types of data can be maintained through multiple communication protocols.
[0006] The detailed steps of the object-oriented modeling method of the present invention are as follows:
[0007] (1) Create a new object model through the web form, configure the category, Chinese name, English name and remarks, organize the form data into JSON format when submitting, and submit it to the back-end server through the HTTP interface. The back-end server dynamically creates a corresponding data table in the database based on the English name of the object model. The basic attributes in the data table are separate 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, 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 tunnel; selecting different categories will make the object model contain different basic attributes;
[0009] When the selected category is auxiliary transportation, it contains the following basic attributes: license plate number, vehicle number, speed limit, department, and vehicle ownership;
[0010] When the selected category is other than auxiliary transport, the following basic attributes are included: subsystem number, remarks, internal code, external code, S\N code, commissioning status, installation location, and factory date;
[0011] The Chinese name is used for display purposes, and the English name is related to the creation of the database table. Considering the naming restrictions of the database itself and the rationality of the name, the English name must start with a letter and allow a combination of letters, numbers, and the character "_". The length is 3 to 40 characters.
[0012] (2) Select the created model on the web side, fill in the form with the custom attribute information of the object model, and submit the data in JSON format to the backend server through the HTTP interface. After the backend server parses the configuration, it organizes and saves all custom attributes to the custom attribute field of the object model table.
[0013] Specifically, the form content includes the attribute name, attribute English name, attribute type and configuration items of the corresponding type. The English name is used as the basis for attribute access in subsequent logic. Therefore, the attribute English name must start with a letter and allows a combination of letters, numbers and the character "_". The length is 3 to 40.
[0014] Custom attribute types include: String, int, decimal, bool, key-value pair, DateTime, reference point value, reference object, image, automatically created point, and video channel.
[0015] String type configuration items are read-write status and initial value. The read-write status can be read-write or read-only. The read-write status is used to configure whether the attribute is read-only or read-write-enabled. The initial value is used to configure the initial value of the attribute when the object is created.
[0016] The configuration items of int type 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, this configuration is used to control whether the int attribute is displayed on the page using an input box or a drop-down enumeration; the maximum value and minimum value limit the value range of the int type, and the user can only configure the value within the limited range;
[0017] The decimal type configuration items are read-write status, initial value, number of 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 number of decimal places is used to control the number of decimal places of the attribute value. The maximum value and minimum value limit the value range of the int type. Users can only configure values within the limited range.
[0018] The bool type configuration items are the property selection mode and initial value. The property selection mode can be selected by checking the box or selecting from the drop-down list. This configuration item is used to control the display method of the bool property on the page; the initial value is used to configure the initial value of the property when the object is created.
[0019] The configuration item of the key-value pair type is a row of key values. Multiple key-value pairs can be added through the form button. The key is the interface display value, and the value is the submitted value, which is displayed using a drop-down list.
[0020] The configuration items of DateTime type 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 plus time.
[0021] The reference point value type configuration items are the point property, point category and value attribute. These three configuration items are used to filter the referenced points.
[0022] The reference object type configuration item is the object type, which is used to filter the category to which the reference object belongs.
[0023] The image 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 property when the object is created.
[0024] The configuration items for automatically creating measuring points are measuring point properties, measuring point categories, and value attributes. These three configuration items are used to define the relevant attributes of automatically creating measuring points.
[0025] There are no configurable items for video channel properties.
[0026] After the corresponding attribute is created, the related configuration of the attribute will be organized as data in JSON format and stored in the custom attribute field of the object model.
[0027] (3) Select the configured object model on the web side and create an object instance of the model. The web page dynamically generates a form based on the model configuration. After filling in the form data, the JSON format data is submitted to the backend server through the HTTP interface. At the same time, the object instance directly allows the creation of parent-child relationships to form a hierarchical structure, which can be used to define strongly related devices, such as vehicles and on-board terminals, vehicles and on-board cameras, substations and power supplies, and regional controllers and power supplies.
[0028] Specifically, form attributes are divided into basic attributes and custom attributes. Basic attributes are automatically generated according to the object model classification. When the model category is auxiliary transportation, it includes the following basic attributes: license plate number, vehicle number, speed limit value, department, and vehicle affiliation.
[0029] 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 factory date.
[0030] Custom attributes are automatically generated based on the object model configuration, and the required elements are dynamically rendered on the web side by reading the attribute category and configuration items.
[0031] The string type is a text input box. The default value of the 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. If it is read-only, no input is allowed and only the default value is displayed. If it is read-write, normal input is allowed.
[0032] The int type renders different page elements according to the attribute selection mode. If it is an input box, the page is rendered as a numeric input box, the restriction type is integer, the default value of the numeric 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 and minimum values; 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 and minimum values.
[0033] The decimal type is a numeric input box. The number of decimal places of the component is limited according to the configuration item of retaining decimal places, and the value range of the input box is displayed according to the maximum and minimum values.
[0034] The bool type renders different page elements according to the attribute selection mode. If it is a check box, 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, it is checked by default, and if it is false, it is not checked. If the selection mode is 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] The DateTime type is a date display component. The input state of the date component is configured according to the read-write state, and the default date of the component is configured according to the initial value. If the read-write state is read-only, the initial value date cannot be modified. If the read-write state is read-write, the initial value date can be modified normally. Modify the display mode of the date component according to the mode configuration item. If the mode is date, the component only displays the date. If the mode is date plus time, the date component displays the date and time and provides actual selection when selecting.
[0036] The reference point value type is a drop-down box. The measuring points are filtered according to the measuring point properties, measuring point categories and value attributes in the attribute configuration, and these measuring points are used as optional contents in the drop-down box.
[0037] The reference object type is a drop-down box. According to the object type in the property configuration, all eligible objects are filtered and these objects are used as optional contents in the drop-down box.
[0038] The picture type uses the picture display component, which displays the picture configured with the initial value by default. Whether the component can be modified is configured based on the read-write status. If the read-write status is read-write, the picture can be modified. If the read-write status is read-only, the picture cannot be modified.
[0039] The automatically created measurement point type is a non-editable text box with no value by default. After the form is submitted, a measurement point will be dynamically created based on the measurement point properties, measurement point categories, and value attributes configured in the attribute, and the measurement point ID will be bound to the attribute.
[0040] The video channel type is a text box and has no value by default.
[0041] After the form is submitted, the corresponding object instance table will be created according to the object model configuration, the basic attributes will be saved to the corresponding data table fields, and the custom attributes will be integrated into JSON format data and saved in one field.
[0042] (4) Manually maintain or assign values to the attributes of object instances through various communication protocols. Text input boxes, numeric input boxes, drop-down boxes, check boxes, and image selection components in the form can be maintained manually or by calling the HTTP interface for data maintenance. The configuration related to the automatically created measurement point can query the measurement point ID associated with the object attribute through the HTTP interface, and then query or maintain the configuration of the automatically created measurement point through the ID. The real-time value and status value of the automatically created measurement point can be maintained through various communication protocols, such as modbus protocol, mqtt protocol, text protocol, and OPC protocol.
[0043] (5) Query and display object data or perform statistical summary display according to actual needs. When a certain type of equipment is needed, the HTTP interface can be used to query the equipment English name and the acquired equipment object attributes can be associated with the English name.
[0044] When you need to obtain the device external code, you can access this property through Device.DeviceCode. The methods for obtaining other properties are similar.
[0045] The entire object tree can be obtained through the http interface, and a device or its sub-devices can be accessed through the hierarchical structure.
[0046] The real-time values and attribute values of all objects' associated measurement points can be obtained through the http interface.
[0047] The beneficial effects of the present invention are: the object-oriented modeling method can establish models of different devices through dynamic configuration, thereby reducing the workload of customized development through configuration methods, supporting multiple methods to maintain device data, providing HTTP interface for data query for large-screen display or data statistics, and the interface returns JSON data in a fixed format, which is convenient for data consumers to use. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a flowchart of the object-oriented modeling method of the present invention. DETAILED DESCRIPTION
[0049] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.
[0050] like Figure 1 As shown, the present invention provides a modeling method, comprising:
[0051] Object model creation: Create a new object model through the web form, configure the category, Chinese name, English name and remarks, organize the form data into JSON format when submitting, and submit it to the back-end server through the HTTP interface. The back-end server dynamically creates the corresponding data table in the database according to the configuration, that is, creates basic attributes. The basic attributes in the data table are separate fields, and a field is created to save all custom attributes. After the object model is created, create custom attributes of the object model through the form on the web, and submit the JSON format data to the back-end server through the HTTP interface. After the back-end server parses the configuration, it organizes all custom attributes and saves them to the custom attribute field of the object model table, that is, creates custom attributes;
[0052] Object instance creation: Select the configured object model on the web side and create an object instance of the model. The web page dynamically generates a form based on 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. At the same time, the object instance directly allows the creation of parent-child relationships to form a hierarchical structure.
[0053] Object instance data assignment: maintained manually or by parsing third-party data sources;
[0054] Usage data: Display object data on a large screen or perform statistical summary display according to actual needs; when a certain type of equipment is needed, report query can be performed through the http interface using the English name of the equipment, and the acquired equipment object attributes can be associated with the English name, and alarms can be issued for abnormal analysis and data.
[0055] The detailed steps of the present invention are as follows:
[0056] (1) Create a new object model through the web form, configure the category, Chinese name, English name and remarks, organize the form data into JSON format when submitting, and submit it to the back-end server through the HTTP interface. The back-end server dynamically creates a corresponding data table in the database based on the English name of the object model. The basic attributes in the data table are separate fields, and a field is created to save all custom attributes.
[0057] Specifically, the category selected when creating a new object model is 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 tunnel; selecting different categories will make the object model contain different basic attributes;
[0058] When the selected category is auxiliary transportation, it contains the following basic attributes: license plate number, vehicle number, speed limit, department, and vehicle ownership;
[0059] When the selected category is other than auxiliary transport, the following basic attributes are included: subsystem number, remarks, internal code, external code, S\N code, commissioning status, installation location, and factory date;
[0060] The Chinese name is used for display purposes, and the English name is related to the creation of the database table. Considering the naming restrictions of the database itself and the rationality of the name, the English name must start with a letter and allow a combination of letters, numbers, and the character "_". The length is 3 to 40 characters.
[0061] (2) Select the created model on the web side, fill in the form with the custom attribute information of the object model, and submit the data in JSON format to the backend server through the HTTP interface. After the backend server parses the configuration, it organizes and saves all custom attributes to the custom attribute field of the object model table.
[0062] Specifically, the form content includes the attribute name, attribute English name, attribute type and configuration items of the corresponding type. The English name is used as the basis for attribute access in subsequent logic. Therefore, the attribute English name must start with a letter and allows a combination of letters, numbers and the character "_". The length is 3 to 40.
[0063] Custom attribute types include: String, int, decimal, bool, key-value pair, DateTime, reference point value, reference object, image, automatically created point, and video channel.
[0064] String type configuration items are read-write status and initial value. The read-write status can be read-write or read-only. The read-write status is used to configure whether the attribute is read-only or read-write-enabled. The initial value is used to configure the initial value of the attribute when the object is created.
[0065] The configuration items of int type 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, this configuration is used to control whether the int attribute is displayed on the page using an input box or a drop-down enumeration; the maximum value and minimum value limit the value range of the int type, and the user can only configure the value within the limited range;
[0066] The decimal type configuration items are read-write status, initial value, number of 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 number of decimal places is used to control the number of decimal places of the attribute value. The maximum value and minimum value limit the value range of the int type. Users can only configure values within the limited range.
[0067] The bool type configuration items are the property selection mode and initial value. The property selection mode can be selected by checking the box or selecting from the drop-down list. This configuration item is used to control the display method of the bool property on the page; the initial value is used to configure the initial value of the property when the object is created.
[0068] The configuration item of the key-value pair type is a row of key values. Multiple key-value pairs can be added through the form button. The key is the interface display value, and the value is the submitted value, which is displayed using a drop-down list.
[0069] The configuration items of DateTime type 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 plus time.
[0070] The reference point value type configuration items are the point property, point category and value attribute. These three configuration items are used to filter the referenced points.
[0071] The reference object type configuration item is the object type, which is used to filter the category to which the reference object belongs.
[0072] The image 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 property when the object is created.
[0073] The configuration items for automatically creating measuring points are measuring point properties, measuring point categories, and value attributes. These three configuration items are used to define the relevant attributes of automatically creating measuring points.
[0074] There are no configurable items for video channel properties.
[0075] After the corresponding attribute is created, the related configuration of the attribute will be organized as data in JSON format and stored in the custom attribute field of the object model.
[0076] (3) Select the configured object model on the web side and create an object instance of the model. The web page dynamically generates a form based on the model configuration. After filling in the form data, the JSON format data is submitted to the backend server through the HTTP interface. At the same time, the object instance directly allows the creation of parent-child relationships to form a hierarchical structure, which can be used to define strongly related devices, such as vehicles and on-board terminals, vehicles and on-board cameras, substations and power supplies, and regional controllers and power supplies.
[0077] Specifically, form attributes are divided into basic attributes and custom attributes. Basic attributes are automatically generated according to the object model classification. When the model category is auxiliary transportation, it includes the following basic attributes: license plate number, vehicle number, speed limit value, department, and vehicle affiliation.
[0078] 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 factory date.
[0079] Custom attributes are automatically generated based on the object model configuration, and the required elements are dynamically rendered on the web side by reading the attribute category and configuration items.
[0080] The string type is a text input box. The default value of the 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. If it is read-only, no input is allowed and only the default value is displayed. If it is read-write, normal input is allowed.
[0081] The int type renders different page elements according to the attribute selection mode. If it is an input box, the page is rendered as a numeric input box, the restriction type is integer, the default value of the numeric 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 and minimum values; 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 and minimum values.
[0082] The decimal type is a numeric input box. The number of decimal places of the component is limited according to the configuration item of retaining decimal places, and the value range of the input box is displayed according to the maximum and minimum values.
[0083] The bool type renders different page elements according to the attribute selection mode. If it is a check box, 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, it is checked by default, and if it is false, it is not checked. If the selection mode is 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] The DateTime type is a date display component. The input state of the date component is configured according to the read-write state, and the default date of the component is configured according to the initial value. If the read-write state is read-only, the initial value date cannot be modified. If the read-write state is read-write, the initial value date can be modified normally. Modify the display mode of the date component according to the mode configuration item. If the mode is date, the component only displays the date. If the mode is date plus time, the date component displays the date and time and provides actual selection when selecting.
[0085] The reference point value type is a drop-down box. The measuring points are filtered according to the measuring point properties, measuring point categories and value attributes in the attribute configuration, and these measuring points are used as optional contents in the drop-down box.
[0086] The reference object type is a drop-down box. According to the object type in the property configuration, all eligible objects are filtered and these objects are used as optional contents in the drop-down box.
[0087] The picture type uses the picture display component, which displays the picture configured with the initial value by default. Whether the component can be modified is configured based on the read-write status. If the read-write status is read-write, the picture can be modified. If the read-write status is read-only, the picture cannot be modified.
[0088] The automatically created measurement point type is a non-editable text box with no value by default. After the form is submitted, a measurement point will be dynamically created based on the measurement point properties, measurement point categories, and value attributes configured in the attribute, and the measurement point ID will be bound to the attribute.
[0089] The video channel type is a text box and has no value by default.
[0090] After the form is submitted, the corresponding object instance table will be created according to the object model configuration, the basic properties will be saved to the corresponding data table fields, and the custom properties will be integrated into JSON format data and saved in one field.
[0091] (4) Manually maintain or assign values to the attributes of object instances through various communication protocols. Text input boxes, numeric input boxes, drop-down boxes, check boxes, and image selection components in the form can be maintained manually or by calling the HTTP interface for data maintenance. The configuration related to the automatically created measurement point can query the measurement point ID associated with the object attribute through the HTTP interface, and then query or maintain the configuration of the automatically created measurement point through the ID. The real-time value and status value of the automatically created measurement point can be maintained through various communication protocols, such as modbus protocol, mqtt protocol, text protocol, and OPC protocol.
[0092] (5) Query and display the object data or perform statistical summary display according to actual needs. When a certain type of equipment is needed, the http interface can be used to query the equipment English name. The acquired equipment object attributes are associated with the English name. The object data JSON structure 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 2300m@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 you need to obtain the device external code, you can access this property through Device.DeviceCode. The methods for obtaining other properties are similar.
[0127] The entire object tree can be obtained through the http interface, and a device or its sub-devices can be accessed through the hierarchical structure.
[0128] The real-time values and attribute values of all objects' associated measurement points 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 category monitoring device. The HTTP interface submits data as {
[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 custom attributes for the positioning base station model. The positioning base station custom attributes include
[0138] Positioning mode, English name LocateMode, type key-value pair, contains two pairs of key-value pairs, key 1 precise positioning, value 1 is 1, key 2 regional positioning, value 2 is 2.
[0139] Base station location, English name LacatePosition, type key-value pair, contains four pairs of key-value pairs, key 1 above the well, value 1 is 1, key 2 below the well, value 2 is 2, key 3 ground parking lot, value 3 is 3, key 4 bottom of the well parking lot, value 4 is 4.
[0140] The communication status of the base station is called LocationStationState in English. The type is automatically created measuring point. The nature of the measuring point is digital quantity. The category of the measuring point is positioning base station. The attribute of the measuring point value is real-time value.
[0141] Vehicle entry prohibited, English name CarNoEntry, type key-value pair, contains two pairs of key-value pairs, key 1 is no, value 1 is 1, key 2 is yes, 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] UpDownMineJudge, English name UpDownMineJudge, type key-value pair, contains three pairs of key-value pairs, key 1 is none, value 1 is 0, key 2 is wellhead base station, value 2 is 1, key 3 is well bottom base station, value 3 is 2.
[0144] Taking the vehicle dwell time as an example, the HTTP interface submits data example:
[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" / / Property English name
[0158] PropName: "Vehicle stay timeout" / / Property 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 the test subsystem, the external code is 1, the S / N code is 0, the commissioning status is in use, the installation location is 03 Jiaoyun 12 Lianxiang, the factory date is November 6, 2024, the associated channel is the test channel, the vehicle stay timeout is 0, the positioning method is precise positioning, the base station location is above the well, the vehicle entry is no, and the upper and lower wells are no. HTTP interface submission data example:
[0166] {"MainJsonData":"
[0167] {\"DeviceName\":\"Test base station\", / / Device name
[0168] \"SystemID\":1881778480344065,
[0169] \"DeviceID\":0,
[0170] \"DeviceCode\":\"1\", / / External code
[0171] \"DeviceSN\":\"0\", / / S / N code
[0172] \"DeviceRunState\":1, / / Operation status, 1 means 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\", / / Vehicles are prohibited from entering
[0182] \"UpDownMineJudge\":\"0\ / / Up and down well judgment
[0183] "}"}
[0184] In the fourth step, you can manually modify and save some properties, such as external coding, vehicle dwell time, positioning method, base station location and vehicle entry prohibition, etc. After obtaining the base station status through other means, update the status measurement point value of the base station object.
[0185] The fifth step is to obtain the current base station status through the object real-time status interface. The real-time status interface return value example:
[0186] {
[0187] ID:"2136032646009857_2"
[0188] PointName: "Test base station$$Positioning base station" / / Test point name
[0189] PointState:
[0190] StateGroupID:0
[0191] StateID:0
[0192] StateImageUrl: / / The image corresponding to the state
[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: "Positioning base station" / / Measurement point category name
[0198] PointUnit: ""
[0199] PointValueTypeName: "Digital value"
[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 embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. An object-oriented modeling method, characterized in that: The steps include: (1) Create a new object model through the web form, configure the category, Chinese name, English name and remarks, organize the form data into JSON format 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 based on the English name of the object model. The basic attributes in the data table are separate fields, and a field is created to save all custom attributes; (2) Select the created model on the web side, fill in the form with the custom attribute information of the object model, and submit the data in JSON format to the backend server through the HTTP interface. After the backend server parses the configuration, it organizes and saves all the custom attributes to the custom attribute field of the object model table; (3) Select the configured object model on the web side and create an object instance of the model. The web page dynamically generates a form based on the model configuration. After filling in the form data, the JSON format data is submitted to the backend server through the HTTP interface. At the same time, the object instance directly allows the creation of parent-child relationships to form a hierarchical structure. (4) Manually maintain or assign values to the attributes of object instances through various communication protocols; the text input box, number input box, drop-down box, check box, and picture selection components in the form can be maintained manually or by calling the HTTP interface for data maintenance; the configuration related to the automatically created measurement point can query the measurement point ID associated with the object attribute through the HTTP interface, and then query or maintain the configuration of the automatically created measurement point through the ID. The real-time value and status value of the automatically created measurement point can be maintained through various communication protocols; (5) The object data is queried and displayed or statistically summarized and displayed according to actual needs; when a certain type of equipment is needed, a conditional query is performed using the English name of the equipment through the http interface, and the acquired equipment object attributes are associated with the English name.
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 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, reservoirs, and tunnels.
3. The object-oriented modeling method according to claim 2, characterized in that: When the selected category is auxiliary transportation, it includes the following basic attributes: license plate number, vehicle number, speed limit, 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 factory date.
4. The object-oriented modeling method according to claim 1, characterized in that: In step (2), the form content includes the attribute name, attribute English name, attribute type and 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 divided into: String, int, decimal, bool, key-value pair, DateTime, reference point value, reference object, image, automatically created 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, where the basic attributes are automatically generated according to the object model classification. When the model category is auxiliary transportation, the following basic attributes are included: license plate number, vehicle number, speed limit value, department, and vehicle affiliation; 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 factory date; custom attributes are automatically generated according to the object model configuration, and the required elements are dynamically rendered on the web side by reading the attribute category and configuration items.
7. The object-oriented modeling method according to claim 1, characterized in that: In step (4), the multiple communication protocols include modbus protocol, mqtt protocol, text protocol and OPC protocol.
8. The object-oriented modeling method according to claim 1, characterized in that: In step (5), when the device external code needs to be obtained, the property is accessed through Device.DeviceCode. The methods for obtaining other properties are similar. 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 property 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
Cross-platform application construction tool and method based on web in college scene
CN112860260A
Extensible form configuration method and system based on object-oriented thought
CN115659932A
Form design method and device, equipment and storage medium
CN118502756A
Method and apparatus for storing and retrieving data in a relational database using an object model
WO1997007470A1