Equipment connection method and equipment of applet and storage medium

By using the Vue2 editor to generate configuration model data in the connection between applets and IoT devices, the problems of poor compatibility and inconsistent configuration management between applets and IoT devices are solved, and efficient and reliable device connection and data interaction are achieved.

CN120066568APending Publication Date: 2025-05-30深圳渊联技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510236437.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The poor compatibility between mini programs and IoT devices leads to high development costs and lack of a unified configuration management mechanism, resulting in connection failure and data interaction disorder.

Method used

Create a new local device data framework and applet configuration through Vue2 editor, set protocol data and interface data based on preset connection parameters, generate local device attributes, and perform connection verification processing. When the verification result is qualified, configuration model data is generated to realize the connection settings between the applet and the device.

Benefits of technology

It reduces the adaptive development needs of mini program developers for each device, improves the reliability and versatility of device connections, and avoids connection failures and data interaction problems caused by inconsistent configurations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066568A_ABST
    Figure CN120066568A_ABST
Patent Text Reader

Abstract

The invention relates to the field of connection configuration, and discloses an applet device connection method and device and a storage medium. The method comprises the following steps of: newly establishing a local equipment data framework and applet configuration through a Vue2 editor; based on the preset connection parameters, setting protocol data and interface data of a local equipment data framework, and generating local equipment attributes; performing connection verification processing on the local device based on the local device attribute and the applet configuration to obtain a verification result; and when the verification result is qualified, packaging the applet configuration and the local equipment attribute to generate configuration model data, and performing read-write processing on the local equipment based on the configuration model data to realize connection setting of the applet and the equipment. In the embodiment of the invention, the problems of connection failure, data interaction disorder and the like caused by inconsistent configuration are avoided, the reliability and universality of equipment connection are improved, and the development cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of connection configurations, and particularly to a device connection method, a device, and a storage medium for a small program. Background Art

[0002] Many device manufacturers develop supporting small programs specifically for their devices to promote their products. In this mode, a private connection protocol defined by the manufacturer is adopted between the small program and the device, and the configuration information is hard-coded into the small program code. Since each manufacturer has its own connection protocol and configuration storage method, when a user has multiple smart devices of different brands, multiple different small programs need to be installed. Device manufacturers customize the middleware connection method. Some device manufacturers will develop custom middleware to serve as a bridge between the device and the small program. This middleware usually includes a device driver and a small program communication interface. For example, in the connection solution of some smart security devices, the middleware provided by the manufacturer can convert the data of devices such as cameras and door and window sensors in a specific format and transmit it to the corresponding small program. The middleware needs to cooperate closely with the device firmware and the small program. Once the device firmware is upgraded or the small program updates its function, the middleware may need to be updated synchronously, which is a significant maintenance burden for both manufacturers and developers, and the maintenance cost is too high. The middleware of different manufacturers varies greatly and cannot be universal. This means that if a developer hopes to develop a small program that can be compatible with multiple brands, separate development needs to be carried out for the middleware of each brand, which increases the complexity and cost of development and has poor universality.

[0003] Devices of different brands and models each have independent connection protocols, interface specifications, and configuration requirements. This makes it necessary for small program developers to carry out complex and repetitive adaptation work for each device separately when developing device connections. This not only consumes a large amount of human and time costs, but also due to the diversity and complexity of the devices, compatibility problems are extremely likely to occur, resulting in an extended development cycle and increased development costs.

[0004] When multiple small programs need to connect to the same device, due to the lack of a unified configuration management mechanism, each small program has to store and manage the device connection configuration by itself. This method not only causes waste of storage resources, but also because the configurations of each small program may be inconsistent, it will lead to problems such as connection failures and data interaction disorders, seriously affecting the user experience. Therefore, in view of the technical problem of poor compatibility between small programs and Internet of Things devices, resulting in high development costs, a new technology is urgently needed to overcome these problems. Summary of the Invention

[0005] The main purpose of the present invention is to solve the technical problem of poor compatibility between small programs and Internet of Things devices, resulting in high development costs.

[0006] The first aspect of the present invention provides a method for a small program to connect to a device. The method for the small program to connect to the device includes:

[0007] Create a local device data framework and a small program configuration through a Vue2 editor;

[0008] Based on preset connection parameters, set the protocol data and interface data of the local device data framework to generate local device attributes;

