Access Method, Device, Electronic Device and Readable Storage Medium for Third-Party Devices

By responding to the third-party device model parameter configuration, analyzing the channel program and executing the application program interface, the code burden and debugging problems of third-party devices when accessing the Internet of Things platform are solved, and the online debugging and service stability of third-party devices are achieved.

CN112559357BActive Publication Date: 2025-05-30GLODON CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011520417.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-21
Publication Date
2025-05-30
Estimated Expiration
2040-12-21

AI Technical Summary

Technical Problem

In the prior art, when third-party devices access the Internet of Things platform, developers need to manually define model information, attribute information and process network logic, which increases the code burden of developers, and each time the access is successful, the service needs to be redeployed, resulting in service interruption, inconvenient debugging and difficult to confirm the access status in time.

Method used

By responding to model parameter configuration operations on third-party devices, acquiring and parsing channel programs, determining application program interfaces, and executing channel programs based on configuration properties and interfaces, returning debugging data in real time, avoiding redeployment of services, and realizing online debugging and timely access status confirmation.

Benefits of technology

It reduces the burden of developers on writing code, ensures uninterrupted third-party device services, and realizes online debugging and timely access status confirmation of third-party devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112559357B_ABST
    Figure CN112559357B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of third-party device data processing, and discloses an access method, device, electronic device and readable storage medium for a third-party device. Among them, the method includes: responding to a configuration operation on model parameters of at least one third-party device; obtaining channel programs of at least one third-party device based on the device types of at least one third-party device; parsing the channel programs to determine application program interfaces corresponding to configuration commands of at least one third-party device; determining debugging data of at least one third-party device based on the configuration attributes and application program interfaces of at least one third-party device; determining the access status of at least one third-party device according to the debugging data of at least one third-party device to debug the channel programs. By implementing the present invention, the code burden is reduced, real-time return of debugging data and online debugging of third-party devices are achieved, and the access status of third-party devices can be determined in a timely manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of third-party device data processing, and particularly to an access method, device, electronic device and readable storage medium for a third-party device. Background Art

[0002] Currently, the technology for third-party devices to access the Internet of Things platform is implemented based on the Python language. For different third-party device connections, it is necessary to define the device model of the third-party device and define its attribute list in the device model. When the server receives the data of the third-party device, it is necessary to perform attribute mapping on the data reported by the third-party device, filter out the attributes required by the Internet of Things platform, convert them into standard format data, and then report them to the Internet of Things platform. Although the third-party device access technology implemented based on the Python language supports custom access of protocols such as HTTP, TCP, UDP, supports docking through open interfaces, and also supports third-party devices to directly connect to the Internet of Things platform address for docking, when accessing a type of third-party device, it is necessary to define model information and attribute information, and manually handle network-related logic. This requires developers to be proficient in the Python language and be able to be familiar with the implementation framework process of the Python language, increasing the code burden on developers. Moreover, after each third-party device access development is completed, it is necessary to redeploy the service of the third-party device, resulting in the interruption of the third-party device service, which is not convenient for the access debugging of the third-party device and difficult to confirm in a timely manner whether the third-party device is successfully accessed. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide an access method, device, electronic device and readable storage medium for a third-party device to solve the problems of heavy code burden on developers, inconvenient access debugging, and difficulty in timely confirming whether the third-party device is successfully accessed.

[0004] According to a first aspect, an embodiment of the present invention provides an access method for a third-party device, including the following steps: in response to a configuration operation on model parameters of at least one third-party device, the model parameters including attributes and commands; obtaining a channel program of the at least one third-party device based on the device type of the at least one third-party device; parsing the channel program to determine an application program interface corresponding to a configuration command of the at least one third-party device; determining debugging data of the at least one third-party device based on the configuration attributes of the at least one third-party device and the application program interface; and determining an access status of the at least one third-party device according to the debugging data of the at least one third-party device to debug the channel program.

[0005] The access method for third-party devices provided by the embodiments of the present invention responds to a configuration operation on model parameters of at least one third-party device, where the model parameters include attributes and commands. Based on the device types of at least one third-party device, channel programs of at least one third-party device are obtained, the channel programs are parsed, application program interfaces corresponding to the configuration commands of at least one third-party device are determined, and based on the configuration attributes and application program interfaces of at least one third-party device, debugging data of at least one third-party device is determined. The access status of at least one third-party device is determined according to the debugging data to debug the channel program. This method responds to a configuration operation on model parameters of at least one third-party device. Without developers defining the model information and attribute information of third-party devices in the code program, developers only need to write and upload the channel program according to the task requirements of third-party devices, thereby reducing the code writing burden of developers. And according to the configuration of third-party devices, corresponding application program interfaces are determined, and the channel program is executed within the determined application program interfaces according to the configuration data of third-party devices, and debugging data is returned in real time without redeploying the services of third-party devices, ensuring the uninterrupted services of third-party devices. At the same time, the access status of third-party devices is determined according to the debugging data. When the access is unsuccessful, the channel program is modified, realizing the online debugging of third-party devices and being able to determine the access status of third-party devices in a timely manner.

[0006] Combined with the first aspect, in the first implementation manner of the first aspect, the responding to a configuration operation on model parameters of at least one third-party device, where the model parameters include attributes and commands, includes: based on the configuration operation, determining the model parameters of at least one third-party device; based on the model parameters of at least one third-party device, determining the models of at least one third-party device.

