Iot private protocol assisted conversion method, device and storage medium

By identifying and analyzing communication entities and protocol commands in the source code of open-source projects, a list of modifications to IoT private protocols is generated, solving the problem of low conversion efficiency of IoT private protocols and achieving efficient protocol conversion and resource utilization.

CN117119072BActive Publication Date: 2026-08-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310615327.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-29
Publication Date
2026-08-25
Estimated Expiration
2043-05-29

AI Technical Summary

Technical Problem

The lack of effective tools in the Internet of Things (IoT) field to assist in the conversion of proprietary protocols into standard protocols results in high resource consumption and low efficiency during project updates, which is especially difficult when commercial versions of open-source projects are restricted and lack sufficient information.

Method used

By obtaining the source code of open-source projects, using pre-defined key strings to identify communication entities and private protocol commands, finding communication exchange lists and function call relationships, generating a list of modifications to IoT private protocols, and assisting in the conversion to IoT standard protocols.

Benefits of technology

It improves the efficiency of IoT private protocol conversion, avoids the waste of open source project source code, and makes reasonable use of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117119072B_ABST
    Figure CN117119072B_ABST
Patent Text Reader

Abstract

The application relates to an Internet of Things private protocol auxiliary conversion method, device, equipment and storage medium. The method comprises the following steps: obtaining open source project source code; identifying a communication entity list and an Internet of Things private protocol command list from the open source project source code according to a preset key string; searching for a communication counterpart list corresponding to a target command from the Internet of Things private protocol command list; obtaining a target function list from the Internet of Things private protocol command list, wherein the target function list comprises a target function and a corresponding function calling relationship; and obtaining an Internet of Things private protocol modification list from the communication entity list, the Internet of Things private protocol command list, the communication counterpart list and the target function list, which is used for assisting in converting the Internet of Things private protocol into an Internet of Things standard protocol. The method can automatically find the Internet of Things private protocol modification list through the open source project source code, can be used for assisting in converting the Internet of Things private protocol into the Internet of Things standard protocol, and improves the efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer device, and storage medium for assisting in the conversion of proprietary protocols for the Internet of Things. Background Technology

[0002] In the realm of REST (Application Programming Interface) APIs, design and testing tools such as Postman (an interface testing tool) are available for API development and testing. Postman improves the efficiency of interface analysis and updates in legacy software projects that are being refactored using REST architecture. However, in the IoT field, projects using proprietary protocols have almost no similar tools available, and even if they exist, they are not publicly available.

[0003] However, the lack of suitable tools often leads to significant obstacles when projects need to update protocols. There are many reasons for this, such as the developers no longer maintaining the code or having left the company, or the project not providing documentation. When using open-source projects for product prototyping or technical research, obstacles are often encountered when understanding and changing communication protocols. This is mainly because it is difficult to understand the project's interfaces, documentation, source code structure descriptions, etc., and there is also a lack of familiarity with the standard protocols of the specific domain to which the project needs to be converted.

[0004] One existing approach is to manually analyze the communication components, the communication relationships between components, the protocol content, etc., and then output a description document of the protocol part of the old project based on one's own understanding. Finally, the communication interface part of the prototype system is redesigned according to the requirements of the standard protocol to be used.

[0005] However, this approach is not only too resource-intensive, but also faces the problem of missing documentation, such as blocked descriptions, when there is a commercial version of this open-source project. Furthermore, manual analysis is relatively inefficient. Summary of the Invention

[0006] Therefore, it is necessary to provide a method, device, computer equipment, and storage medium for assisting in the conversion of proprietary IoT protocols to address the aforementioned technical problems. This method can automatically identify the list of modifications to proprietary IoT protocols through open-source project source code and can be used to assist in converting proprietary IoT protocols to IoT standard protocols, thereby improving efficiency.

[0007] An IoT proprietary protocol-assisted conversion method, the method comprising:

[0008] Obtain the source code of an open-source project;

[0009] The list of communication entities and the list of IoT private protocol commands are identified from the source code of open source projects based on pre-defined key strings.

[0010] Search the list of communication records corresponding to the target command from the list of IoT private protocol commands;

[0011] Retrieve the target function list from the IoT private protocol command list. The target function list includes the target functions and their corresponding function call relationships.

[0012] Based on the list of communication entities, the list of IoT private protocol commands, the list of communication exchanges, and the list of objective functions, an IoT private protocol modification list is obtained. This IoT private protocol modification list is used to assist in converting IoT private protocols into IoT standard protocols.

