Multi-protocol device access method and related device
Through the multi-protocol device access method, using packed parameters to parse and verify protocol data packets, the problem of poor device stability and increased number of modules when multi-vendor protocols are accessed is solved, system stability and performance are improved, and equipment and Platform for flexible communication.
Patent Information
- Application Number
- CN202111650440.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-12-30
AI Technical Summary
In the existing technology, multiple manufacturers' custom protocols lead to poor device stability and long debugging cycles when devices are connected to a unified protocol. The increase in the number of dedicated modules leads to reduced system complexity and stability, which wastes hardware resources and logical convenience.
Provide a multi-protocol device access method, obtain the packing parameters by displaying the shell configuration interface, and use it to pack the protocol data packets. The management platform parses and verifies the protocol data packets based on the packing parameters, reducing the need for special module development. Achieve unified parsing and encapsulation.
It improves the system stability and performance of the management platform, reduces the waste of hardware resources, enables flexible communication between devices and platforms, and simplifies the parsing and encapsulation process of protocol data packets.
Smart Images

Figure CN114172978B
Abstract
Description
Background Art
[0002] A hardware device must at least go through several stages, including circuit design, parts selection, chip selection, sample production, driver development, and equipment commissioning. Manufacturers need to consider the overall relationship between hardware cost, equipment stability, program debugging and burning, equipment mass production testing, monitoring, and delivery. Therefore, the cycle will be relatively long, and program modification and burning, changes in storage methods, etc. may extend the delivery time. For this reason, once the protocol is characterized, it can be modified in a small range, but it is difficult and unwilling to make too many changes. If the platform side compromises in the existing way for the sake of equipment stability, each manufacturer will develop a dedicated module for the manufacturer's protocol.
[0003] When multiple protocols are connected to the same platform, most platforms use a one-protocol-to-one proprietary module access method to meet the access requirements of protocol manufacturers. This access method requires each manufacturer to provide its own detailed protocol in advance. Platform manufacturers need to obtain the protocol in advance and independently package the module to solve the manufacturer's equipment access problem.
[0004] As more and more protocol manufacturers come, their dedicated modules also increase. In this way, the platform loads more and more proprietary modules, which will cause a sharp decline in system stability and performance, and seriously waste hardware resources and business logic convenience.
[0005] Therefore, in summary, there are at least the following three problems in the related art.
[0006] 1. There are many manufacturers, each with its own custom protocol, making it difficult to unify standards;
[0007] 2. Changing the unified protocol of terminal equipment will result in poor equipment quality and stability, and a longer commissioning cycle;
[0008] 3. Develop a dedicated module for each manufacturer independently. As more manufacturers join, the number of dedicated modules will increase, and the complexity and stability will decrease. Summary of the invention
[0009] The embodiments of the present application provide a multimedia information editing method and related devices, which are used to solve the problem that more and more proprietary modules are loaded on the platform in the related technology, which will cause a sharp decline in system stability, performance, etc., and seriously waste hardware resources and business logic convenience.
[0010] In a first aspect, the present application provides a multi-protocol device access method, the method comprising:
[0011] Display the shell configuration interface;
[0012] In response to a user operation on the shell configuration interface, shell parameters of the Internet of Things device are obtained; the shell parameters are used to shell the protocol data packets of the Internet of Things device and send them to a management platform, and the shell parameters are used to indicate a verification method, an instruction parsing method and an instruction encapsulation method of the protocol data packets.
[0013] In some embodiments, the shelling parameters include: a message synchronization word, a verification method identifier of the protocol data packet;
[0014] The message synchronization word is used to instruct the management platform to obtain a parsing file of the IoT device, wherein the parsing file is configured with a parsing method and an instruction encapsulation method for the protocol data packet;
[0015] The verification method identifier is used to instruct the management platform to perform a verification operation on the protocol data packet using the verification method corresponding to the verification method identifier.
[0016] In some embodiments, the shell parameters also include: a device unique identifier of the IoT device, the device unique identifier and the message synchronization word, and an index value of the parsing model constructed by a user.
[0017] In some embodiments, the method further comprises:
[0018] The parsing file is configured based on the following method:
[0019] Display a parsing file configuration interface; the parsing file configuration interface is used to configure at least one set of instruction parsing templates, each set of instruction parsing templates includes: an operation item for configuring an instruction type, an operation item for configuring an instruction word of the instruction type, and an operation item for configuring a byte position and an attribute value of the instruction word in the protocol data packet;
[0020] The parsing file is generated based on a user operation on the parsing file configuration interface.
[0021] In a second aspect, the present application also provides a multi-protocol device access method, the method comprising:
[0022] Receiving a shelled data packet sent by an IoT device, wherein the shelled data packet is sent by the IoT device after shelling a protocol data packet of the IoT device based on pre-configured shelling parameters, wherein the shelling parameters are used to indicate a verification method and an instruction parsing method of the protocol data packet;
[0023] The shelling parameters and the protocol data packet are parsed from the shelling data packet, the protocol data packet is parsed based on the instruction parsing method of the shelling parameters, and the protocol data packet is verified based on the verification method in the shelling parameters.
[0024] In some embodiments, the shelling parameters include a message synchronization word;
[0025] The instruction parsing method based on the shell parameter parses the protocol data packet, including:
[0026] Based on the message synchronization word, searching for a parsing file corresponding to the message synchronization word;
[0027] The protocol data packet is parsed based on the parsing method included in the parsing file.
[0028] In some embodiments, the shell parameter is also used to indicate an instruction packaging method for sending instructions to the IoT device, and the method further includes:
[0029] The instructions to be sent are packaged based on the instruction packaging method, and the instructions obtained by the package processing are sent to the Internet of Things device.
[0030] In some embodiments, the parsing file includes at least one set of instruction parsing templates, and each set of instruction parsing templates includes an instruction type, an instruction word, a byte position of the instruction word in the protocol data packet, and an attribute value.
[0031] In a third aspect, the present application further provides a multi-protocol device access device, the device comprising:
[0032] An interface display module, used to display the shell configuration interface;
[0033] The shell parameter acquisition module is used to obtain the shell parameters of the Internet of Things device in response to the user operation on the shell configuration interface; the shell parameters are used to shell the protocol data packet of the Internet of Things device and send it to the management platform, and the shell parameters are used to indicate the verification method, instruction parsing method and instruction encapsulation method of the protocol data packet.
[0034] In some embodiments, the shelling parameters include: a message synchronization word, a verification method identifier of the protocol data packet;
[0035] The message synchronization word is used to instruct the management platform to obtain a parsing file of the IoT device, wherein the parsing file is configured with a parsing method and an instruction encapsulation method for the protocol data packet;
[0036] The verification method identifier is used to instruct the management platform to perform a verification operation on the protocol data packet using the verification method corresponding to the verification method identifier.
[0037] In some embodiments, the shell parameters also include: a device unique identifier of the IoT device, the device unique identifier and the message synchronization word, and an index value of the parsing model constructed by a user.
[0038] In some embodiments, the apparatus further comprises:
[0039] The parsing file configuration module is used to configure the parsing file based on the following method:
[0040] Display a parsing file configuration interface; the parsing file configuration interface is used to configure at least one set of instruction parsing templates, each set of instruction parsing templates includes: an operation item for configuring an instruction type, an operation item for configuring an instruction word of the instruction type, and an operation item for configuring a byte position and an attribute value of the instruction word in the protocol data packet;
[0041] The parsing file is generated based on a user operation on the parsing file configuration interface.
[0042] In a fourth aspect, the present application further provides a multi-protocol device access device, the device comprising:
[0043] A receiving module, used to receive a shelled data packet sent by an IoT device, wherein the shelled data packet is sent by the IoT device after shelling a protocol data packet of the IoT device based on pre-configured shelling parameters, wherein the shelling parameters are used to indicate a verification method and an instruction parsing method of the protocol data packet;
[0044] The parsing module is used to parse the shell parameter and the protocol data packet from the shell data packet, parse the protocol data packet based on the instruction parsing method of the shell parameter, and verify the protocol data packet based on the verification method in the shell parameter.
[0045] In some embodiments, the shelling parameters include a message synchronization word;
[0046] The analysis module is specifically used for:
[0047] Based on the message synchronization word, searching for a parsing file corresponding to the message synchronization word;
[0048] The protocol data packet is parsed based on the parsing method included in the parsing file.
[0049] In some embodiments, the shell parameter is also used to indicate an instruction packaging method for sending instructions to the IoT device, and the apparatus further includes:
[0050] The encapsulation module is used to encapsulate the instructions to be sent based on the instruction encapsulation method, and send the instructions obtained by the encapsulation to the Internet of Things device.
[0051] In some embodiments, the parsing file includes at least one set of instruction parsing templates, and each set of instruction parsing templates includes an instruction type, an instruction word, a byte position of the instruction word in the protocol data packet, and an attribute value.
[0052] In a fifth aspect, the present application further provides an electronic device, including:
[0053] processor;
[0054] a memory for storing instructions executable by the processor;
[0055] The processor is configured to execute the instructions to implement any method provided in the first aspect or the second aspect of the present application.
[0056] In the sixth aspect, an embodiment of the present application further provides a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any method provided in the first aspect or the second aspect of the present application.
[0057] In a seventh aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements any method provided in the first aspect or the second aspect of the present application.
[0058] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
[0059] In the embodiment of the present application, a shell configuration interface is displayed;
[0060] An embodiment of the present application provides an access method for a multi-protocol device. In an embodiment of the present application, a manufacturer can customize the shelling parameters for shelling a protocol data packet, so that the management platform can parse the manufacturer's protocol data packet based on the shelling parameters and perform corresponding operations. During implementation, the shelling parameters are used to indicate the verification method and instruction parsing method of the protocol data packet. Each manufacturer can uniformly configure the shelling parameters for its own protocol data packet according to the requirements of the management platform, so that the management platform can complete the parsing of protocol data packets from different manufacturers based on the shelling parameters. In this way, the management platform does not need to develop a proprietary module for each manufacturer's personalized configuration, the system stability and performance of the management platform are improved, and the hardware resources and business logic can also be facilitated. In addition, based on the flexible encapsulation instructions of the encapsulation method, two-way flexible communication between the management platform and the device is realized for the Internet of Things device.
[0061] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings introduced below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0063] Figure 1 A schematic diagram of an application scenario of the multi-protocol device access method provided in an embodiment of the present application;
[0064] Figure 2 A flowchart of a multi-protocol device access method provided in one embodiment of the present application;
[0065] Figure 3 A schematic diagram of an entry page of a first page provided in an embodiment of the present application;
[0066] Figure 4a One of the interface schematic diagrams of the multi-protocol device access method provided in one embodiment of the present application;
[0067] Figure 4b A second interface diagram of a multi-protocol device access method provided in an embodiment of the present application;
[0068] Figure 5 Another schematic diagram of a multi-protocol device access method provided in an embodiment of the present application;
[0069] Figure 6 A schematic diagram of a multi-protocol device access apparatus provided in an embodiment of the present application;
[0070] Figure 7 Another schematic diagram of a multi-protocol device access apparatus provided by an embodiment of the present application;
[0071] Figure 8 The figure is a schematic diagram of the structure of an electronic device showing a method for editing multimedia information according to an exemplary embodiment. DETAILED DESCRIPTION
[0072] In order to enable ordinary persons in the art to better understand the technical solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0073] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0074] Below, some terms in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.
[0075] (1) In the embodiments of the present application, the term "plurality" refers to two or more than two, and other quantifiers are similar.
[0076] (2) "and / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0077] (3) Internet of Things devices, such as the Internet of Things devices of the embodiments of the present application, are smart devices with various sensors, such as temperature sensors, humidity sensors, pressure sensors, etc., which can report detection data online.
[0078] (4) Shelling parameters. In the embodiment of the present application, shelling parameters can be used to shell the manufacturer's own protocol data packets, so that the management platform of the Internet of Things device can parse the manufacturer's protocol data packets based on the shelling parameters.
[0079] (5) Parsing file: In the embodiment of the present application, the parsing file can also be understood as a configuration file of the manufacturer, which is used to define the type and location of the manufacturer's corresponding instructions to facilitate parsing the contents of the manufacturer's protocol data packets.
[0080] (6) Servers serve terminals, such as providing resources to terminals and storing terminal data. Servers correspond to applications installed on terminals and run in conjunction with applications on terminals. In the embodiments of the present application, servers can be implemented as a management platform for IoT devices.
[0081] (7) Terminal device, which can refer to software APP (Application) or client. It has a visual display interface and can interact with users; it corresponds to the server and provides local services to customers. For software applications, except for some applications that only run locally, they are generally installed on ordinary client terminals and need to cooperate with the server to run. After the development of the Internet, more commonly used applications include short video applications, email clients for sending and receiving emails, and instant messaging clients. For this type of application, there needs to be corresponding servers and service programs in the network to provide corresponding services, such as database services, configuration parameter services, etc. In this way, a specific communication connection needs to be established between the client terminal and the server to ensure the normal operation of the application. In the embodiment of the present application, the terminal device can be set on the manufacturer side, and the manufacturer can configure the shell parameters and parsing files based on the interaction between the terminal device and the server.
[0082] In the related art, as more and more protocol manufacturers come, more and more dedicated modules are produced by the manufacturers. In this way, more and more proprietary modules are loaded on the platform, which will cause a sharp decline in the stability and performance of the system, seriously wasting hardware resources and the convenience of business logic.
[0083] In view of this, an embodiment of the present application provides an access method for a multi-protocol device. In an embodiment of the present application, a manufacturer can customize the shelling parameters for shelling a protocol data packet, so that the management platform can parse the manufacturer's protocol data packet based on the shelling parameters and perform corresponding operations. During implementation, the shelling parameters are used to indicate the verification method and instruction parsing method of the protocol data packet. Each manufacturer can uniformly configure the shelling parameters for its own protocol data packet according to the requirements of the management platform, so that the management platform can complete the parsing of protocol data packets from different manufacturers based on the shelling parameters. In this way, the management platform does not need to develop a proprietary module for each manufacturer's personalized configuration, the system stability and performance of the management platform are improved, and the hardware resources and business logic can also be facilitated. In addition, based on the flexible encapsulation instructions of the encapsulation method, two-way flexible communication between the management platform and the device is realized for the Internet of Things device.
[0084] refer to Figure 1, which is a schematic diagram of an application scenario of the multi-protocol device access method provided in an embodiment of the present application. The application scenario includes multiple IoT devices 101 (including IoT device 101-1, IoT device 101-2, ... IoT device 101-n), and also includes a server 102 (i.e., a management platform) and a terminal device 103. Among them, the IoT device 101 and the server 102 are connected via a wireless or wired network, and the IoT device 101 includes various IoT devices such as temperature sensors, pressure sensors, and humidity sensors. The server 102 can be a server cluster or a cloud computing center composed of a single server, a plurality of servers. The server 102 can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0085] The terminal device 103 can be a mobile phone, tablet computer, desktop computer, smart TV, etc., which can display a user operation interface and interact with the user. For example, the manufacturer can access the server 102 through the terminal device 103, complete the configuration operation of the shell parameters and the parsing file in the user material interface of the terminal device 103, and synchronize the configuration results to the server 102 for storage. Therefore, when the IoT device sends a protocol data packet to the server 102, it can shell the protocol data packet based on the shell parameters. After the server 102 receives the shelled protocol data packet, it can deshell the protocol data packet to obtain the shell parameters, and then obtain the parsing file corresponding to the manufacturer based on the shell parameters to parse the protocol data packet of the scene, thereby executing the corresponding operation of the protocol data packet.
[0086] Of course, the method provided in the embodiment of the present application is not limited to Figure 1 The application scenarios shown can also be used in other possible application scenarios, and the embodiments of the present application are not limited thereto. Figure 1 The functions that can be implemented by each device in the application scenario shown will be described in the subsequent method embodiments, and will not be described in detail here.
[0087] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiment of the present application.
[0088] When multiple protocols are accessed to the same platform, most platforms use a one-protocol-one-module access method to meet the access requirements of protocol manufacturers. This access method requires each manufacturer to provide its own detailed protocol in advance. The platform manufacturer needs to obtain the protocol in advance and independently package the module to solve the manufacturer's equipment access problem. In the embodiment of the present application, the protocol method used is to allow the device to access the manufacturer, use user interface operation, and dynamic programming to automatically implement protocol parsing, without the need for each manufacturer to provide a module. Reference Figure 2 A flowchart of a multi-protocol device access method is provided for an embodiment of the present application. The method is applied to a terminal device and includes the following steps:
[0089] In step 201, the shell configuration interface is displayed;
[0090] In step 202, in response to a user operation on the shell configuration interface, shell parameters of the IoT device are obtained.
[0091] As described above, the shelling parameters are used to shell the protocol data packet of the IoT device and then send it to the management platform. The shelling parameters are used to indicate the verification method, instruction parsing method and instruction encapsulation method of the protocol data packet.
[0092] In some possible implementations, the shelling parameters include: a message synchronization word, a verification method identifier of the protocol data packet;
[0093] The message synchronization word is used to instruct the management platform to obtain a parsing file of the IoT device, wherein the parsing file is configured with a parsing method and an instruction encapsulation method for the protocol data packet;
[0094] The verification method identifier is used to instruct the management platform to perform a verification operation on the protocol data packet using the verification method corresponding to the verification method identifier.
[0095] Among them, the equipment manufacturer can refer to the manufacturer of various equipment to be connected to the equipment management platform, and each manufacturer has different manufacturer agreements with the management platform. In the embodiment of the present application, the management platform has a fixed manufacturer synchronization word (i.e., message synchronization word) and message instruction word position, and provides a unified data accuracy verification method and verification function. This can provide a unified shell configuration interface to configure shell parameters for each scene. Figure 3 The figure shows an exemplary schematic diagram of the shell configuration interface. Figure 3 In the , manufacturers can edit their own message synchronization words. For the management platform, the message synchronization word is globally unique and can distinguish different manufacturers or different devices. Figure 3 The "Details" in the dialog box allows manufacturers to view the configured shell parameters. Figure 3The "Delete" button in the command prompt can help manufacturers delete obsolete shell parameters. Figure 3 The editor in allows manufacturers to configure new shell parameters or modify existing shell parameters. Figure 3 You can query the message synchronization key in or use the "Create" control to create a new message synchronization key.
[0096] It can be seen that the present application discloses a multi-protocol device access method, which enables manufacturers to achieve multi-protocol access through the simplest interface operation combined with data storage mode, using automated dynamic programming, allowing protocol flexibility and diversity.
[0097] In some embodiments, not only can the message synchronization word be used as the index of the parsed file, but the shell parameters in the embodiments of the present application also include: the device unique identifier of the IoT device, the device unique identifier and the message synchronization word, and the user constructs the index value of the parsing model.
[0098] One way to configure the parsing file can be implemented as follows:
[0099] In step A1, a parsing file configuration interface is displayed; the parsing file configuration interface is used to configure at least one set of instruction parsing templates, each set of instruction parsing templates includes: an operation item for configuring an instruction type, an operation item for configuring an instruction word of the instruction type, and an operation item for configuring a byte position and an attribute value of the instruction word;
[0100] In step A2, the parsing file is generated based on the user operation on the parsing file configuration interface.
[0101] like Figure 4a The figure shows a user interface diagram for configuring parsing files. Figure 4a In the , the instruction type, instruction word and the location of the instruction word, the key parameter byte location and attribute value are marked, and the management platform stores the information data. The message synchronization word is used as the index and the fixed format template (analysis template) is written into the database. Figure 4b As shown, in the parsing file of each scene, multiple sets of parsing templates can be configured through the user interface of the parsing file. In the embodiment of the present application, each instruction type corresponds to a set of parsing templates.
[0102] Suppose the user clicks Figure 3 Click the "Edit" control in the menu to enter the user interface diagram of the power on and off command configuration. Figure 4a As shown. Figure 4a The message synchronization word (i.e., manufacturer synchronization word) and manufacturer name are displayed in the display, indicating the manufacturer that provided the equipment. Figure 4a In the interface shown, the operation item for configuring the instruction type is "Instruction Type". Figure 4aThe instruction type is configured as the type for power on and off. The instruction word of the instruction type is used to identify the instruction type, such as Figure 4a The command word 01a in the middle identifies the configured command type as power on / off. Figure 4a The overall length is used to configure the number of bytes occupied by the power-on and power-off instructions to be 12 bytes. The data content is the attribute value of the instruction word. Figure 4a The attribute value 01 indicates power on, and 00 indicates power off. The length after the data content is used to indicate the position of the instruction word, that is, power on starts parsing at the second byte of the overall length, and power off starts parsing at the second byte of the 12-byte overall length. Power on and power off are mutually exclusive operations, so only one state will be reported each time, and there is no conflict.
[0103] Similar, such as Figure 4b The figure shows a user interface diagram of a set of parsing templates for configuring an instruction type of "message reporting". Figure 4b In the example, the message reporting instruction word is 12, the total length of the message is 50 bytes, and the data content is used as the attribute value of the instruction word, including the port number, which is used to indicate which port the reported message is obtained from, and the length after the port number, which is used to indicate which byte the content of the message starts from. For example Figure 4b In the byte, the valid data content used to indicate the message report starts from the 22nd byte. Figure 4b Another attribute value is the start time, which is used to indicate the specific reporting time of the message. The start time can be parsed from the 30th byte of the received protocol data packet.
[0104] In other embodiments, Figure 4b As shown, the plus sign control can be used to add the attributes of the instruction word. During implementation, different instruction types may include different user interface contents and layout methods, as long as they can facilitate the configuration of the parsing file, they are applicable to the embodiments of the present application.
[0105] like Figure 4b As shown, the instruction type can also be increased to be a heartbeat message response, and its manufacturer's instruction word is 43. The overall length of this message is 32 bytes, and the specific result attribute of the message processing starts from the 11th byte, and the length is 1 byte. The parsing of the port sequence number attribute starts from the 12th byte, and the length is 1 byte. The length shown behind the attribute is the attribute starting to parse the starting byte in the whole message, and the specific attribute length is obtained by subtracting the starting bytes of adjacent attributes in the order of addition. Of course, in other embodiments, the length of the port sequence number and the message processing result can also be configured as a configurable item.
[0106] Therefore, based on the parsing file configuration interface scenario, the parsing text can be customized and saved to the management platform, and then the management platform can parse the protocol data packet of the corresponding scenario based on the shell parameters and the parsing file.
[0107] like Figure 5 The figure is a flowchart of a multi-protocol device access method of a management platform, including the following contents:
[0108] In step 501, a shelled data packet sent by an IoT device is received, wherein the shelled data packet is sent by the IoT device after shelling a protocol data packet of the IoT device based on pre-configured shelling parameters, and the shelling parameters are used to indicate a verification method and an instruction parsing method of the protocol data packet.
[0109] In step 502, the shell parameter and the protocol data packet are parsed from the shell data packet, the protocol data packet is parsed based on the instruction parsing method of the shell parameter, and the protocol data packet is verified based on the verification method in the shell parameter.
[0110] In the embodiment of the present application, the parsing result can be obtained after parsing the protocol data packet, and the parsing result can be verified by the verification method. It is also possible to verify the legitimacy and data integrity of the protocol data packet by the verification method before parsing the protocol data packet, and then parse the protocol data packet after the legitimacy and data integrity verification pass.
[0111] In some embodiments, when an IoT device is detected to be connected, the method of the embodiment of the present application is executed. Device access may refer to the platform having data to be sent to the IoT device or receiving data uploaded by the IoT device. That is, the solution provided by the embodiment of the present application can be used when receiving data transmitted by a physical network device or sending data to an IoT device. For example, when sending data, the corresponding data can be constructed according to the configured parsing file, and then sent to the IoT device after being encapsulated.
[0112] That is, in the embodiment of the present application, data parsing or encapsulation is performed according to the parsing template found, and after data verification, the encapsulated data is sent to the terminal or the parsed data is stored as data.
[0113] The encapsulation can be implemented as the shell parameter is also used to indicate an instruction encapsulation method for sending instructions to the Internet of Things device. When instructions need to be encapsulated, the instructions to be sent can be encapsulated based on the instruction encapsulation method, and the instructions obtained by the encapsulation process are sent to the Internet of Things device.
[0114] In some possible embodiments, as described above, the shelling parameters include a message synchronization word;
[0115] The instruction parsing method based on the shell parameter parses the protocol data packet, including:
[0116] Based on the message synchronization word, searching for a parsing file corresponding to the message synchronization word;
[0117] The protocol data packet is parsed based on the parsing method included in the parsing file.
[0118] The parsing file includes at least one set of instruction parsing templates, each set of instruction parsing templates includes instruction type, instruction word, byte position of the instruction word in the protocol data packet and attribute value;
[0119] The parsing of the protocol data packet based on the parsing method included in the parsing file may be implemented as follows:
[0120] For each set of instruction parsing templates, the instructions to be executed are read from the protocol data packet based on the byte position and attribute value of the instruction word in the instruction parsing template in the protocol data packet, and the operations to be executed corresponding to the instructions to be executed are determined based on the instruction type and the instruction word, and the operations to be executed are executed.
[0121] For example, the protocol data packet can be parsed according to the power-on and power-off messages of the device below. The parsing template is as follows:
[0122]
[0123] Based on the message synchronization word ohgy, the parsing file of the scene is indexed. The parsing templates related to the upper and lower points in the parsing file are shown in the above example. Based on the parsing template, if the command word position of the protocol data packet is parsed to 01, it means the power-on command, and if it is parsed to 00, it means the power-off command. In this way, the corresponding power-on or power-off operation can be executed.
[0124] In some embodiments, after the parsing template is not found, the present application may also fill in an exception parsing log and provide a protocol parsing reminder based on the exception parsing log.
[0125] For example, write an exception analysis log to remind that there is no corresponding protocol analysis solution, so that users can add the corresponding analysis template. After having the analysis template, they can parse or encapsulate the corresponding data normally.
[0126] In the embodiment of the present application, the internationally accepted CRC128 verification scheme is adopted by formulating the manufacturer synchronization word and a unified verification algorithm and verification method; the manufacturer protocol instruction word and key attribute value and location are configured through interface operation; the key value information is stored according to the manufacturer instruction word and a fixed template for easy parsing.
[0127] Based on the same inventive concept, the embodiment of the present application also provides a multi-protocol device access device, such as Figure 6 As shown, the device 600 includes:
[0128] The interface display module 601 is used to display the shell configuration interface;
[0129] The shell parameter acquisition module 602 is used to obtain the shell parameters of the Internet of Things device in response to the user operation on the shell configuration interface; the shell parameters are used to shell the protocol data packet of the Internet of Things device and send it to the management platform, and the shell parameters are used to indicate the verification method, instruction parsing method and instruction encapsulation method of the protocol data packet.
[0130] In some embodiments, the shelling parameters include: a message synchronization word, a verification method identifier of the protocol data packet;
[0131] The message synchronization word is used to instruct the management platform to obtain a parsing file of the IoT device, wherein the parsing file is configured with a parsing method and an instruction encapsulation method for the protocol data packet;
[0132] The verification method identifier is used to instruct the management platform to perform a verification operation on the protocol data packet using the verification method corresponding to the verification method identifier.
[0133] In some embodiments, the shell parameters also include: a device unique identifier of the IoT device, the device unique identifier and the message synchronization word, and an index value of the parsing model constructed by a user.
[0134] In some embodiments, the apparatus further comprises:
[0135] The parsing file configuration module is used to configure the parsing file based on the following method:
[0136] Display a parsing file configuration interface; the parsing file configuration interface is used to configure at least one set of instruction parsing templates, each set of instruction parsing templates includes: an operation item for configuring an instruction type, an operation item for configuring an instruction word of the instruction type, and an operation item for configuring a byte position and an attribute value of the instruction word in the protocol data packet;
[0137] The parsing file is generated based on a user operation on the parsing file configuration interface.
[0138] Based on the same inventive concept, the embodiment of the present application also provides a multi-protocol device access device, such as Figure 7 As shown, the device 700 includes:
[0139] A receiving module 701 is used to receive a shelled data packet sent by an IoT device, wherein the shelled data packet is sent by the IoT device after shelling the protocol data packet of the IoT device based on pre-configured shelling parameters, and the shelling parameters are used to indicate a verification method and an instruction parsing method of the protocol data packet;
[0140] The parsing module 702 is used to parse the shell parameter and the protocol data packet from the shell data packet, parse the protocol data packet based on the instruction parsing method of the shell parameter, and verify the protocol data packet based on the verification method in the shell parameter.
[0141] In some embodiments, the shelling parameters include a message synchronization word;
[0142] The analysis module is specifically used for:
[0143] Based on the message synchronization word, searching for a parsing file corresponding to the message synchronization word;
[0144] The protocol data packet is parsed based on the parsing method included in the parsing file.
[0145] In some embodiments, the shell parameter is also used to indicate an instruction packaging method for sending instructions to the IoT device, and the apparatus further includes:
[0146] The encapsulation module is used to encapsulate the instructions to be sent based on the instruction encapsulation method, and send the instructions obtained by the encapsulation to the Internet of Things device.
[0147] In some embodiments, the parsing file includes at least one set of instruction parsing templates, and each set of instruction parsing templates includes an instruction type, an instruction word, a byte position of the instruction word in the protocol data packet, and an attribute value.
[0148] After introducing the multi-protocol device access method and apparatus according to an exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.
[0149] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.
[0150] In some possible implementations, the electronic device according to the present application may include at least one processor and at least one memory. The memory stores program code, and when the program code is executed by the processor, the processor executes the multimedia information editing method according to various exemplary implementations of the present application described above in this specification. For example, the processor may execute the steps in the multimedia information editing method.
[0151] Refer to the following Figure 8The electronic device 130 according to this embodiment of the present application is described. Figure 8 The electronic device 130 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0152] like Figure 8 As shown, the electronic device 130 is in the form of a general electronic device. The components of the electronic device 130 may include but are not limited to: the at least one processor 131, the at least one memory 132, and a bus 133 connecting different system components (including the memory 132 and the processor 131).
[0153] Bus 133 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
[0154] The memory 132 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 1321 and / or a cache memory 1322 , and may further include a read-only memory (ROM) 1323 .
[0155] The memory 132 may also include a program / utility 1325 having a set (at least one) of program modules 1324, such program modules 1324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0156] The electronic device 130 may also communicate with one or more external devices 134 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 130, and / or communicate with any device that enables the electronic device 130 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 135. Furthermore, the electronic device 130 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 136. As shown, the network adapter 136 communicates with other modules for the electronic device 130 via a bus 133. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0157] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 132 including instructions, and the instructions can be executed by the processor 131 of the device 700 or the processor 131 of the device 800 to complete the above-mentioned multimedia information editing method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0158] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by the processor 131, any method of the multimedia information editing method provided in the present application is implemented.
[0159] In an exemplary embodiment, various aspects of a multimedia information editing method provided by the present application can also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the multimedia information editing method according to various exemplary embodiments of the present application described above in this specification.
[0160] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0161] The program product for multimedia information editing method of the embodiment of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on electronic devices. However, the program product of the present application is not limited to this. In this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, device or device.
[0162] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein readable program code is carried. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0163] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0164] The program code for performing the operations of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also conventional procedural programming languages such as "C" language or similar programming languages. The program code can be executed entirely on the user electronic device, partially on the user device, as an independent software package, partially on the user electronic device and partially on the remote electronic device, or entirely on the remote electronic device or server. In the case of a remote electronic device, the remote electronic device can be connected to the user electronic device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using an Internet service provider to connect through the Internet).
[0165] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0166] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0167] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0168] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable image scaling device to produce a machine, so that the instructions executed by the processor of the computer or other programmable image scaling device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0169] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable image scaling device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, the instruction device being implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0170] These computer program instructions may also be loaded onto a computer or other programmable image scaling device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0171] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0172] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A multi-protocol device access method, characterized in that: The method comprises: Display the shell configuration interface; In response to a user operation on the shell configuration interface, shell parameters of the Internet of Things device are obtained; the shell parameters are used to shell the protocol data packet of the Internet of Things device and then send it to a management platform, the shell parameters are used to indicate the verification method, instruction parsing method and instruction encapsulation method of the protocol data packet, and the shell parameters include: a message synchronization word and a verification method identifier of the protocol data packet; the message synchronization word is used to instruct the management platform to obtain a parsing file of the Internet of Things device, and the parsing file is configured with the parsing method and instruction encapsulation method of the protocol data packet; the verification method identifier is used to instruct the management platform to use the verification method corresponding to the verification method identifier to perform a verification operation on the protocol data packet.
2. The method according to claim 1, characterized in that The shell parameters also include: a unique device identifier of the IoT device, the unique device identifier and the message synchronization word, and an index value of a parsing model constructed by a user.
3. The method according to claim 1, characterized in that: The method further comprises: The parsing file is configured based on the following method: Display a parsing file configuration interface; the parsing file configuration interface is used to configure at least one set of instruction parsing templates, each set of instruction parsing templates includes: an operation item for configuring an instruction type, an operation item for configuring an instruction word of the instruction type, and an operation item for configuring a byte position and an attribute value of the instruction word in the protocol data packet; The parsing file is generated based on a user operation on the parsing file configuration interface.
4. A multi-protocol device access method, characterized in that: The method comprises: Receiving a shelled data packet sent by an IoT device, wherein the shelled data packet is sent by the IoT device after shelling a protocol data packet of the IoT device based on pre-configured shelling parameters, wherein the shelling parameters are used to indicate a verification method and an instruction parsing method of the protocol data packet, and the shelling parameters include a message synchronization word; The shelled parameters and the protocol data packet are parsed from the shelled data packet, a parsing file corresponding to the message synchronization word is searched based on the message synchronization word, the protocol data packet is parsed based on a parsing method included in the parsing file, and the protocol data packet is verified based on a verification method in the shelled parameters.
5. The method according to claim 4, characterized in that The shell parameter is also used to indicate an instruction packaging method for sending instructions to the IoT device, and the method further includes: The instructions to be sent are packaged based on the instruction packaging method, and the instructions obtained by the package processing are sent to the Internet of Things device.
6. The method according to claim 4, characterized in that The parsing file includes at least one set of instruction parsing templates, and each set of instruction parsing templates includes instruction type, instruction word, byte position of the instruction word in the protocol data packet and attribute value.
7. A multi-protocol device access device, characterized in that: The device comprises: An interface display module, used to display the shell configuration interface; A shell parameter acquisition module is used to obtain the shell parameters of the Internet of Things device in response to user operations on the shell configuration interface; the shell parameters are used to shell the protocol data packet of the Internet of Things device and then send it to the management platform, the shell parameters are used to indicate the verification method, instruction parsing method and instruction encapsulation method of the protocol data packet, and the shell parameters include: a message synchronization word and a verification method identifier of the protocol data packet; the message synchronization word is used to instruct the management platform to obtain the parsing file of the Internet of Things device, and the parsing file is configured with the parsing method and instruction encapsulation method of the protocol data packet; the verification method identifier is used to instruct the management platform to use the verification method corresponding to the verification method identifier to perform a verification operation on the protocol data packet.
8. A multi-protocol device access device, characterized in that: The device comprises: A receiving module, used for receiving a shelled data packet sent by an IoT device, wherein the shelled data packet is sent by the IoT device after shelling a protocol data packet of the IoT device based on pre-configured shelling parameters, wherein the shelling parameters are used to indicate a verification method and an instruction parsing method of the protocol data packet, and the shelling parameters include a message synchronization word; A parsing module is used to parse the shell parameters and the protocol data packet from the shell data packet, search for a parsing file corresponding to the message synchronization word based on the message synchronization word, parse the protocol data packet based on a parsing method included in the parsing file, and verify the protocol data packet based on a verification method in the shell parameters.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the steps of the method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the steps of the method according to any one of claims 1 to 6.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