[0007] The access method for third-party devices provided by the embodiments of the present invention determines the model parameters of third-party devices through a configuration operation on the model parameters of third-party devices, generates models of third-party devices according to the model parameters, avoids developers defining model parameters such as attributes and commands of third-party devices in the development program, and without developers understanding the model definition framework of third-party devices, reduces the code burden of developers; without developers understanding the programming language of the model definition framework of third-party devices, realizes the rapid construction of third-party device models.

[0008] Combined with the first aspect, in the second implementation manner of the first aspect, the obtaining the channel programs of at least one third-party device based on the device types of at least one third-party device includes: using the device types of at least one third-party device to determine whether there are corresponding channel programs; when there are corresponding channel programs, extracting the corresponding channel programs to determine the channel programs of at least one third-party device.

[0009] The access method for third-party devices provided by the embodiments of the present invention uses the device types of at least one third-party device to determine whether there is a corresponding channel program. When there is a corresponding channel program, the corresponding channel program is extracted to determine the channel programs of at least one third-party device. Third-party devices of the same type do not need to be loaded repeatedly, reducing the memory occupancy and thus improving the running speed of the channel program. By dynamically loading the channel programs of third-party devices, it is avoided that excessive memory occupancy affects the access speed of third-party devices.

[0010] In combination with the first aspect, in the third implementation manner of the first aspect, determining the debugging data of the at least one third-party device based on the configuration attributes of the at least one third-party device and the application programming interface includes: obtaining the interface type of the application programming interface, where the interface type includes a pull control interface and a push interface; determining the processing mode corresponding to the interface type based on the interface type; and determining the debugging data of the at least one third-party device based on the processing mode and the configuration attributes of the at least one third-party device.

[0011] The access method for third-party devices provided by the embodiments of the present invention obtains the interface type of the application programming interface, where the interface type includes a pull control interface and a push interface, determines the processing mode corresponding to the interface type based on the interface type, and determines the debugging data of the at least one third-party device based on the processing mode and the configuration attributes of the at least one third-party device. Since the processing modes corresponding to different types of application programming interfaces are different, by obtaining the interface type of the application programming interface, the channel program can be connected to the corresponding application programming interface, the channel program is executed according to the configuration attributes of the third-party device and the processing mode of the application programming interface, and the debugging data corresponding to the third-party device is returned, realizing the online debugging of the access of the third-party device, avoiding the situation that the service of the third-party device is interrupted due to the need to redeploy the application programming interface after accessing the debugging program, and thus ensuring the uninterrupted online debugging of the access of the third-party device.

[0012] In combination with the fifth implementation manner of the first aspect, in the fourth implementation manner of the first aspect, when the interface type is an authentication pull control interface, determining the debugging data of the at least one third-party device based on the processing mode and the configuration attributes of the at least one third-party device includes: obtaining the login information; sending the login information to the application programming interface, and in the application programming interface, executing the channel program based on the configuration attributes of the at least one third-party device, and returning the debugging data of the at least one third-party device for executing the channel program.

[0013] The access method for a third-party device provided by an embodiment of the present invention, when the interface type is an authentication pull control interface, obtains login information and sends the login information to an application programming interface to determine that the channel program of the third-party device has execution permission. After determining that the channel program has execution permission, the channel program is executed in the application programming interface based on at least one configuration attribute of the third-party device, and debugging data of the executed channel program of at least one third-party device is returned. By determining the interface type to determine the access process of the channel program, the channel program can directly perform data flow according to the processing mode of the authentication pull control interface, improving the access speed of the third-party device.

[0014] Combined with the fifth implementation manner of the first aspect, in the fifth implementation manner of the first aspect, when the interface type is a cyclic pull control interface, the determining the debugging data of the at least one third-party device based on the processing mode and the at least one configuration attribute of the third-party device includes: displaying an input page for cyclic data; in response to an operation on the input page for cyclic data, determining the cyclic data of the at least one third-party device; based on the cyclic data and the configuration data of the at least one third-party device, running the channel program of the at least one third-party device, and returning the debugging data of the executed channel program.

[0015] The access method for a third-party device provided by an embodiment of the present invention, when the interface type is a cyclic pull control interface, displays an input page for cyclic data, in response to an operation on the input page for cyclic data, determines the cyclic data of at least one third-party device, and based on the cyclic data and the configuration data of at least one third-party device, runs the channel program and returns the debugging data of the executed channel program. By determining the interface type to determine the access process of the channel program, the channel program can directly perform data flow according to the processing mode of the cyclic pull control interface, improving the access speed of the third-party device.

[0016] Combined with the fifth implementation manner of the first aspect, in the sixth implementation manner of the first aspect, when the interface type is a push interface, the determining the debugging data of the at least one third-party device based on the processing mode and the at least one configuration attribute of the third-party device includes: receiving the reported request data of the at least one third-party device, and determining the associated program of the at least one third-party device; determining whether the associated program has been loaded; when the associated program has been loaded, detecting whether the reported request data is legal; when the reported request data is legal, returning the debugging data corresponding to the reported request data.

[0017] The access method for third-party devices provided by the embodiments of the present invention, when the interface type is a push interface, receives the reported request data of at least one third-party device, determines the associated programs of at least one third-party device, determines whether the associated programs have been loaded, when the associated programs have been loaded, detects whether the reported request data is legal, and when the reported request data is legal, returns the debugging data corresponding to the reported request data, ensuring the security of data push. By determining the interface type to determine the access process of the channel program, the channel program can directly perform data flow according to the processing mode of the push interface, improving the access speed of third-party devices.