[0013] In one embodiment, the process of identifying a list of communication entities and a list of IoT private protocol commands from the source code of an open-source project based on a preset key string includes: finding a matching first communication entity from the source code of the open-source project based on a socket string, finding a matching first IoT private protocol command from the source code of the open-source project based on a socket string, finding a matching second communication entity from the source code of the open-source project based on an IoT command, and finding a matching second IoT private protocol command from the source code of the open-source project based on an IoT command.

[0014] In one embodiment, finding a matching first communication entity from the source code of an open-source project based on a socket string includes: determining a corresponding first key string from the source code of the open-source project based on the socket string, and determining the matching first communication entity based on the socket string and the first key string.

[0015] In one embodiment, finding a matching first IoT private protocol command from the source code of an open-source project based on the socket string includes: finding a matching first filename, first function name, and first associated communication operation from the source code of the open-source project based on the socket string, and generating the first IoT private protocol command corresponding to the socket string based on the first filename, first function name, and first associated communication operation.

[0016] In one embodiment, finding a matching second communication entity from the source code of an open-source project according to an IoT command includes: determining a corresponding second key string from the source code of the open-source project according to the IoT command, and determining a matching second communication entity according to the IoT command and the second key string.

[0017] In one embodiment, finding a matching second IoT private protocol command from the source code of an open-source project based on the IoT command includes: finding a matching second file name, second function name, and second associated communication operation from the source code of the open-source project based on the IoT command, and generating a second IoT private protocol command corresponding to the IoT command based on the second file name, second function name, and second associated communication operation.

[0018] In one embodiment, searching for the communication record corresponding to the target command from the IoT private protocol command list includes: searching for the associated socket string and key string from the IoT private protocol command list based on the IoT command, and searching for the matching communication record from the IoT private protocol command list based on the socket string and key string.

[0019] In one embodiment, a target function list is obtained from the IoT private protocol command list. The target function list includes target functions and corresponding function call relationships, including: finding the read function and / or write function of the socket string in the IoT private protocol command list, obtaining the corresponding upper-layer calling function based on the read function and / or write function, and establishing the function call relationship between the read function and / or write function and the corresponding upper-layer calling function.

[0020] An IoT proprietary protocol-assisted conversion device, the device comprising:

[0021] The first acquisition module is used to acquire the source code of open source projects;

[0022] The identification module is used to identify the list of communication entities and the list of IoT private protocol commands from the source code of open source projects based on preset key strings;

[0023] The lookup module is used to search for the communication record corresponding to the target command from the list of IoT private protocol commands.

[0024] The second acquisition module is used to obtain a list of target functions from the IoT private protocol command list. The list of target functions includes the target functions and their corresponding function call relationships.

[0025] The generation module is used to obtain a list of modifications to the IoT private protocol based on the list of communication entities, the list of IoT private protocol commands, the list of communication exchanges, and the list of objective functions. The list of modifications to the IoT private protocol is used to assist in the conversion of the IoT private protocol into the IoT standard protocol.

[0026] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, performs the following steps:

[0027] Obtain the source code of an open-source project;

[0028] The list of communication entities and the list of IoT private protocol commands are identified from the source code of open source projects based on pre-defined key strings.

[0029] Search the list of communication records corresponding to the target command from the list of IoT private protocol commands;

[0030] Retrieve the target function list from the IoT private protocol command list. The target function list includes the target functions and their corresponding function call relationships.

[0031] Based on the list of communication entities, the list of IoT private protocol commands, the list of communication exchanges, and the list of objective functions, an IoT private protocol modification list is obtained. This IoT private protocol modification list is used to assist in converting IoT private protocols into IoT standard protocols.

[0032] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0033] Obtain the source code of an open-source project;

[0034] The list of communication entities and the list of IoT private protocol commands are identified from the source code of open source projects based on pre-defined key strings.

[0035] Search the list of communication records corresponding to the target command from the list of IoT private protocol commands;

[0036] Retrieve the target function list from the IoT private protocol command list. The target function list includes the target functions and their corresponding function call relationships.

[0037] Based on the list of communication entities, the list of IoT private protocol commands, the list of communication exchanges, and the list of objective functions, an IoT private protocol modification list is obtained. This IoT private protocol modification list is used to assist in converting IoT private protocols into IoT standard protocols.