[0009] Based on the local device attributes and the small program configuration, perform connection verification processing on the local device to obtain a verification result;

[0010] When the verification result is qualified, package the small program configuration and the local device attributes to generate configuration model data, and based on the configuration model data, perform read and write processing on the local device to achieve the connection setting between the small program and the device.

[0011] Optionally, in the first implementation manner of the first aspect of the present invention, the creating a local device data framework and a small program configuration through a Vue2 editor includes:

[0012] Through a Vue2 editor, establish a framework for device name, protocol type, network port setting, and serial port setting to generate a local device data framework;

[0013] Create a small program configuration in the Vue2 editor based on the API interface data of the small program.

[0014] Optionally, in the second implementation manner of the first aspect of the present invention, the network port setting includes: network port setting data with an attached device ID, device IP, device port, and read / write register address, and the serial port setting includes: serial port setting data with a baud rate, start address, and parity bit.

[0015] 5. Optionally, in the third implementation manner of the first aspect of the present invention, the protocol type includes any one of Modbus protocol, Citrix ICA protocol, FINS / TCP protocol, IO protocol, OPC UA protocol, and Siemmens_S7_1200 protocol.

[0016] Optionally, in the fourth implementation manner of the first aspect of the present invention, the performing read and write processing on the local device based on the configuration model data to achieve the connection setting between the small program and the device includes:

[0017] Read the communication data format of the local device;

[0018] Using a Vue2 editor, according to the communication data format, reconstruct the configuration model data in key-value pair format to generate model communication data;

[0019] Send the model communication data to the local device to implement the connection setting between the applet and the device.

[0020] Optionally, in the fifth implementation manner of the first aspect of the present invention, after packing the applet configuration and the local device attributes to generate configuration model data, it further includes:

[0021] Upload the configuration model data to the model platform and create platform annotation data based on the local device attributes.

[0022] Optionally, in the sixth implementation manner of the first aspect of the present invention, the uploading the configuration model data to the application platform and creating platform annotation data based on the local device attributes includes:

[0023] Based on a preset first neural network model, verify the data structure and parameter range of the configuration model data to obtain a first verification result;

[0024] When the first verification result is qualified, then based on a preset second neural network model, verify the protocol specification and parameter reference relationship of the configuration model data to obtain a second verification result;

[0025] When the second verification result is qualified, upload the configuration model data to the application platform and create platform annotation data based on the local device attributes, where the platform annotation data includes: device name, version number, update description.

[0026] Optionally, in the seventh implementation manner of the first aspect of the present invention, before creating the local device data framework and applet configuration through the Vue2 editor, it further includes:

[0027] Receive the applet selection instruction of the user, and query the applet configuration corresponding to the applet selection instruction in the preset configuration list based on the applet selection instruction.

[0028] The second aspect of the present invention provides an applet device connection device, including: a memory and at least one processor, instructions are stored in the memory, and the memory and the at least one processor are interconnected by a line; the at least one processor calls the instructions in the memory to enable the applet device connection device to execute the above-mentioned applet device connection method.

[0029] The third aspect of the present invention provides a computer-readable storage medium, in which instructions are stored. When the instructions run on a computer, the computer is caused to execute the above-mentioned device connection method for the small program.

[0030] In the embodiments of the present invention, through unified configuration management, small program developers no longer need to perform complex adaptation and development work for each device. They only need to develop according to the unified configuration interface, which greatly reduces the development difficulty and cost. By adopting a unified configuration management mechanism, multiple small programs can connect to devices through the same set of configuration information, avoiding problems such as connection failures and data interaction disorders caused by inconsistent configurations, and improving the reliability and versatility of device connection. It effectively solves the compatibility and configuration management problems in the process of connecting small programs to Internet of Things devices, and provides strong support for the in-depth integration and application of small programs and Internet of Things devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a schematic diagram of an embodiment of the device connection method for a small program in an embodiment of the present invention;

[0032] Figure 2 It is a schematic diagram of a specific embodiment of step 104 in an embodiment of the present invention;

[0033] Figure 3 It is a schematic diagram of a specific embodiment of step 1044 in an embodiment of the present invention;

[0034] Figure 4 It is a schematic diagram of an embodiment of the device connection device for a small program in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0035] The embodiments of the present invention provide a device connection method, device and storage medium for a small program.