[0018] According to a second aspect, the embodiments of the present invention provide an access device for third-party devices, including: a first response module, configured to respond to a configuration operation on the model parameters of at least one third-party device, where the model parameters include attributes and commands; an acquisition module, configured to acquire the channel programs of the at least one third-party device based on the device types of the at least one third-party device; a parsing module, configured to parse the channel programs to determine the application program interfaces corresponding to the configuration commands of the at least one third-party device; a determination module, configured to determine the debugging data of the at least one third-party device based on the configuration attributes of the at least one third-party device and the application program interfaces; and a debugging module, configured to determine the access status of the at least one third-party device according to the debugging data of the at least one third-party device to debug the channel programs.

[0019] The access device for third-party devices provided by the embodiments of the present invention responds to a configuration operation on model parameters of at least one third-party device, where the model parameters include attributes and commands. Based on the device types of at least one third-party device, it obtains the channel programs of at least one third-party device, parses the channel programs, determines the application program interfaces corresponding to the configuration commands of at least one third-party device, and based on the configuration attributes and application program interfaces of at least one third-party device, determines the debugging data of at least one third-party device, and determines the access status of at least one third-party device according to the debugging data to debug the channel programs. By responding to the configuration operation on the model parameters of at least one third-party device, this device does not require developers to define the model information and attribute information of third-party devices in the code program. Developers only need to write and upload the channel programs according to the task requirements of third-party devices, thereby reducing the code writing burden of developers. Moreover, it determines the corresponding application program interfaces according to the configuration of third-party devices, executes the channel programs within the determined application program interfaces according to the configuration data of third-party devices, and returns the debugging data in real time without redeploying the services of third-party devices to ensure the uninterrupted service of third-party devices. At the same time, it determines the access status of third-party devices according to the debugging data. When the access is unsuccessful, it modifies the channel programs, realizing the online debugging of third-party devices and being able to determine the access status of third-party devices in a timely manner.

[0020] According to a third aspect, an embodiment of the present invention provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the access method for third-party devices according to the first aspect or any one of the embodiments of the first aspect.

[0021] According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the access method for third-party devices according to the first aspect or any one of the embodiments of the first aspect. Description of the Drawings

[0022] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0023] Figure 1 is a flowchart of the access method for third-party devices according to an embodiment of the present invention;

[0024] Figure 2 It is a flowchart of a method for accessing a third - party device according to an embodiment of the present invention;

[0025] Figure 3 It is a flowchart of a method for accessing a third - party device according to an embodiment of the present invention;

[0026] Figure 4 It is a structural block diagram of an access device for a third - party device according to an embodiment of the present invention;

[0027] Figure 5 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present invention.

[0029] For the method of accessing a third - party device implemented based on the Python language, each time a new third - party device is accessed, model information and attribute information need to be defined, and the logic related to the network needs to be manually processed. This requires developers to be proficient in the Python language and be able to know well the implementation framework process of the Python language, increasing the code burden of developers. Moreover, every time the access of a third - party device is developed and completed, the service of the third - party device needs to be redeployed, resulting in the interruption of the service of the third - party device, which is not convenient for the access and debugging of the third - party device, and it is difficult to confirm in time whether the third - party device has been successfully accessed to the Internet of Things platform.

[0030] Based on this, this application implements the access of a third - party device to the Internet of Things platform based on the Java language. By responding to the configuration operation of the model parameters of at least one third - party device, the device type of the third - party device is determined, and developers do not need to define the model information and attribute information of the third - party device in the code program, reducing the code - writing burden of developers; according to the configuration of the third - party device, the corresponding application programming interface is determined, and within the determined application programming interface, the channel program is executed according to the configuration information of the third - party device, and the debugging data is returned in real time, realizing the online debugging of the third - party device and being able to determine the access status of the third - party device in time.

[0031] According to an embodiment of the present invention, an embodiment of an access method for a third-party device 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 the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0032] In this embodiment, an access method for a third-party device is provided, which can be used in electronic devices such as an Internet of Things platform, a server terminal, etc. In this application embodiment, the Internet of Things platform is taken as an example for illustration. Figure 1 It is a flowchart of an access method for a third-party device according to an embodiment of the present invention, as Figure 1 shown, and this process includes the following steps:

[0033] S11, in response to a configuration operation on model parameters of at least one third-party device, where the model parameters include attributes and commands.

[0034] The third-party device is other electronic devices accessing the Internet of Things platform, such as a smoke detector, a temperature sensor, etc. On the display interface of the Internet of Things platform, there may be labels or buttons for configuring the model parameters of the third-party device, or developers use other interaction methods to interact with the Internet of Things platform to perform a configuration operation on the model parameters of at least one third-party device. The model parameters include attributes and commands. Among them, the attributes are general data (such as temperature data, smoke data) and characteristic data (such as smoke alarm) that the third-party device needs to report; the commands are control data (such as switch control) sent by the Internet of Things platform that the third-party device can receive. For example, on the display interface of the Internet of Things platform, there are respectively displayed configuration labels for attributes and commands, or there may be parameter setting labels corresponding to at least one attribute and command displayed on the display interface of the Internet of Things platform. When developers need to set the parameters of one or more of the attributes and commands, the Internet of Things platform, in response to the operation of the developers, configures the corresponding attributes and commands of the third-party device.