[0038] The aforementioned IoT proprietary protocol auxiliary conversion method, device, computer equipment, and storage medium obtain open-source project source code, identify a list of communication entities and a list of IoT proprietary protocol commands from the open-source project source code based on preset key strings, search for the communication exchange list corresponding to the target command from the IoT proprietary protocol command list, obtain a list of target functions from the IoT proprietary protocol command list, the target function list includes the target functions and their corresponding function call relationships, and obtain an IoT proprietary protocol modification list based on the communication entity list, the IoT proprietary protocol command list, the communication exchange list, and the target function list. The IoT proprietary protocol modification list is used to assist in converting the IoT proprietary protocol into an IoT standard protocol.

[0039] Therefore, it is possible to identify a list of modifications to proprietary IoT protocols by analyzing the source code of open-source projects. This list can then be used to assist in converting proprietary IoT protocols into standard IoT protocols, improving conversion efficiency. Furthermore, processing based on open-source project source code can avoid wasting the source code and make more efficient use of it. Attached Figure Description

[0040] Figure 1 This is a flowchart illustrating an IoT private protocol-assisted conversion method in one embodiment;

[0041] Figure 2 This is a structural block diagram of an IoT private protocol auxiliary conversion device in one embodiment;

[0042] Figure 3 This is an internal structural diagram of a computer device in one embodiment;

[0043] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0045] In one embodiment, such as Figure 1 As shown, an IoT proprietary protocol-assisted conversion method is provided. Taking the application of this method to a computer device as an example, the method includes the following steps:

[0046] Step 102: Obtain the source code of the open-source project.

[0047] Open source code refers to a collection of software whose source code is publicly available and can be freely used, copied, modified, and redistributed. Therefore, open source code can be collected or crawled to obtain it, and its analysis can yield auxiliary documentation for converting IoT private protocols into standard protocols, thus avoiding the waste of open source code.

[0048] Step 104: Identify the list of communication entities and the list of IoT private protocol commands from the source code of the open source project based on the preset key strings.

[0049] The preset key strings can be pre-defined keywords used to identify potential functional semantics within IoT private protocols. These can be pre-defined based on actual business needs, product requirements, or application scenarios. Specifically, the process involves obtaining the preset key strings, identifying at least one matching communication entity from the open-source project's source code to form a communication entity list, and simultaneously searching for at least one corresponding IoT private command from the open-source project's source code based on the preset key strings to obtain an IoT private protocol command list. In other words, the communication entity list is a collection of all communication entities in the open-source project's source code, while the IoT private protocol command list is a collection of all IoT private protocol commands in the open-source project's source code.

[0050] Among them, so-called IoT proprietary protocols, also known as IoT non-standard protocols, are protocols developed by individual companies without being adopted or approved by international or national standardization organizations. The implementation details of these protocols are not disclosed, and they are only used between devices manufactured by the company itself. These are application layer protocols specifically built on top of the TCP (Transmission Control Protocol).

[0051] Step 106: Find the communication record corresponding to the target command from the list of IoT private protocol commands.

[0052] The communication log lists represent the data interaction relationships between communication entities corresponding to IoT private protocol commands in the IoT private protocol command list. For example, it shows who sends and who receives each IoT private protocol command during the communication process. The target command can be an IoT-related command, determined from IoT-related commands based on actual business needs, product requirements, or application scenarios. For example, an IoT command could be the target command.

[0053] Specifically, the target command is determined, and the communication record that matches the target command is searched from the list of IoT private protocol commands. A communication list is then generated based on the communication record.

[0054] Step 108: Obtain the target function list from the IoT private protocol command list. The target function list includes the target functions and their corresponding function call relationships.

[0055] The target function list is a set of at least one target function from the IoT private protocol command list, including the function call relationships between the target functions. Specifically, target functions are determined from the IoT private protocol command list, upper-layer calling functions are found based on the target functions, and function call relationships between the target functions and upper-layer calling functions are established to obtain the target function list.

[0056] Step 110: Obtain the IoT private protocol modification list based on the communication entity list, IoT private protocol command list, communication exchange list, and objective function list. The IoT private protocol modification list is used to assist in converting IoT private protocols into IoT standard protocols.