[0036] The embodiments disclosed by the present invention will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the accompanying drawings and embodiments of the present invention are only for exemplary purposes and are not used to limit the protection scope of the present invention.

[0037] In the description of the embodiments disclosed in the present invention, the term "including" and its similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "an embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. There may also be other explicit and implicit definitions hereinafter.

[0038] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to Figure 1 , a schematic diagram of an embodiment of the device connection method of the applet in the embodiments of the present invention, including the steps:

[0039] 101. Create a local device data framework and applet configuration through a Vue2 editor;

[0040] In this embodiment, the Vue.js 2 progressive JavaScript framework is used to develop an editor that adapts to the local device and applet configuration data based on the Vue.js 2 (abbreviated as vue2) framework, which is used to adjust the data in the local device data framework and set the applet configuration.

[0041] Establish the data of the local device data framework and applet configuration based on the Vue2 editor.

[0042] Specifically, before creating the local device data framework and applet configuration through the Vue2 editor, it further includes:

[0043] 1011. Receive the applet selection instruction of the user, and query the applet configuration corresponding to the applet selection instruction in the preset configuration list based on the applet selection instruction.

[0044] In step 1011, there can be multiple selection objects for the applet. When targeting the target local device, the user selects multiple applets based on requirements. After receiving the applet selection instruction of the user, query the applet configuration data corresponding to the applet selection instruction in the pre-pulled or added configuration list.

[0045] Specifically, the following specific implementation manners are included in step 101:

[0046] 1012. Through the Vue2 editor, establish the frameworks of device name, protocol type, network port setting, and serial port setting to generate a local device data framework;

[0047] 1013. Create an applet configuration in the Vue2 editor based on the API interface data of the applet.

[0048] In steps 1012 - 1013, based on the Vue2 editor, a framework for the device name, protocol type, interface type, etc. of local data is set up. The data content under this framework is for subsequent pulling and filling to generate a local device data framework.

[0049] Based on the external API interface data of the applet, pull data in the Vue2 editor and create applet configurations.

[0050] Specifically, the network port settings include: network port setting data with attached device ID, device IP, device port, read / write register address. The serial port settings include: serial port setting data with baud rate, starting address, parity bit.

[0051] The attached device ID, Slave ID, is a unique identifier used to identify the slave device (slave). The IP address of the local device, and the device port is the network port number used for communication, especially for modifying the configuration server and configuration file in Modbus TCP / IP communication. The read / write register address is the storage location for the Internet of Things execution commands within the final device.

[0052] The baud rate is the data transmission rate during the transmission process. The starting address is the starting address for processing read / write in the communication protocol. The parity bit is the position of the check code for verifying the integrity of the entire data, including the serial port data containing the above data.

[0053] Furthermore, the protocol type includes any one of the following: Modbus protocol, Citrix ICA protocol, FINS / TCP protocol, IO protocol, OPC UA protocol, Siemmens_S7_1200 protocol.

[0054] The Modbus protocol is a communication protocol applied in the fields of industrial automation and the Internet of Things, mainly used to achieve data interaction and control between devices. The Citrix ICA protocol is a communication protocol for remote desktop and application delivery, connecting to a remote server or virtual desktop through a network and using the applications and services thereon. The FINS / TCP protocol is an industrial automation communication protocol used for data exchange between devices such as Omron PLCs and sensors. IO-Link is a point-to-point serial digital communication protocol for two-way communication between sensors and actuators and controllers (such as PLCs) in industrial automation. The OPC UA protocol is a cross-platform and cross-industry communication protocol standard developed by the OPC Foundation, aiming to provide a secure, reliable, and scalable communication mechanism for achieving interoperability between different devices and applications in industrial automation systems. The Siemmens_S7_1200 protocol is a protocol for communication between Siemens S7-1200 series PLCs (programmable logic controllers) and between PLCs and other devices (such as host computers, HMIs, etc.).

[0055] 102. Based on the preset connection parameters, set the protocol data and interface data of the local device data framework to generate local device attributes;

[0056] In this embodiment, through the preset connection parameters, various types of data of the local device are pulled and written into the protocol data and interface data encapsulation in the local device data framework to form local device attributes.

[0057] 103. Based on the local device attributes and the applet configuration, perform connection verification processing on the local device to obtain a verification result;

[0058] In this embodiment, through the local device attributes and applet configuration parameters, the local device is verified for connection to test the communication network link and transmission network speed between the local device and the applet.

