Device access method, device and electronic device
By creating device models and target drivers, combined with node selection and configuration, the problem of low device access efficiency in the IoT platform is solved, and efficient and accurate device access and multi-protocol data compatibility is achieved.
Patent Information
- Application Number
- CN202210626086.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2042-06-02
AI Technical Summary
In the IoT platform, the device access efficiency is low, mainly due to the different types of protocols supported by different devices, which requires the development of specific access plug-ins. Developers need to be proficient in programming languages and understand framework processes, which increases the development workload and difficulty .
By creating a device model, determining the connection relationship between the target driver, including the data access node, data conversion node and data output node, and debugging, finally creating a target access task, providing a modular access method to reduce developers Internet of Things platform business that needs to be understood to improve access efficiency.
It realizes efficient device access. Through integrated access interface and online debugging, the workload of developers is reduced, the efficiency and accuracy of device access is improved, and it is compatible with data access of multiple protocol types.
Smart Images

Figure CN114942792B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to a device access method, device and electronic equipment. Background Art
[0002] The Internet of Things (IoT) refers to the use of various information sensors, laser scanners and other devices and technologies to collect any objects or processes that need to be monitored, connected, and interacted in real time, collect their sound, light, heat, electricity and other required information, and achieve ubiquitous connection between objects and objects and between objects and people through various possible network accesses, and realize intelligent perception, identification and management of objects and processes. For the IoT platform, various devices need to be connected through the IoT platform.
[0003] Since different devices support different protocol types, when deploying on the IoT platform, it is necessary to deploy different protocol types accordingly. When accessing a new type of device requires the implementation of a new plug-in, since a specific access plug-in needs to be developed, developers need to be proficient in programming languages and have some understanding of the existing framework process, which will lead to low access efficiency. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a device access method, apparatus and electronic device to solve the problem of low device access efficiency.
[0005] According to a first aspect, an embodiment of the present invention provides a device access method, including:
[0006] In response to a creation operation of a device model of a target device, determining an interactive data type of the device model;
[0007] In response to a driver configuration operation on the device model, determining a target driver of the device model, the target driver including a connection relationship between a data access node, a data conversion node, and a data output node;
[0008] Debugging the target driver;
[0009] When the target driver is debugged successfully, in response to a task creation operation on the device model, a target access task corresponding to the target driver is determined.
[0010] The device access method provided in the embodiment of the present invention realizes device access in a modular manner, and specifically realizes access to the target device by utilizing device models, driver configuration, and task creation. The method provides an integrated access interface, reduces the developer's development workload for device access, and the developer does not need to have an in-depth understanding of the Internet of Things platform business, and can achieve access through interactive configuration. The development efficiency is improved by online debugging, thereby improving the efficiency of device access.
[0011] In combination with the first aspect, in a first implementation of the first aspect, in response to the driver configuration operation on the device model, determining the target driver of the device model includes:
[0012] Display the driver management page;
[0013] In response to a selection operation on the driver management page, creating a corresponding relationship between the target driver and the device model;
[0014] Display a driver development page, wherein the driver development page includes a driver node display area and a driver node configuration area;
[0015] In response to a selection operation on the driver node display area, displaying the data access node, the data conversion node, and the data output node in the driver node configuration area;
[0016] In response to the configuration operations on the data access node, the data conversion node and the data output node, a target drive of the device model is determined.
[0017] The device access method provided in the embodiment of the present invention realizes the binding of the target driver and the device model by establishing the corresponding relationship between the target driver and the created device model, and then realizes the construction of the interactive target driver by utilizing the selection, connection and configuration of the nodes, thereby improving the construction efficiency of the target driver.
[0018] In combination with the first implementation manner of the first aspect, in the second implementation manner of the first aspect, the responding to the configuration operation of the data access node, the data conversion node, and the data output node to determine the target driver of the device model includes:
[0019] In response to connection operations on the data access node, the data conversion node, and the data output node, determining the connection relationship;
[0020] The target drive is determined in response to operator setting operations on the data access node, the data conversion node, and the data output node.
[0021] The device access method provided in the embodiment of the present invention uses an integrated operator to configure each node. There is no need to understand the implementation logic of the algorithm, and the configuration of the node can be achieved through the integrated operator.
[0022] In combination with the first aspect, in a third implementation of the first aspect, in response to a creation operation of a device model of a target device, determining the interaction data type of the device model includes:
[0023] Display the device model page;
[0024] In response to a selection operation of a model in the device model page, determining the device model;
[0025] In response to the interaction data configuration operation on the device model, the interaction data type of the device model is determined, and the interaction data type includes the device data reported by the target device, the control command received by the target device, and the target event reported by the target device.
[0026] The device access method provided by the embodiment of the present invention reports data, control commands and configuration of target events in a page interactive manner during the construction of the device model, and can include all interaction data between the device and the platform, thereby ensuring the accuracy of the constructed device model.
[0027] In combination with the first aspect, in a fourth implementation of the first aspect, the method further includes:
[0028] Acquire the data to be processed corresponding to the device access task, where the data to be processed includes a device identifier of the corresponding device;
[0029] Determine a corresponding device driver based on the device identifier to determine a data processing logic corresponding to the device driver, wherein the data processing logic is determined based on operators of nodes in the device driver and connections between nodes;
[0030] The data to be processed is processed based on the data processing logic.
[0031] The device access method provided by the embodiment of the present invention, during specific data processing, parses the corresponding driver to extract the data processing logic corresponding to each node, and automatically processes the data to be processed according to the data processing logic, thereby improving the real-time performance of data interaction.
[0032] In combination with the fourth implementation manner of the first aspect, in the fifth implementation manner of the first aspect, the data processing logic is a pull control type, and the processing of the to-be-processed data based on the data processing logic includes:
[0033] Parsing the data access node in the data processing logic to determine the request interface corresponding to the data to be processed and the type of the request interface;
[0034] Processing the data to be processed based on the request interface and the type of the request interface to obtain preset data;
[0035] Parsing the data conversion node in the data processing logic, and performing data conversion on the preset data to determine target data;
[0036] The data output node in the data processing logic is parsed to determine a first target device corresponding to the target data, so as to push the target data to the first target device.
[0037] The device access method provided by the embodiment of the present invention parses the requested interface and the type of requested interface in the data processing logic of the pull control class, performs corresponding processing on the data to be processed, and then pushes the processed data to the target device, thereby ensuring the accuracy of the target data obtained by the target device.
[0038] In combination with the fourth implementation manner of the first aspect, in the sixth implementation manner of the first aspect, the data processing logic is a third-party push type, and the processing of the data to be processed based on the data processing logic includes:
[0039] Parsing the data conversion node in the data processing logic, and performing data conversion on the data to be processed to determine data in a target format;
[0040] The data output node in the data processing logic is parsed to determine a second target device corresponding to the data in the target format, so as to send the data in the target format to the second target device.
[0041] The device access method provided in the embodiment of the present invention converts the data to be processed into a unified target format for back-end processing in the data processing logic of the third-party push class, so that the method can be compatible with data access of multiple protocol types, expanding the application scenarios of the method.
[0042] According to the second aspect, an embodiment of the present invention further provides a device access apparatus, including:
[0043] A first response module, configured to determine the interactive data type of the device model in response to a creation operation of the device model of the target device;
[0044] A second response module, configured to determine a target drive of the device model in response to a drive configuration operation on the device model, wherein the target drive includes a connection relationship between a data access node, a data conversion node, and a data output node;
[0045] A debugging module, used for debugging the target driver;
[0046] The third response module is used to determine a target access task corresponding to the target driver in response to a task creation operation on the device model when the target driver is debugged successfully.
[0047] According to a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the device access method described in the first aspect or any one of the embodiments of the first aspect by executing the computer instructions.
[0048] According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the device access method described in the first aspect or any one of the implementations of the first aspect.
[0049] It should be noted that, for the corresponding beneficial effects of the device access apparatus, electronic device and computer-readable storage medium provided in the embodiments of the present invention, please refer to the description of the corresponding beneficial effects of the device access method above, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 is a schematic diagram of an application scenario according to an embodiment of the present invention;
[0052] Figure 2 is a flow chart of a device access method according to an embodiment of the present invention;
[0053] Figure 3 is a schematic diagram of a debugging interface according to an embodiment of the present invention;
[0054] Figure 4 is a schematic diagram of task creation according to an embodiment of the present invention;
[0055] Figure 5 is a flow chart of a device access method according to an embodiment of the present invention;
[0056] Figure 6is a schematic diagram of a driver management page according to an embodiment of the present invention;
[0057] Figure 7 is a schematic diagram of a driver development page according to an embodiment of the present invention;
[0058] Figure 8 is a schematic diagram of a node configuration according to an embodiment of the present invention;
[0059] Fig. 9 is a flow chart of a device access method according to an embodiment of the present invention;
[0060] Fig.10 is a business processing flow chart of HTTP Pull according to an embodiment of the present invention;
[0061] Fig.11 is a flowchart of HTTP Push service processing according to an embodiment of the present invention;
[0062] Fig.12 is a structural block diagram of a device access apparatus according to an embodiment of the present invention;
[0063] Fig.13 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0065] It should be noted that the device access method provided in the embodiment of the present invention can be used for an Internet of Things platform, or a device gateway connected to an Internet of Things platform, etc. There is no restriction on its specific application here, and it is set according to actual needs. The method provides a configuration interface for device access, constructs device models, drivers, and tasks in an interactive manner, and integrates various processing nodes in a modular manner. Users only need to pay attention to their data processing flow without having to understand the specific processing logic of the data in detail, thereby improving the efficiency of device access.
[0066] Furthermore, the method also provides a processing flow for data access using the target task obtained by the above configuration. In specific data processing, data processing logic is generated by the configured driver, and then the data processing logic is parsed to achieve data processing.
[0067] As an optional application scenario of the embodiment of the present invention, the electronic device is a device gateway, such as Figure 1 As shown, the electronic device 10 is connected to the IoT platform 20 through the Kafka bridge mode, and each device realizes data interaction with the IoT platform 20 by connecting to the electronic device 10. The data interaction between each device and the IoT platform includes but is not limited to the device uploading data to the IoT platform, the IoT platform sending control commands to the device, and the IoT platform pulling data from third-party devices and sending them to the device.
[0068] When a new device is added, the device model, driver and task are created on the electronic device 10. After the creation is completed, the device can subsequently interact with the Internet of Things platform 20 based on the created task based on the device model and driver.
[0069] Of course, the above is only an optional application scenario of an embodiment of the present invention and does not limit the protection scope of the present invention. The specific application scenario is set according to actual needs and is not limited here.
[0070] According to an embodiment of the present invention, an embodiment of a device access method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0071] In this embodiment, a device access method is provided, which can be used for the above-mentioned electronic devices, such as device routing, Internet of Things platform, etc. Figure 2 is a flow chart of device access according to an embodiment of the present invention, such as Figure 2 As shown, the process includes the following steps:
[0072] S11 , in response to a creation operation of a device model of a target device, determining an interactive data type of the device model.
[0073] The device model is related to the data interaction with the target device, and is used to define the data reported and received by the target device. For example, the reported data includes temperature, concentration, etc. The received data includes the control instructions of the IoT platform to the device, or the control instructions sent to the device by other third-party devices through the IoT platform, etc. The electronic device is provided with an interactive setting interface for model creation, and the user determines the interactive data type of the device model by configuring the corresponding parameters in the interactive setting interface.
[0074] For electronic devices, multiple types of device models can be built in. For example, they can be divided into image transmission and measurement categories according to their uses. There are corresponding device models for various uses. When setting up interactions, you can select built-in device models based on the device type. If there is no corresponding device model or the existing device model does not meet the requirements, the electronic device also provides a new interaction with the device model, and determines the interaction data of the device model through a custom device model.
[0075] It should be noted that the creation of the device model here does not mean building a three-dimensional device model, but setting the interactive data type of the device model.
[0076] This step will be described in detail below.
[0077] S12, in response to the driver configuration operation on the device model, determining a target driver of the device model.
[0078] The target driver includes the connection relationship between the data access node, the data conversion node and the data output node.
[0079] After the device model is determined, the driver needs to be configured so that the device model can process data according to the data processing logic defined by the driver. Specifically, the electronic device is provided with a driver configuration interface, on which data access nodes, data conversion nodes and data output nodes are defined to determine the target driver of the device model. Among them, the data access node is used to define where the data comes from, the data conversion node is used to define how the data is processed, and the data output node is used to define where the processed data is sent. For example, data access nodes include but are not limited to HTTP nodes, UDP nodes and TCP nodes; data conversion nodes include but are not limited to protocol type conversion, data format conversion, etc.; data output nodes include but are not limited to output to terminal devices, or output to the Internet of Things platform, or output value Kafka bridging, etc.
[0080] The user configures each node in the driver configuration interface provided by the electronic device, where the specific implementation of each node is realized through the built-in operator of the node. An operator is a program module that implements a certain function. There are operators with multiple functions built into the electronic device. When configuring a node, by configuring the operator, the node can realize the function corresponding to the operator.
[0081] In addition to various types of nodes, target drivers also include connection relationships between nodes. The connection relationship between nodes is used to indicate the processing direction of data, and a one-way arrow can be used to indicate the connection relationship between nodes.
[0082] This step will be described in detail below.
[0083] S13, debugging the target driver.
[0084] After configuring the target driver, debug the target driver online. The debugging is used to check whether the various functions of the target driver meet the requirements, realize online debugging, improve development efficiency, and users can see the running effect of their own code without waiting for the server to restart. For example, Figure 3 The target-driven debugging interface is shown, in which the debugging results of each node and the running time, etc. are displayed.
[0085] S14, when the target driver is debugged successfully, in response to the task creation operation on the device model, a target access task corresponding to the target driver is determined.
[0086] After the target driver is debugged, the target access task for the target device can be created. Figure 4 As shown, the electronic device is provided with a task configuration interface, in which the target access task is configured, wherein the task cycle is used to indicate the time interval at which the corresponding interaction data in the device model is reported or issued; the selection of the driver is used to associate the device model with the driver created in the above steps, so as to ensure that the device model can operate normally. After the corresponding parameters are configured in the task configuration interface as described in 4, the target access task corresponding to the target driver can be obtained. After the target device is subsequently online, the scheduled task is started, and the driver definition process is executed regularly to realize device access and data interaction.
[0087] The device access method provided in this embodiment implements device access in a modular manner, specifically utilizing device models, driver configuration, and task creation to implement target device access. The method provides an integrated access interface, reduces the developer's workload for device access development, and developers do not need to have an in-depth understanding of the IoT platform business. Access can be achieved through interactive configuration, and development efficiency is improved through online debugging, thereby improving device access efficiency.
[0088] In this embodiment, a device access method is provided, which can be used for the above-mentioned electronic devices, such as device routing, Internet of Things platform, etc. Figure 5 is a flow chart of device access according to an embodiment of the present invention, such as Figure 5 As shown, the process includes the following steps:
[0089] S21 , in response to a creation operation of a device model of a target device, determining an interactive data type of the device model.
[0090] Specifically, the above S21 includes:
[0091] S211, displaying a device model page.
[0092] When the target device is connected, the electronic device provides a user development interface. The user logs in to the development interface, and the device model page can be displayed on the interface of the electronic device.
[0093] S212: In response to a selection operation on a model in the device model page, determine a device model.
[0094] As mentioned above, electronic devices provide built-in models, so you can use the built-in models for reuse or customize the system model.
[0095] S213 , in response to the interaction data configuration operation on the device model, determining the interaction data type of the device model.
[0096] The interaction data types include device data reported by the target device, control commands received by the target device, and target events reported by the target device.
[0097] Fill in the attributes, commands and events contained in the device model in the device model page through interactive operations. Among them, attributes are common data reported by the device, such as temperature, brightness, etc.; commands are data sent to the device from the cloud, such as switches; events are special data generated by the device, such as smoke alarms, etc. Of course, the above attributes can be built-in device models, custom attributes, or attributes in the system model can be loaded. After adding the attributes, you can save the device model and determine the interactive data type of the device model.
[0098] S22 , in response to the driver configuration operation on the device model, determining a target driver of the device model.
[0099] The target driver includes the connection relationship between the data access node, the data conversion node and the data output node.
[0100] Specifically, the above S22 includes:
[0101] S221, displaying the driver management page.
[0102] The electronic device provides a driver management page, and the user creates a driver through the interactive interface of the driver management page, for example, setting the basic driver information such as manufacturer, model, access method (HTTP / TCP / UDP), etc. Figure 6 A schematic diagram of the driver management page is shown.
[0103] S222: In response to the selection operation on the driver management page, a corresponding relationship between the target driver and the device model is created.
[0104] like Figure 6 As shown, in the process of configuring the basic information of the driver, the device model created in the above steps is selected in the model to achieve the creation of the corresponding relationship between the target driver and the device model. That is, the binding relationship between the target driver and the device model created subsequently is achieved.
[0105] S223, displaying the driver development page.
[0106] The driver development page includes a driver node display area and a driver node configuration area.
[0107] In the driver development page, you can freely edit the data conversion process of the entire device access by dragging and dropping nodes. There are many types of nodes built into the electronic device by default: data input nodes, such as HTTP nodes, UDP nodes, and TCP nodes, etc., data conversion nodes, and data output nodes. These three types of nodes deal with where the data comes from, how the data is converted, and where the data goes. Users can connect different types of nodes through one-way connecting lines, and the direction of the connecting line represents the direction of data flow.
[0108] like Figure 7 As shown, the left side of the driver development page is the driver node display area, and the back side is the driver node configuration area. In the driver node display area, restrictions are made by node type, including HTTP interface, data conversion, and data push, which correspond to the data input node, data conversion node, and data output node described above, respectively.
[0109] S224, in response to the selection operation on the driving node display area, displaying the data access node, the data conversion node and the data output node in the driving node configuration area.
[0110] By interacting with the driver development page, the user can select the corresponding node from the driver node display area and place it in the driver node configuration area. The interactive operations include but are not limited to dragging, selecting, and copying.
[0111] S225 , in response to the configuration operation on the data access node, the data conversion node, and the data output node, to determine the target driver of the device model.
[0112] After placing the data input node, data conversion node, and data output node in the driver node configuration area, in order to express the processing logic relationship between the nodes, use one-way arrows to connect the nodes with associated relationships. For example, Figure 7The arrowed line is shown. Furthermore, in addition to determining the association relationship between nodes, data processing logic can also be configured for each node. Of course, each node can also use its own logic for processing, or it can be customized. The data processing logic of each node is implemented by the corresponding operator, and each operator can be built-in in the node or customized.
[0113] In some implementations, the above S225 includes:
[0114] (1) In response to connection operations on a data access node, a data conversion node, and a data output node, a connection relationship is determined.
[0115] (2) In response to the operator setting operation on the data access node, the data conversion node and the data output node, the target drive is determined.
[0116] For the determination of the connection relationship, please refer to the above description. After the connection relationship is determined, the electronic device also provides an operator setting interface. For example, after the user selects a node, the interface displays the following Figure 8 Alternatively, the user right-clicks the node to display the operator configuration interface. Of course, there is no limitation on the triggering display mode of the operator configuration interface, which can be set according to actual needs.
[0117] Configure the operator on the operator configuration interface, for example Figure 8 The contents selected by the rectangular box in the figure. This part of the operators can be built-in to the node, or modified on this basis, etc. Use the integrated operators to configure each node. There is no need to understand the implementation logic of the algorithm. The node configuration can be realized through the integrated operators.
[0118] S23, debugging the target driver.
[0119] For details, please see Figure 2 S13 of the illustrated embodiment will not be described in detail here.
[0120] S24, when the target driver is debugged successfully, in response to the task creation operation on the device model, a target access task corresponding to the target driver is determined.
[0121] For details, please see Figure 2 S14 of the illustrated embodiment will not be described in detail here.
[0122] The device access method provided in this embodiment reports data, control commands and configuration of target events in a page interactive manner during the device model construction process, and can include all interactive data between the device and the platform, thereby ensuring the accuracy of the constructed device model. By establishing a corresponding relationship between the target driver and the created device model, the target driver and the device model are bound, and then the construction of the interactive target driver is realized by selecting, connecting and configuring the nodes, thereby improving the construction efficiency of the target driver.
[0123] In this embodiment, a device access method is provided, which can be used for the above-mentioned electronic devices, such as device routing, Internet of Things platform, etc. Figure 2 as well as Figure 5 The device access method shown is described from the configuration process before device access, and in the following embodiments, it is described from the specific processing process of access data. Of course, the configuration process before device access described above is still applicable in the embodiments described below. Fig. 9 is a flow chart of device access according to an embodiment of the present invention, such as Fig. 9 As shown, the process includes the following steps:
[0124] S31, obtaining the to-be-processed data corresponding to the device access task.
[0125] The data to be processed includes a device identification of a corresponding device.
[0126] The data to be processed can be uploaded by the device to the electronic device, or sent by the electronic device to the device, and therefore, are collectively referred to as the data to be processed corresponding to the device access task. The data to be processed includes the device identification of the device, which is used to determine the device currently interacting with data. The device identification can be the device serial number, or a unique identification assigned by the electronic device when the device model is constructed, etc.
[0127] S32, determining a corresponding device driver based on the device identifier to determine a data processing logic corresponding to the device driver.
[0128] The data processing logic is determined based on the operators of the nodes in the device driver and the connections between the nodes.
[0129] As mentioned above, the device needs to configure the driver before connecting to the electronic device. The driver is used to define the processing logic of the interactive data related to the device. Therefore, after obtaining the data to be processed, the device driver is queried using the device identifier in the data to be processed, so as to use the device driver to process the data to be processed.
[0130] According to the above description, the driver is represented in a graphical form. For electronic devices, it is necessary to identify the graphical form and convert it into a processable logic. Therefore, after determining the device driver, it is necessary to convert the device driver into the corresponding data processing logic. For example, a tree diagram is used in the electronic device to represent the graphical driver, and each node of the tree diagram represents each node in the driver, and the processing method of each node is implemented by the operator described above.
[0131] S33, processing the data to be processed based on the data processing logic.
[0132] After the data processing logic is determined, the data processing logic can be used to process the data to be processed. The electronic device processes the data to be processed by calling an operator, for example, performing a corresponding function operation or logic comparison on the data to be processed.
[0133] The device access method provided in this embodiment, during specific data processing, parses the corresponding driver to extract the data processing logic corresponding to each node, and automatically processes the data to be processed according to the data processing logic, thereby improving the real-time performance of data interaction.
[0134] Device access is divided into two categories: HTTP and non-HTTP. According to the request direction, it can be divided into pull control and third-party push. For pull control, it means that the electronic device calls the interface or service of the third-party manufacturer to obtain data or issue commands; for third-party push, the third party needs to call the interface or service of the electronic device to push device data. Access types include but are not limited to: HTTP Pull, HTTP Push, TCP Pull, TCP Push, etc.
[0135] In some implementations, when the data processing logic is a pull control type, the above S33 includes:
[0136] (1) Analyze the data access nodes in the data processing logic to determine the request interface corresponding to the data to be processed and the type of the request interface.
[0137] (2) Based on the request interface and the type of the request interface, the data to be processed is processed to obtain preset data.
[0138] (3) Analyze the data conversion nodes in the data processing logic and perform data conversion on the preset data to determine the target data.
[0139] (4) Analyze the data output node in the data processing logic, determine the first target device corresponding to the target data, and push the target data to the first target device.
[0140] The data processing logic is obtained by analyzing the device driver, for example, converting the device driver into a language representation that can be processed by the electronic device, for example, generating a domain-specific language (DSL) code based on the device driver. By parsing the data access nodes in the data processing logic, it is obtained which request interfaces the data to be processed should be sent to and the types of each request interface. Among them, the types of request interfaces include but are not limited to loop, authentication, and processing, etc.
[0141] After determining the request interface and type, the operator corresponding to the data access node is used to process it accordingly to obtain the preset data. Then the data conversion node in the data processing logic is parsed to determine the data conversion method, and the preset data is converted using the data conversion method to obtain the target data. Finally, the data output node in the data processing logic is parsed to obtain the first target device corresponding to the target data, that is, the recipient of the target device, and the target data is pushed to the first target device.
[0142] In the data processing logic of the pull control class, the requested interface and the type of the requested interface are parsed, the data to be processed is processed accordingly, and then the processed data is pushed to the target device, thereby ensuring the accuracy of the target data obtained by the target device.
[0143] In a specific embodiment, Fig.10 As shown, the data processing methods of HTTP Pull include:
[0144] (1) Read the driver configuration and generate DSL code. DSL is a specific language that describes the relationships between nodes in the driver through operators.
[0145] (2) Parse the HTTP Pull node operator in the DSL to determine which interfaces need to be requested and what types of interfaces these interfaces are. When encountering an authentication type request, it will be processed according to the authentication business and the configured login information will be sent to the authentication interface. The returned data will be retained in the session and can be used by the next node; when encountering a loop type request, it is necessary to provide loop data input.
[0146] (3) Parse the data conversion node operators in the DSL and generate basic information of the device, metadata of the device, and attributes based on the operators.
[0147] (4) According to the standard node configuration, the converted device information is transferred to the corresponding endpoint, such as the IoT platform, Kafka, and third-party systems.
[0148] In some implementations, when the data processing logic is a third-party push type, the above S33 includes:
[0149] (1) Parse the data conversion nodes in the data processing logic and perform data conversion on the data to be processed to determine the target format of the data.
[0150] (2) Parsing the data output node in the data processing logic, determining the second target device corresponding to the data in the target format, and sending the data in the target format to the second target device.
[0151] The third-party push type is that a third-party device uploads data to the electronic device, and accordingly, the electronic device converts the received data into a target format that the electronic device can process, and finally sends the target format data to a second target device. The second target device includes but is not limited to an IoT platform and a storage device, etc.
[0152] The electronic device analyzes the data conversion node in the data processing logic to determine the data conversion method, that is, converts the data to be processed in various formats into data in the target format. Then, the electronic device analyzes the data output node in the data processing logic to determine the terminal that receives the data in the target format, that is, the second target device. The electronic device then sends the data in the target format to the second target device, so that the second target device performs corresponding processing on the received data in the target format.
[0153] In the data processing logic of the third-party push class, the data to be processed is converted into a unified target format for back-end processing, so that the method can be compatible with data access of multiple protocol types, expanding the application scenarios of the method.
[0154] In a specific embodiment, Fig.11 As shown, the data processing method of HTTP Push includes:
[0155] After receiving the data reporting request from the third party, the electronic device will find the corresponding driver according to the product, model, project and other information of the device; and generate the DSL for data conversion according to the driver configuration. The parsing operator converts the transmitted data into the target data format defined by the electronic device. After obtaining the data in the target format, it can be uploaded to the device for storage, or uploaded to the Internet of Things platform, etc. Among them, the standard data format can be as follows:
[0156]
[0157] In this embodiment, a device access device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0158] This embodiment provides a device access apparatus, such as Fig.12 As shown, including:
[0159] A first response module 41, configured to determine the interactive data type of the device model in response to a creation operation of the device model of the target device;
[0160] A second response module 42, configured to determine a target drive of the device model in response to a drive configuration operation on the device model, wherein the target drive includes a connection relationship between a data access node, a data conversion node, and a data output node;
[0161] A debugging module 43, used for debugging the target driver;
[0162] The third response module 44 is configured to determine a target access task corresponding to the target driver in response to a task creation operation on the device model when the target driver is debugged successfully.
[0163] In some embodiments, the second response module 42 includes:
[0164] A first display unit, used for displaying a driver management page;
[0165] A first response unit, configured to create a correspondence between the target driver and the device model in response to a selection operation on the driver management page;
[0166] A second display unit, used to display a driver development page, wherein the driver development page includes a driver node display area and a driver node configuration area;
[0167] A second response unit, configured to display the data access node, the data conversion node and the data output node in the driver node configuration area in response to a selection operation on the driver node display area;
[0168] The third response unit is used to respond to the configuration operation of the data access node, the data conversion node and the data output node to determine the target drive of the device model.
[0169] In some embodiments, the third response unit includes:
[0170] A first response subunit, configured to determine the connection relationship in response to a connection operation on the data access node, the data conversion node, and the data output node;
[0171] The second response subunit is used to determine the target drive in response to the operator setting operation on the data access node, the data conversion node and the data output node.
[0172] In some embodiments, the first response module 41 includes:
[0173] A third display unit, used to display a device model page;
[0174] In response to a selection operation of a model in the device model page, determining the device model;
[0175] In response to the interaction data configuration operation on the device model, the interaction data type of the device model is determined, and the interaction data type includes the device data reported by the target device, the control command received by the target device, and the target event reported by the target device.
[0176] In some embodiments, the device further comprises:
[0177] An acquisition module, used to acquire the to-be-processed data corresponding to the device access task, wherein the to-be-processed data includes a device identifier of the corresponding device;
[0178] A determination module, used to determine a corresponding device driver based on the device identifier, so as to determine a data processing logic corresponding to the device driver, wherein the data processing logic is determined based on operators of nodes in the device driver and connections between nodes;
[0179] A processing module is used to process the data to be processed based on the data processing logic.
[0180] In some implementations, the data processing logic is a pull control type, and the processing module includes:
[0181] A first parsing unit, configured to parse the data access node in the data processing logic, and determine a request interface corresponding to the data to be processed and a type of the request interface;
[0182] A processing unit, configured to process the data to be processed based on the request interface and the type of the request interface to obtain preset data;
[0183] A second parsing unit, used to parse the data conversion node in the data processing logic, and perform data conversion on the preset data to determine target data;
[0184] The third parsing unit is used to parse the data output node in the data processing logic, determine the first target device corresponding to the target data, and push the target data to the target device.
[0185] In some implementations, the data processing logic is a third-party push type, and the processing module includes:
[0186] A fourth parsing unit, configured to parse the data conversion node in the data processing logic, and perform data conversion on the data to be processed to determine data in a target format;
[0187] A fifth parsing unit is used to parse the data output node in the data processing logic, determine the second target device corresponding to the data in the target format, and send the data in the target format to the second target device.
[0188] The device access apparatus in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0189] The further functional description of each of the above modules is the same as that of the above corresponding embodiments and will not be repeated here.
[0190] The embodiment of the present invention also provides an electronic device having the above Fig.12 The device shown is accessed by a device.
[0191] See also Fig.13 , Fig.13 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Fig.13 As shown, the electronic device may include: at least one processor 51, such as a CPU (Central Processing Unit), at least one communication interface 53, a memory 54, and at least one communication bus 52. The communication bus 52 is used to realize the connection and communication between these components. The communication interface 53 may include a display screen (Display) and a keyboard (Keyboard), and the optional communication interface 53 may also include a standard wired interface and a wireless interface. The memory 54 may be a high-speed RAM memory (Random Access Memory) or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 54 may optionally be at least one storage device located away from the aforementioned processor 51. The processor 51 may be combined with Fig.12In the described device, the memory 54 stores an application program, and the processor 51 calls the program code stored in the memory 54 to execute any of the above method steps.
[0192] The communication bus 52 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The communication bus 52 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.13 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0193] Among them, the memory 54 may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviated: RAM); the memory may also include a non-volatile memory (English: non-volatile memory), such as a flash memory (English: flash memory), a hard disk drive (English: hard disk drive, abbreviated: HDD) or a solid-state drive (English: solid-state drive, abbreviated: SSD); the memory 54 may also include a combination of the above types of memory.
[0194] The processor 51 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and a NP.
[0195] The processor 51 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0196] Optionally, the memory 54 is also used to store program instructions. The processor 51 can call the program instructions to implement the device access method shown in any embodiment of the present application.
[0197] The embodiment of the present invention also provides a non-transitory computer storage medium, which stores computer executable instructions, and the computer executable instructions can execute the device access method in any of the above method embodiments. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, abbreviated: HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.
[0198] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A device access method, characterized in that: include: In response to a creation operation of a device model of a target device, determining an interactive data type of the device model; In response to a driver configuration operation on the device model, a target driver of the device model is determined, the target driver includes a connection relationship between a data access node, a data conversion node, and a data output node, wherein the determination of the target driver of the device model in response to the driver configuration operation on the device model includes: displaying a driver management page; in response to a selection operation on the driver management page, creating a corresponding relationship between the target driver and the device model; displaying a driver development page, the driver development page including a driver node display area and a driver node configuration area; in response to a selection operation on the driver node display area, displaying the data access node, the data conversion node, and the data output node in the driver node configuration area; in response to the configuration operation on the data access node, the data conversion node, and the data output node, to determine the target driver of the device model; Debugging the target driver; When the target driver is debugged successfully, in response to a task creation operation on the device model, a target access task corresponding to the target driver is determined.
2. The method according to claim 1, characterized in that The step of determining the target driver of the device model in response to the configuration operation of the data access node, the data conversion node, and the data output node includes: In response to connection operations on the data access node, the data conversion node, and the data output node, determining the connection relationship; The target drive is determined in response to operator setting operations on the data access node, the data conversion node, and the data output node.
3. The method according to claim 1, characterized in that: In response to the creation operation of the device model of the target device, determining the interactive data type of the device model includes: Display the device model page; In response to a selection operation of a model in the device model page, determining the device model; In response to the interaction data configuration operation on the device model, the interaction data type of the device model is determined, and the interaction data type includes the device data reported by the target device, the control command received by the target device, and the target event reported by the target device.
4. The method according to claim 1, characterized in that: The method further comprises: Acquire the data to be processed corresponding to the device access task, where the data to be processed includes a device identifier of the corresponding device; Determine a corresponding device driver based on the device identifier to determine a data processing logic corresponding to the device driver, wherein the data processing logic is determined based on operators of nodes in the device driver and connections between nodes; The data to be processed is processed based on the data processing logic.
5. The method according to claim 4, characterized in that The data processing logic is a pull control type, and the processing of the data to be processed based on the data processing logic includes: Parsing the data access node in the data processing logic to determine the request interface corresponding to the data to be processed and the type of the request interface; Processing the data to be processed based on the request interface and the type of the request interface to obtain preset data; Parsing the data conversion node in the data processing logic, and performing data conversion on the preset data to determine target data; The data output node in the data processing logic is parsed to determine a first target device corresponding to the target data, so as to push the target data to the first target device.
6. The method according to claim 4, characterized in that The data processing logic is a third-party push type, and the processing of the data to be processed based on the data processing logic includes: Parsing the data conversion node in the data processing logic, and performing data conversion on the data to be processed to determine data in a target format; The data output node in the data processing logic is parsed to determine a second target device corresponding to the data in the target format, so as to send the data in the target format to the second target device.
7. A device access apparatus, characterized in that: include: A first response module, configured to determine the interactive data type of the device model in response to a creation operation of the device model of the target device; a second response module, for determining the target driver of the device model in response to the driver configuration operation on the device model, the target driver including the connection relationship between the data access node, the data conversion node and the data output node, wherein the second response module is specifically used to display a driver management page; in response to the selection operation on the driver management page, create a corresponding relationship between the target driver and the device model; display a driver development page, the driver development page including a driver node display area and a driver node configuration area; in response to the selection operation on the driver node display area, display the data access node, the data conversion node and the data output node in the driver node configuration area; in response to the configuration operation on the data access node, the data conversion node and the data output node, determine the target driver of the device model; A debugging module, used for debugging the target driver; The third response module is used to determine a target access task corresponding to the target driver in response to a task creation operation on the device model when the target driver is debugged successfully.
8. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the device access method according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the device access method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method for generating internet applications on line, system integration method and supporting platform
CN105512304A
Equipment data access method and device, computer equipment and storage medium
CN110515522A
Dynamic interaction method and system for Internet of Things equipment and platform, and storage medium
CN110716974A
Gateway system and method supporting multiple types of equipment to access Internet of Things
CN111491001A
Access method and equipment of third-party equipment, electronic equipment and readable storage medium
CN112559357A