[0057] Specifically, after obtaining the list of communication entities, the list of IoT private protocol commands, the list of communication exchanges, and the list of target functions, these can be combined to form an IoT private protocol modification list. This IoT private protocol modification list can be used to assist in converting IoT private protocols into IoT standard protocols. This IoT private protocol modification list can be provided to relevant developers, who can then convert IoT private protocols into IoT standard protocols based on the contents of the IoT private protocol modification list, making reasonable use of open source project source code and improving the conversion rate of IoT private protocols.

[0058] In the aforementioned IoT proprietary protocol-assisted conversion method, the source code of an open-source project is obtained. Based on preset key strings, a list of communication entities and a list of IoT proprietary protocol commands are identified from the source code. The communication exchange list corresponding to the target command is searched from the IoT proprietary protocol command list. A list of target functions is obtained from the IoT proprietary protocol command list, which includes the target functions and their corresponding function call relationships. Based on the list of communication entities, the list of IoT proprietary protocol commands, the communication exchange list, and the list of target functions, a list of IoT proprietary protocol modifications is obtained. This list of IoT proprietary protocol modifications is used to assist in converting the IoT proprietary protocol into an IoT standard protocol.

[0059] Therefore, it is possible to identify a list of modifications to proprietary IoT protocols by analyzing the source code of open-source projects. This list can then be used to assist in converting proprietary IoT protocols into standard IoT protocols, improving conversion efficiency. Furthermore, processing based on open-source project source code can avoid wasting the source code and make more efficient use of it.

[0060] In one embodiment, identifying a list of communication entities and a list of IoT private protocol commands from the source code of an open-source project based on preset key strings includes: finding a matching first communication entity from the source code of the open-source project based on a socket string, finding a matching first IoT private protocol command from the source code of the open-source project based on a socket string, finding a matching second communication entity from the source code of the open-source project based on an IoT command, and finding a matching second IoT private protocol command from the source code of the open-source project based on an IoT command.

[0061] In this context, a socket is an abstraction of an endpoint for bidirectional communication between application processes on different hosts in a network. A socket is one end of the communication between processes on the network, providing a mechanism for application layer processes to exchange data using network protocols. A socket can be seen as an endpoint in the communication connection between two network applications.

[0062] Specifically, based on the socket string, the system searches the open-source project's source code for the first matching communication entity, such as a TCP server or client. Simultaneously, based on the socket string, it searches the open-source project's source code for relevant IoT private protocol commands to obtain the first IoT private protocol command.

[0063] Furthermore, in addition to the socket string, a matching second communication entity, such as a TCP server or client, can be found from the open-source project source code based on the IoT command (IoT). Simultaneously, relevant IoT private protocol commands can be found from the open-source project source code based on the IoT command (IoT) to obtain the second IoT private protocol command.

[0064] In one embodiment, finding a matching first communication entity from the source code of an open-source project based on a socket string includes: determining a corresponding first key string from the source code of the open-source project based on the socket string, and determining the matching first communication entity based on the socket string and the first key string.

[0065] Specifically, the first communication entity corresponding to the socket string "socket" can be determined by first identifying the corresponding first key string from the open-source project's source code. For example, the first key string corresponding to the socket string "socket" might be "listen," and the first key string corresponding to the socket string "socket" might be "write." Further, the first communication entity is determined by combining the socket string and the first key string. For example, the socket string "socket" and the first key string "read" determine that the corresponding first communication entity is the client, and the socket string "socket" and the first key string "listen" determine that the corresponding first communication entity is the server.

[0066] In one embodiment, finding a matching first IoT private protocol command from the source code of an open-source project based on a socket string includes: finding a matching first filename, first function name, and first associated communication operation from the source code of the open-source project based on the socket string, and generating the first IoT private protocol command corresponding to the socket string based on the first filename, first function name, and first associated communication operation.

[0067] Specifically, based on the socket string, the system searches for the first matching filename, the first function name, and the first associated communication operation in the source code of the open-source project. For example, the socket string "socket" is matched in the file "bc", and this socket string "socket" is also associated with a socket write operation (the first communication operation). The first function name searched is "f2".

[0068] For example, the first IoT private protocol command found based on the socket string "socket" is shown in the table below:

[0069]

[0070] In one embodiment, finding a matching second communication entity from the source code of an open-source project according to an IoT command includes: determining a corresponding second key string from the source code of the open-source project according to the IoT command, and determining a matching second communication entity according to the IoT command and the second key string.

