Standard equipment library application method and system based on edge calculator
By building a standard equipment library in the industrial IoT system and managing equipment templates through a cloud platform, the automatic generation and one-click deployment of equipment point lists are achieved, solving the problems of complex equipment access configuration and low operation and maintenance efficiency, and improving system reliability and the uniformity of equipment management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHONGRUIHENG (BEIJING) TECH CO LTD
- Filing Date
- 2026-01-20
- Publication Date
- 2026-05-01
AI Technical Summary
In existing industrial IoT systems, device access configuration is complex and error-prone, lacks unified management and version control, and is difficult to achieve cross-project sharing and synchronization, resulting in low operation and maintenance efficiency.
By building a standard device library based on edge calculators, and using a cloud platform to store and manage device templates, the system enables automatic generation and one-click deployment of device point tables, supports unified access for multiple protocols and types of devices, and achieves centralized management and updates of templates through cloud version management.
Significantly reduces manual configuration time, improves system reliability and deployment efficiency, ensures consistent device configuration, supports the accumulation and sharing of device knowledge, reduces operational complexity, and enhances the efficiency of large-scale deployment and operation.
Smart Images

Figure CN121967218A_ABST
Abstract
Description
A method and system for applying a standard device library based on an edge calculator Technical Field
[0001] This invention relates to the fields of industrial automation and the Internet of Things, and in particular to a method and system for applying a standard device library based on an edge calculator. Background Technology
[0002] With the rapid development of the Industrial Internet of Things (IIoT), edge calculators play a crucial role in the field, undertaking key responsibilities such as device access, data acquisition and preprocessing, and downstream control execution. In existing IIoT systems, when connecting new devices, edge calculators typically require manual configuration of device point information by technicians. This includes basic parameters such as point name, data type, read / write attributes, and measurement range, as well as extended attributes related to communication, such as address, sampling period, unit conversion, and alarm thresholds. This process is highly repetitive and labor-intensive, with a long configuration chain and many steps, making it prone to configuration errors or inconsistencies due to human intervention. This can lead to data quality issues (such as type mismatch, incorrect unit conversion, and measurement range exceeding limits) and control risks (such as improper read / write permission settings and missing boundary conditions).
[0003] The diversity of industrial field devices and protocols further exacerbates configuration complexity. Devices from different manufacturers and models differ in register definitions, point semantics, and firmware versions. Common protocols such as Modbus, BACnet, OPC UA, and MQTT also exhibit inconsistencies at the implementation level, requiring engineers to repeatedly compile and adapt point tables for each type of device. Although some systems support local export / import of point table files to shorten configuration time or reuse within projects, there is still a lack of unified centralized management and version control, making it difficult to achieve cross-project device configuration sharing and synchronization. The resulting knowledge silos prevent the accumulation of best practices, make configuration changes untraceable, hinder difference comparison and auditing, and limit team collaboration and unified operation and maintenance across multiple sites.
[0004] In terms of equipment lifecycle management, existing methods cannot achieve batch synchronization and remote updates when equipment models are updated or locations are changed. They often require manual modification and verification on each edge node. This not only significantly increases operation and maintenance costs and manpower input, but may also lead to problems such as extended on-site downtime, inconsistent configuration status, and difficulty in managing change risks, severely restricting the efficiency of large-scale equipment deployment and operation and maintenance. These shortcomings are particularly pronounced in industrial scenarios requiring rapid expansion or frequent iterations (such as adding sensors, process adjustments, and switching energy consumption optimization strategies).
[0005] Furthermore, many enterprise-level systems lack unified standardized templates and knowledge bases for device model and point table management, focusing more on driver layer adaptation rather than the standardization and reuse of the configuration process. Simultaneously, limited cloud-edge collaboration capabilities make centralized version management, difference comparison, approval, and rollback of device point tables difficult, and a secure and compliant remote distribution and update mechanism is lacking. Even with the introduction of standard protocols (such as OPC UA and its accompanying specifications), implementation challenges remain in existing devices and heterogeneous field environments, leading to manual configuration and local file transfer remaining the mainstream practices in engineering.
[0006] Therefore, current industrial IoT device configuration and site management rely on manual operation, lack unified centralized management and version control, and are difficult to share and synchronize across different projects. Furthermore, batch synchronization and remote updates are impossible when device models are updated or site locations change, significantly reducing the efficiency of large-scale deployment and maintenance. These problems persist throughout the entire lifecycle of device access, operation and maintenance, and iterative upgrades, and are key bottlenecks restricting the large-scale and highly reliable operation of industrial IoT. Summary of the Invention
[0007] To address the shortcomings of existing technologies, this application provides a standard device library application method and system based on edge calculators. This method can abstract the configured device point table into a standard template and upload it to the cloud, constructing a shareable, searchable, and version-controlled standard device library. This allows other edge calculators to quickly search and download templates through the cloud platform, enabling automatic generation and one-click deployment of device point tables. This significantly reduces manual configuration time, improves system reliability and deployment efficiency, and supports the standardization and knowledge reuse of device management.
[0008] According to an embodiment of this application, in one aspect, a standard device library application method based on an edge calculator is provided. The standard device library application method includes: the edge calculator initiating a retrieval request to a cloud server based on the feature information of a target device; the cloud server responding to the retrieval request returning preset information and / or at least one matching device template to the edge calculator; the edge calculator parsing the obtained device template and creating a device instance entry locally for driving and managing the target device; and / or, the edge calculator sending a prompt message to a user terminal based on the preset information; the feature information includes one or more of device brand information, device model information, and device type information; the device template is pre-generated by the edge calculator and uploaded to the cloud server, and the cloud server stores the device template in a specific device library; the device template includes device brand information, device model information, device type information, protocol type information, location list information, and the serial number information of the edge calculator that uploaded the device template.
[0009] Furthermore, each device template is associated with a unique version number, which is recorded in the device template itself and / or maintained by the cloud server in the form of metadata. The cloud server generates and maintains a download log table, which includes the template ID information, version number information, and serial number information of the edge calculator for the device template. When the version number information changes, the cloud server determines the edge calculator that has acquired the corresponding device template based on the download log table and pushes an update. The edge calculator compares the version number stored locally with the version number pushed by the cloud server to determine whether an update is needed, and performs an update when necessary.
[0010] Furthermore, the edge calculator can utilize a pre-trained device template generation model to generate device templates in tabular format based on imported deployment specification documents; the deployment specification documents include one or more of the following: location name, address, meaning description, data type, and read / write attributes; the device template generation model uses a validated standard device template library as training data, the standard device template library including various deployment specification documents and corresponding device templates; the edge calculator collects location data of the target device based on the generated device template, and if the collection is successful, it uploads the generated device template to the cloud server.
[0011] Furthermore, the cloud server performs standardization processing on the fields of the uploaded device templates and generates a standardized key field in the template table for uniqueness constraints and duplicate detection. The standardization processing includes one or more operations such as field name unification, unit and range unification, address sorting and noise reduction. Before storing the uploaded device templates into the device library, the cloud server performs uniqueness verification on the template table based on the standardized key and one or more information such as brand, model, type, and protocol type in the device template. If there are equivalent records, it is determined to be duplicated, and multiple duplicate device templates are merged, or the newly uploaded device template is associated with the corresponding device template as a new version and the corresponding device template is updated. Otherwise, the uploaded device template is newly stored in the device library.
[0012] Furthermore, the edge calculator parses the acquired device templates, creates device instances based on the parsing results, generates a batch of location list information, and obtains device connection parameters. Obtaining device connection parameters includes receiving device connection parameters provided by the user and / or sending an acquisition request to the user and receiving the returned device connection parameters. When the cloud server returns multiple matching device templates, the edge calculator presents a set of candidate device templates to the user and creates device instances based on the confirmation information after obtaining user confirmation.
[0013] Furthermore, after creating a device instance based on the device template, the edge calculator verifies the correctness of the information in the device instance. If the verification passes, the device template and / or the device instance are marked as available; otherwise, a problem report is generated and output.
[0014] Furthermore, the edge calculator performs joint debugging verification after updating the device template to confirm whether the updated point configuration is compatible with the protocol parameters of the target device. The joint debugging verification includes: confirming the connection to ensure normal communication with the target device; reading read-only points and comparing them with expected values or reasonable ranges; writing test values to writable points within a preset security range and reading back the results for verification; retrying abnormal results a preset number of times and terminating according to the timeout policy; if the verification passes, the updated device template is applied to the corresponding device instance and marked as deployed; if the verification fails, the device template version before the update is rolled back and an information report containing failed points, error codes, and rollback time is generated.
[0015] Furthermore, the edge calculator can receive voice commands from the user through the user terminal, parse the voice commands into device connection parameters and / or template selection commands, create device instances based on the parsing results, and configure point data for the device instances.
[0016] Furthermore, when the cloud server receives a newly uploaded device template, it authenticates the edge calculator that performed the upload and records the upload information, including the edge calculator's serial number, timestamp, and file hash value. Subsequently, it queries the corresponding device library based on device brand information, device model information, device type information, and protocol type information to locate the corresponding historical version. The newly uploaded device template is then compared with the historical version to generate a difference list containing newly added points, deleted points, modified points, and protocol parameter changes. This difference list is saved as a difference record for subsequent update push and rollback.
[0017] Another aspect of this application provides a standard device library application system based on an edge calculator. The standard device library application system includes an edge calculator, a cloud server, and a user terminal. The edge calculator is communicatively connected to both the cloud server and the user terminal. The edge calculator is used to acquire feature information of a target device, initiate a search request to the cloud server, parse device templates, and create device instances. The cloud server is used to store and manage device templates and return matching device templates to the edge calculator according to the search request. The user terminal is used to provide device connection parameters and / or voice commands to the edge calculator. The standard device library application system is configured to execute the standard device library application method described above.
[0018] The technical solutions provided by the embodiments of this disclosure can include the following beneficial effects: by using a standardized template structure and a cloud-edge collaboration mechanism, the device configuration is transformed from manual point-to-point operation to template-based automatic deployment, realizing automatic generation of point tables and ensuring consistent configuration of devices of the same model; relying on the cloud-based standard device library, the device knowledge is accumulated and shared across projects, supporting unified access of multiple protocols and multiple types of devices, enhancing system scalability and adaptability; at the same time, cloud version management is used as the core to realize centralized management, distribution and updating of templates, combined with edge-side difference comparison and one-click update, supporting batch synchronization and rapid iteration, significantly reducing operation and maintenance complexity and improving deployment efficiency and system reliability.
[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 is a flowchart illustrating the application method of a standard device library provided in one embodiment; Figure 2 is a partial flowchart illustrating the application method of a standard device library provided in one embodiment; Figure 3 is a schematic diagram illustrating the list display of multiple device templates in one embodiment; Figure 4 is a schematic diagram illustrating the template details interface of a device template in one embodiment; Figure 5 is a schematic diagram illustrating the interface when the user updates the template library for the edge calculator in one embodiment; Figure 6 is a schematic diagram illustrating the addition of a driver when configuring a device template in the prior art; Figure 7 is a schematic diagram illustrating the addition of a channel when configuring a device template in the prior art; Figure 8 is a schematic diagram illustrating the setting of a channel when configuring a device template in the prior art; Figure 9 is a schematic diagram illustrating the addition of a device when configuring a device template in the prior art; Figure 10 is a schematic diagram illustrating the setting of device attributes when configuring a device template in the prior art; Figure 11 is a schematic diagram illustrating the addition of tags when configuring a device template in the prior art; Figure 12 is a schematic diagram illustrating the setting of tags when configuring a device template in the prior art. Figure 13 is a schematic diagram of the operation interface for uploading a template after the device test is completed in one embodiment; Figure 14 is a schematic diagram of the operation interface for managing template devices on the platform side in one embodiment; Figure 15 is a schematic diagram of the operation interface for selecting devices from the standard device library when deploying devices in one embodiment; Figure 16 is a schematic diagram of the interface for automatically configuring and deploying devices at their locations after the user clicks save in one embodiment; Figure 17 is a schematic diagram of the interface for deploying electricity meters in a specific embodiment; Figure 18 is a schematic diagram of the selection interface for uploading device templates in a specific embodiment; Figure 19 is a schematic diagram of the specific interface for uploading device templates in a specific embodiment; Figure 20 is a schematic diagram of the interface for saving device templates in the cloud in a specific embodiment; Figure 21 is a schematic diagram of the interface for creating a device instance of an electricity meter based on a device template in a specific embodiment; Figure 22 is a schematic diagram of the interface for obtaining multiple device instances of electricity meters in a specific embodiment. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0023] Referring to Figure 1, this embodiment of the application provides a standard device library application method based on an edge calculator. The standard device library application method includes: the edge calculator initiating a retrieval request to a cloud server based on the feature information of a target device; the cloud server responding to the retrieval request returning preset information and / or at least one matching device template to the edge calculator; the edge calculator parsing the obtained device template and creating a device instance entry locally for driving and managing the target device; and / or, the edge calculator sending a prompt message to the user terminal based on the preset information; the feature information includes one or more of device brand information, device model information, and device type information; the device template is pre-generated by the edge calculator and uploaded to the cloud server, and the cloud server stores the device template in a specific device library; the device template includes device brand information, device model information, device type information, protocol type information, location list information, and the serial number information of the edge calculator that uploaded the device template.
[0024] The preset information includes: reports or alarms when no matching device template exists, and relevant information for generating the device template, such as template generation parameters, device model and manufacturer identifier, interface protocol and attribute field definitions, driver package download link and verification code, firmware / configuration version information, compatibility constraints, and operation guidance for automatically collecting device fingerprints or attributes. The prompts guide the user to select or confirm the device type, authorize the generation or download of the device template and driver, upload device feature data or configuration files, supplement missing key parameters, and may include specific operation steps, risk warnings, and rollback options.
[0025] Regarding the retrieval and download of device templates, the Edge Calculator initiates template query requests to the cloud using keywords such as device brand, model, and type. Multiple keywords can be queried using SQL statements. The cloud returns a list of matching templates and their version information. Users can manually select the desired templates to download locally, and then automatically configure and deploy the devices. A successful SELECT statement indicates that the corresponding template library and version match. Database queries can then locate the corresponding point table within the template library.
[0026] The corresponding SQL statement is shown below: char zrh_persister_find_labparm(const char parmname){sqlite3_stmt stmt = NULL; char labparm = NULL; const char query = "SELECT labparm FROM parms WHERE parmname =?";if (SQLITE_OK != sqlite3_prepare_v2(global_db, query, -1,&stmt,NULL)) {nlog_error("prepare `%s` fail: %s", query, sqlite3_errmsg(global_db));return "";}if (SQLITE_OK != sqlite3_bind_text(stmt, 1, parmname, -1, NULL)) {nlog_error("bind `%s` with `%s` fail: %s", query, parmname,sqlite3_errmsg(global_db));return "";}if (SQLITE_ROW != sqlite3_step(stmt)) {nlog_warn("SQL `%s` with `%s` fail: %s", query, parmname,sqlite3_errmsg(global_db));return "";}if(sqlite3_column_text(stmt, 0)){labparm= strdup((char ) sqlite3_column_text(stmt, 0));}else{labparm="";}return labparm;}char zrh_persister_find_unit(const char driver,const char group,const char labparm){char label=zrh_persister_mqtt_find_onelabel(driver,group);sqlite3_stmt stmt = NULL;char parmunit=NULL;const char query = "SELECT parmunit FROM parms WHERE label =? andlabparm=? ";if (SQLITE_OK != sqlite3_prepare_v2(global_db, query, -1,&stmt,NULL)) {nlog_error("prepare `%s` fail: %s", query, sqlite3_errmsg(global_db));return "";}if (SQLITE_OK != sqlite3_bind_text(stmt, 1, label, -1, NULL)) {nlog_error("bind `%s` with `%s` fail: %s", query, label,sqlite3_errmsg(global_db));return "";}if (SQLITE_OK != sqlite3_bind_text(stmt, 2, labparm, -1, NULL)) {nlog_error("bind `%s` with `%s` fail: %s", query, labparm,sqlite3_errmsg(global_db));return "";}if (SQLITE_ROW != sqlite3_step(stmt)) {nlog_warn("SQL `%s` with `%s` fail: %s", query, labparm,sqlite3_errmsg(global_db));return "";}if(sqlite3_column_text(stmt, 0)){parmunit= strdup((char See Figures 1-5. In one embodiment, each device template is associated with a unique version number. The version number is recorded in the device template itself and / or maintained by the cloud server in the form of metadata. The cloud server generates and maintains a download log table, which includes the template ID information, version number information, and serial number information of the edge calculator. When the version number information changes, the cloud server determines the edge calculator that has acquired the corresponding device template based on the download log table and pushes an update. The edge calculator compares the version number stored locally with the version number pushed by the cloud server to determine whether an update is needed, and performs an update when necessary.
[0027] The cloud supports template version control. When a template is updated, an update notification is pushed to edge calculators that have downloaded the template. When an edge calculator uploads a template, it includes version information. The cloud compares the received version number with the stored version to determine whether the device has updated the template. If an update is confirmed, the cloud will push an update notification to the edge calculators that need to update the template based on the object model data uploaded by the edge calculators within its jurisdiction. The edge calculator supports template difference comparison. After receiving the update notification (including the template version number) sent by the cloud, it will compare it with the local version number and decide whether to download the new template and update it with one click, ensuring that the device configuration is always consistent with the latest standard.
[0028] Figure 5 shows the user interface when updating the template library for the Edge Calculator.
[0029] Referring to Figures 2 and 4, in one embodiment, the cloud server performs standardization processing on the fields of the uploaded device template and generates a standardized key field in the template table for uniqueness constraints and duplicate detection. The standardization processing includes one or more operations such as field name unification, unit and range unification, address sorting, and noise reduction. Before storing the uploaded device template in the device library, the cloud server performs a uniqueness check on the template table based on the standardized key and one or more information such as brand, model, type, and protocol type in the device template. If there are equivalent records, it is determined to be duplicated, and the multiple duplicate device templates are merged, or the newly uploaded device template is associated with the corresponding device template as a new version and the corresponding device template is updated. Otherwise, the uploaded device template is newly stored in the device library.
[0030] The edge calculator uploads templates to the cloud backend, where the templates are stored, deduplicated, and managed in a unified manner.
[0031] The cloud can not only receive templates uploaded by the edge calculator, but also learn and parse device data containing the following information to parse it into a general template device: device brand, model, type, protocol type, and point list (name, address, data type, read / write attributes, unit, upper and lower limits, etc.).
[0032] Since the original templates were verified on real devices using the Edge Calculator, there are no unusable templates. Templates generated based on device manufacturer documentation must also be verified on the Edge Calculator before being uploaded, thus ensuring template accuracy. The cloud only needs to parse the above information according to established rules.
[0033] Referring to Figures 1 and 2, in one embodiment, the edge calculator can generate device templates in tabular format based on imported deployment specification documents using a pre-trained device template generation model. The deployment specification documents include one or more of the following: location name, address, meaning description, data type, and read / write attributes. The device template generation model uses a validated standard device template library as training data, which includes various deployment specification documents and corresponding device templates. The edge calculator collects location data of the target device based on the generated device templates. If the data collection is successful, the generated device templates are uploaded to the cloud server.
[0034] That is, the edge calculator provides a template generation function, which allows users to encapsulate the configured device point table into a structured template (JSON / XML format).
[0035] In the construction and uploading of standard equipment templates, the template sources typically fall into two categories: first, equipment templates marked or created by deployment personnel in actual project deployments that they deem reusable; and second, templates generated based on deployment instructions provided by equipment manufacturers. Manufacturer documents must contain specific location information (such as name, address, descriptive meaning, data type, read / write capability, etc.) to facilitate extraction into the required format and template generation through a large model. The training data for this model comes from a template library whose format has been verified as correct. The new file generated by the model can be in Excel format, which can be directly imported into an edge calculator to convert into an equipment template for verification of location data collection. After verification, it is then uploaded to the template library in the cloud.
[0036] The template includes the device brand, model, type, protocol type, list of locations (name, address, data type, read / write attributes, unit, upper and lower limits, etc.), and the SN number of the edge calculator uploaded to the template.
[0037] Referring to Figure 2, in one embodiment, the edge calculator parses the acquired device template, creates device instances based on the parsing results, generates a batch of location list information, and obtains device connection parameters. Obtaining device connection parameters includes receiving device connection parameters provided by the user terminal and / or sending an acquisition request to the user terminal and receiving the returned device connection parameters. When the cloud server returns multiple matching device templates, the edge calculator presents a set of candidate device templates to the user terminal and creates device instances based on the confirmation information after obtaining user confirmation.
[0038] After parsing the downloaded template file, the edge calculator automatically creates device instances and generates batch point configurations. Users only need to fill in the actual connection information of the devices (such as IP, port, etc.) and confirm that the port is available. No manual point table configuration is required, greatly simplifying the deployment process. Example code is as follows: void handle_add_devmodel_config(nng_aio aio){zrh_plugin_t plugin = zrh_rest_get_plugin();ZRH_PROCESS_HTTP_REQUEST_VALIDATE_JWT(aio, zrh_json_add_devmodel_config_req_t,zrh_json_decode_add_devmodel_config_req, {if (strlen(req->group)>= ZRH_GROUP_NAME_LEN) {ZRH_JSON_RESPONSE_ERROR(ZRH_ERR_GROUP_NAME_TOO_LONG, {zrh_http_response(aio, ZRH_ERR_GROUP_NAME_TOO_LONG,result_error);});} else {int ret = 0;zrh_reqresp_head_t header = { 0};zrh_req_add_devmodel_t cmd = { 0};header.ctx = aio;header.type = ZRH_REQ_ADD_DEVMODEL;strcpy(cmd.driver, req->node);strcpy(cmd.group, req->group); / / if((req->labname==NULL) || (strlen(req->labname)==0)){ / / strcpy(cmd.labname, ""); / / }else{ / / strcpy(cmd.labname, req->labname); / / }if((req->byte2==NULL) || (strlen(req->byte2)==0)){strcpy(cmd.byte2 , "L" );}else{strcpy(cmd.byte2, req->byte2);}if((req->byte4==NULL) || (strlen(req->byte4)==0)){strcpy(cmd.byte4 , "LL");}else{strcpy(cmd.byte4, req->byte4);}if((req->float4==NULL) || (strlen(req->float4)==0)){strcpy(cmd.float4, "LL");}else{strcpy(cmd.float4, req->float4);}if((req->devplace==NULL) || (strlen(req->devplace)==0)){strcpy(cmd.devplace, "");}else{strcpy(cmd.devplace, req->devplace);}strcpy(cmd.modeltype, req->modeltype);strcpy(cmd.labname, req->modeltype);strcpy(cmd.company, req->company);strcpy(cmd.devtype, req->devtype);strcpy(cmd.protocol, req->protocol); / *if(req->modeltype==NULL || strlen(req->modeltype)==0){ZRH_JSON_RESPONSE_ERROR(ZRH_ERR_BODY_IS_WRONG, {zrh_http_response(aio, ZRH_ERR_BODY_IS_WRONG, result_error);});}else {strcpy(cmd.modeltype, req->modeltype);strcpy(cmd.labname, req->modeltype);}if(req->company==NULL || strlen(req->company)==0){ZRH_JSON_RESPONSE_ERROR(ZRH_ERR_BODY_IS_WRONG, {zrh_http_response(aio, ZRH_ERR_BODY_IS_WRONG, result_error);});}else {strcpy(cmd.company, req->company);}if(req->device==NULL || strlen(req->device)==0){ZRH_JSON_RESPONSE_ERROR(ZRH_ERR_BODY_IS_WRONG, {zrh_http_response(aio, ZRH_ERR_BODY_IS_WRONG, result_error);});}else {strcpy(cmd.device, req->device);}* / cmd.slave = req->slave;cmd.interval = req->interval;ret = zrh_plugin_op(plugin, header,&cmd);if (ret != 0) {ZRH_JSON_RESPONSE_ERROR(ZRH_ERR_IS_BUSY, {zrh_http_response(aio, ZRH_ERR_IS_BUSY, result_error);});}}})}void xlsx_tolabel_zh_handle(nng_aio. aio){xlsxioreader xlsxioread;int rv=0,succ=0,fail=0,repeat=0;int filehandle;if ((filehandle = open(filename, O_RDONLY | O_BINARY, 0)) == -1) {zrh_http_ok(aio, "{\"error\":-1,\"msg\":\"Error openinglabelparm.xlsx file\"}");return;}if ((xlsxioread = xlsxioread_open_filehandle(filehandle)) == NULL) {zrh_http_ok(aio, "{\"error\":-1,\"msg\":\"Error readinglabelparm.xlsx file\"}");return;}xlsxioreadersheetlist sheetlist;const XLSXIOCHAR sheetname;if ((sheetlist = xlsxioread_sheetlist_open(xlsxioread)) != NULL) {while ((sheetname = xlsxioread_sheetlist_next(sheetlist)) != NULL) {XML_Char_printf(X(" - %s\n"), sheetname);}xlsxioread_sheetlist_close(sheetlist);}XLSXIOCHAR value; int i = 0; rv = zrh_persister_add_devicet("", ""); rv = zrh_persister_add_devicet("Template Device", "Template Device"); rv = zrh_persister_add_parms("", "", "", ""); int OA_OP_label = UNNEED_ACTION, OA_OP_parm = UNNEED_ACTION, ACRONYM_OP = UNNEED_ACTION; char labname
[64] = {0}, parmname
[64] = {0}, label
[64] = {0}, labparm
[64] = {0}, parmunit
[64] = {0}; xlsxioreadersheet sheet = xlsxioread_sheet_open(xlsxioread, NULL, XLSXIOREAD_SKIP_EMPTY_ROWS); while (xlsxioread_sheet_next_row(sheet)) { i = 零; memset(parmname, 0, 64); while ((value = xlsxioread_sheet_next_cell(sheet)) != NULL && i < 5) { switch (i) { case 0: if (strcmp(value, "") != 0) { strcpy(labname, value); OA_OP_label = NEED_ACTION;} break; case 1: if (strcmp(value, "") != 0) { strcpy(parmname, value); OA_OP_parm = NEED_ACTION;} break; case 2: if (strcmp(value, "") != 0) { if (OA_OP_label) strcpy(label, value); if (OA_OP_parm) strcpy(labparm, value);} else { if (OA_OP_label) strcpy(label, labname); if (OA_OP_parm) strcpy(labparm, parmname);} break; case 4: strcpy(parmunit, value); It should be noted that there seems to be an incorrect "零" in the translation which should be "0" as in the original code for the variable "i". The above is the translation with the correction made for that part.if(ACRONYM_OP==NEED_ACTION){if(OA_OP_label){rv=zrh_persister_add_devicet(label,labname);nlog_notice("insert into devicet:%s,%s",label,labname);if(rv==0){succ++;}else{fail++;}if(rv==19)repeat++;}if(OA_OP_parm){rv=ZRH_persister_add_parms(label,labparm,parmname,parmunit);nlog_notice("insert into parms:%s,%s,%s,%s",label,labname,parmname,parmunit);if(rv==0){succ++;}else{fail++;}if(rv==19)repeat++;}}else{ACRONYM_OP=NEED_ACTION;}OA_OP_label=UNNEED_ACTION;OA_OP_parm=UNNEED_ACTION;}xlsxioread_free(value);i++;}}xlsxioread_sheet_close(sheet);xlsxioread_close(xlsxioread);json_t; obj=json_object();json_object_set_new( obj, "error" , json_integer(0));json_object_set_new( obj, "success" , json_integer(succ));json_object_set_new( obj, "fail" , json_integer(fail));json_object_set_new( obj, "repeat" , json_integer(repeat));char result;ZRH_json_encode(obj,&result);ZRH_http_ok(aio,result);return;} In one embodiment, after creating a device instance based on the device template, the edge calculator verifies the correctness of the information in the device instance. If the verification passes, the device template and / or the device instance are marked as available; otherwise, a problem report is generated and output.
[0039] Referring to Figure 2, in one embodiment, the edge calculator performs joint debugging verification after updating the device template to confirm whether the updated point configuration is compatible with the protocol parameters of the target device. The joint debugging verification includes: confirming the connection to ensure normal communication with the target device; reading read-only points and comparing them with expected values or reasonable ranges; writing test values to writable points within a preset security range and reading back the results for verification; retrying abnormal results a preset number of times and terminating according to a timeout policy; if the verification passes, the updated device template is applied to the corresponding device instance and marked as deployed; if the verification fails, the device template version before the update is rolled back and an information report containing failed points, error codes, and rollback times is generated.
[0040] In one embodiment, the edge calculator can receive voice commands from the user through the user terminal, parse the voice commands into device connection parameters and / or template selection commands, create a device instance based on the parsing results, and configure point data for the device instance.
[0041] When deploying templates on the edge calculator, users can either select template devices to deploy all locations with one click, or deploy quickly via voice: first wake up the device with "Xiao Niu Xiao Niu", then say "Add X brand (manufacturer name) CN156 air conditioner (equipment type) device to X brand air conditioner (channel name)" to complete the deployment; the system prevents false triggering through wake-up monitoring, and can select and parse the corresponding manufacturer and equipment model from the template library by adding or deleting keywords to complete the addition of the device.
[0042] In one embodiment, when the cloud server receives a newly uploaded device template, it authenticates the edge calculator that performed the upload and records the upload information, including the edge calculator's serial number, timestamp, and file hash value. Subsequently, it queries the corresponding device library based on device brand information, device model information, device type information, and protocol type information to locate the corresponding historical version. The newly uploaded device template is then compared with the historical version to generate a difference list containing newly added points, deleted points, modified points, and protocol parameter changes. This difference list is saved as a difference record for subsequent update push and rollback.
[0043] Another aspect of this application provides a standard device library application system, which includes an edge calculator, a cloud server, and a user terminal. The edge calculator is communicatively connected to both the cloud server and the user terminal. The edge calculator is used to acquire feature information of a target device, initiate a search request to the cloud server, parse device templates, and create device instances. The cloud server is used to store and manage device templates and return matching device templates to the edge calculator according to the search request. The user terminal is used to provide device connection parameters and / or voice commands to the edge calculator. The standard device library application system is configured to execute the standard device library application method described above.
[0044] This application significantly improves the efficiency and consistency of equipment deployment. Compared with the existing technology that requires manual configuration of each device point by point, which is time-consuming and prone to errors, this application achieves "one-click configuration" by automatically generating point tables through templates, effectively eliminating human error and ensuring configuration consistency among devices of the same model.
[0045] This application's embodiments also enable the accumulation and sharing of device knowledge. Existing point table configurations are scattered across different projects, making cross-project reuse difficult; this application relies on a cloud-based standard device library to transform various best practices into shareable assets, promoting knowledge accumulation and supporting team collaboration.
[0046] In terms of operation and maintenance and iteration, this application supports unified management of large-scale equipment. Previously, changes to equipment locations required manual modification for each device, resulting in high operation and maintenance costs; this application, through cloud version management, enables batch updates and synchronization of templates, significantly reducing maintenance complexity and accelerating iteration speed.
[0047] In terms of system scalability and compatibility, this application is significantly superior to existing technologies. In the past, custom development of drivers and point tables was often required for devices with different protocols and models; this application adopts a standardized template structure, supports rapid access for multiple protocols and types of devices, and has good scalability and adaptability.
[0048] The core innovation of this application lies in transforming the device configuration process in edge computing from "repetitive manual operations" to "template-based automated deployment," and achieving centralized management, distribution, and updating of templates through a cloud-edge collaboration mechanism. In practice, manually adding an air conditioner typically requires configuring channels or drivers (such as Modbus) and device names, followed by adding switches, setting temperatures, fan speeds, modes, and other standard settings, taking at least ten minutes (see Figures 6-12). This involves adding drivers, adding channels, setting channels, adding devices, setting device attributes, adding tags, and setting tags, and is prone to errors. With template configuration, deployment can be completed in seconds simply by selecting the device type, manufacturer, and model from a dropdown menu.
[0049] Figures 13-16 illustrate, in one embodiment, the operation interface for uploading the template after device testing, the operation interface for managing the template device on the platform side (i.e., the cloud), the operation interface for selecting the device from the standard device library when deploying the device, and the interface for automatically configuring and deploying the device's locations after the user clicks save. In Figure 15, the interval represents the interval of the device data acquisition request, that is, the interval for obtaining a valid message, and the order represents the endianness of the values displayed by the data corresponding to the received location, such as 0x1234 or 0x3412.
[0050] The following is a specific embodiment to illustrate the technical solution of this application: Referring to Figure 17, Edge Calculator No. 1 deployed a Schneider Electric meter in the project. The actual project test showed that the point data reading and point data control were all correct. The deployment personnel believed that this electric meter would be used in multiple projects or multiple floors of this project in the future, so they uploaded the electric meter template, as shown in Figure 18. After clicking save, the template was uploaded to the cloud, as shown in Figure 19. The cloud search found that this device was not in the template library, so it was stored in the template library, as shown in Figure 20. At this time, Edge Calculator No. 2 also needs to connect to this electric meter. It only needs to download and update the template library first, as shown in Figure 5, and then select this Schneider Electric meter model in the new device to complete the one-click deployment, as shown in Figure 21. The final device template list is shown in Figure 22.
[0051] The edge calculator receives a request to add a template library. Based on the JSON transmitted via the web, it determines the parameters: `modeltype` is "electric meter", `company` is "S brand", and `devtype` is "DM2300V109_01". Then, it calls the following code to retrieve and add the location attributes. After adding, the edge calculator sends the corresponding protocol message to the device to complete the collection of the corresponding location data: `int zrh_persister_get_devmodels_tags(char...)` protocol, char modeltype, char company, char devtype, UT_array tags){sqlite3_stmt stmt = NULL; const char query = "SELECT tagname, address, attribute, precision,decimal, ""unit,type, description,labparm,parmname,algorithm,tagjson ""FROM devmodels WHERE modeltype=? AND company=? AND devtype=? ANDprotocol=?""ORDER BY rowid ASC";utarray_new( tags, zrh_tag_get_icd()); / / if (SQLITE_OK != sqlite3_prepare_v2(global_db, query, -1,&stmt,NULL)) {nlog_error("prepare `%s` fail: %s", query, sqlite3_errmsg(global_db));goto error;}if (SQLITE_OK != sqlite3_bind_text(stmt, 1, modeltype, -1, NULL)) {nlog_error("bind `%s` with `%s` fail: %s", query, modeltype,sqlite3_errmsg(global_db));goto error;}if (SQLITE_OK != sqlite3_bind_text(stmt, 2, company, -1, NULL)) {nlog_error("bind `%s` with `%s` fail: %s", query, company,sqlite3_errmsg(global_db));goto error;}if (SQLITE_OK != sqlite3_bind_text(stmt, 3, devtype, -1, NULL)) {nlog_error("bind `%s` with `%s` fail: %s", query, devtype,sqlite3_errmsg(global_db));goto error;}if (SQLITE_OK != sqlite3_bind_text(stmt, 4, protocol, -1, NULL)) {nlog_error("bind `%s` with `%s` fail: %s", query, protocol,sqlite3_errmsg(global_db));goto error;}if (0 != collect_devmodels_tags_info(stmt, tags)) {nlog_warn("query `%s` fail: %s", query, sqlite3_errmsg(global_db)); / / do not set return code, return partial or empty result}sqlite3_finalize(stmt);return 0;error:utarray_free(; tags); This application constructs an evolving and shareable device knowledge system, providing basic support for the large-scale deployment and intelligent operation and maintenance of IoT devices; at the same time, it significantly improves configuration and operation and maintenance efficiency by reducing operation steps and simplifying configuration processes; and under normal communication conditions, it realizes the real-time display of device data on the edge calculator and the reliable execution of the control function.
[0052] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the indirect coupling or communication connection of the apparatus or modules can be electrical, mechanical, or other forms.
[0053] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0054] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.
[0055] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A method for applying a standard device library based on an edge calculator, characterized in that, The standard device library application method includes: an edge calculator initiating a retrieval request to a cloud server based on the characteristic information of a target device; the cloud server responding to the retrieval request returning preset information and / or at least one matching device template to the edge calculator; the edge calculator parsing the obtained device template and creating a device instance entry locally for driving and managing the target device; and / or, the edge calculator sending a prompt message to the user terminal based on the preset information; the characteristic information includes one or more of device brand information, device model information, and device type information; the device template is pre-generated by the edge calculator and uploaded to the cloud server, and the cloud server stores the device template in a specific device library; the device template includes device brand information, device model information, device type information, protocol type information, location list information, and the serial number information of the edge calculator that uploaded the device template.
2. The standard equipment library application method as described in claim 1, characterized in that: Each device template is associated with a unique version number, which is recorded in the device template itself and / or maintained by the cloud server in the form of metadata. The cloud server generates and maintains a download log table, which includes the template ID information, version number information, and serial number information of the edge calculator for the device template. When the version number information changes, the cloud server determines the edge calculator that has obtained the corresponding device template based on the download log table and pushes an update; the edge calculator compares the version number stored locally with the version number pushed by the cloud server to determine whether an update is needed, and performs an update when necessary.
3. The standard equipment library application method as described in claim 1, characterized in that: The edge calculator can generate device templates in tabular format based on imported deployment specification documents using a pre-trained device template generation model. The deployment specification documents include one or more of the following information: location name, address, meaning description, data type, and read / write attributes. The device template generation model uses a validated standard device template library as training data, which includes various deployment specification documents and corresponding device templates. The edge calculator collects location data of the target device based on the generated device template. If the collection is successful, the generated device template is uploaded to the cloud server.
4. The standard equipment library application method as described in claim 1, characterized in that: The cloud server performs standardization processing on the fields of the uploaded device templates and generates a standardized key field in the template table for uniqueness constraints and duplicate detection. The standardization processing includes one or more operations such as field name unification, unit and range unification, address sorting and noise reduction. Before storing the uploaded device templates into the device library, the cloud server performs a uniqueness check on the template table based on the standardized key and one or more information such as brand, model, type, and protocol type in the device template. If there are equivalent records, it is determined to be a duplicate, and multiple duplicate device templates are merged, or a newly uploaded device template is associated with the corresponding device template as a new version and the corresponding device template is updated. Otherwise, the uploaded device template is newly stored in the device library.
5. The standard equipment library application method as described in claim 1, characterized in that: The edge calculator parses the acquired device templates, creates device instances based on the parsing results, generates a batch list of locations, and obtains device connection parameters. Obtaining device connection parameters includes receiving device connection parameters provided by the user and / or sending an acquisition request to the user and receiving the returned device connection parameters. When the cloud server returns multiple matching device templates, the edge calculator presents a set of candidate device templates to the user and creates device instances based on the confirmation information after obtaining user confirmation.
6. The standard equipment library application method as described in claim 5, characterized in that, After creating a device instance based on the device template, the edge calculator verifies the correctness of the information in the device instance. If the verification passes, the device template and / or the device instance are marked as available; otherwise, a problem report is generated and output.
7. The standard equipment library application method as described in claim 2, characterized in that: The edge calculator performs joint debugging verification after updating the device template to confirm whether the updated point configuration is compatible with the protocol parameters of the target device. The joint debugging verification includes: confirming the connection to ensure normal communication with the target device; reading read-only points and comparing them with expected values or reasonable ranges; writing test values to writable points within a preset security range and reading back the results for verification; retrying abnormal results a preset number of times and terminating according to the timeout policy; if the verification passes, the updated device template is applied to the corresponding device instance and marked as deployed; if the verification fails, it rolls back to the previous device template version and generates an information report containing failed points, error codes, and rollback times.
8. The standard equipment library application method as described in claim 1, characterized in that, The edge calculator can receive voice commands from users through a user terminal, parse the voice commands into device connection parameters and / or template selection commands, create device instances based on the parsing results, and configure point data for the device instances.
9. The standard equipment library application method as described in claim 1, characterized in that, When the cloud server receives a newly uploaded device template, it authenticates the edge calculator that performed the upload and records the upload information, including the edge calculator's serial number, timestamp, and file hash value. Subsequently, the corresponding historical version is located by querying the corresponding device library based on device brand information, device model information, device type information, and protocol type information. The newly uploaded device template is then compared with the historical version to generate a difference list containing newly added points, deleted points, modified points, and protocol parameter changes. This difference list is saved as a difference record for subsequent update push and rollback.
10. A standard device library application system based on an edge calculator, characterized in that: The standard device library application system includes an edge calculator, a cloud server, and a user terminal; the edge calculator is communicatively connected to the cloud server and the user terminal respectively; the edge calculator is used to obtain the feature information of the target device, initiate a search request to the cloud server, parse the device template, and create a device instance; the cloud server is used to store and manage the device templates and return a matching device template to the edge calculator according to the search request. The user terminal is used to provide device connection parameters and / or voice commands to the edge calculator; the standard device library application system is configured to execute the standard device library application method as described in any one of claims 1 to 9.