[0059] 104. When the verification result is qualified, pack the applet configuration and the local device attributes to generate configuration model data, and based on the configuration model data, perform read and write processing on the local device to achieve the connection setting between the applet and the device.

[0060] In this embodiment, when the verification result is qualified data, the applet configuration and the local device attributes are packed and processed to form a confirmed qualified configuration model data. In the subsequent connection process, the configuration model data is directly called to perform read and write processing on the local device to achieve the connection setting between the applet and the device.

[0061] Specifically, please refer to Figure 2 , Figure 2This is a schematic diagram of a specific embodiment of step 104 in the embodiments of the present invention. In step 104, "based on the configuration model data, perform read and write processing on the local device to implement the connection setting between the applet and the device" includes the following specific implementation manners:

[0062] 1041. Read the communication data format of the local device;

[0063] 1042. Use the Vue2 editor to reconstruct the configuration model data into a key-value pair format according to the communication data format to generate model communication data;

[0064] 1043. Send the model communication data to the local device to implement the connection setting between the applet and the device.

[0065] In steps 1041-1043, import the configuration model data, identify the parameters and data in the file. Then the Vue2 editor reassembles the data into key-value pairs according to the data writing format of the local device (for example: device name: device 1, device protocol: modbus, interface type: network port, etc.). Finally, the assembled data format is consistent with the data writing format of the local device and is written into the local device. In the Vue2 editor, multiple buttons can be added, and the behavior "read and write device" is added to the click event of the button. This behavior can select the device (device instance saved locally), attributes (newly created attributes when creating the device instance, such as: read and write of registers), and assign values to the parameters that need to be passed or obtained.

[0066] Specifically, after step 104 "package the applet configuration and the local device attributes to generate configuration model data", it further includes:

[0067] 1044. Upload the configuration model data to the model platform and create platform annotation data based on the local device attributes.

[0068] In step 1044, upload the configuration model data to the model platform, and add or update the model data of the model platform through the API interface. When adding a new model, data such as device name, version number, icon, device picture introduction, and update description need to be automatically pulled as platform annotation data.

[0069] Further, please refer to Figure 3 , Figure 3 This is a schematic diagram of a specific embodiment of step 1044 in the embodiments of the present invention. In step 1044, it includes the following specific implementation manners:

[0070] 10441. Based on a preset first neural network model, verify the data structure and parameter range of the configuration model data to obtain a first verification result;

[0071] 10442. When the first verification result is qualified, verify the protocol specification and parameter reference relationship of the configuration model data based on a preset second neural network model to obtain a second verification result;

[0072] 10443. When the second verification result is qualified, upload the configuration model data to the application platform and create platform annotation data based on the local device attributes. The platform annotation data includes: device name, version number, and update description.

[0073] In steps 10441 - 10443, first use a first neural network model (such as a CNN network, RNN network, LSTM network, ResNet network, etc.) to verify the data structure and parameter range of the configuration model data, and verify whether the features in the configuration model data conform to the set specifications to avoid abnormal data leading to the release of an incorrect version model.

[0074] When the first verification result is qualified, a second neural network model (such as a Transformer model, GNN model) verifies the protocol specification and parameter reference relationship of the configuration model data. After verifying the configuration model data, a second verification result is obtained.

[0075] If the second verification result is qualified, upload the configuration model data to the application platform through a pre - set interface, use the device name of the original local device attributes as the platform annotation data, and generate a version number and an update description and add them to the platform annotation data.

[0076] In the embodiment of the present invention, through unified configuration management, mini - program developers no longer need to perform complex adaptation development work for each device. They only need to develop according to the unified configuration interface, which greatly reduces the development difficulty and cost. By adopting a unified configuration management mechanism, multiple mini - programs can connect to devices through the same set of configuration information, avoiding problems such as connection failures and data interaction disorders caused by inconsistent configurations, and improving the reliability and versatility of device connections. It effectively solves the compatibility and configuration management problems in the process of connecting mini - programs with Internet of Things devices, and provides strong support for the in - depth integration and application of mini - programs and Internet of Things devices.