[0071] Specifically, the IoT command can be an IoT command itself. Using the IoT command as a pre-defined key string, a matching second communication entity is searched for in the open-source project's source code. Specifically, the IoT command is first used to search for a matching second key string in the open-source project's source code. Combining the IoT command and the second key string identifies the second communication entity. For example, if the second key string matched by the IoT command in the open-source project's source code is "ping," then combining the IoT command and the key string "ping" identifies the second communication entity as the server.

[0072] In one embodiment, finding a matching second IoT private protocol command from the source code of an open-source project based on an IoT command includes: finding a matching second filename, second function name, and second associated communication operation from the source code of the open-source project based on the IoT command, and generating a second IoT private protocol command corresponding to the IoT command based on the second filename, second function name, and second associated communication operation.

[0073] Specifically, the IoT command (IOT) is used to find the matching second file name, second function name, and second associated communication operation from the source code of the open-source project. For example, the IoT command (IOT) is matched in the ac file, and this IoT command (IOT) is also associated with a receive operation (second communication operation). The second function name found is f1.

[0074] For example, the second IoT private protocol command found based on IoT commands is shown in the table below:

[0075]

[0076] In one embodiment, searching for the communication record corresponding to the target command from the IoT private protocol command list includes: searching for the associated socket string and key string from the IoT private protocol command list based on the IoT command, and searching for the matching communication record from the IoT private protocol command list based on the socket string and key string.

[0077] Specifically, based on the IoT command (IoT), the key string and socket string associated with it can be queried from the IoT private protocol command list. Combining the key string and socket string, the matching communication records can be searched from the IoT private protocol command list to obtain a communication record. The communication record includes the communication entities and the interaction relationships between them. For example, it shows who the sender and receiver are in the communication process corresponding to a certain command.

[0078] For example, the list of IoT private protocol commands is shown in the table below, which consists of the first IoT private protocol command of the above socket string and the second IoT private protocol command corresponding to the IoT command:

[0079]

[0080] Furthermore, based on the IoT command (IoT), the following table shows the matching communication records retrieved from the aforementioned IoT private protocol command list:

[0081] 1 PING socket1 socket2 PONG 2 PONG Socket2 Socket1 PING

[0082] In one embodiment, a list of target functions is obtained from an IoT private protocol command list. The list of target functions includes target functions and corresponding function call relationships, including: finding read and / or write functions of socket strings in the IoT private protocol command list, obtaining the corresponding upper-layer calling functions based on the read and / or write functions, and establishing the function call relationship between the read and / or write functions and the corresponding upper-layer calling functions.

[0083] Specifically, the read and / or write functions for the socket string are searched from the IoT private protocol command list. Then, the corresponding upper-layer calling functions are found based on the read and / or write functions, establishing a function call relationship between the read and / or write functions and their corresponding upper-layer calling functions. Furthermore, the corresponding upper-level calling functions are found based on the upper-layer calling relationship functions, establishing a function call relationship between the upper-layer calling relationship functions and their corresponding upper-level calling functions.

[0084] For example, the list of IoT private protocol commands is shown in the table below, which consists of the first IoT private protocol command of the above socket string and the second IoT private protocol command corresponding to the IoT command:

[0085]

[0086] Furthermore, the list of target functions corresponding to the read and / or write functions for socket strings is shown in the table below:

[0087]

[0088] In a specific application scenario, an auxiliary system can be used to assist in the conversion of proprietary IoT protocols to standard IoT protocols. This auxiliary system can be implemented through the following steps:

[0089] Based on word segmentation, the system identifies multiple communication entities (i.e., TCP server and client) in TCP communication from the codebase of open-source projects. It also identifies the communication actions mapped to IoT commands (e.g., a PING command corresponds to a specific communication entity writing to a socket), and identifies packet encapsulation / decapsulation functions (e.g., the keyword 'pack') and message structure. The system outputs a list of communication entities, a list of IoT protocol commands (note: each command actually corresponds to a communication action, either sending or receiving a message), a list of data interaction relationships between communication entities (identifying who sends and receives in the communication process corresponding to a given command), a list of functions for reading and writing sockets, and the calling relationships between these functions.

[0090] The auxiliary system is composed of modules such as word segmentation, source code communication entity confirmation, IoT command confirmation, communication exchange summary, MQTT message subscriber, publisher modification module, list modification module, and MQTT new communication testing module.