[0035] S12, based on the device types of at least one third-party device, obtain the channel programs of at least one third-party device.

[0036] The device type is the type corresponding to the third-party device. For example, a smoke detector and a temperature sensor belong to the sensor device; a crane, a sprinkler device, etc. belong to the hardware control device. The channel program is a Java program developed by developers according to functional requirements. Since the device types of the third-party devices are different and the tasks to be performed are different, the corresponding channel programs may also be different. The Internet of Things platform can, in response to the upload operation of the developers, obtain the channel programs of at least one third-party device to be accessed.

[0037] S13. Analyze the channel program to determine the application programming interface corresponding to the configuration commands of at least one third-party device.

[0038] Based on the fact that the developer uploads the channel program in the form of a jar package, after the Internet of Things platform receives the jar package containing the channel program, it compiles and analyzes the jar package containing the channel program to obtain the Java program and the configuration file corresponding to the Java program. Among them, the Java program is used to send control instructions to the third-party device or call the device data of the third-party device, etc. Through the configuration file, the application programming interface required to execute the Java program can be determined, that is, the application programming interface corresponding to the configuration commands of at least one third-party device is determined.

[0039] S14. Based on the configuration attributes and application programming interfaces of at least one third-party device, determine the debugging data of at least one third-party device.

[0040] Based on the configuration attributes of the third-party device, the data that the third-party device needs to report to the Internet of Things platform can be determined. According to the reported data of the third-party device, the corresponding application programming interface of the third-party device is called, and the debugging data obtained by the third-party device calling the application programming interface can be determined by executing the Java program. In this way, the debugging data of at least one third-party device accessing the Internet of Things platform can be determined. Among them, the debugging data is the standard data in the unified data format specified by the Internet of Things platform. The specific format is as follows:

[0041]

[0042] S15. According to the debugging data of at least one third-party device, determine the access status of at least one third-party device to debug the channel program.

[0043] After obtaining the debugging data of the third-party device, it is judged whether the debugging data corresponds to the third-party device, the model of the third-party device, and the reported data of the third-party device in the Internet of Things platform, that is, whether the debugging data is consistent with the expected data for the third-party device to successfully access the Internet of Things platform. If the debugging data corresponds to the third-party device, the model of the third-party device, and the reported data of the third-party device in the Internet of Things platform, it means that the third-party device has been successfully accessed; if the debugging data does not correspond to the third-party device, the model of the third-party device, and the reported data of the third-party device in the Internet of Things platform, that is, it does not reach the expected data, it means that the third-party device has not been successfully accessed. At this time, the developer can modify the channel program according to the debugging data returned by the Internet of Things platform so that the third-party device can successfully access the Internet of Things platform.

[0044] The access method for third-party devices provided by the embodiments of the present invention responds to a configuration operation on the model parameters of at least one third-party device, where the model parameters include attributes and commands. Based on the device types of at least one third-party device, the channel programs of at least one third-party device are obtained, the channel programs are parsed, the application programming interfaces corresponding to the configuration commands of at least one third-party device are determined, and based on the configuration attributes and application programming interfaces of at least one third-party device, the debugging data of at least one third-party device is determined. The access status of at least one third-party device is determined according to the debugging data to debug the channel program. This method responds to the configuration operation on the model parameters of at least one third-party device. Without developers defining the model information and attribute information of third-party devices in the code program, developers only need to write and upload the channel program according to the task requirements of third-party devices, thereby reducing the code writing burden of developers. And the corresponding application programming interfaces are determined according to the configuration of third-party devices, and the channel program is executed within the determined application programming interfaces according to the configuration data of third-party devices, and the debugging data is returned in real time without redeploying the services of third-party devices to ensure the uninterrupted services of third-party devices. At the same time, the access status of third-party devices is determined according to the debugging data. When the access is unsuccessful, the channel program is modified, realizing the online debugging of third-party devices and being able to determine the access status of third-party devices in a timely manner.

[0045] In this embodiment, an access method for third-party devices is provided, which can be used in the above-mentioned electronic devices, such as computers, mobile phones, tablet computers, etc. Figure 2 It is a flowchart of the access method for third-party devices according to the embodiments of the present invention, as Figure 2 shown. The process includes the following steps:

[0046] S21, respond to a configuration operation on the model parameters of at least one third-party device, where the model parameters include attributes and commands.

[0047] Specifically, the above step S21 may include the following steps:

[0048] S211, based on the configuration operation, determine the model parameters of at least one third-party device.

[0049] After the Internet of Things platform receives the login information of the developer, it makes a corresponding response and displays the creation interface of the device model, where the creation interface includes a selection area for the model, and the selection area for the model is used to display the preset model description and custom model description corresponding to the currently accessed third-party device.

[0050] On the display interface for creating a model, there may be labels or buttons for model selection, or developers can use other interaction methods to interact with the display interface of the Internet of Things platform to perform a selection operation for determining the model of at least one third-party device. For example, on the display interface for creating a model, there are respectively displayed a selection label for the built-in model and a selection label for the custom model. When the developer selects a model, the display interface determines the model of at least one third-party device by responding to the developer's operation.