[0077] Figure 4FIG. 0 is a schematic structural diagram of a device connection device of a mini-program provided by an embodiment of the present invention. The device connection device 400 of the mini-program may vary greatly due to different configurations or performances, and may include one or more processors (central processing units, CPUs) 410 (for example, one or more processors) and a memory 420, and one or more storage media 430 (for example, one or more mass storage devices) for storing application programs 433 or data 432. Among them, the memory 420 and the storage media 430 may be transient storage or persistent storage. The program stored in the storage media 430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the device connection device 400 of the mini-program. Further, the processor 410 may be configured to communicate with the storage media 430 and execute a series of instruction operations in the storage media 430 on the device connection device 400 of the mini-program.

[0078] The device connection device 400 based on the mini-program may further include one or more power supplies 440, one or more wired or wireless network interfaces 450, one or more input / output interfaces 460, and / or one or more operating systems 431, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, and so on. Those skilled in the art can understand that Figure 4 the shown structural diagram of the device connection device of the mini-program does not constitute a limitation on the device connection device based on the mini-program, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0079] The present invention also provides a computer-readable storage medium. The computer-readable storage medium may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions run on a computer, the computer is caused to execute the steps of the device connection method of the mini-program.

[0080] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0081] Moreover, although the operations are depicted in a particular order, this should be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed to achieve the desired result. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single implementation. Conversely, the various features that are described in the context of a single implementation can also be implemented separately or in any suitable subcombination in multiple implementations.

[0082] Although the subject matter has been described in language specific to structural features and / or methodological acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A device connection method for a small program, characterized in that: Includes steps: Create a new local device data framework and applet configuration through the Vue2 editor; Based on the preset connection parameters, setting the protocol data and interface data of the local device data frame to generate local device attributes; Based on the local device attributes and the applet configuration, performing connection verification processing on the local device to obtain a verification result; When the verification result is qualified, the mini program configuration and the local device attributes are packaged and processed to generate configuration model data, and based on the configuration model data, the local device is read and written to realize the connection setting between the mini program and the device.

2. The device connection method of the applet according to claim 1, characterized in that: The new local device data framework and applet configuration through the Vue2 editor include: Through the Vue2 editor, establish the framework of device name, protocol type, network port settings, and serial port settings to generate the local device data framework; Based on the API interface data of the mini program, create the mini program configuration in the Vue2 editor.

3. The device connection method of the applet according to claim 2, characterized in that: The network port settings include: network port setting data with accessory device ID, device IP, device port, and read / write register address; the serial port settings include: serial port setting data with baud rate, start address, and parity bit.

4. The device connection method of the applet according to claim 2, characterized in that: The protocol type includes: any one of Modbus protocol, Citrix ICA protocol, FINS / TCP protocol, IO protocol, OPC UA protocol, and Siemmens_S7_1200 protocol.

5. The device connection method of the applet according to claim 1, characterized in that: The reading and writing of the local device based on the configuration model data to achieve the connection setting between the applet and the device includes: Read the communication data format of the local device; Using the Vue2 editor, according to the communication data format, the configuration model data is reconstructed in a key-value pair format to generate model communication data; The model communication data is sent to the local device to implement the connection setting between the applet and the device.

6. The device connection method of the applet according to claim 1, characterized in that: After packaging the mini-program configuration and the local device attributes to generate configuration model data, the method further includes: The configuration model data is uploaded to a model platform, and platform annotation data is created based on the local device attributes.

7. The device connection method of the applet according to claim 6, characterized in that: The uploading of the configuration model data to the application platform and creating platform annotation data based on the local device attributes includes: Based on the preset first neural network model, verify the data structure and parameter range of the configuration model data to obtain a first verification result; When the first verification result is qualified, the protocol specification and parameter reference relationship of the configuration model data are verified based on the preset second neural network model to obtain a second verification result; When the second verification result is qualified, the configuration model data is uploaded to the application platform, and platform annotation data is created based on the local device attributes, wherein the platform annotation data includes: device name, version number, and update description.

8. The device connection method of the applet according to claim 1, characterized in that: Before creating a new local device data framework and applet configuration through the Vue2 editor, it also includes: A mini-program selection instruction from a user is received, and based on the mini-program selection instruction, a mini-program configuration corresponding to the mini-program selection instruction is searched in a preset configuration list.

9. A device connection device for a small program, characterized in that: The device connection device of the applet includes: a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor calls the instructions in the memory to enable the device connection device of the applet to execute the device connection method of the applet according to any one of claims 1-8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the device connection method of the applet according to any one of claims 1 to 8 is implemented.