[0091] The word segmentation module manages text word segmentation. Word segmentation refers to keywords that exist in socket read / write function names, IoT commands, etc., and can be used to identify functional semantics. For example, the `bind` keyword can be used to identify socket server entities.

[0092] The source code communication entity verification module refers to identifying different communication entities by analyzing the TCP socket server and client in the source code.

[0093] The IoT command confirmation module analyzes the code that reads and writes sockets based on different conditions, and summarizes these conditions. These read / write conditions typically appear in the `case` block of a `switch` statement, are usually macro definitions containing the word "CMD," and their confirmation meaning is the IoT command. These commands can be used as message topics in the MQTT protocol.

[0094] The communication exchange summary module refers to the module that summarizes and analyzes all communication exchanges between communication entities and compiles them into a list.

[0095] This module transforms MQTT message subscribers and publishers. It converts TCP socket clients and servers using proprietary protocols into MQTT message subscribers or publishers. Generally, the communication entity is both a subscriber and a publisher.

[0096] The Modify List module outputs a list of functions that need modification. The number of functions requiring modification can be large, and the modifications can take the form of changes such as altering the number of parameters (e.g., adding new parameters) or changing the meaning of parameters (e.g., changing "socket" to "handle").

[0097] The new MQTT communication test module refers to the communication test module that assists in the modification of the system, such as the built-in MQTT server, MQTT message subscription and publishing function library, etc.

[0098] It should be understood that although the steps in the flowchart above are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart above may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0099] In one embodiment, such as Figure 2 As shown, an IoT private protocol auxiliary conversion device 200 is provided, including: a first acquisition module 202, an identification module 204, a search module 206, a second acquisition module 208, and a generation module 210, wherein:

[0100] The first acquisition module 202 is used to acquire the source code of open source projects.

[0101] The identification module 204 is used to identify the list of communication entities and the list of IoT private protocol commands from the source code of open source projects based on preset key strings.

[0102] The lookup module 206 is used to look up the communication record corresponding to the target command from the list of IoT private protocol commands.

[0103] The second acquisition module 208 is used to obtain a list of target functions from the IoT private protocol command list. The list of target functions includes target functions and their corresponding function call relationships.

[0104] The generation module 210 is used to obtain an IoT private protocol modification list based on the communication entity list, the IoT private protocol command list, the communication exchange list and the objective function list. The IoT private protocol modification list is used to assist in converting IoT private protocols into IoT standard protocols.

[0105] In one embodiment, the identification module 204 searches for a matching first communication entity in the open-source project source code based on the socket string, searches for a matching first IoT private protocol command in the open-source project source code based on the socket string, searches for a matching second communication entity in the open-source project source code based on the IoT command, and searches for a matching second IoT private protocol command in the open-source project source code based on the IoT command.

[0106] In one embodiment, the identification module 204 determines the corresponding first key string from the source code of the open source project based on the socket string, and determines the matching first communication entity based on the socket string and the first key string.

[0107] In one embodiment, the identification module 204 searches for a matching first file name, first function name, and first associated communication operation in the source code of an open-source project based on the socket string, and generates a first IoT private protocol command corresponding to the socket string based on the first file name, first function name, and first associated communication operation.

[0108] In one embodiment, the identification module 204 determines the corresponding second key string from the source code of the open source project based on the IoT command, and determines the matching second communication entity based on the IoT command and the second key string.

[0109] In one embodiment, the identification module 204 searches for a matching second file name, second function name, and second associated communication operation in the source code of an open-source project based on the IoT command, and generates a second IoT private protocol command corresponding to the IoT command based on the second file name, second function name, and second associated communication operation.

[0110] In one embodiment, the lookup module 206 searches for associated socket strings and key strings from the IoT private protocol command list based on the IoT command, and then searches for matching communication records from the IoT private protocol command list based on the socket strings and key strings.

[0111] In one embodiment, the second acquisition module 208 searches for the read function and / or write function corresponding to the socket string in the IoT private protocol command list, obtains the corresponding upper-layer calling function based on the read function and / or write function, and establishes the function call relationship between the read function and / or write function and the corresponding upper-layer calling function.

[0112] Specific limitations regarding the IoT proprietary protocol auxiliary conversion device can be found in the limitations of the IoT proprietary protocol auxiliary conversion method described above, and will not be repeated here. Each module in the aforementioned IoT proprietary protocol auxiliary conversion device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0113] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores a list of IoT proprietary protocol modifications. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements an IoT proprietary protocol-assisted conversion method.