[0051] After determining the model corresponding to the third-party device, a model parameter setting interface corresponding to the model can be displayed in the display interface. On the display interface for creating a model, there may be setting labels or buttons for model parameters, or developers can use other interaction methods to interact with the display interface of the Internet of Things platform to perform a setting operation for the model parameters of at least one third-party device. For example, when the developer selects the built-in model, the display interface displays the model parameters corresponding to the built-in model by responding to the developer's operation; when the developer selects the custom model, the display interface displays the model parameters of the custom model by responding to the developer's operation.

[0052] S212. Determine the model of at least one third-party device based on the model parameters of at least one third-party device.

[0053] The creation interface of the device model determines a custom model corresponding to at least one third-party device by responding to the developer's operation, and creates the model of at least one third-party device according to the model parameters of the determined custom model.

[0054] It should be noted that there are preset device models corresponding to at least one third-party device built in the Internet of Things platform. Developers can directly use them without defining model parameters, and only need to determine the required model parameters according to their needs. Specifically, the electronic device can determine the preset device model corresponding to at least one third-party device by responding to the selection operation of the preset device model, and adjust the model parameters of the preset device model according to actual needs, so as to adjust the preset device model to obtain the model corresponding to at least one third-party device.

[0055] S22. Obtain the channel programs of at least one third-party device based on the device types of at least one third-party device.

[0056] Specifically, the above step S22 may include the following steps:

[0057] S221. Use the device types of at least one third-party device to determine whether there are corresponding channel programs.

[0058] The Internet of Things platform queries in the local cache whether there is a channel program corresponding to the device type of at least one third-party device determined. If there is a channel program corresponding to the device type, step S222 is executed; otherwise, step S223 is executed.

[0059] S222. Extract the corresponding channel program to determine the channel program of at least one third-party device.

[0060] When the Internet of Things platform queries that there is a channel program corresponding to the device type of at least one third-party device locally, it means that the Internet of Things platform has compiled this channel program and there is no need to load the channel program again. At this time, the Internet of Things platform can directly call the channel program corresponding to the device type of at least one third-party device, thereby determining the channel program of at least one third-party device accessing the Internet of Things platform.

[0061] S223. Display the channel program upload interface.

[0062] When the Internet of Things platform does not have a channel program corresponding to the device type of at least one third-party device, it means that the Internet of Things platform has not compiled the channel program of this device type and needs to load the channel program of this device type. At this time, the Internet of Things platform can display the upload interface of the channel program to dynamically load the channel program of this device type. There can be a label or a button for program upload on the upload interface, or developers can use other interaction methods to interact with the upload interface to perform the upload operation of the channel program of at least one third-party device. For example, there is a program upload label displayed on the upload interface, and the upload interface of the Internet of Things platform uploads the corresponding channel program of the third-party device in response to the operation of the developer.

[0063] S224. In response to the program upload operation on the channel program upload interface, determine the channel program of at least one third-party device.

[0064] The display interface of the Internet of Things platform can obtain the channel program of at least one third-party device in response to the program upload operation of the developer. For example, when the Internet of Things platform detects that there is no channel program corresponding to the device model of at least one third-party device locally, the Internet of Things platform can pop up the upload interface of the program. There can be an upload button set in the upload interface. In response to the click operation of the upload button by the developer, the channel program of at least one third-party device is obtained.

[0065] S23. Analyze the channel program to determine the application program interface corresponding to the configuration command of at least one third-party device. For the detailed description, refer to the relevant description of step S13 in the above-mentioned embodiment, which will not be elaborated here.

[0066] S24. Determine the debugging data of at least one third-party device based on the configuration attributes of at least one third-party device and the application programming interface. For the detailed description, refer to the relevant description of step S14 in the above embodiment, which will not be elaborated here.

[0067] S25. Determine the access status of at least one third-party device according to the debugging data of at least one third-party device to debug the channel program. For the detailed description, refer to the relevant description of step S15 in the above embodiment, which will not be elaborated here.

[0068] The access method for third-party devices provided by the embodiments of the present invention determines the model parameters of third-party devices through the configuration operation of the model parameters of third-party devices, generates a model of third-party devices according to the model parameters, avoids developers from defining model parameters such as the attributes and commands of third-party devices in the development process, and developers do not need to understand the model definition framework of third-party devices, reducing the code burden on developers; developers do not need to understand the programming language of the model definition framework of third-party devices, realizing the rapid construction of the third-party device model. Using the device type of at least one third-party device to determine whether there is a corresponding channel program, when there is a corresponding channel program, extract the corresponding channel program to determine the channel program of at least one third-party device, and the same type of third-party device does not need to be loaded, reducing the memory occupancy, and thus improving the running speed of the channel program; when there is no channel program corresponding to the third-party device, display the channel program upload interface, and in response to the program upload operation on the channel program upload interface, determine the channel program of at least one third-party device. By dynamically loading the channel program of the third-party device, it is avoided that too much memory occupancy affects the access speed of the third-party device.

[0069] In this embodiment, an access method for third-party devices is provided, which can be used in the above-mentioned electronic devices, such as computers, mobile phones, tablet computers, etc. Figure 3 It is a flowchart of the access method for third-party devices according to the embodiments of the present invention. As Figure 3 shown, the process includes the following steps:

[0070] S31. In response to the configuration operation on the model parameters of at least one third-party device, the model parameters include attributes and commands. For the detailed description, refer to the relevant description of step S21 in the above embodiment, which will not be elaborated here.

