Protocol management method of Internet of Things platform and Internet of Things platform
By detecting protocol update events in the Internet of Things platform and dynamically updating the communication protocol instance set, the problem of inefficient communication protocol management in the existing technology is solved, and efficient and flexible protocol management is achieved.
Patent Information
- Application Number
- CN202411477345.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-18
AI Technical Summary
The existing technology is difficult to support IoT platforms to manage diversified communication protocols efficiently and inexpensively, resulting in inefficient communication protocol management.
By detecting protocol update events during the operation of the IoT platform, analyzing update events, obtaining the current protocol instance set, and updating the protocol instance set based on the update indication information, the IoT platform can dynamically update the communication protocol.
It realizes automated dynamic updates of communication protocols, reduces manual intervention, significantly improves the efficiency and flexibility of protocol management, and reduces the management difficulty of technicians.
Smart Images

Figure CN119484656A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of computer technology and Internet of Things technology, and in particular to a protocol management method for an Internet of Things platform and an Internet of Things platform. Background Art
[0002] In the field of Internet of Things, the transmission of device data and the optimization of device program configuration are usually achieved through message interaction between IoT devices and IoT platforms (such as IoT platforms). In order to facilitate efficient and centralized management of diverse IoT devices, multiple IoT devices are usually connected to the same IoT platform. Since the message interaction between the IoT platform and different IoT devices may use different communication protocols, the current protocol management solution is difficult to support the relevant management equipment to manage the diverse communication protocols of such IoT platforms efficiently and with low difficulty. In view of this, there is an urgent need to propose a new protocol management solution to reduce the difficulty of communication protocol management and improve the management efficiency of communication protocols. Summary of the invention
[0003] The embodiments of the present application provide a protocol management method for an Internet of Things platform and an Internet of Things platform, which can reduce the difficulty of managing communication protocols and improve the management efficiency of communication protocols.
[0004] On the one hand, an embodiment of the present application provides a protocol management method for an Internet of Things platform, including:
[0005] Detecting protocol update events during the operation of the IoT platform, parsing the detected protocol update events, and determining the target communication protocol to be updated and update indication information;
[0006] Acquire a protocol instance set currently used by the Internet of Things platform, where the protocol instance set is used to indicate various communication protocols that the Internet of Things platform is allowed to call;
[0007] Based on the update indication information and the target communication protocol, the protocol instance set is updated with a protocol instance, so that the Internet of Things platform performs message interaction based on the updated protocol instance set.
[0008] On the other hand, an embodiment of the present application provides an Internet of Things platform, including a protocol loader and a protocol manager, wherein there is a communication connection between the protocol loader and the protocol manager;
[0009] The protocol manager is used to store a set of protocol instances used by the Internet of Things platform, where the set of protocol instances is used to indicate various communication protocols that the Internet of Things platform is allowed to call;
[0010] The protocol manager is further used to detect protocol update events during the operation of the Internet of Things platform, and parse the detected protocol update events to determine the target communication protocol to be updated and the update indication information;
[0011] The protocol loader is used to update the protocol instance set stored in the protocol manager based on the update indication information and the target communication protocol determined by the protocol manager.
[0012] On the other hand, the embodiment of the present application provides a protocol management device for an Internet of Things platform, including:
[0013] A detection unit, used to detect a protocol update event during the operation of the Internet of Things platform, and parse the detected protocol update event to determine the target communication protocol to be updated and the update indication information;
[0014] An acquisition unit, used to acquire a protocol instance set currently used by the Internet of Things platform, wherein the protocol instance set is used to indicate each communication protocol that the Internet of Things platform is allowed to call;
[0015] An updating unit is used to update the protocol instance of the protocol instance set based on the update indication information and the target communication protocol, so that the Internet of Things platform performs message interaction based on the updated protocol instance set.
[0016] On the other hand, an embodiment of the present application provides a computer device, including:
[0017] a processor adapted to implement one or more computer programs;
[0018] A memory storing one or more computer programs, wherein the one or more computer programs are suitable for being loaded by the processor and executing the method according to the first aspect.
[0019] On the other hand, an embodiment of the present application provides a computer-readable medium, which stores one or more computer programs, and the one or more computer programs are suitable for being loaded by a processor and executing the method of the first aspect.
[0020] On the other hand, an embodiment of the present application provides a program product, which includes a computer program, and the computer program is suitable for being loaded by a processor and executing the method of the first aspect.
[0021] The embodiment of the present application detects a protocol update event during the operation of the IoT platform, and updates the communication protocol that can be adopted by the IoT platform based on the update indication information involved in the protocol update event, so that the communication protocol adopted by the IoT platform can be dynamically updated based on the automatic execution of program instructions during the operation of the platform, avoiding manual intervention in the communication protocol update process, thereby greatly improving the efficiency and flexibility of protocol management and reducing the difficulty of technical personnel in protocol management. Since the IoT platform can use different communication protocols to exchange information with different types of IoT devices, then by improving the flexibility of communication protocol management, it can also support flexible expansion of the information interaction function of the IoT platform to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 is a schematic diagram of an Internet of Things system provided by an embodiment of the present application;
[0024] Figure 2 It is a schematic flow chart of a protocol management method for an Internet of Things platform provided in an embodiment of the present application;
[0025] Figure 3 It is a flowchart of a new communication protocol provided in an embodiment of the present application;
[0026] Figure 4 It is a schematic diagram of an information interaction principle provided by an embodiment of the present application;
[0027] Figure 5 It is a structural diagram of a protocol management device of an Internet of Things platform provided in an embodiment of the present application;
[0028] Figure 6 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] It should be noted in advance that in order to enable people in the technical field to better understand the technical solutions proposed in the embodiments of the present application, the embodiments of the present application will be combined with one or more drawings to clearly and completely describe the implementation of the technical solutions proposed in the embodiments of the present application. In addition, the various drawings shown in the embodiments of the present application are only exemplary descriptions. For example, the execution order of each step in the drawings can be adaptively adjusted according to the actual application scenario.
[0030] In addition, in the embodiments of the present application, the block diagrams, modules and units shown in the drawings are merely functional entities, which do not necessarily correspond to physically independent entities, and each module or unit may be a part of an overall module or unit that includes the function of the module or unit. That is, the term "module" or "unit" mentioned in the embodiments of the present application refers to a computer program or a part of a computer program with a predetermined function, which can work with other related parts to achieve a predetermined goal, and can also be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof, or implemented in different networks and / or processor devices and / or microcontroller devices. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units.
[0031] This application mainly focuses on the protocol management scenario of the Internet of Things platform and proposes a technical solution for efficiently managing the communication protocol adopted by the Internet of Things platform. The solution can be applied to Figure 1 The IoT system shown in Figure 1. Figure 1 , the Internet of Things system in this application is composed of at least an Internet of Things platform and multiple Internet of Things devices. Among them, there is a communication connection between the Internet of Things platform and each Internet of Things device, and the Internet of Things platform and different Internet of Things devices can use different communication protocols to exchange messages (i.e., communicate). In addition, in actual applications, the Internet of Things platform can be run in a computer device, and the computer device can manage the various communication protocols involved in the platform based on the technical solution proposed in this application. Of course, other computer devices other than the computer device running the Internet of Things platform can also be used to manage the communication protocols in the Internet of Things platform based on the technical solution proposed in this application, which is not limited here.
[0032] Specifically, when the corresponding computer equipment applies the technical solution proposed in this application, it can detect the protocol update event during the operation of the Internet of Things platform, and update the communication protocol that can be adopted by the Internet of Things platform based on the update indication information involved in the protocol update event, so that the communication protocol adopted by the Internet of Things platform can be dynamically updated based on the automatic execution of program instructions during the operation of the platform, and there is no need for human participation in the update of the communication protocol, which can not only greatly improve the efficiency and flexibility of protocol management, but also reduce the difficulty of technical personnel in protocol management. Since the Internet of Things platform can use different communication protocols to exchange information with different types of Internet of Things devices, then by improving the flexibility of communication protocol management, it can also support the flexible expansion of the information interaction function of the Internet of Things platform to a certain extent.
[0033] It is worth mentioning that the computer equipment used in this application can be composed of one or both of terminal devices and servers, wherein the terminal devices may include but are not limited to smart phones, smart wearable devices, portable computers and desktop computers, etc., and the servers may include but are not limited to independent physical servers, physical server clusters, virtual servers (cloud servers) for providing cloud services, etc.
[0034] Based on the principle of the above technical solution, the embodiment of the present application specifically proposes a protocol management method for an Internet of Things platform, which can still be executed by the aforementioned computer device, and the schematic flow chart of the method can be found in Figure 2 .like Figure 2 , the method may include the following steps S201-S203:
[0035] S201. Detecting a protocol update event during the operation of the Internet of Things platform, parsing the detected protocol update event, and determining a target communication protocol to be updated and update indication information.
[0036] In a specific embodiment, the computer device can set a protocol update event for the Internet of Things platform based on an event monitoring mechanism to capture the protocol update behavior for the Internet of Things platform. Among them, the protocol update behavior may include but is not limited to the behavior of updating the protocol description information (such as a protocol file), the behavior of updating the protocol bytecode, and the behavior of updating the hash value of the protocol file, etc. It can be understood that the protocol update behavior can be executed by relevant personnel through human-computer interaction, or it can be executed by the computer device based on the received program instructions, and any protocol update behavior for the Internet of Things platform will trigger a protocol update event, which can be detected by the computer device, so that the computer device determines the specific protocol update requirements by parsing the protocol update event. Exemplarily, the protocol update requirement can be explicitly specified by the initiating object of the protocol update behavior, or it can be determined by the corresponding device (such as the device used by the initiating object to trigger the protocol update behavior) by predicting the needs of the initiating object, which is not limited here.
[0037] The protocol update requirement is used to describe at least the target communication protocol to be updated and specific update indication information. The update indication information is mainly used to indicate the update strategy for the target communication protocol, such as adding a new target communication protocol, modifying a target communication protocol or deleting a target communication protocol. The number of target communication protocols can be one or more.
[0038] Optionally, the protocol update requirement can be further used to describe information such as the protocol loading method and device configuration requirements. Among them, the protocol loading method is mainly used to indicate the loading strategy for the target communication protocol, such as one or more of immediate loading, scheduled loading, network loading, local loading, etc. By describing the protocol loading method in the protocol update requirement, the computer device can clarify the loading strategy, thereby reducing the trial and error cost of the computer device for the loading strategy and improving the efficiency of protocol loading.
[0039] Device configuration requirements are mainly used to indicate the parameters that need to be configured when updating the target communication protocol, such as storage parameters, operating parameters, etc. By describing the device configuration requirements in the protocol update requirements, the computer device can perform the update of the target communication protocol when the corresponding configuration is met, thereby avoiding program errors or downtime due to insufficient performance of the computer device, ensuring the functional stability of the computer device to a certain extent, and improving the efficiency and accuracy of the protocol update.
[0040] S202: Acquire a protocol instance set currently used by the Internet of Things platform, where the protocol instance set is used to indicate various communication protocols that the Internet of Things platform is allowed to call.
[0041] In a specific embodiment, the communication protocol is used to define the message processing logic during message interaction, and the protocol instance set refers to a set composed of instances of the communication protocol. Among them, instance is a technical term in program development, which refers to the specific implementation of a set of properties or methods. In the embodiment of the present application, an instance of a communication protocol (or protocol instance) can be understood as an executable instruction with specific message processing logic created based on the definition of the communication protocol, and different defined communication protocols can be used to create different protocol instances. Computer devices can trigger the execution of corresponding executable instructions by calling the protocol instance of the communication protocol, thereby realizing message interaction using the message processing logic defined by the communication protocol.
[0042] Typically, the protocol instances in the protocol instance set are created based on the communication protocols currently allowed to be used by the IoT platform. The protocol instance can be stored in association with the protocol state, and the protocol state is mainly used to indicate whether the corresponding protocol instance is available. Specifically, the protocol state associated with the protocol instance can be one of a disabled state or an enabled state. Among them, the disabled state indicates that the protocol instance is currently unavailable, and the enabled state indicates that the protocol instance is currently available. Optionally, the computer device can delete the protocol instance whose protocol state is a disabled state in the protocol instance set to release storage resources and improve the effective utilization of storage resources. Alternatively, the computer device can delete the protocol instance that has been kept in a disabled state for a predetermined period of time to avoid frequent updates of the protocol instance set in a short period of time while improving the effective utilization of storage resources.
[0043] Optionally, the protocol state associated with the protocol instance can also be "qualified and available state", which indicates that the protocol instance can be called when the current communication environment meets the corresponding conditions. The establishment of this protocol state can enable the protocol instance in the IoT platform to be called in a targeted manner, thereby laying a technical foundation for the customized development of the message interaction function of the IoT platform, and enabling the message interaction function of the IoT platform to be flexibly expanded.
[0044] S203: Based on the update indication information and the target communication protocol, the protocol instance set is updated, so that the Internet of Things platform performs message interaction based on the updated protocol instance set.
[0045] In one embodiment, the update indication information can be used to indicate the addition of a new target communication protocol. In this case, when the computer device updates the protocol instance set, it can first obtain the protocol file associated with the protocol update event, which is usually used to describe the target communication protocol, and then create a protocol instance of the target communication protocol based on the target communication protocol described by the protocol file, and finally add the protocol instance to the protocol instance set to update the protocol instance in the protocol instance set.
[0046] In yet another embodiment, the update indication information may be used to indicate a protocol modification to the target communication protocol, and the protocol modification may include a modification to the protocol status and a modification to the protocol content.
[0047] If the protocol modification is a modification of the protocol state, then when the computer device updates the protocol instance set, it can first determine the expected state of the target communication protocol from the protocol update event, then query the protocol instance of the target communication protocol in the protocol instance set, and then update the protocol state associated with the queried protocol instance to the expected state, thereby realizing the modification of the protocol state. Among them, the expected state refers to the protocol state where the target communication protocol is expected to be, and the expected state can be included in the update indication information, and can also be included in other data stored in association with the protocol update event, which is not limited here.
[0048] If the protocol modification is a modification of the protocol content, then when the computer device updates the protocol instance set, it can first obtain the protocol file associated with the protocol update event, and then create a protocol instance of the target communication protocol based on the protocol file. Then, before adding the protocol instance to the protocol instance set, query the protocol instance of the target communication protocol in the protocol instance set, and update the protocol status associated with the queried protocol instance to a deactivated state to prevent the IoT platform from using the old protocol. Finally, add the created protocol instance to the protocol instance set so that the IoT platform can perform corresponding message interactions based on the created protocol instance.
[0049] It should be noted that in the above two embodiments, the computer device can obtain the protocol file by calling the protocol loader, and the protocol loader is related to the protocol file type. Specifically, the computer device can first determine the file loading address of the target communication protocol from the protocol update event, and obtain the protocol file type of the target communication protocol, and then determine the protocol loader associated with the protocol file type of the target communication protocol based on the preset association relationship between the protocol file type and the protocol loader, so as to call the determined protocol loader and load the protocol file of the target communication protocol from the file loading address.
[0050] In a specific implementation, when there are multiple protocol files loaded, multiple protocol loaders can be called to create protocol instances in parallel, and the created protocol instances can be temporarily cached in a dictionary (i.e., MAP) or a single-column data set (i.e., List) data structure, and registered (or added) to the protocol instance set at an appropriate time to avoid updating multiple protocol instances of the protocol instance set at one time, thereby avoiding a sharp consumption of computing resources or storage resources by the computer device, which is beneficial to maintaining the stability of the computer device.
[0051] In addition, the file loading address of the protocol file can be a local storage address or a cloud storage address, which is not limited here. The protocol file type can be a Jar package type, a bytecode type, etc. The protocol file can be a protocol development kit, which can contain configuration metadata and one or more instruction files, so as to use the instruction file and the configuration metadata to jointly describe the target communication protocol. Among them, the instruction file is mainly used to describe (or define) the information processing rules (or policies) in the message interaction process, and the configuration metadata includes the implementation parameters configured for the rules (or policies) described in each instruction file, such as communication parameters, security setting parameters, function status parameters (used to indicate whether the function is enabled), etc., and the data format of the configuration metadata can be JSON format, XML format or YAML format, etc., which is not limited here.
[0052] Optionally, the instruction file may be a security authentication instruction file, a command processing instruction file, a message processing instruction file, etc.
[0053] As an example, the security authentication instruction file can be used to describe the security authentication policy under the target communication protocol, specifically describing: the processing logic required to verify the security of the communication environment between the two parties performing message interaction. When creating a protocol instance based on the protocol file, the security authentication instruction file can be used to create a security authenticator, and security verification can be achieved by calling the security authenticator in the protocol instance.
[0054] The instruction processing instruction file can be used to describe the instruction response strategy under the target communication protocol, and specifically can describe: the processing logic that needs to be executed before and / or after executing a certain instruction. For example, assuming that the communication protocol adopted by the IoT device is protocol a, the device must be in a preset device state when responding to instruction A, and the preset device state can be triggered by executing instruction B. Then, the instruction response strategy described in the instruction processing instruction file can be: execute instruction B before executing instruction A. Similar to the security authentication instruction file, when a computer device creates a protocol instance based on a protocol file, the instruction processing instruction file can be used to create an instruction interceptor. By calling the instruction interceptor in the protocol instance, the relevant processing before or after the instruction response can be implemented.
[0055] The message processing instruction file can be used to describe the message encoding strategy and message decoding strategy under the target communication protocol. Among them, the message encoding strategy can specifically describe the logic of data encoding for downlink data to obtain downlink messages. Downlink data refers to the data that the IoT platform needs to send to the IoT device. In the process of creating a protocol instance based on the protocol file, the computer device can create a message encoder based on the message encoding strategy in the message processing instruction file. By calling the message encoder in the protocol instance, the assembly (or generation) of the downlink message can be achieved.
[0056] The message decoding strategy can specifically describe the logic of decoding the uplink message to obtain data in a format that can be processed by the IoT platform. Among them, the uplink message refers to the message sent by the IoT device to the IoT platform, which usually carries the data collected by the IoT device. For example, the LoRaWAN water meter is a common IoT device, and the uplink message sent to the IoT platform can carry the tap water consumption data collected by the water meter. Similar to the aforementioned message encoding strategy, the computer device can create a message decoder based on the message decoding strategy in the message processing instruction file, so that the uplink message can be parsed by calling the message decoder in the protocol instance to obtain interactive information readable by the IoT platform.
[0057] The embodiment of the present application detects a protocol update event during the operation of the IoT platform, and updates the communication protocol that can be adopted by the IoT platform based on the update indication information involved in the protocol update event, so that the communication protocol adopted by the IoT platform can be dynamically updated based on the automatic execution of program instructions during the operation of the platform, avoiding manual intervention in the communication protocol update process, thereby greatly improving the efficiency and flexibility of protocol management and reducing the difficulty of technical personnel in protocol management. Since the IoT platform can use different communication protocols to exchange information with different types of IoT devices, then, by improving the flexibility of communication protocol management, it can also support flexible expansion of the information interaction function of the IoT platform to a certain extent.
[0058] Based on the protocol management method of the above-mentioned IoT platform, the embodiment of the present application proposes an IoT platform, which is composed of at least a protocol loader and a protocol manager, and there is a communication connection between the protocol loader and the protocol manager, and the protocol instance set used by the IoT platform can be stored in the protocol manager. In the protocol management scenario:
[0059] The protocol manager can be used to detect protocol update events during the operation of the IoT platform, and parse the detected protocol update events to determine the target communication protocol to be updated and the update indication information. As an example, the protocol manager can detect protocol update events through an event monitoring mechanism, and the protocol update event refers to a monitoring event used to detect protocol update behavior. In addition, when the IoT platform is started, the protocol manager can also be used to initialize each stored protocol instance so that each protocol instance can be called during the operation of the IoT platform.
[0060] The protocol loader can be used to update the protocol instance set stored in the protocol manager based on the update indication information and the target communication protocol determined by the protocol manager, so that the IoT platform can continue to interact with information based on the updated protocol instance set. As an example, the protocol loader in the IOT platform can be implemented by inheriting the URLClassLoader class in the Java development framework to support loading protocol files from a local address or a network address, and different protocol loaders can be used to load different types of protocol files, and each protocol loader can be registered in the same location for centralized management.
[0061] In a specific implementation, when the update indication information indicates adding a new protocol or modifying the protocol content, the protocol loader can be used to update the protocol instance set, and when the update indication information is used to indicate modifying the protocol status, the protocol manager can be used to update the protocol instance.
[0062] Specifically, when the update indication information indicates the addition of a new protocol or the modification of the protocol content, the protocol manager can be used to obtain the protocol file type associated with the detected protocol update event, and select a target protocol loader that matches the protocol file type from each preset protocol loader, and then send a loader call instruction to the target protocol loader, which may include the update indication information and the target communication protocol. After receiving the loader call instruction, the target protocol loader can be used to update the protocol instance of the protocol instance set stored in the protocol manager based on the update indication information and the target communication protocol in the loader call instruction. Among them, the principle of the protocol loader updating the protocol instance can be referred to the aforementioned Figure 2 The various embodiments involved in step S203 are not described in detail here.
[0063] In the case where the update indication information is used to indicate the modification of the protocol state, the protocol manager can also be used to determine the expected state of the target communication protocol from the protocol update event, and query the protocol instance of the target communication protocol from the stored protocol instance set, and then update the protocol state associated with the queried protocol instance to the aforementioned expected state, where the expected state refers to the protocol state that the target communication protocol is expected to be in. It is worth mentioning that when the expected state is the deactivated state or the update indication information is used to indicate the deletion of the protocol, the protocol manager can also be used to query the protocol instance of the target communication protocol from the stored protocol instance set, and delete the protocol instance from the protocol instance set.
[0064] In one implementation, the communication protocol in the IoT platform is associated with the device type of the IoT device. For example, an IoT device is associated with one or more communication protocols so that the IoT device can perform message interaction with other IoT devices under any of the communication protocols. In this case, the protocol manager can also be used to call a protocol instance in the protocol instance set to respond to a message interaction instruction, thereby realizing message interaction between the IoT platform and the IoT device.
[0065] Specifically, the protocol manager can be used to determine the IoT device that the message interaction instruction indicates to interact with (i.e., the IoT device that performs message interaction with the IoT platform) when a message interaction instruction is detected, and then select a target protocol instance that matches the device type of the IoT device from the currently stored set of protocol instances, and then call the target protocol instance to respond to the message interaction instruction, so that the IoT device can perform message interaction with the IoT platform under the corresponding communication protocol.
[0066] In actual application scenarios, message interaction instructions may refer to: program instructions for instructing the IoT platform to send a communication message carrying target data to the IoT device. In this case, when the protocol manager is used to call the target protocol instance to respond to the message interaction instruction, it can first be used to obtain the target data (i.e., the downlink data mentioned above) sent as instructed by the message interaction instruction, and then used to call the message encoder in the target protocol device to perform message encoding processing based on the target data, thereby obtaining a communication message in a preset format, and then used to send the communication message to the corresponding IoT device. Among them, the communication message in a preset format may refer to a format that can be recognized by an IoT device, which is usually defined by the communication protocol adopted by the IoT device.
[0067] In addition, the protocol instance can be created by the protocol loader based on the protocol package (i.e., protocol file) used to define the communication protocol, and the protocol package can be loaded from the specified loading address, and the specific loading principle can be found in the relevant description in the aforementioned step S203, which will not be repeated here. However, it should be noted that the protocol instance in the embodiment of the present application may include a message decoder, a message encoder, an instruction interceptor, and a security authenticator, and the "device" mentioned here refers to a set of program instructions or program codes used to implement the corresponding functions, which is essentially a functional module, and not necessarily a hardware module.
[0068] Among them, the message encoder / decoder can be used to implement message parsing / message format conversion (or assembly), and then realize the message format conversion between the IoT platform and the IoT device, ensuring that both the IoT device and the IoT platform can receive their own recognizable messages. Exemplarily, the message encoder / decoder in the embodiment of the present application can be implemented by calling or reusing a pre-developed program interface, which will not be described in detail here.
[0069] The instruction interceptor is used to implement the interception of program instructions and the processing after interception. Exemplarily, the processing may include a message retransmission mechanism set based on the communication environment, message encryption / decryption processing, etc.
[0070] The security authenticator can be used to implement security authentication of IoT devices, and different types of IoT devices may have different corresponding authentication methods. As an example, the security authenticator can implement the same security authentication principle as the security authentication principle defined by the interface by calling the corresponding program interface, or implement a custom security authentication based on the security authentication principle defined by the interface by reusing the interface.
[0071] It is understandable that the Internet of Things platform provided in the embodiments of the present application can be used to execute Figure 2 For some or all of the steps in Figure 2The various embodiments in the present application, and the technical effects that can be achieved by using the Internet of Things platform provided by the embodiments of the present application are the same as those Figure 2 The technical effects achieved by the methods shown are the same and are not described in detail here just for the sake of brevity.
[0072] To facilitate those skilled in the art to more clearly understand the embodiments of the present application, the application process of the target communication protocol in the embodiments of the present application is briefly described below in conjunction with specific examples and drawings. In this example, the IoT device that applies the target communication protocol is referred to as the target IoT device.
[0073] Please see first Figure 3 , Figure 3 The figure shows the processing flow involved in adding a new target communication protocol in the IoT platform. Figure 3 It can be seen that when the target communication protocol needs to be applied, the relevant technical personnel first customize and develop the corresponding protocol package based on the communication requirements of the Internet of Things device, and upload (or store) the protocol package to the local storage space or cloud storage space, and obtain the storage address of the protocol package in the corresponding storage space. Then, the operation of adding a new target communication protocol to the Internet of Things platform is triggered on the corresponding operating device, so that the computer device can detect the corresponding protocol update event. In addition, before triggering the execution of the operation, the technician can input the specific protocol update requirements and the storage address of the protocol package on the operating device, so that the protocol update requirements and the storage address of the protocol package are associated with the corresponding protocol update event, so that the computer device can perform the addition of the target communication protocol based on the detected protocol update event.
[0074] Specifically, a variety of protocol loaders can be configured in the computer device, and each protocol loader can correspond to a protocol package type, such as protocol loader 1 corresponds to the Jar package type, and protocol loader 2 corresponds to the Java bytecode type. Then, when the computer device adds a new target communication protocol, it can first determine the protocol package type of the protocol package, and then call the protocol loader corresponding to the type, load the protocol package of the target communication protocol from the storage address associated with the protocol update event, and create a protocol instance based on the loaded protocol package, and then add the created protocol instance to the protocol instance set currently used by the Internet of Things platform.
[0075] Next, see Figure 4 , Figure 4 The principle of information interaction between the IoT platform and the target IoT device based on the target communication protocol is shown. Figure 4 As shown, the target communication protocol may include definitions of processing logics such as security authentication logic, message conversion logic, and instruction interception logic. This example mainly describes the message conversion logic.
[0076] Specifically, when the IoT platform sends a message to the target IoT device, the protocol instance of the target communication protocol can be called to encode the message to be sent according to the message conversion logic defined by the target communication protocol to obtain a message that can be sent to the target IoT device. This process can also be understood as message assembly. When the target IoT device sends a message to the IoT platform, the IoT platform can call the message conversion logic corresponding to the target communication protocol to parse the received message to obtain data in a format that the IoT platform can process. For example, when the message is in the form of encrypted data, parsing the message can include decrypting the message so that the data received by the IoT platform can be in the form of readable plaintext data.
[0077] Based on the aforementioned protocol management method and IoT platform, this application also provides a protocol management device for an IoT platform. Figure 5 , Figure 5 The structure of the device is shown, and the device can be mounted on a computer device and used to implement the above Figure 2 Some or all of the functions of the described method embodiments. Figure 5 , the device may include a detection unit 501, an acquisition unit 502, and an update unit 503, wherein:
[0078] The detection unit 501 is used to detect the protocol update event during the operation of the Internet of Things platform, and parse the detected protocol update event to determine the target communication protocol to be updated and the update indication information;
[0079] An acquisition unit 502 is used to acquire a protocol instance set currently used by the Internet of Things platform, where the protocol instance set is used to indicate each communication protocol that the Internet of Things platform is allowed to call;
[0080] The updating unit 503 is used to update the protocol instance of the protocol instance set based on the update indication information and the target communication protocol, so that the Internet of Things platform performs message interaction based on the updated protocol instance set.
[0081] In one implementation, the update indication information is used to indicate the addition of the target communication protocol; when the updating unit 503 updates the protocol instance set based on the update indication information and the target communication protocol, it is specifically used to execute:
[0082] Acquire a protocol file associated with the protocol update event, wherein the protocol file is used to describe the target communication protocol;
[0083] Creating a protocol instance of the target communication protocol based on the protocol file, wherein the protocol instance of the target communication protocol is used to execute message interaction under the target communication protocol when called;
[0084] A protocol instance of the target communication protocol is added to the protocol instance set.
[0085] In another embodiment, the update indication information is used to indicate that a protocol modification is performed on the target communication protocol, and the protocol modification includes a modification of the protocol content; when the updating unit 503 performs a protocol instance update on the protocol instance set based on the update indication information and the target communication protocol, it is specifically used to perform:
[0086] Acquire a protocol file associated with the protocol update event, wherein the protocol file is used to describe the target communication protocol;
[0087] Creating a protocol instance of the target communication protocol based on the protocol file, and querying the protocol instance of the target communication protocol in the protocol instance set;
[0088] The protocol state associated with the queried protocol instance is updated to a disabled state, and the created protocol instance is added to the protocol instance set.
[0089] In yet another embodiment, when the updating unit 503 is used to obtain the protocol file associated with the protocol update event, it is specifically used to execute:
[0090] Determine the file loading address of the target communication protocol from the protocol update event, and obtain the protocol file type of the target communication protocol;
[0091] Determining the protocol loader associated with the protocol file type of the target communication protocol based on a preset association relationship between the protocol file type and the protocol loader;
[0092] The determined protocol loader is called to load the protocol file of the target communication protocol from the file loading address.
[0093] In another embodiment, the update indication information is used to indicate a protocol modification to the target communication protocol, where the protocol modification includes a modification of a protocol state; when the updating unit 503 updates the protocol instance set based on the update indication information and the target communication protocol, it is specifically used to execute:
[0094] Determining an expected state of the target communication protocol from the protocol update event, wherein the expected state refers to a protocol state in which the target communication protocol is expected to be;
[0095] The protocol instance set is queried for a protocol instance of the target communication protocol, and a protocol state associated with the queried protocol instance is updated to the expected state.
[0096] It should be noted that Figure 5 The various units in the device shown can be separately or all combined into one or several other units to constitute, or one (some) of the units can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. In other words, the above-mentioned units are divided based on logical functions. In practical applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, the aforementioned device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0097] According to another embodiment of the present application, the following can be performed by running a computer program on a computing device including a central processing unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and other processing elements and storage elements. Figure 2 A computer program (including program code) for each step involved in the corresponding method shown in Figure 5 The apparatus shown in and the method for implementing the embodiments of the present application. The computer program can be recorded on, for example, a computer-readable storage medium, and loaded into the above-mentioned apparatus through the computer-readable storage medium and run therein.
[0098] Based on the aforementioned protocol management method and Internet of Things platform, the present application embodiment also provides a computer device for executing the above Figure 2 Part or all of the steps in the method embodiments described. Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 6 As shown, the computer device may include a processor 601, a communication interface 602, and a memory 603. The processor 601, the communication interface 602, and the memory 603 may be connected via a bus or other means.
[0099] Processor 601 (or CPU) is the computing core and control core of the computer device. It can parse various instructions in the computer device and process various data of the computer device. For example, the CPU can be used to parse protocol update events and control the computer device to perform corresponding operations; for example, the CPU can exchange data between the internal structures of the computer device, etc.
[0100] The communication interface 602 may include a standard wired interface and / or a wireless interface (such as WI-FI, mobile communication interface, etc.). Under the control of the processor 601, the communication interface 602 may be used to send and receive data. In addition, the communication interface 602 may also be used for transmission and interaction of data within a computer device.
[0101] The memory 603 (Memory) is a memory device in the computer device, which is used to store programs and data. It is understandable that the memory 603 here can include both the built-in memory of the computer device and the extended memory supported by the computer device. The memory 603 provides a storage space, and the storage space stores the operating system of the computer device. In addition, one or more computer programs suitable for being loaded and executed by the processor 601 are also stored in the storage space. These computer programs can be one or more program codes.
[0102] It should be noted that the above-mentioned memory 603 can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory; optionally, it can also be at least one memory located far away from the aforementioned processor.
[0103] The present application also provides a computer readable medium on which a computer program is stored, and when the computer program is executed by a processor, the aforementioned protocol management method is implemented. The computer readable medium may be included in the computer device described in the above embodiment, or may exist independently without being assembled into the computer device.
[0104] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. The computer program contained in the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0105] An embodiment of the present application also provides a program product, which includes computer instructions. When a processor reads and executes the computer instructions, the protocol management method of the Internet of Things platform provided in the above method embodiment is implemented.
[0106] It should be noted that the principles of the problems solved by the devices, equipment, computer-readable media, and program products provided in the embodiments of the present application belong to the same inventive concept as the aforementioned corresponding methods, and therefore the relevant implementation methods can continue to refer to the corresponding method embodiments, which will not be described here for the sake of brevity. In addition, it should be understood that the above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person of ordinary skill in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application, so the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. A protocol management method for an Internet of Things platform, characterized in that: include: Detecting protocol update events during the operation of the IoT platform, parsing the detected protocol update events, and determining the target communication protocol to be updated and update indication information; Acquire a protocol instance set currently used by the Internet of Things platform, where the protocol instance set is used to indicate various communication protocols that the Internet of Things platform is allowed to call; Based on the update indication information and the target communication protocol, the protocol instance set is updated with a protocol instance, so that the Internet of Things platform performs message interaction based on the updated protocol instance set.
2. The method according to claim 1, characterized in that The update indication information is used to indicate the addition of the target communication protocol; The updating of the protocol instance set based on the update indication information and the target communication protocol includes: Acquire a protocol file associated with the protocol update event, wherein the protocol file is used to describe the target communication protocol; Creating a protocol instance of the target communication protocol based on the protocol file, wherein the protocol instance of the target communication protocol is used to execute message interaction under the target communication protocol when called; A protocol instance of the target communication protocol is added to the protocol instance set.
3. The method according to claim 1, characterized in that The update indication information is used to indicate that a protocol modification is performed on the target communication protocol, and the protocol modification includes modification of protocol content; and the protocol instance update is performed on the protocol instance set based on the update indication information and the target communication protocol, including: Acquire a protocol file associated with the protocol update event, wherein the protocol file is used to describe the target communication protocol; Creating a protocol instance of the target communication protocol based on the protocol file, and querying the protocol instance of the target communication protocol in the protocol instance set; The protocol state associated with the queried protocol instance is updated to a deactivated state, and the created protocol instance is added to the protocol instance set.
4. The method according to claim 2 or 3, characterized in that: The obtaining of the protocol file associated with the protocol update event includes: Determine the file loading address of the target communication protocol from the protocol update event, and obtain the protocol file type of the target communication protocol; Determining the protocol loader associated with the protocol file type of the target communication protocol based on a preset association relationship between the protocol file type and the protocol loader; The determined protocol loader is called to load the protocol file of the target communication protocol from the file loading address.
5. The method according to claim 1, characterized in that The update indication information is used to indicate that a protocol modification is performed on the target communication protocol, and the protocol modification includes a modification of a protocol state; and the protocol instance update is performed on the protocol instance set based on the update indication information and the target communication protocol, including: Determining an expected state of the target communication protocol from the protocol update event, wherein the expected state refers to a protocol state in which the target communication protocol is expected to be; The protocol instance set is queried for a protocol instance of the target communication protocol, and a protocol state associated with the queried protocol instance is updated to the expected state.
6. An Internet of Things platform, characterized in that: It includes a protocol loader and a protocol manager, and there is a communication connection between the protocol loader and the protocol manager; wherein: The protocol manager is used to store a set of protocol instances used by the Internet of Things platform, where the set of protocol instances is used to indicate various communication protocols that the Internet of Things platform is allowed to call; The protocol manager is further used to detect protocol update events during the operation of the Internet of Things platform, and parse the detected protocol update events to determine the target communication protocol to be updated and the update indication information; The protocol loader is used to update the protocol instance set stored in the protocol manager based on the update indication information and the target communication protocol determined by the protocol manager.
7. The platform according to claim 6, characterized in that The protocol manager is also used to: If the update indication information is used to indicate adding a new protocol or modifying the protocol content, then obtaining the protocol file type associated with the detected protocol update event; Selecting a target protocol loader that matches the protocol file type from among the protocol loaders; A loader call instruction is sent to the target protocol loader, wherein the loader call instruction includes the update indication information and the target communication protocol, so that after receiving the loader call instruction, the target protocol loader updates the protocol instance set stored in the protocol manager based on the update indication information and the target communication protocol in the loader call instruction.
8. The platform according to claim 6, characterized in that The protocol manager is also used to: If the update indication information is used to indicate modification of the protocol state, determining the expected state of the target communication protocol from the protocol update event, wherein the expected state refers to the protocol state in which the target communication protocol is expected to be; The protocol instance of the target communication protocol is queried in the currently stored protocol instance set, and the protocol state associated with the queried protocol instance is updated to the expected state.
9. The platform according to claim 6, characterized in that: The protocol manager is also used to: When a message interaction instruction is detected, determining an IoT device to be interacted with as indicated by the message interaction instruction; From the currently stored protocol instance set, a target protocol instance matching the device type of the IoT device is queried, and the target protocol instance is called to respond to the message interaction instruction.
10. The platform according to claim 9, characterized in that The message interaction instruction is used to instruct to send a communication message carrying target data to the IoT device; when the protocol manager calls the target protocol instance to respond to the message interaction instruction, it is used to: Acquire the target data sent as instructed by the message interaction instruction; Calling a message encoder in the target protocol instance, performing message encoding processing based on the target data, and obtaining a communication message in a preset format, wherein the preset format refers to a format that can be recognized by the Internet of Things device; The communication message in the preset format is sent to the Internet of Things device.
Citation Information
Cited By
Dynamic protocol loading method and system of Internet of Things platform
CN120692331A