[0114] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements an IoT proprietary protocol-assisted conversion method. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0115] Those skilled in the art will understand that Figure 3 or Figure 4The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0116] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: obtaining open-source project source code; identifying a list of communication entities and a list of IoT private protocol commands from the open-source project source code based on preset key strings; searching for a communication exchange list corresponding to a target command from the list of IoT private protocol commands; obtaining a list of target functions from the list of IoT private protocol commands, the list of target functions including target functions and corresponding function call relationships; and obtaining a modification list of IoT private protocols based on the list of communication entities, the list of IoT private protocol commands, the communication exchange list, and the list of target functions. The modification list of IoT private protocols is used to assist in converting IoT private protocols into IoT standard protocols.

[0117] In one embodiment, when the processor executes the computer program, it further performs the following steps: searching for a matching first communication entity in the source code of an open-source project based on the socket string, searching for a matching first IoT private protocol command in the source code of an open-source project based on the socket string, searching for a matching second communication entity in the source code of an open-source project based on the IoT command, and searching for a matching second IoT private protocol command in the source code of an open-source project based on the IoT command.

[0118] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining a corresponding first key string from the source code of an open-source project based on the socket string, and determining a matching first communication entity based on the socket string and the first key string.

[0119] In one embodiment, when the processor executes the computer program, it further performs the following steps: searching for a matching first file name, first function name, and first associated communication operation in the source code of an open-source project based on the socket string, and generating a first IoT private protocol command corresponding to the socket string based on the first file name, first function name, and first associated communication operation.

[0120] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining a corresponding second key string from the source code of the open-source project based on the IoT command, and determining a matching second communication entity based on the IoT command and the second key string.

[0121] In one embodiment, when the processor executes the computer program, it further performs the following steps: searching for a matching second file name, second function name, and second associated communication operation from the source code of the open-source project according to the IoT command, and generating a second IoT private protocol command corresponding to the IoT command based on the second file name, second function name, and second associated communication operation.

[0122] In one embodiment, when the processor executes the computer program, it also performs the following steps: searching for an associated socket string and key string from the IoT private protocol command list based on the IoT command, and searching for a matching communication list from the IoT private protocol command list based on the socket string and key string.

[0123] In one embodiment, when the processor executes the computer program, it also performs the following steps: searching for the read function and / or write function of the socket string in the IoT private protocol command list, obtaining the corresponding upper-level calling function based on the read function and / or write function, and establishing the function call relationship between the read function and / or write function and the corresponding upper-level calling function.

[0124] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: obtaining the source code of an open-source project; identifying a list of communication entities and a list of IoT private protocol commands from the source code based on preset key strings; searching for a communication exchange list corresponding to a target command from the list of IoT private protocol commands; obtaining a list of target functions from the list of IoT private protocol commands, the list of target functions including target functions and corresponding function call relationships; and obtaining a modification list of IoT private protocols based on the list of communication entities, the list of IoT private protocol commands, the communication exchange list, and the list of target functions. The modification list of IoT private protocols is used to assist in converting IoT private protocols into IoT standard protocols.

[0125] In one embodiment, when the processor executes the computer program, it further performs the following steps: searching for a matching first communication entity in the source code of an open-source project based on the socket string, searching for a matching first IoT private protocol command in the source code of an open-source project based on the socket string, searching for a matching second communication entity in the source code of an open-source project based on the IoT command, and searching for a matching second IoT private protocol command in the source code of an open-source project based on the IoT command.

[0126] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining a corresponding first key string from the source code of an open-source project based on the socket string, and determining a matching first communication entity based on the socket string and the first key string.

[0127] In one embodiment, when the processor executes the computer program, it further performs the following steps: searching for a matching first file name, first function name, and first associated communication operation in the source code of an open-source project based on the socket string, and generating a first IoT private protocol command corresponding to the socket string based on the first file name, first function name, and first associated communication operation.

[0128] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining a corresponding second key string from the source code of the open-source project based on the IoT command, and determining a matching second communication entity based on the IoT command and the second key string.

[0129] In one embodiment, when the processor executes the computer program, it further performs the following steps: searching for a matching second file name, second function name, and second associated communication operation from the source code of the open-source project according to the IoT command, and generating a second IoT private protocol command corresponding to the IoT command based on the second file name, second function name, and second associated communication operation.

