Access service processing method, system, device, electronic device and storage medium
By abstracting the access application of IoT devices into plug-ins and using plug-in management services for authentication and life cycle management, the problem of complexity of IoT devices access is solved, and unified management and business services of the terminal are realized.
Patent Information
- Application Number
- CN202211118641.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-09-14
AI Technical Summary
Due to differences in access protocols, application development languages and application deployment methods, Internet of Things devices make access to the Internet of Things platform complex and difficult to manage in a unified manner.
By abstracting the access applications of different devices into a unified plug-in, using plug-in management services for authentication and life cycle management, the plug-in is compatible with the Internet of Things platform, and communication is carried out through a unified interface definition specification.
It simplifies the access process of IoT devices, realizes unified management and business services for different models of terminals, and reduces the complexity of platform resource occupation and management.
Smart Images

Figure CN115514667B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technologies, and in particular to an access service processing method, system, device, electronic device, and storage medium. Background Art
[0002] With the development of the Internet of Things, IoT platforms have emerged. IoT platforms can manage a large number of terminals, such as IoT devices. However, various IoT devices have different ways of connecting to the Internet of Things due to their different hardware manufacturers. For example, there are huge differences between devices in access protocols, application development languages, application deployment methods, and application monitoring and management methods, making terminal access to IoT platforms very complicated. Summary of the Invention
[0003] The present disclosure provides an access service processing method, the method comprising:
[0004] Obtain at least one access component and download at least one plug-in corresponding to each access component; wherein each access component corresponds to at least one plug-in, and different plug-ins match different terminal models;
[0005] authenticating at least one plug-in in response to a startup request sent by the access component;
[0006] Based on the authenticated plug-in, business services are provided for the corresponding terminal models, and the business services at least include terminal access services and terminal remote control services.
[0007] In an optional example, based on the authenticated plug-in, business services are provided for the corresponding terminal model, including:
[0008] In response to a request for a plug-in to be run by the terminal, run the plug-in after authentication;
[0009] Receive access requests sent by the plug-in, which are sent by the terminal to the plug-in;
[0010] Based on the access request, the terminal is connected to the Internet of Things to provide access services.
[0011] In an optional example, after authenticating at least one plug-in in response to the startup request sent by the access component, the method further includes:
[0012] Generate a visualization list based on the authenticated plug-ins and the terminal models corresponding to the authenticated plug-ins, which includes the correspondence between the plug-ins and the terminals;
[0013] Publish the visualization list on a web page;
[0014] The run request is sent by the terminal user after confirming the plug-in on the visualization list.
[0015] In an optional example, the business service includes a remote control service, which provides business services for terminals of corresponding models based on authenticated plug-ins, including:
[0016] Acquire control information for a first terminal to be controlled, wherein the control information is device information sent by the first terminal through a first plug-in, or the control information is information sent by a second terminal through a second plug-in;
[0017] Based on the control information, a control instruction is sent to the first plug-in to instruct the first plug-in to send the control instruction to the first terminal, so that the first terminal performs an operation corresponding to the control instruction.
[0018] In an optional example, authenticating at least one plug-in in response to a startup request sent by the access component includes:
[0019] In response to the start request, start the plug-in;
[0020] Receive a handshake message sent by the activated plug-in, wherein the handshake message carries configuration information configured by the plug-in; the configuration information includes at least one of a communication protocol version, a data protocol version, and a network address;
[0021] Based on the configuration information, the plug-in is authenticated to determine whether the configuration information of the plug-in is suitable for the current operating environment.
[0022] In an optional example, after obtaining at least one access component, the method further includes:
[0023] Allocating a target port that meets a first condition to each plug-in corresponding to the access component from a plurality of ports included in the port pool; the first condition includes a condition that the port is unused and unreserved, or a condition that the port is unused but reserved;
[0024] After authenticating at least one plug-in, the method further includes:
[0025] Bind the target port to the plug-in that has passed authentication so that the plug-in can access the terminal based on the target port.
[0026] In an optional example, after binding the target port for the authenticated plug-in, the method further includes:
[0027] When receiving a run / restart request for a plug-in, check the target port to determine whether the target port is used by other plug-ins;
[0028] After the target port is verified, run the plug-in;
[0029] In the case that the target port fails to pass the verification, a port that meets the second condition is screened from the port pool, and the port that meets the second condition is bound to the plug-in; wherein the second condition is that the port is not in use.
[0030] In an optional example, after obtaining at least one access component and downloading at least one plug-in corresponding to each access component, the method further includes:
[0031] Get the interface definition language corresponding to the plug-in;
[0032] Convert the interface definition language into stub code;
[0033] Based on the stubbing code, access each plug-in.
[0034] In an optional example, after accessing a terminal of a corresponding model based on the authenticated plug-in, the method further includes:
[0035] receiving a processing request sent by the access component to a target plug-in in at least one plug-in;
[0036] Based on the processing request, a processing operation corresponding to the processing request is performed on the target plug-in, wherein the processing operation includes at least one of starting, stopping, restarting, and status monitoring.
[0037] In an optional example, the processing operation includes status monitoring, and based on the processing request, performing a processing operation corresponding to the processing request on the target plug-in, including:
[0038] During the operation of the target plug-in, monitoring information of the plug-in during operation is obtained through the instance object corresponding to the target plug-in; wherein the monitoring information includes heartbeat data packets sent by the plug-in and / or operation logs of the plug-in during operation;
[0039] Based on the monitoring information, monitor the running status and / or business status of the plug-in; wherein the business status is used to represent the state of the business service provided by the plug-in to the terminal;
[0040] Restart the plug-in that has a fault in the running state, and stop the plug-in that has a fault in the business state.
[0041] In an optional example, based on the processing request, performing a processing operation corresponding to the processing request on the target plug-in includes:
[0042] If the processing request is a stop request, stop the target plug-in;
[0043] If the processing request is a restart request, re-authenticate the target plug-in and restart the target plug-in after the authentication is passed;
[0044] When the processing request is an update request, the target plug-in is updated based on the update data carried in the update request.
[0045] The present disclosure also provides an access service system, which includes: an external interface, a plug-in management service module and a business service module; wherein: the external interface is used to connect to at least one access component and communicate with the plug-in management service module, and the business service module is used to communicate with the running plug-in;
[0046] External interface, used to connect to at least one access component;
[0047] The plug-in management service module is used to download at least one plug-in and respond to
[0048] The access component authenticates at least one plug-in in response to a startup request sent by the plug-in;
[0049] Business service module, used to provide corresponding terminal models based on the plug-in passed by authentication
[0050] Business services include at least terminal access services and terminal remote control services.
[0051] In an optional example, the plug-in management service module communicates with at least one plug-in based on a unified interface definition specification;
[0052] Among them, the unified interface definition specification converts the interface definition language into stub code and is generated based on the stub code.
[0053] In an optional example, the external interface is further configured to receive a processing request sent by the access component for a target plug-in in at least one plug-in, and send the processing request to the management service module;
[0054] The plug-in management service module is further configured to execute a processing operation corresponding to the processing request on the target plug-in based on the processing request, wherein the processing operation includes at least one of starting, stopping, restarting, and status monitoring.
[0055] In an optional example, the access service system runs on a server, at least one plug-in runs on the server, and / or runs on a host connected to the server.
[0056] The present disclosure further provides an access service processing device, the device comprising:
[0057] An acquisition module, configured to acquire at least one access component and download at least one plug-in corresponding to each access component; wherein each access component corresponds to at least one plug-in, and different plug-ins correspond to different terminal models;
[0058] an authentication module, configured to authenticate at least one plug-in in response to a startup request sent by the access component for the plug-in;
[0059] The service module is used to provide business services for terminals of corresponding models based on authenticated plug-ins. The business services include at least terminal access services and terminal remote control services.
[0060] The present disclosure also provides a computer-readable storage medium, wherein a computer program stored in the medium causes a processor to execute an access service processing method.
[0061] The present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and an access service processing method implemented when the computer program is executed by the processor.
[0062] By adopting the access service processing method provided in the present application, at least one access component can be obtained, and at least one plug-in corresponding to each access component can be downloaded; and at least one plug-in can be authenticated in response to the startup request sent by the access component for the plug-in; based on the plug-in that has passed the authentication, business services are provided for terminals of corresponding models, wherein the business services include at least terminal access services and terminal remote control services, and the access components correspond to at least one plug-in with the same attributes, and different plug-ins correspond to terminals of different models.
[0063] On the one hand, the plug-ins corresponding to different terminal models are uniformly downloaded to the IoT platform, and the plug-ins are authenticated. Once the authentication is passed, access services and remote control services can be provided to the corresponding terminal models through the plug-ins, so that different terminal models can access the IoT platform through matching plug-ins and use the services provided by the IoT platform. In this way, even if there are differences between the access protocols, application development languages, application deployment methods, and application monitoring and management methods of each terminal, from the user's side, running a plug-in can join the IoT platform. From the IoT platform's side, the IoT platform does not need to connect to each terminal separately. It can connect to multiple terminals through the plug-ins already running on the platform, thereby establishing communication connections between the IoT platform and multiple terminals through the plug-ins, simplifying the operation of users joining the IoT platform and also simplifying the operation of the IoT platform connecting to different types of terminals.
[0064] On the other hand, each plug-in can be managed through a corresponding access component. For example, if the access component initiates a startup request, the plug-in can be authenticated, so that the plug-in can be uniformly supervised through the access component, thereby realizing the centralized management of the plug-in by the IoT platform, avoiding the failure problems caused by the multi-threaded runtime occupying more platform resources and the large number of threads when the plug-in is managed discretely.
[0065] The above description is only an overview of the technical solution of the present disclosure. In order to more clearly understand the technical means of the present disclosure, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand, the specific implementation methods of the present disclosure are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or related technologies, the following is a brief introduction to the drawings required for the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. It should be noted that the sizes and shapes of the figures in the drawings do not reflect the actual scale. The purpose is only to illustrate the content of the present invention. The same or similar numbers in the drawings represent the same or similar elements or elements with the same or similar functions.
[0067] Figure 1 A communication environment diagram schematically illustrates a method for processing access services;
[0068] Figure 2 The following schematically illustrates a flow chart of steps of an access service processing method of the present application;
[0069] Figure 3 Schematically illustrates the schematic diagram of the unified management of plug-ins through access components of the present application;
[0070] Figure 4 The following schematically illustrates the operating environment of the access service processing method of the present application;
[0071] Figure 5 The following schematically illustrates a specific flow chart of the access service processing method of the present application;
[0072] Figure 6 The following schematically shows a framework diagram of an access service system of the present application;
[0073] Figure 7 The schematic diagram schematically shows the framework of the access service processing device of the present application. DETAILED DESCRIPTION
[0074] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0075] In the field of the Internet of Things (IoT), numerous IoT devices need to be connected to an IoT platform to enable control of these devices. However, due to the significant differences in access protocols, application development languages, application deployment methods, and application monitoring and management methods among these numerous IoT devices, the connection process for each IoT device to access the IoT platform's services is complex.
[0076] In view of this, in order to solve the above technical problems, this application proposes the following core concept: to provide a lightweight IoT device access service hosting method, abstract the access applications of different device protocols into a unified plug-in, and different plug-ins correspond to a class of terminals of different models. In this way, a class of terminals of the same model can be connected to the IoT through an authenticated plug-in, and provide business services to the terminals through the plug-in.
[0077] Among them, the plug-in can communicate with the IoT platform through a unified interface definition specification. In this way, the plug-in is independent of the programming language, so the IoT platform can connect with plug-ins in multiple programming languages through this interface definition specification.
[0078] Reference Figure 1 As shown, a schematic diagram of the communication environment of the access service processing method of the present application is shown, as Figure 1 As shown, it includes an IoT platform, multiple terminals, a third-party platform and third-party applications. Among them, the third-party application can be understood as the terminal manufacturer. The manufacturer enters the third-party platform through the third-party application and communicates with the IoT platform through the third-party platform to abstract the access application of the IoT device produced by itself into a plug-in and upload it to the IoT platform.
[0079] After the IoT platform authenticates the uploaded plug-ins, it will deploy these plug-ins on its own platform and publish them on a visual web page. When the user holding the terminal needs to connect the IoT device to the IoT platform, he can select the plug-in that is compatible with his terminal on the visual web page and run the plug-in. The running plug-in can help the terminal connect to the IoT platform, and then the user of the IoT device can use the business services provided by the IoT platform to manage and control the terminal.
[0080] Terminals can include IoT devices, such as barcode scanners, RFID, sensors, global positioning systems, laser scanners, and other sensing devices. They can also include other types of devices, such as mobile phones and household appliances.
[0081] Among them, a plug-in management service runs on the Internet of Things platform. The plug-in management service can communicate between third-party users and plug-ins, respond to third-party users' management instructions on plug-ins, and perform operations such as starting, restarting, stopping, and authenticating plug-ins.
[0082] The following is an introduction to the access service processing method of this application. Figure 2 As shown, a flowchart of a method for processing access services is shown. Figure 2 As shown, this method can be executed by the plug-in management service of the Internet of Things platform, and can specifically include the following steps:
[0083] Step S201: Acquire at least one access component, and download at least one plug-in corresponding to each access component.
[0084] Among them, the access component corresponds to at least one plug-in, and different plug-ins match different models of terminals.
[0085] Step S202: authenticating at least one plug-in in response to a startup request sent by the access component;
[0086] Step S203: Based on the authenticated plug-in, business services are provided for the corresponding terminal model, where the business services at least include terminal access services and terminal remote control services.
[0087] In this embodiment, the access components and plug-ins can be created and uploaded by third-party users through a third-party platform. In practice, the third-party user can be the manufacturer of the terminal, or a manufacturer that provides access applications (applications that access the Internet of Things platform) for the terminal.
[0088] Among them, the plug-in can be understood as an access application for the terminal to access the Internet of Things. In this application, different plug-ins match different types of terminals. Specifically, third-party users will create plug-ins that are adapted to different types of terminals based on the access protocols and application development languages of different types of terminals, so that the plug-in can serve as an access application for the terminal to access the Internet of Things, and then join the Internet of Things. Therefore, by matching a plug-in with each type of terminal, different types of terminals can be helped to quickly access the Internet of Things.
[0089] Among them, the access component can be understood as a microservice that provides third-party users with the management of uploaded plug-ins. After logging into the IoT platform, third-party users can use the access component to initiate instructions such as stopping plug-ins, starting plug-ins, and restarting plug-ins to the plug-in management service, thereby achieving the purpose of managing the uploaded plug-ins.
[0090] An access component can correspond to at least one plug-in with the same attribute. This attribute can refer to the same manufacturer or the same batch. This means that after a third-party user uploads an access component, they can then upload one or more plug-ins from the same manufacturer or batch. In this way, one access component can manage one or more plug-ins. A plug-in can match one or multiple terminals of the same model. This means that a plug-in can connect to the same terminal model, allowing multiple terminals of the same model to access the IoT platform.
[0091] In other words, the same terminal manufacturer or access application outsourcer can manage multiple plug-ins created by themselves. When one access component corresponds to one plug-in, each plug-in corresponding to each terminal model can be managed and maintained separately. When one access component corresponds to multiple plug-ins, multiple plug-ins from the same manufacturer or from the same batch can be managed and maintained. This reduces the resource usage of the IoT platform by the access component, improving the platform's operational efficiency, compared to when one plug-in corresponds to one access component.
[0092] In this way, the plug-in is managed by the access component, and the plug-in is matched with the terminal. In this way, the deployment of access components can match the monitoring and management methods of access applications of terminals of different models, and realize unified management of access applications of different terminals.
[0093] In specific implementation, a third-party user can start a plug-in through the access component. In this way, the plug-in management service can respond to the start request sent by the access component for the plug-in and start the downloaded plug-in. When starting, at least one plug-in is first authenticated.
[0094] Among them, authentication of the plug-in can be understood as: checking whether the communication protocol version, data protocol version, network address, and protocol address of the plug-in match those of the IoT platform. If they match, the authentication is passed, indicating that the plug-in is compatible with the IoT platform and can communicate with the IoT platform. That is to say, before starting the plug-in, it is necessary to check whether the data protocol and communication protocol of the plug-in are compatible with the data protocol and communication protocol of the IoT platform. If they are compatible, the plug-in can exchange information with the IoT platform.
[0095] For plug-ins that pass authentication, the plug-in can be started. For plug-ins that fail authentication, the plug-in can be stopped and the authentication failure information can be fed back to the access component. In this way, when a third-party user learns that the authentication fails through the access component, the data protocol and communication protocol of the plug-in can be corrected and authenticated again.
[0096] Among them, the plug-in that passes the authentication matches the terminal on the one hand and the Internet of Things platform on the other hand. In this way, the plug-in can serve as a communication bridge for the terminal to communicate with the Internet of Things platform, and is used to provide the terminal with access services to the Internet of Things platform, as well as provide the terminal with remote control services, so that the terminal is controlled by the Internet of Things platform and performs corresponding operations.
[0097] In specific implementation, when the terminal needs to access the Internet of Things platform, it can run an authenticated plug-in to enable the terminal to access the plug-in, and the plug-in is pre-deployed on the Internet of Things platform (that is, when running the plug-in, the plug-in is actually running on the Internet of Things platform). Therefore, when the terminal accesses the plug-in, it is connected to the Internet of Things platform, and then it can interact with the Internet of Things platform for information. Specifically, on the one hand, the terminal can access the Internet of Things platform and send data to the Internet of Things platform; on the other hand, the terminal can receive control instructions sent by the Internet of Things platform through the plug-in, and then perform corresponding operations.
[0098] It should be noted that once a terminal is connected to a plug-in, the plug-in can continue to run to ensure real-time communication between the terminal and the IoT platform. A plug-in can be connected to one or multiple terminals of the same model.
[0099] By adopting the technical solution in the embodiment, it is possible to upload adapted plug-ins for different types of terminals on the Internet of Things platform, and use the plug-ins as the access applications of the terminals, so that the terminals can join the Internet of Things by accessing the plug-ins. When the plug-in is started, the plug-in is authenticated. After the authentication is passed, it indicates that the plug-in is compatible with the Internet of Things platform, so that the plug-in can transfer information between the terminal and the Internet of Things platform, so that the Internet of Things platform can provide business services to the terminal.
[0100] On the one hand, even if different terminals have differences in access protocols, application development languages, and application deployment methods, for the terminal side, it only needs to establish a connection with the matching plug-in to join the IoT platform, thereby simplifying the operation of terminal access to the IoT platform.
[0101] On the other hand, for the IoT platform, no matter what type of terminal it is, it only needs to interact with the corresponding plug-in to provide business services to the terminal. In this way, the access applications of various types of terminals are included in the IoT platform for unified deployment and management.
[0102] In an optional example, the process of authenticating a plug-in may be as follows: in response to a startup request, starting the plug-in using a command line; receiving handshake information sent by the started plug-in; and authenticating the plug-in based on the configuration information to determine whether the configuration information of the plug-in is adapted to the current operating environment.
[0103] The handshake information carries configuration information configured by the plug-in; the configuration information includes at least one of a communication protocol version, a data protocol version, and a network address.
[0104] In this embodiment, since the plug-in can be understood as an access application for the terminal to access the Internet of Things, it requires a data protocol and a communication protocol when communicating with the Internet of Things platform and the terminal. The communication protocol is used to specify the communication method between the plug-in and the terminal, and the data protocol is used to specify the data exchange format between the plug-in and the terminal.
[0105] Communication protocols may include TCP (Transmission Control Protocol), UDP (User Data Protocol), MQTT (Message Queuing Telemetry Transport) and CoAP protocols, wherein MQTT is an instant messaging protocol and CoAP is a computer protocol applied to the Internet of Things.
[0106] The data protocol may include: a protocol in JSON (JavaScript Object Notation) format, a protocol in text format, and a protocol in binary format.
[0107] The network address may indicate the network range of terminals that the plug-in can serve, that is, terminals within the network range are allowed to access the plug-in to join the Internet of Things.
[0108] Among them, the Internet of Things platform can verify the data protocol version and communication protocol version carried in the handshake information. Specifically, it can verify whether it is the version of the protocol allowed by the platform and whether the network address is the network allowed to be accessed. After successful verification, it means that the plug-in is compatible with the operating environment of the Internet of Things platform, and thus it can be allowed to run on the Internet of Things platform.
[0109] Since this application uniformly abstracts the access applications of various terminals into plug-ins, and provides access services and remote control services for IoT devices through plug-ins, in order to improve the centralized operation and maintenance management of plug-ins by the IoT platform of this application and reduce the complexity of management, the following implementation plan is further provided:
[0110] Reference Figure 3As shown, it shows a schematic diagram of further unified management of plug-ins through access components in this application, such as Figure 3 As shown, under the triggering of the access component, the plug-in can be started / stopped / restarted, and the status monitoring and other operations can be performed on the plug-in through the plug-in management server.
[0111] Specifically, the plug-in can provide access services for the terminal to access the IoT platform, as well as data forwarding services when the terminal interacts with the IoT platform after accessing the IoT platform. Figure 3 As shown, the following further implementation schemes are provided in this optional example:
[0112] Further implementation plan 1: Figure 3 As shown, the life cycle of multiple plug-ins is managed, including deployment, start, stop, restart, and status monitoring of plug-ins.
[0113] Further implementation plan 2: The plug-in implements a unified interface definition specification that supports all mainstream programming languages to connect with the Internet of Things platform through a unified interface definition specification.
[0114] Further implementation plan three: port pool management, allocate an externally available port to each plug-in application, and make every effort to ensure that the port remains unchanged.
[0115] <Implementation Plan 1> Manage the lifecycle of multiple plug-ins, including deployment, start, stop, restart, and status monitoring of plug-ins.
[0116] Among them, the deployment of the plug-in can be understood as referring to the deployment method of the plug-in in the Internet of Things platform. Specifically, the plug-in can be deployed in the cloud or edge. Among them, the cloud can refer to the server running the Internet of Things platform, and the edge can be understood as the physical machine connected to the server.
[0117] Among them, such as Figure 1 As shown, whether deployed in the cloud or at the edge, it can be uploaded by a third-party platform, and then the IoT platform downloads the uploaded plug-in to the edge or to the server.
[0118] Among them, the startup of the plug-in can refer to: after the plug-in is downloaded on the IoT platform, it receives a startup request from the access component and starts the plug-in process through the command line. It should be noted that after starting the plug-in, the plug-in must first be authenticated to verify the plug-in version, data protocol, network type, network address, communication protocol, etc. Only plug-ins that pass the authentication can be deployed and run normally.
[0119] The restart of the plug-in may refer to: receiving a restart request from the access component and restarting the plug-in process, including restarting the plug-in in the event of a failure in operation, and also including restarting the plug-in in the event of a failure in business service.
[0120] Among them, status monitoring is mainly used to actively monitor the running status of plug-in applications, provide fault prompts, and support automatic restart of faulty plug-ins.
[0121] In specific implementation, after accessing the corresponding model of the terminal based on the plug-in that has passed the authentication, it can also receive a processing request sent by the access component for the target plug-in in at least one plug-in; and based on the processing request, perform the processing operation corresponding to the processing request on the target plug-in.
[0122] The processing operation includes at least one of starting, stopping, restarting and status monitoring.
[0123] In this embodiment, the target plug-in is any one of the at least one plug-in corresponding to the access component. Specifically, Figure 3 As shown, the processing request includes a start request, a stop request, a restart request, and a status monitoring request. In the case of a start request, the target plug-in can be started, where Figure 3 As shown, in the case of a start request, the plug-in may be authenticated first, for example, by receiving a handshake message sent by the plug-in and authenticating the plug-in based on the handshake message;
[0124] If it is a stop request, the target plug-in may be stopped, and if it is a restart request, the target plug-in may be restarted.
[0125] Accordingly, in the case of status monitoring, it is necessary to perform status monitoring on the running status of the plug-in. In an embodiment of the present application, the running status may include the running status and / or business status of the plug-in. Specifically, only the running status of the plug-in may be monitored, or only the business status of the plug-in may be monitored, or both the running status and the business status of the plug-in may be monitored.
[0126] The running status may refer to the running status of the plug-in process, that is, whether the process is running normally, and the business status may refer to whether the plug-in forwards the data packets interacting between the IoT platform and the IoT device normally during the process of providing business services for the IoT device.
[0127] like Figure 3As shown, the plug-in management service provides three modules: port pool management, plug-in authentication, and instance objects. Among them, port pool management is used to allocate ports to plug-ins and is responsible for the use and recycling of ports. Plug-in authentication is used to authenticate plug-ins. Instance objects are used to perform start, stop, restart, and status monitoring operations on plug-ins in response to start requests, stop requests, restart requests, and status monitoring requests.
[0128] Among them, for status monitoring requests, such as Figure 3 As shown, during the operation of the target plug-in, the monitoring information of the plug-in during the operation can be obtained through the instance object corresponding to the target plug-in; and based on the monitoring information, the operation status and / or business status of the plug-in is monitored; then, the plug-in with a fault in the operation status is restarted, and the plug-in with a fault in the business status is stopped.
[0129] The service status is used to represent the status of the service provided by the plug-in to the terminal. The monitoring information includes the heartbeat data packets sent by the plug-in and / or the operation log of the plug-in during operation.
[0130] In this embodiment, the monitoring information of the plug-in during operation can be obtained through the instance object. In the case where the monitoring information includes an operation log, the plug-in will write the operation log to a specified channel during operation, and the instance object can obtain the operation log written by the plug-in by monitoring the channel.
[0131] Among them, when the monitoring information includes heartbeat data packets, the heartbeat data packets sent by the plug-in are generally sent to the Internet of Things platform. The instance object can capture the heartbeat data packets at regular intervals and determine the running status of the plug-in based on the captured heartbeat data packets.
[0132] Specifically, the running status and business status of the plug-in can be determined through the running log, and the running status of the plug-in can be determined through the heartbeat data packet. For example, it is possible to detect whether the plug-in process is alive and whether the services provided by the plug-in are available, such as http server service, tcp server service, etc., so as to detect whether the running status of the plug-in has any faults; when a fault code appears in the running log, it can be determined that the business status of the plug-in has failed.
[0133] When it is determined that the plug-in fails, the instance object can feedback the failure status to the access component. If a restart request is received from the access component in response to the failure status feedback, the plug-in is restarted, for example, the plug-in process is restarted.
[0134] As mentioned above, in addition to monitoring the running status and / or service status of the plug-in, you can also start and restart the plug-in through the access component. Specifically:
[0135] If the processing request is a stop request, stop the target plug-in;
[0136] If the processing request is a restart request, re-authenticate the target plug-in, and restart the target plug-in after the authentication is passed;
[0137] In the case where the processing request is an update request, the target plug-in is updated based on the update data carried in the update request.
[0138] In this implementation scheme, when the processing request is a stop operation request, the operation of the target plug-in is stopped. Since the target plug-in is connected to the terminal it matches, stopping the operation of the target plug-in will stop the access service and remote control service for the terminal; when the processing request is a restart request, the target plug-in can be restarted, and then the access to the terminal adapted by the target plug-in is restarted, that is, the access service and remote control service for the terminal of the same model are restarted.
[0139] In this embodiment, in addition to stop requests and restart requests, processing requests may also include update requests. In some cases, the plug-in serves as an access application for the terminal to access the Internet of Things, and there may be a need to update it at intervals. In this case, a third-party user can send an update request for the target plug-in through the access component. The update request can carry update data, which can be understood as an upgrade data packet. The plug-in management service can then update the target plug-in based on the update data.
[0140] By adopting this implementation plan, even if there are huge differences in the application monitoring and management methods of the terminals themselves, the plug-in can be started, stopped, restarted, and status monitored through requests sent by the access component to achieve life cycle management of the corresponding terminal.
[0141] <Implementation Plan 2> The plug-in implements a unified interface definition specification.
[0142] In the second embodiment, the connection between the plug-in and the IoT platform is generally achieved through the corresponding interface. In order to improve the convenience of the IoT platform to connect multiple plug-ins, an interface definition language can be set in advance. Later, when the plug-in needs to be connected, the interface definition language can be converted into a stub code. Based on the stub code, the plug-in and the IoT platform can both comply with the same interface definition specification, and the plug-in management service and the plug-in communicate based on this specification.
[0143] In specific implementation, after downloading the plug-in, the interface definition language corresponding to the plug-in can be obtained; the interface definition language can be converted into a stub code; and each plug-in can be connected based on the stub code.
[0144] In this embodiment, the stubbing code can also be referred to as pile code, wherein the implementation provided by the pile code is temporary / to be edited, so that the user can temporarily not edit this code without affecting the use of the program. In this application, a standard interface specification between the plug-in management service and the plug-in can be defined. The plug-in management service and the plug-in jointly comply with the interface specification and communicate based on this specification. In this way, the plug-in management service can communicate with different plug-ins through the interface specification.
[0145] Specifically, you can first obtain an interface definition language, and then use the scaffolding tool to quickly convert the interface definition language into stub code for services, methods, and message structures, which is more convenient for plug-in management service calls.
[0146] By adopting this second implementation scheme, different plug-ins can communicate with the plug-in management service through a unified interface specification, thereby improving the communication compatibility between the management plug-in service and different plug-ins, thereby realizing communication between the Internet of Things platform and different models of terminals.
[0147] <Implementation Plan 3> Port Pool Management
[0148] In this implementation, the port pool includes multiple ports, which are allocated to plug-ins. After the plug-ins bind the ports, they provide external services to the terminals (IoT devices). This mainly includes port allocation, port maintenance, port use, and port recycling.
[0149] In a specific implementation, after obtaining the plug-in, a target port that meets the first condition can be allocated to each plug-in corresponding to the access component from the multiple ports included in the port pool;
[0150] Accordingly, these allocated target ports can be bound to the plug-in so that the plug-in can provide external services through the target port. After authenticating at least one downloaded plug-in, the target port can be bound to the authenticated plug-in so that the plug-in can access the terminal based on the target port.
[0151] The first condition includes a condition that the port is unused and unreserved, or a condition that the port is unused but reserved.
[0152] In this embodiment, ports in the port pool are allocated to plug-ins to provide communication channels between the plug-ins and the terminal. Ports allocated to plug-ins can be added to a reserved list, which includes ports allocated to plug-ins but not yet running. Ports currently in use by plug-ins can be added to a used list, which includes ports of currently running plug-ins. In this way, the remaining ports in the port pool can be allocated to new plug-ins.
[0153] The same port is either in the reserved list or in the used list.
[0154] Since the first condition set in this embodiment includes the condition that the port is unused and unreserved, or the condition that the port is unused but reserved, when allocating ports, they can be allocated according to the status of the ports. As mentioned above, the status of the port can include an idle state, a standby state, and a used state. The idle state indicates that the port is neither reserved for the plug-in nor used by the plug-in. The standby state indicates that the port is reserved for the plug-in but not used by the plug-in. The used state indicates that the port is used by the plug-in.
[0155] In an optional example, an idle port will be preferentially selected from the port pool for the plug-in, that is, an idle port that is not used by the plug-in and not reserved for the plug-in will be selected. If there is no idle port, a standby port can be selected, that is, an unused port will be selected for the plug-in. If there is neither an idle port nor a stand-by port in the port pool, the port allocation fails.
[0156] In this way, each time a port is allocated to a plug-in, the plug-in can preferentially obtain an unused and unreserved port, so that the port can be used independently by the plug-in, avoiding the problem of cross-use of ports.
[0157] Accordingly, when a run / restart request for a plug-in is received, the target port may be checked to determine whether the target port is used by another plug-in.
[0158] Among them, after the target port verification passes, the plug-in is run; if the target port verification fails, the port that meets the second condition is screened from the port pool, and the port that meets the second condition is bound to the plug-in; wherein, the second condition is that the port is not in use.
[0159] Since the access component can stop, run or restart the plug-in, in the case of restart, the plug-in needs to be restarted, that is, the plug-in needs to re-establish the binding relationship with the port. In this case, in order to prevent the port bound before the plug-in restart from being used by other plug-ins after the restart, the target port bound to the plug-in can be verified first.
[0160] Specifically, the status of the target port can be obtained. If the status is idle or standby, the target port can be bound to the plug-in and restarted. If the status is in use, the verification fails, and it is necessary to filter the port that meets the second condition from the port pool. The second condition can be the condition that the port is not in use. In this case, the port in idle or standby state can be selected for the plug-in.
[0161] In an optional example, if the access component sends a stop request to the plug-in, when the plug-in is stopped, the port allocated to the plug-in can be released to make the port status standby, that is, the reference port is moved from the usage list to the reserved list to indicate that the port is allocated to the plug-in but is not used by the plug-in.
[0162] In another optional example, if the access component sends a deletion request for a plug-in, when the plug-in is deleted, the port allocated to the plug-in can be released, that is, the port is completely removed from the usage list and the reserved list, and the port is completely released, making the port idle so that the port can be allocated to other new plug-ins.
[0163] By adopting the implementation scheme of the present application, the port can be re-checked so that the assigned port of each plug-in can maintain the original port as much as possible before and after the restart, thereby avoiding the problem of needing to switch ports when re-accessing the terminal, thereby improving the efficiency of the terminal re-accessing the plug-in.
[0164] Through the above implementation plan, the unified operation and maintenance of plug-ins corresponding to various types of terminals on the Internet of Things platform is realized. As mentioned above, after the plug-ins are deployed on the Internet of Things platform, the Internet of Things platform can publish a visual list to display the plug-ins that have been deployed on the platform. The visual list can include the correspondence between the names of the plug-ins and the models of the terminals. Users can use this correspondence to determine which plug-in their terminal needs to correspond to. After selecting the corresponding plug-in and clicking run, the plug-in can be run, and the terminal randomly accesses the plug-in. The plug-in is deployed on the Internet of Things platform, so that the terminal can access the Internet of Things platform through the running plug-in.
[0165] <The process of the IoT platform providing business services to terminals>
[0166] Specifically, the IoT platform can provide access services and remote control services for terminals through plug-ins. Access services can refer to services for terminals to join the IoT platform, and remote control services can refer to services for the IoT platform to remotely control terminals to perform corresponding operations.
[0167] In specific implementation, for access services, the plug-in can be run after authentication in response to the running request sent by the terminal to the plug-in; then, the access request sent by the plug-in is received, and the access request is sent by the terminal to the plug-in; thereafter, based on the access request, the terminal is connected to the Internet of Things to provide access services.
[0168] Accordingly, as mentioned above, the IoT platform can publish a visualization list. Correspondingly, the IoT platform can generate a visualization list based on the authenticated plug-ins and the models of the terminals corresponding to the authenticated plug-ins, and publish the visualization list on the web page.
[0169] Correspondingly, the running request is sent by the user of the terminal after confirming the plug-in on the visualization list, and the visualization list includes the correspondence between the plug-in and the terminal.
[0170] In this implementation scheme, after the plug-in is authenticated, it can be published in the visualization list. At the same time, the model of the terminal to which the plug-in is adapted is also published in the visualization list. The terminal user can clearly know which plug-in to select for the terminal he owns through the visualization list. For example, if the terminal corresponding to plug-in 001 is Xinhaus S41C1, the user can select plug-in 001 and click Run, so that the running plug-in 001 can establish a connection with the terminal.
[0171] It should be noted that when logging into the Internet of Things platform on the terminal, click Run, and the plug-in can establish a connection with the terminal through its assigned port. If the terminal does not have a display screen, you can use other smart terminals to log in to the Internet of Things platform. The terminal and the smart terminal can communicate wirelessly via Bluetooth or infrared. Add the terminal to the wireless communication device list of the smart terminal, and the smart terminal logs in to the Internet of Things platform. The user selects the corresponding plug-in and terminal model and clicks Run. At this time, the running plug-in will automatically try to shake hands with the terminal selected in the wireless communication device list through the port assigned to it, thereby accessing the terminal and allowing the terminal to join the Internet of Things platform.
[0172] This implementation method can provide access services for a variety of IoT devices.
[0173] Among them, the remote control service may include the remote control of the terminal by the Internet of Things platform based on the device information uploaded by the terminal itself, and may also include the remote control of another terminal based on the information uploaded by one terminal.
[0174] In specific implementation, control information for the first terminal to be controlled can be obtained, and based on the control information, a control instruction can be sent to the first plug-in to instruct the first plug-in to send the control instruction to the first terminal, so that the first terminal performs an operation corresponding to the control instruction.
[0175] The control information is device information sent by the first terminal through the first plug-in, or the control information is information sent by the second terminal through the second plug-in.
[0176] In this embodiment, when the control information is the device information sent by the first terminal through the first plug-in, the terminal can upload its own device information at regular intervals. Specifically, the device information can be determined based on the control requirements. For example, when the control requirement is to control the temperature of the terminal to be maintained within a fixed range, the device information can include the temperature of the terminal. If the control requirement is to control the terminal to perform an opening operation when the conditions are met (commonly used for access control), the device information can be the visitor image collected by the terminal.
[0177] In this embodiment, the controlled terminal is referred to as the first terminal. The first terminal can send its device information to the IoT platform via the first plug-in. The IoT platform can then determine a control strategy for the terminal based on this device information. For example, if the temperature exceeds a preset value, the IoT platform can issue a cooling command to the first terminal. Upon receiving this cooling command, the first terminal activates its own cooling device to perform cooling. For another example, if the device information is a visitor's image, and the IoT platform determines that the visitor is a authorized user based on the image, it will send an activation command to the first plug-in. The first plug-in will then send this activation command to the first terminal, which will then execute the activation operation.
[0178] For example, the first terminal is a refrigerator. It is necessary to monitor the status of the items stored in the refrigerator and adjust the temperature of the refrigerator in time. The refrigerator can be added to the Internet of Things platform in advance. After that, the refrigerator regularly sends the status of the items and the refrigeration temperature of the refrigerator to the first plug-in, which feeds back to the Internet of Things platform. The Internet of Things platform can then determine whether the refrigeration temperature of the refrigerator is appropriate based on the status of the items. If it is not appropriate, the appropriate temperature is packaged as an instruction and sent to the first plug-in. The first plug-in sends it to the refrigerator, and the refrigerator cools according to the refrigeration temperature in the instruction to ensure the quality of the stored items.
[0179] When the control information is sent by the second terminal via the second plug-in, the first terminal can be controlled by the second terminal to perform corresponding operations, thereby achieving interconnection and mutual control between IoT devices. The control information can be determined based on control requirements and can include the model and network address of the first terminal. When the second plug-in sends the control information to the IoT platform, the IoT platform can identify the first plug-in based on the terminal's signal and network address and send the control instructions corresponding to the control information to the first plug-in. The first plug-in then sends the control instructions to the first terminal, allowing the first terminal to be controlled by the second terminal to perform corresponding operations.
[0180] For example, if a user needs to turn on the rice cooker at home in a different place, he or she can connect the mobile phone and the rice cooker to the Internet of Things platform in advance. The mobile phone and the rice cooker have their own plug-ins. After the user logs in to the Internet of Things platform through the mobile phone, he or she clicks on the controlled device "rice cooker" and selects to turn it on. The mobile phone then sends the turn-on control information to the second plug-in, and the second plug-in sends the turn-on control information to the Internet of Things platform. Based on the turn-on control information, the Internet of Things platform determines that the controlled device is the rice cooker, and can send a turn-on instruction to the first plug-in corresponding to the rice cooker. The first plug-in feeds back the turn-on instruction to the rice cooker, so that the rice cooker starts to enter the cooking mode.
[0181] Of course, the above is only an exemplary description and does not represent a specific limitation on the application scenario.
[0182] The following is an overall description of the access service processing method of this application, referring to Figure 4 and Figure 5 As shown, Figure 4 A schematic diagram showing the operating environment of the access service processing method of the present application is shown. Figure 5 A specific flow chart of the access service processing method of the present application is shown.
[0183] like Figure 4 As shown, it includes plug-in management service, access component and Internet of Things platform. The plug-in management service and access component can all be used as a microservice of the Internet of Things platform; among them, the plug-in management service, access component and plug-in can be deployed on different hosts respectively. The plug-in management service and the access component are called through gRPC methods, and the plug-in management service and the plug-in can also be called through gRPC methods to enable an application on one device to call an application on another device, thereby forming a distributed operating environment.
[0184] The access component sends a start / stop / restart request to the plug-in management service, and the plug-in management service starts / stops / restarts the corresponding plug-in based on the start / stop / restart request.
[0185] The access component sends a status monitoring request to the plug-in management service, and the plug-in management service performs status monitoring on the corresponding plug-in based on the status monitoring request.
[0186] The terminal can send its own access request to the plug-in, and the plug-in sends the access request to the IoT platform, using the access service provided by the IoT platform to join the IoT platform;
[0187] Afterwards, the terminal can send its own control information to the plug-in, and the plug-in sends the control information to the IoT platform, which then sends control instructions to the terminal through the plug-in.
[0188] specific place, reference Figure 5 As shown, the whole process can include the following steps:
[0189] 1.1. First, the third-party platform creates the access component;
[0190] 1.2. Upload the access component to the IoT platform through the external interface provided by the IoT platform. Specifically, you can first register the access component with the service registration center. In this way, other microservices, such as the plug-in management service, can call the access component through the service center. When calling, you can call it through gRPC.
[0191] 1.3. The plug-in management service can allocate a port for a custom access component, which can be used by the plug-in corresponding to the custom access component.
[0192] 2.1. The third-party platform uploads the plug-in to a designated address through the external interface provided by the IoT platform.
[0193] 3.1. The third-party platform sends a request to start the access component through the access component;
[0194] 3.2. Based on the startup request, the plug-in management service starts the access component and establishes communication with the access component.
[0195] 3.3. Next, the plug-in management service responds to the start request and needs to start the plug-in. Specifically, it includes the following processes 3.4 and 3.5:
[0196] 3.4. Download the plug-in from the specified address and establish a connection with the plug-in through the interface definition specification. In this case, a port is allocated to the plug-in, and an instance object corresponding to the plug-in is generated, and a plug-in is managed through the instance object.
[0197] 3.5, the IoT platform authenticates the plug-in;
[0198] 3.6. After authentication is passed, the plug-in sends a handshake message to the IoT platform and receives information returned by the IoT platform, thereby establishing a connection with the IoT platform.
[0199] Next, the plug-in management service can perform lifecycle management and status monitoring on the plug-in, specifically including the following steps 3.7-3.11:
[0200] 3.7, the instance object listens to a specific channel, collects and prints the logs written to the channel by the plug-in process, and completes log retrieval.
[0201] 3.8. The plug-in management service sends a status monitoring instruction to the instance object corresponding to the plug-in, and the instance object obtains the working status and business status of the plug-in;
[0202] 3.9, the instance object reports the monitored working status and business status to the plug-in management service;
[0203] 3.10. The plug-in management service determines that a plug-in has failed based on its working status and business status, and automatically restarts the plug-in.
[0204] 3.11, the instance object receives this restart information and restarts the plug-in. When restarting the plug-in, the plug-in port can be re-checked. The port that passes the check can continue to be used. If the check port does not pass, the port needs to be reallocated.
[0205] 4.1, the access component sends a request to stop the plug-in to the plug-in management service;
[0206] 4.2. In response to the stop request, the plug-in management service sends a plug-in stop instruction to the instance object, and the instance object stops the plug-in.
[0207] <Terminals use plug-ins to access the IoT platform>
[0208] 5.1. The terminal selects a plug-in and runs it. During the running process, the plug-in establishes a connection with the terminal through the assigned port and receives data (control information) sent by the terminal. At the same time, it can upload periodic heartbeat packets to the Internet of Things platform (IOT platform) to ensure that the IoT platform maintains the communication connection with the plug-in.
[0209] 5.2. After receiving the data, the plug-in reports it to the IoT platform;
[0210] 6.1, the IoT platform issues control instructions to the plug-in based on the reported data;
[0211] 6.2, the plug-in returns the control instruction to the terminal, and the terminal performs the corresponding operation under the drive of this control instruction.
[0212] By adopting the technical solution of the embodiment of the present application, on the one hand, even if different terminals have differences in access protocols, application development languages, and application deployment methods, for the terminal side, it only needs to establish a connection with a matching plug-in to join the Internet of Things platform, thereby simplifying the operation of the terminal accessing the Internet of Things platform.
[0213] On the other hand, for the IoT platform, no matter what type of terminal it is, it only needs to interact with the corresponding plug-in to provide business services to the terminal. In this way, the access applications of various types of terminals are included in the IoT platform for unified deployment and management.
[0214] On the other hand, the access component can manage the life cycle of the plug-in, so that the operation failure of the plug-in can be discovered in time and the failure can be eliminated in time to avoid failure problems after the terminal is connected to the Internet of Things platform.
[0215] On the other hand, gRPC methods can be used to call between access components and plug-in management services, and gRPC methods can also be used between plug-in management services and plug-ins. In this way, plug-ins can be deployed on the edge or in the cloud to realize the distributed management and operation of numerous plug-ins by the plug-in management service.
[0216] Based on the same inventive concept, this application also provides an access service system, referring to Figure 6 As shown in FIG, a schematic diagram of the framework of the access service system is shown. Figure 6 As shown, the system includes: an external interface 601 , a plug-in management service module 602 (the plug-in management service of the above embodiment) and a business service module 603 .
[0217] Among them, the external interface 601 is used to connect to at least one access component 604 and communicate with the plug-in management service module 602, and the business service module 603 is used to communicate with the running plug-in 605;
[0218] External interface 601, used to connect to at least one access component 604;
[0219] The plug-in management service module 602 is configured to download the at least one plug-in 605 and authenticate the at least one plug-in 605 in response to a startup request sent by the access component 604 for the plug-in 605;
[0220] The business service module 603 is used to provide business services for the corresponding model of the terminal based on the authenticated plug-in 605. The business services at least include the access service of the terminal and the remote control service of the terminal.
[0221] like Figure 6 As shown, gRPC method calls are made between the plug-in management service module 602 and the plug-in 605, and gRPC method calls are made between the plug-in management service module 602 and the access component 604. The terminal and the plug-in 605 can communicate through communication protocols such as TCP / UDP / MQTT / CoAP, and can exchange data through JSON / text / binary. Among them, the plug-in and the business service module can communicate, and the communication protocol adopted by the communication can be MQTT.
[0222] In an optional example, as in the above embodiment, the plug-in management service module 602 communicates with at least one plug-in 605 based on the unified interface definition specification;
[0223] Among them, the unified interface definition specification converts the interface definition language into stub code and is generated based on the stub code.
[0224] In an optional example, the external interface 601 is further configured to receive a processing request sent by the access component for a target plug-in in at least one plug-in, and send the processing request to the management service module;
[0225] The plug-in management service module is further configured to execute a processing operation corresponding to the processing request on the target plug-in based on the processing request, wherein the processing operation includes at least one of starting, stopping, restarting, and status monitoring.
[0226] In an optional embodiment, the access service system runs on the server, and at least one plug-in runs on the server and / or runs on a host connected to the server. In other words, some of the multiple plug-ins can run on the server, and other plug-ins can run on the host.
[0227] In an optional example, the plug-in management service module further includes multiple instance objects, wherein different instance objects correspond to different plug-ins, and the plug-in management service module communicates with the corresponding plug-ins through the instance objects.
[0228] Based on the same inventive concept, the present application also provides an access service processing device, referring to Figure 7 As shown, a schematic diagram of the structure of the access service processing device is shown. Figure 7 As shown, the access service processing device may be located in the plug-in management service, and may specifically include the following modules:
[0229] The acquisition module 701 is configured to acquire at least one access component and download at least one plug-in corresponding to each access component; wherein each access component corresponds to at least one plug-in, and different plug-ins correspond to different terminal models;
[0230] An authentication module 702 is configured to authenticate at least one plug-in in response to a startup request sent by the access component for the plug-in;
[0231] The service module 703 is used to provide business services for terminals of corresponding models based on authenticated plug-ins. The business services include at least terminal access services and terminal remote control services.
[0232] Optionally, the service module 703 includes:
[0233] A running unit, configured to respond to a running request sent by a terminal to a plug-in and run the plug-in after passing authentication;
[0234] A receiving unit receives an access request sent by the plug-in, where the access request is sent by the terminal to the plug-in;
[0235] The access unit is used to connect the terminal to the Internet of Things based on the access request to provide access services.
[0236] Optionally, the device further comprises:
[0237] A list generation module is used to generate a visual list based on the authenticated plug-ins and the terminal models corresponding to the authenticated plug-ins, and the visual list includes the correspondence between the plug-ins and the terminals;
[0238] The list publishing module is used to publish the visualization list on the web page; wherein, the run request is sent after the terminal user confirms the plug-in on the visualization list.
[0239] Optionally, the service module 703 includes:
[0240] an information acquisition unit, configured to acquire control information for a first terminal to be controlled, wherein the control information is device information sent by the first terminal via a first plug-in, or the control information is information sent by a second terminal via a second plug-in;
[0241] The instruction issuing unit is configured to send a control instruction to the first plug-in based on the control information, so as to instruct the first plug-in to send the control instruction to the first terminal so that the first terminal performs an operation corresponding to the control instruction.
[0242] Optionally, the authentication module 702 includes:
[0243] A startup unit, configured to start the plug-in using a command line in response to a startup request;
[0244] A handshake information receiving unit, configured to receive handshake information sent by the activated plug-in, wherein the handshake information carries configuration information configured by the plug-in; the configuration information includes at least one of a communication protocol version, a data protocol version, and a network address;
[0245] The authentication unit is used to authenticate the plug-in based on the configuration information to determine whether the configuration information of the plug-in is suitable for the current operating environment.
[0246] Optionally, the device further comprises:
[0247] A port allocation module is configured to allocate a target port that meets a first condition to each plug-in corresponding to the access component from a plurality of ports included in the port pool; the first condition includes a condition that the port is unused and unreserved, or a condition that the port is unused but reserved;
[0248] The port binding module is used to bind the target port for the plug-in that has passed the authentication so that the plug-in can access the terminal based on the target port.
[0249] Optionally, the device further comprises:
[0250] The port verification module is used to verify the target port when receiving a run / restart request for a plug-in to determine whether the target port is used by other plug-ins;
[0251] The first processing module is used to run the plug-in after the target port verification passes;
[0252] The second processing module is used to screen ports that meet the second condition from the port pool when the target port fails the verification, and bind the ports that meet the second condition to the plug-in; wherein the second condition is that the port is not in use.
[0253] Optionally, the device further comprises:
[0254] An interface definition language acquisition module is used to acquire the interface definition language corresponding to the plug-in;
[0255] The conversion module is used to convert the interface definition language into stub code;
[0256] Access module, used to access each plug-in based on stubbing code.
[0257] Optionally, the device further comprises:
[0258] a processing request receiving module, configured to receive a processing request sent by the access component to a target plug-in in at least one plug-in;
[0259] The processing module is configured to execute a processing operation corresponding to the processing request on the target plug-in based on the processing request, wherein the processing operation includes at least one of starting, stopping, restarting, and status monitoring.
[0260] Optionally, the processing operation includes status monitoring, and the processing module includes:
[0261] A monitoring information acquisition unit is used to obtain monitoring information of the target plug-in during its operation through an instance object corresponding to the target plug-in; wherein the monitoring information includes heartbeat data packets sent by the plug-in and / or an operation log of the plug-in during its operation;
[0262] A status monitoring unit, configured to monitor the running status and / or service status of the plug-in based on the monitoring information; wherein the service status is used to represent the status of the service provided by the plug-in to the terminal;
[0263] The fault handling unit is used to restart the plug-in that has a fault in the running state and stop the plug-in that has a fault in the business state.
[0264] Optionally, the processing module is specifically configured to:
[0265] If the processing request is a stop operation request, stop the operation of the target plug-in to stop the business service of the terminal matched by the target plug-in;
[0266] If the processing request is a restart request, re-authenticate the target plug-in and restart the target plug-in after the authentication is passed, so as to restart the business service for the terminal matching the target plug-in;
[0267] When the processing request is an update request, the target plug-in is updated based on the update data carried in the update request.
[0268] The device embodiment is similar to the method embodiment and will not be described in detail here.
[0269] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0270] Finally, it should be noted that, unless otherwise defined, the terms "first", "second" and similar terms used in this document do not indicate any order, quantity or importance, but are only used to distinguish different components. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device that includes a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements that are inherent to such process, method, commodity or device. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, commodity or device that includes the element. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0271] The above is a detailed introduction to an access service processing method, access service system, access service processing device, electronic device and storage medium provided by the present disclosure. Specific examples are used in this article to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method of the present disclosure and its core ideas. At the same time, for general technical personnel in this field, according to the ideas of the present disclosure, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present disclosure.
[0272] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0273] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
[0274] References herein to "one embodiment," "an embodiment," or "one or more embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present disclosure. Furthermore, please note that instances of the phrase "in one embodiment" do not necessarily all refer to the same embodiment.
[0275] In the description provided herein, numerous specific details are described. However, it is understood that embodiments of the present disclosure may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.
[0276] In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present disclosure may be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names.
[0277] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present disclosure.
Claims
1. A method for processing access services, characterized in that: Applied to an Internet of Things platform, the Internet of Things platform provides access services and remote control services for terminals through plug-ins, and the Internet of Things platform communicates with a third-party platform; the method includes: Obtaining at least one access component and downloading at least one plug-in corresponding to each access component; wherein each access component corresponds to at least one plug-in, and different plug-ins match different terminal models; the access component and the plug-in are uploaded by a third-party user through the third-party platform; In response to a startup request sent by the third-party user through the access component, authenticating the at least one plug-in to determine whether the plug-in is compatible with the Internet of Things platform; after the plug-in passes the authentication, pre-deploying the plug-in on the Internet of Things platform, and publishing a visualization list generated by the plug-in to a web page so that the terminal can run the plug-in through the web page; wherein the visualization list includes a correspondence between the plug-in and the terminal; Providing business services for terminals of corresponding models based on the authenticated plug-in, including: in response to the terminal selecting the plug-in adapted to itself on the web page, running a plug-in that has passed authentication, matches the connected terminal, and is pre-deployed on the Internet of Things platform; and, based on an access request sent by the plug-in, connecting the terminal to the Internet of Things to provide access services, so that the running plug-in helps the terminal access the Internet of Things platform; wherein, when authenticating the plug-in, the network address of the plug-in is authenticated, and the network address indicates the network range where the terminal to be served is located; the access request is sent by the terminal to the plug-in; The business service at least includes the terminal access service and the terminal remote control service; After the plug-in that has passed authentication is connected to a terminal of a corresponding model, the method further includes: receiving a request from the third-party platform to start an access component through the access component; establishing communication with the access component based on the request to start the access component; receiving a processing request from the third-party user through the access component for at least one target plug-in in the plug-ins; Based on the processing request, a processing operation corresponding to the processing request is performed on the target plug-in to manage the plug-in uploaded by the third-party user, including: if the processing request is a stop operation request, stopping the operation of the target plug-in; if the processing request is a restart request, re-authenticating the target plug-in and restarting the target plug-in after the authentication is passed; if the processing request is an update request, updating the target plug-in based on the update data carried by the update request; wherein the processing operation includes at least one of starting, stopping, restarting and status monitoring.
2. The method according to claim 1, characterized in that The plug-in that passes the authentication provides business services for the terminal of the corresponding model, including: In response to a running request sent by the terminal to the plug-in, running the plug-in after passing authentication; receiving an access request sent by the plug-in, wherein the access request is sent by the terminal to the plug-in; Based on the access request, the terminal is connected to the Internet of Things to provide the access service.
3. The method according to claim 2, characterized in that After authenticating the at least one plug-in in response to the startup request sent by the access component, the method further includes: Generate a visualization list based on the authenticated plug-ins and the terminal models corresponding to the authenticated plug-ins, wherein the visualization list includes the correspondence between the plug-ins and the terminals; Publishing the visualization list on a web page; The execution request is sent by the user of the terminal after selecting a plug-in on the visualization list.
4. The method according to claim 1, wherein The business service includes the remote control service, and the plug-in provided with the authentication-passed service for the terminal of the corresponding model includes: Acquire control information for a first terminal to be controlled, wherein the control information is device information sent by the first terminal through a first plug-in, or the control information is information sent by a second terminal through a second plug-in; Based on the control information, a control instruction is sent to the first plug-in to instruct the first plug-in to send the control instruction to the first terminal, so that the first terminal performs an operation corresponding to the control instruction.
5. The method according to claim 1, wherein The step of authenticating the at least one plug-in in response to the startup request sent by the access component includes: In response to the start request, start the plug-in; Receiving a handshake message sent by the activated plug-in, wherein the handshake message carries configuration information configured by the plug-in; the configuration information includes at least one of a communication protocol version, a data protocol version, and a network address; Based on the configuration information, the plug-in is authenticated to determine whether the configuration information of the plug-in is adapted to the current operating environment.
6. The method according to claim 1, characterized in that After obtaining at least one access component, the method further includes: Allocating a target port that meets a first condition to each plug-in corresponding to the access component from a plurality of ports included in the port pool; the first condition includes a condition that the port is unused and unreserved, or a condition that the port is unused but reserved; After authenticating the at least one plug-in, the method further includes: The target port is bound to the plug-in that has passed the authentication, so that the plug-in accesses the terminal based on the target port.
7. The method according to claim 6, characterized in that After binding the target port to the plug-in that has passed the authentication, the method further includes: Upon receiving a run / restart request for the plug-in, checking the target port to determine whether the target port is used by another plug-in; After the target port is verified, running the plug-in; In the case that the target port fails to pass the verification, a port that meets the second condition is screened from the port pool, and the port that meets the second condition is bound to the plug-in; wherein the second condition is that the port is not in use.
8. The method according to claim 1, characterized in that After obtaining at least one access component and downloading at least one plug-in corresponding to each access component, the method further includes: Obtaining an interface definition language corresponding to the plug-in; Converting the interface definition language into a stub code; Based on the stubbing code, each of the plug-ins is accessed.
9. The method according to claim 8, characterized in that The processing operation includes status monitoring, and the performing of the processing operation corresponding to the processing request on the target plug-in based on the processing request includes: During the operation of the target plug-in, monitoring information of the plug-in during the operation is obtained through the instance object corresponding to the target plug-in; wherein the monitoring information includes a heartbeat data packet sent by the plug-in and / or an operation log of the plug-in during the operation; Based on the monitoring information, monitoring the running state and / or service state of the plug-in; wherein the service state is used to represent the state of the service provided by the plug-in to the terminal; The plug-in with the fault in the running state is restarted, and the plug-in with the fault in the service state is stopped.
10. An access service system, characterized in that: Applied to an Internet of Things platform, the Internet of Things platform provides access services and remote control services to terminals through plug-ins, and the Internet of Things platform communicates with a third-party platform; the system includes: an external interface and business service module, and a plug-in management service module that communicates with the external interface, wherein: The external interface is used to connect to at least one access component; The plug-in management service module is configured to download the at least one plug-in and, in response to a startup request sent by the third-party user through the access component, authenticate the at least one plug-in to determine whether the plug-in is compatible with the IoT platform; after the plug-in is authenticated, pre-deploy the plug-in on the IoT platform and publish a visualization list generated by the plug-in to a web page so that the terminal can run the plug-in through the web page; the access component and the plug-in are uploaded by the third-party user through the third-party platform; A business service module is configured to provide business services for terminals of corresponding models based on the authenticated plug-in, including: in response to the terminal selecting the plug-in adapted for itself on the web page, running a plug-in that has passed authentication, matches the connected terminal, and is pre-deployed on the Internet of Things platform; and, based on an access request sent by the plug-in, connecting the terminal to the Internet of Things to provide access services, so that the running plug-in helps the terminal access the Internet of Things platform; wherein, when authenticating the plug-in, the network address of the plug-in is authenticated, and the network address indicates the network range where the terminal to be served is located; the access request is sent by the terminal to the plug-in; The business service at least includes the terminal access service and the terminal remote control service; After the plug-in that has passed the authentication is connected to the terminal of the corresponding model, the plug-in management service module is further used to receive a request from the third-party platform to start the access component through the access component; establish communication with the access component based on the request to start the access component; and receive a processing request sent by the third-party user through the access component for at least one target plug-in in the plug-ins; Based on the processing request, a processing operation corresponding to the processing request is performed on the target plug-in to manage the plug-in uploaded by the third-party user, including: if the processing request is a stop operation request, stopping the operation of the target plug-in; if the processing request is a restart request, re-authenticating the target plug-in and restarting the target plug-in after the authentication is passed; if the processing request is an update request, updating the target plug-in based on the update data carried by the update request; wherein the processing operation includes at least one of starting, stopping, restarting and status monitoring.
11. The service system according to claim 10, characterized in that: The plug-in management service module communicates with the at least one plug-in based on a unified interface definition specification; The unified interface definition specification is generated by converting the interface definition language into stubbing code and based on the stubbing code.
12. The service system according to claim 10, characterized in that: The external interface is further configured to receive a processing request sent by the access component for at least one target plug-in in the plug-ins, and send the processing request to the management service module; The plug-in management service module includes an instance object corresponding to each plug-in; The instance object is used to perform a processing operation corresponding to the processing request on the target plug-in based on the processing request, wherein the processing operation includes at least one of starting, stopping, restarting, and status monitoring.
13. The service system according to claim 10, characterized in that: The access service system runs on a server, and at least one of the plug-ins runs on the server and / or runs on a host connected to the server.
14. An access service processing device, characterized in that: Applied to an Internet of Things platform, the Internet of Things platform provides access services and remote control services to terminals through plug-ins, and the Internet of Things platform communicates with a third-party platform; the device includes: an acquisition module, configured to acquire at least one access component and download at least one plug-in corresponding to each access component; wherein each access component corresponds to at least one plug-in, and different plug-ins correspond to different terminal models; and wherein the access component and the plug-in are uploaded by a third-party user through the third-party platform; an authentication module configured to authenticate the at least one plug-in in response to a startup request sent by the third-party user through the access component for the plug-in to determine whether the plug-in is compatible with the IoT platform; after the plug-in passes authentication, pre-deploy the plug-in on the IoT platform and publish a visualization list generated by the plug-in to a web page so that a terminal can run the plug-in through the web page; wherein the visualization list includes a correspondence between the plug-in and the terminal; A service module is used to provide business services for terminals of corresponding models based on the plug-in that has passed authentication, including: in response to the terminal selecting the plug-in that is adapted to itself on the web page, running a plug-in that has passed authentication, matches the connected terminal, and is pre-deployed on the Internet of Things platform; and, based on the access request sent by the plug-in, connecting the terminal to the Internet of Things to provide access services, so that the running plug-in helps the terminal access the Internet of Things platform; wherein, when authenticating the plug-in, it includes authenticating the network address of the plug-in, and the network address indicates the network range where the terminal of the service is located; the access request is sent by the terminal to the plug-in The business service at least includes the terminal access service and the terminal remote control service; a processing request receiving module, configured to receive a request from the third-party platform to start the access component through the access component; establish communication with the access component based on the request to start the access component; and receive a processing request sent by the third-party user through the access component for a target plug-in in at least one plug-in; A processing module is used to perform a processing operation corresponding to the processing request on the target plug-in based on the processing request, including: if the processing request is a stop operation request, stopping the operation of the target plug-in; if the processing request is a restart request, re-authenticating the target plug-in and restarting the target plug-in after the authentication is passed; if the processing request is an update request, updating the target plug-in based on the update data carried by the update request, wherein the processing operation includes at least one of starting, stopping, restarting and status monitoring.
15. A computer-readable storage medium, characterized in that The computer program stored therein enables the processor to execute the access service processing method according to any one of claims 1 to 9.
16. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the access service processing method according to any one of claims 1 to 9, the computer program is implemented.
Citation Information
Patent Citations
Plug-in downloading control method and plug-in downloading control system
CN102043649A
Device and method for authenticating object to be loaded
CN102065026A
Plug-in download method and device
CN104717301A
Internet of Things platform based on hot plug and implementation method
CN110430180A
Plug-in management method and device, electronic equipment and storage medium
CN111831320A