[0071] S32. Based on the device type of at least one third-party device, obtain the channel program of at least one third-party device. For the detailed description, refer to the relevant description of step S22 in the above embodiment, which will not be elaborated here.

[0072] S33. Analyze the channel program to determine the application programming interface corresponding to the configuration command of at least one third-party device. For the detailed description, please refer to the relevant description of step S23 in the above embodiment, which will not be repeated here.

[0073] S34. Based on the configuration attributes of at least one third-party device and the application programming interface, determine the debugging data of at least one third-party device.

[0074] Specifically, the above step S34 may include the following steps:

[0075] S341. Obtain the interface type of the application programming interface. The interface type includes a pull control interface and a push interface.

[0076] The interface type can be determined according to the communication protocol between the third-party device and the Internet of Things platform and the request type. The communication protocol between the third-party device and the Internet of Things platform includes the HTTP protocol and non-HTTP protocols. The request type includes a pull request and a push request. The pull request is used for the Internet of Things platform to call the interface or service of the third-party device, and the push request is used for the third-party device to call the interface or service of the Internet of Things platform. Based on the communication protocol between the third-party device and the Internet of Things platform, it can be determined that the interface type includes an HTTP pull control interface, an HTTP push interface, a non-HTTP pull control interface, and a non-HTTP push interface. The non-HTTP protocol can be the TCP protocol, the UDP protocol, or other protocols, which is not limited in this application.

[0077] S342. Based on the interface type, determine the processing mode corresponding to the interface type.

[0078] The processing mode is the processing logic of the channel program corresponding to the interface type. Based on the interface type of the application programming interface, the processing mode corresponding to this interface type can be determined. For example, the HTTP pull (HTTP Pull) interface includes an authentication pull control interface and a cyclic pull control interface. The processing logic of the authentication pull control interface is different from that of the cyclic pull control interface, and the corresponding channel program needs to be executed according to the processing logic of the interface type.

[0079] S343. Based on the processing mode and the configuration attributes of at least one third-party device, determine the debugging data of at least one third-party device.

[0080] Based on the configuration attributes of at least one third-party device, the reported data of at least one third-party device can be obtained. Execute the channel program corresponding to at least one third-party device in the application programming interface according to the processing mode of the application programming interface. The Internet of Things platform can return the debugging data corresponding to the reported data of at least one third-party device during the execution of this channel program.

[0081] Specifically, when the interface type is the authentication pull control interface, the above step S343 may include the following steps:

[0082] (1) Obtain the login information.

[0083] The login information is the login password of the login account on the Internet of Things platform. When developers create the device model of a third-party device, they need to log in to the Internet of Things platform to perform the configuration operation of the device model. The Internet of Things platform can, in response to the input operation of the developer, obtain the login information before the response configuration operation and save the login information.

[0084] (2) Send the login information to the application programming interface, execute the channel program based on the configuration attributes of at least one third-party device in the application programming interface, and return the debug data of the executed channel program of at least one third-party device.

[0085] When it is determined that the interface type is the authentication pull control interface, the Internet of Things platform can send the login information to the application programming interface, obtain the first request information in the channel program, execute the channel program, and return the debug data corresponding to the first request information. The debug data will be retained in the execution session of the channel program so that the next request information of the channel program can directly call it, thereby returning the debug data of the executed channel program.

[0086] When the interface type is the loop pull control interface, the above step S343 may include the following steps:

[0087] (1) Display the input page for loop data.

[0088] When the interface type is the loop pull control interface, the execution of the channel program requires the input of corresponding loop data. At this time, the Internet of Things platform can display the input page for loop data. The input page includes a loop data input area for displaying the loop data description of the channel program corresponding to the third-party device.

[0089] (2) In response to the operation on the input page for loop data, determine the loop data of at least one third-party device.

[0090] On the input interface for loop data, an input box for loop data may be set, or the developer uses other interaction methods to interact with the input interface for loop data to perform the input operation of loop data. For example, an input box for loop data is displayed on the input interface for loop data, and the developer can determine the loop data according to the execution requirements of the channel program corresponding to the third-party device.

[0091] (3) Based on the loop data and the configuration attributes of at least one third-party device, run the channel program of at least one third-party device and return the debug data of the executed channel program.

[0092] The Internet of Things platform can send the determined cyclic data and the configuration attributes of third-party devices to the corresponding application programming interface, execute the channel program corresponding to the third-party device in the application programming interface, and return the debugging data corresponding to the channel program. The Internet of Things platform can call the local data saving method to save the returned debugging data.

[0093] When the interface type is a push interface, step S343 described above may include the following steps:

[0094] (1) Receive the reporting request data of at least one third-party device and determine the associated program of at least one third-party device.

[0095] The associated program is the program required for the Internet of Things platform to execute the channel program of the third-party device. The reporting request data is the interface or service of the Internet of Things platform requested to be called by the third-party device. Based on the reporting request data of at least one third-party device and the channel program, the associated program corresponding to at least one third-party device can be determined.

[0096] (2) Determine whether the associated program has been loaded.

[0097] The associated program can be saved in the cache of the Internet of Things platform. When receiving the reporting request data of the third-party device, the Internet of Things platform can query the content in the cache to determine whether the associated program exists in the cache, that is, whether the Internet of Things platform has loaded the associated program. When the Internet of Things platform has loaded the associated program, execute step (3); otherwise, execute step (5).