[0130] In one embodiment, when the processor executes the computer program, it also performs the following steps: searching for an associated socket string and key string from the IoT private protocol command list based on the IoT command, and searching for a matching communication list from the IoT private protocol command list based on the socket string and key string.

[0131] In one embodiment, when the processor executes the computer program, it also performs the following steps: searching for the read function and / or write function of the socket string in the IoT private protocol command list, obtaining the corresponding upper-level calling function based on the read function and / or write function, and establishing the function call relationship between the read function and / or write function and the corresponding upper-level calling function.

[0132] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0133] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0134] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for assisting in the conversion of proprietary Internet of Things (IoT) protocols, the method comprising: Obtain the source code of an open-source project; The list of communication entities and the list of IoT private protocol commands are identified from the source code of the open-source project based on preset key strings; Search the communication record corresponding to the target command from the list of IoT private protocol commands; Obtain a target function list from the IoT private protocol command list, the target function list including target functions and corresponding function call relationships; Based on the communication entity list, the IoT private protocol command list, the communication exchange list, and the objective function list, an IoT private protocol modification list is obtained. The IoT private protocol modification list is used to assist in converting IoT private protocols into IoT standard protocols. The step of identifying the list of communication entities and the list of IoT private protocol commands from the source code of the open-source project based on preset key strings includes: The first matching communication entity is found in the source code of the open-source project based on the socket string; The first IoT private protocol command is searched for in the source code of the open-source project based on the socket string. The system searches for a matching second communication entity in the source code of the open-source project based on IoT commands. The IoT command is used to search for a matching second IoT private protocol command in the source code of the open-source project.

2. The method according to claim 1, characterized in that, The step of finding a matching first communication entity from the source code of the open-source project based on the socket string includes: The first key string corresponding to the socket string is determined from the source code of the open-source project. The first matching communication entity is determined based on the socket string and the first key string.

3. The method according to claim 1, characterized in that, The step of searching for a matching first IoT private protocol command from the source code of the open-source project based on the socket string includes: Based on the socket string, search for the matching first file name, first function name, and first associated communication operation in the source code of the open source project; Generate the first IoT private protocol command corresponding to the socket string based on the first file name, the first function name, and the first associated communication operation.

4. The method according to claim 1, characterized in that, The step of searching for a matching second communication entity from the source code of the open-source project according to IoT commands includes: The corresponding second key string is determined from the source code of the open-source project based on the IoT command; The matching second communication entity is determined based on the IoT command and the second key string.

5. The method according to claim 1, characterized in that, The step of searching for a matching second IoT private protocol command from the source code of the open-source project based on the IoT command includes: According to the IoT command, search for the matching second file name, second function name, and second associated communication operation in the source code of the open source project; The second IoT private protocol command corresponding to the IoT command is generated based on the second file name, the second function name, and the second associated communication operation.

6. The method according to claim 1, characterized in that, The step of searching for the communication record corresponding to the target command from the IoT private protocol command list includes: Based on the IoT command, search for the associated socket string and key string from the IoT private protocol command list; Based on the socket string and key string, search the list of matching communication transactions from the IoT private protocol command list.

7. The method according to claim 1, characterized in that, The step of obtaining the target function list from the IoT private protocol command list, wherein the target function list includes target functions and corresponding function call relationships, includes: Find the read and / or write functions corresponding to the socket strings in the IoT private protocol command list; Obtain the corresponding upper-level calling function based on the read function and / or the write function; Establish the function call relationship between the read function and / or the write function and the corresponding upper-level calling function.

8. An IoT private protocol auxiliary conversion device for implementing the IoT private protocol auxiliary conversion method according to any one of claims 1-7, characterized in that, The device includes: The first acquisition module is used to acquire the source code of open source projects; The identification module is used to identify the list of communication entities and the list of IoT private protocol commands from the source code of the open source project based on preset key strings; The lookup module is used to search for the communication record corresponding to the target command from the IoT private protocol command list; The second acquisition module is used to acquire a list of target functions from the IoT private protocol command list, wherein the list of target functions includes target functions and corresponding function call relationships; The generation module is used to obtain an IoT private protocol modification list based on the communication entity list, the IoT private protocol command list, the communication exchange list, and the objective function list. The IoT private protocol modification list is used to assist in converting IoT private protocols into IoT standard protocols.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Communication protocol data real-time automatic tracking system

    CN110166326A