[0098] (3) Detect whether the reporting request data is legal.

[0099] When it is detected that the Internet of Things platform has loaded the associated program, it means that the Internet of Things platform has already executed the channel program of the third-party device of the same type. At this time, there is no need to reload and it can be directly used. Before using the associated request, detect whether the reporting request data of the third-party device is legal. If the reporting request data of the third-party device is legal, execute step (4); otherwise, discard the reporting request data of the third-party device.

[0100] (4) Return the debugging data corresponding to the reporting request data.

[0101] When the reporting request data is legal, it means that the Internet of Things platform can push the debugging data corresponding to the reporting request data to the third-party device. The Internet of Things platform calls the associated program, executes the channel program in the application programming interface, and returns the debugging data corresponding to the channel program.

[0102] (5) Dynamically load the associated program.

[0103] When the associated program has not been loaded, it means that the IoT platform has not executed the channel program for third-party devices of the current device type. At this time, it is necessary to load the associated program corresponding to the channel program and put the loaded associated program into the cache for direct call next time.

[0104] S35. Determine the access status of at least one third-party device according to the debugging data of at least one third-party device to debug the channel program. For the detailed description, please refer to the relevant description of step S25 in the above embodiment, which will not be elaborated here.

[0105] The access method for third-party devices provided by the embodiments of the present invention obtains the interface type of the application programming interface. The interface type includes a pull control interface and a push interface. Based on the interface type, the processing mode corresponding to the interface type is determined. Based on the processing mode and the configuration attributes of at least one third-party device, the debugging data of at least one third-party device is determined. Since the processing modes corresponding to different types of application programming interfaces are different, by obtaining the interface type of the application programming interface, the channel program can be connected to the corresponding application programming interface, the channel program is executed according to the configuration attributes of the third-party device and the processing mode of the application programming interface, and the debugging data corresponding to the third-party device is returned, realizing the online debugging of the access of the third-party device, avoiding the situation that the service of the third-party device is interrupted due to the need to redeploy the application programming interface after accessing the debugging program, thus ensuring the uninterrupted online debugging of the access of the third-party device. By determining the interface type to determine the access process of the channel program, the channel program can directly perform data flow according to the processing mode of the interface type, improving the access speed of the third-party device.

[0106] In this embodiment, an access device for a third-party device is further provided. This device is used to implement the above embodiments and preferred implementation manners, and the ones that have been described will not be elaborated here. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0107] This embodiment provides an access device for a third-party device, as Figure 4 shown, including:

[0108] A first response module 41, configured to respond to a configuration operation on the model parameters of at least one third-party device, where the model parameters include attributes and commands. For the detailed description, please refer to the relevant description of step S11 in the above embodiment, which will not be elaborated here.

[0109] An obtaining module 42 is configured to obtain a channel program of at least one third-party device based on the device type of the at least one third-party device. For detailed description, refer to the relevant description of step S12 in the above embodiment, which will not be elaborated here.

[0110] An analysis module 43 is configured to analyze the channel program to determine an application program interface corresponding to a configuration command of at least one third-party device. For detailed description, refer to the relevant description of step S13 in the above embodiment, which will not be elaborated here.

[0111] A determination module 44 is configured to determine debugging data of at least one third-party device based on the configuration attributes of the at least one third-party device and the application program interface. For detailed description, refer to the relevant description of step S14 in the above embodiment, which will not be elaborated here.

[0112] A debugging module 45 is configured to determine an access status of at least one third-party device according to the debugging data of the at least one third-party device, so as to debug the channel program. For detailed description, refer to the relevant description of step S15 in the above embodiment, which will not be elaborated here.

[0113] The access device for a third-party device provided in the embodiment of the present invention responds to a configuration operation on model parameters of at least one third-party device, where the model parameters include attributes and commands. Based on the device type of the at least one third-party device, a channel program of the at least one third-party device is obtained, the channel program is analyzed to determine an application program interface corresponding to a configuration command of the at least one third-party device, and based on the configuration attributes of the at least one third-party device and the application program interface, debugging data of the at least one third-party device is determined. The access status of the at least one third-party device is determined according to the debugging data to debug the channel program. By responding to the configuration operation on the model parameters of at least one third-party device, the device does not require a developer to define model information and attribute information of the third-party device in a code program. The developer only needs to write and upload a channel program according to the task requirements of the third-party device, thereby reducing the code writing burden of the developer. Moreover, the corresponding application program interface is determined according to the configuration of the third-party device, and the channel program is executed within the determined application program interface according to the configuration data of the third-party device, and the debugging data is returned in real time without redeploying the service of the third-party device, ensuring the uninterrupted service of the third-party device. At the same time, the access status of the third-party device is determined according to the debugging data. When the access is unsuccessful, the channel program is modified, realizing online debugging of the third-party device and being able to timely determine the access status of the third-party device.

[0114] The access device for a third-party device in this embodiment is presented in the form of a functional unit. Here, the unit refers to an ASIC circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0115] The further function descriptions of the above-mentioned respective modules are the same as those in the corresponding embodiments above, and will not be elaborated herein.

[0116] An embodiment of the present invention further provides a mobile terminal having the above-mentioned Figure 4 access device for the third-party device shown.

[0117] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of an electronic device provided by an optional embodiment of the present invention. As shown in Figure 5 , the terminal 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. Among them, the communication bus 52 is used to implement connection communication between these components. Among them, the communication interface 53 may include a display screen (Display) and a keyboard (Keyboard). Optionally, the communication interface 53 may further 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, such as at least one disk memory. Optionally, the memory 54 may further be at least one storage device located far from the aforementioned processor 51. Among them, the processor 51 may be combined with Figure 4 the device described, the memory 54 stores application programs, and the processor 51 calls the program code stored in the memory 54 to execute any of the above method steps.

[0118] Among them, the communication bus 52 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 52 may be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 5 only a thick line is used to represent it in

[0119] Among them, the memory 54 may include a volatile memory, such as a random-access memory (RAM); the memory may also include a non-volatile memory, such as a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 54 may further include a combination of the above types of memories.

[0120] Among them, the processor 51 may be a central processing unit (CPU), a network processor (NP) or a combination of a CPU and an NP.

[0121] Among them, the processor 51 may further include a hardware chip. The above hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0122] Optionally, the memory 54 is further configured to store program instructions. The processor 51 may call the program instructions to implement the access method of the third-party device as shown in the embodiments of the present application. Figures 1 to 3 The access method of the third-party device shown in the embodiments of the present application.

[0123] An embodiment of the present invention also provides a non-transitory computer storage medium. The computer storage medium stores computer-executable instructions, and these computer-executable instructions can execute the processing method of the access method of the third-party device in any of the above method embodiments. Among them, the storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memories.

[0124] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. An access method for a third-party device, characterized in that, it includes the following steps: In response to a configuration operation on model parameters of at least one third-party device, the model parameters including attributes and commands; Based on the device types of the at least one third-party device, obtain the channel programs of the at least one third-party device; Parse the channel programs to determine the application program interfaces corresponding to the configuration commands of the at least one third-party device; Based on the configuration attributes of the at least one third-party device and the application program interfaces, determine the debugging data of the at least one third-party device, including: obtaining the interface types of the application program interfaces, the interface types including pull control interfaces and push interfaces; based on the interface types, determine the corresponding processing modes; based on the processing modes and the configuration attributes of the at least one third-party device, determine the debugging data of the at least one third-party device; According to the debugging data of the at least one third-party device, determine the access status of the at least one third-party device to debug the channel programs.

2. The method according to claim 1, characterized in that, the in response to a configuration operation on model parameters of at least one third-party device, the model parameters including attributes and commands, includes: Based on the configuration operation, determine the model parameters of the at least one third-party device; Based on the model parameters of the at least one third-party device, determine the models of the at least one third-party device.

3. The method according to claim 1, characterized in that, the based on the device types of the at least one third-party device, obtain the channel programs of the at least one third-party device, includes: Use the device types of the at least one third-party device to determine whether there are corresponding channel programs; When there are corresponding channel programs, extract the corresponding channel programs to determine the channel programs of the at least one third-party device.

4. The method according to claim 1, characterized in that, when the interface type is an authentication pull control interface, the based on the processing mode and the configuration attributes of the at least one third-party device, determine the debugging data of the at least one third-party device, includes: Obtain login information; Send the login information to the application program interface, and execute the channel program in the application program interface based on the configuration attributes of the at least one third-party device, and return the debugging data of the at least one third-party device for executing the channel program.

5. The method according to claim 1, characterized in that, when the interface type is a cyclic pull control interface, the based on the processing mode and the configuration attributes of the at least one third-party device, determine the debugging data of the at least one third-party device, includes: Display the input page for cyclic data; In response to an operation on the input page for cyclic data, determine the cyclic data of the at least one third-party device; Based on the cyclic data and the configuration data of the at least one third-party device, run the channel programs of the at least one third-party device, and return the debugging data for executing the channel programs.

6. The method according to claim 1, wherein, when the interface type is a push interface, determining the debugging data of the at least one third-party device based on the processing mode and the configuration attributes of the at least one third-party device includes: receiving the reported request data of the at least one third-party device and determining the associated program of the at least one third-party device; judging whether the associated program has been loaded; when the associated program has been loaded, detecting whether the reported request data is legal; when the reported request data is legal, returning the debugging data corresponding to the reported request data.

7. An access device for a third-party device, wherein, comprising: a first response module, configured to respond to a configuration operation on model parameters of at least one third-party device, the model parameters including attributes and commands; an acquisition module, configured to acquire the channel program of the at least one third-party device based on the device type of the at least one third-party device; a parsing module, configured to parse the channel program to determine the application program interface corresponding to the configuration command of the at least one third-party device; a determination module, configured to determine the debugging data of the at least one third-party device based on the configuration attributes of the at least one third-party device and the application program interface, including: obtaining the interface type of the application program interface, the interface type including a pull control interface and a push interface; determining the processing mode corresponding to the interface type based on the interface type; determining the debugging data of the at least one third-party device based on the processing mode and the configuration attributes of the at least one third-party device; a debugging module, configured to determine the access status of the at least one third-party device according to the debugging data of the at least one third-party device so as to debug the channel program.

8. An electronic device, wherein, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to execute the access method for a third-party device according to any one of claims 1-6.

9. A computer-readable storage medium, wherein, the computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the access method for a third-party device according to any one of claims 1-6.

Citation Information

Patent Citations

  • Method and device for realizing interaction with third-party platform, and storage medium

    CN110413354A

  • Simulation test method, server, device, and computer-readable storage medium

    WO2018036273A1