Communication protocol adaptive matching method and terminal
By pre-setting communication protocol files and listening threads in the data acquisition device, the communication protocols of electrical equipment are automatically adapted, solving the problem of low data acquisition efficiency caused by the diversity of communication protocols of electrical equipment, and realizing efficient and reliable data acquisition and transmission.
Patent Information
- Application Number
- CN202411459292.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-10-18
AI Technical Summary
Traditional electrical data acquisition devices cannot automatically adapt to the diverse communication protocols of electrical equipment in power systems, resulting in low data acquisition efficiency and high costs.
By pre-setting multiple communication protocol files in the preset directory of the data acquisition device, traversing these files to obtain communication information, creating virtual devices, and listening for control commands based on the listening thread of each communication interface, parsing the commands to determine the communication type of the target device, configuring the communication channel and transmission parameters, and achieving automatic adaptation.
This improves the versatility and compatibility of the data acquisition device, avoids the need for manual adjustment of communication parameters, and enhances data acquisition efficiency and reliability.
Smart Images

Figure CN119276957B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a communication protocol adaptive matching method and terminal. Background Technology
[0002] To ensure the power quality and stability of power systems, regular inspections, tests, and maintenance of electrical equipment are typically required to guarantee their safe operation. Test data from these devices serves as fundamental information for assessing their operational status; therefore, the accuracy and reliability of this data must be verified during its collection.
[0003] Currently, experimental data is typically collected automatically using dedicated electrical data acquisition devices to ensure accuracy. However, in power systems, the diverse types of electrical equipment and the different platforms used by manufacturers result in varied communication protocols. This lack of standardization necessitates that electrical data acquisition devices be designed and manufactured to accommodate multiple possible protocols, increasing production complexity and cost. Even if a data acquisition device supports multiple protocols, manual adjustment of its communication parameters is still required to adapt to the current communication protocols of the electrical equipment, leading to lower data acquisition efficiency.
[0004] In summary, traditional electrical data acquisition devices cannot automatically adapt to the communication protocols of all electrical devices in a power system to complete data acquisition and transmission. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a communication protocol adaptive matching method and terminal, which can automatically adapt to electrical equipment under different communication protocols to realize data acquisition and transmission, thereby improving the versatility and compatibility of the data acquisition device.
[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0007] An adaptive matching method for communication protocols, applied to a data acquisition device, includes:
[0008] Traverse the communication protocol files in the preset directory, obtain communication information through the communication protocol files, and create virtual devices based on the communication information;
[0009] A listening thread is created based on the communication channel corresponding to each communication interface to listen for communication control commands in each communication channel;
[0010] If the communication control command is detected, the communication control command is parsed to determine the target virtual device for data transmission through the communication channel;
[0011] Obtain the target communication parameters and target communication protocol file corresponding to the target virtual device;
[0012] Configure the communication channel according to the target communication parameters, and transmit data with the target device in the configured communication channel according to the target communication protocol file.
[0013] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:
[0014] A communication protocol adaptive matching terminal includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the various steps of the aforementioned communication protocol adaptive matching method.
[0015] The beneficial effects of this invention are as follows: Multiple types of communication protocol files are pre-installed in a preset directory of the data acquisition device. By traversing all communication protocol files in the preset directory, communication information is directly obtained through these files, thereby creating corresponding virtual devices. Simultaneously, a thread is created to listen for communication control commands on the communication channel corresponding to each communication interface to determine whether the current communication interface is connected to the target device. When a communication control command is detected, it is parsed to determine the target virtual device, i.e., the communication type of the connected target device. Finally, data is transmitted with the target device based on the target communication parameters and target communication protocol of the target virtual device. This invention automatically configures communication channels and data transmission operations through pre-installed communication protocol files and listening threads to adapt to electrical devices under different communication protocols, eliminating the need for manual adjustment of communication parameters and effectively improving the versatility and compatibility of the data acquisition device. Attached Figure Description
[0016] Figure 1 A flowchart of a communication protocol adaptive matching method provided in an embodiment of the present invention;
[0017] Figure 2 This is a schematic diagram of the structure of a communication protocol adaptive matching terminal provided in an embodiment of the present invention;
[0018] Label Explanation:
[0019] 100. A communication protocol adaptive matching terminal; 101. Memory; 102. Processor. Detailed Implementation
[0020] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0021] Embodiments of the present invention provide a communication protocol adaptive matching method, applied to a data acquisition device, comprising:
[0022] Traverse the communication protocol files in the preset directory, obtain communication information through the communication protocol files, and create virtual devices based on the communication information;
[0023] A listening thread is created based on the communication channel corresponding to each communication interface to listen for communication control commands in each communication channel;
[0024] If the communication control command is detected, the communication control command is parsed to determine the target virtual device for data transmission through the communication channel;
[0025] Obtain the target communication parameters and target communication protocol file corresponding to the target virtual device;
[0026] Configure the communication channel according to the target communication parameters, and transmit data with the target device in the configured communication channel according to the target communication protocol file.
[0027] As described above, the beneficial effects of this invention are as follows: Multiple types of communication protocol files are pre-installed in the preset directory of the data acquisition device. By traversing all communication protocol files in the preset directory, communication information is directly obtained through the communication protocol files, thereby creating the corresponding virtual device. Simultaneously, a thread is created to listen for communication control commands on the communication channel corresponding to each communication interface to determine whether the current communication interface is connected to the target device. When a communication control command is detected, it is parsed to determine the target virtual device, i.e., to determine the communication type of the connected target device. Finally, data is transmitted with the target device based on the target communication parameters and target communication protocol of the target virtual device. This invention automatically configures the communication channel and data transmission operations through pre-installed communication protocol files and listening threads to adapt to electrical devices under different communication protocols, eliminating the need for manual adjustment of communication parameters and effectively improving the versatility and compatibility of the data acquisition device.
[0028] Furthermore, before obtaining communication information through the aforementioned communication protocol file, the process also includes:
[0029] Check if the communication protocol file contains communication acquisition functions and command processing functions;
[0030] If so, then perform the step of obtaining communication information through the communication protocol file;
[0031] Otherwise, skip the communication protocol file and traverse the next communication protocol file in the preset directory.
[0032] As described above, the communication acquisition function is used to obtain the communication parameters specified by the current communication protocol, so as to configure the communication channel and adapt to the communication transmission requirements of the target device. The command processing function is used to parse and process the commands specified by the current communication protocol, enabling the data acquisition device to convert the commands so that the data acquisition device can understand the specific operation content corresponding to the command. The communication acquisition function and the command processing function are the key functions for realizing communication configuration and control. If either function is missing, communication configuration and control cannot be successfully implemented. Therefore, checking whether the file contains specific functions verifies whether the file has the expected functionality, thereby ensuring the integrity and correctness of the file, and avoiding communication failures caused by reading files with incorrect formats.
[0033] Furthermore, detecting whether the communication acquisition function and command processing function exist in the communication protocol file includes:
[0034] A standard interface for reading the communication protocol file is used to obtain a preset string from the communication protocol file.
[0035] If the acquisition is successful, the communication protocol file contains a communication acquisition function and a command processing function;
[0036] If the acquisition fails, it means that the communication acquisition function and command processing function do not exist in the communication protocol file.
[0037] As described above, a preset string is obtained from the communication protocol file through a standard interface. The file is then checked for the existence of a function name matching this preset string. If the function is found, it is determined that the file contains the corresponding function; otherwise, it is determined that the file does not contain the corresponding function. This detection process eliminates the need for complex file parsing or code analysis, effectively improving detection efficiency. Furthermore, because the function name can be precisely matched to a specific function, it avoids misjudgments caused by complex file structures or non-standard naming conventions, thus significantly improving detection accuracy.
[0038] Furthermore, the communication information includes communication parameters and device identifier;
[0039] The step of obtaining communication information through the communication protocol file and creating a virtual device based on the communication information includes:
[0040] Read the communication acquisition function in the communication protocol file, and obtain the communication parameters and device identifier recorded in the communication protocol file through the communication acquisition function;
[0041] A virtual device is created based on the device identifier, and a device channel table corresponding to the virtual device is generated based on the communication parameters.
[0042] As described above, since the location and format of communication parameters and device identifiers recorded in different communication protocol files vary, directly reading the communication parameters and device identifiers through a defined communication acquisition function improves the speed of communication adaptation while ensuring the accuracy of the acquired data. Each communication protocol file corresponds to a type of electrical device. To distinguish between different communication protocol files, different device identifiers are used to represent different communication types. Communication parameters are stored in the form of a device channel table to facilitate subsequent lookup of the corresponding communication parameters through the target virtual device.
[0043] Furthermore, the step of parsing the communication control instructions to determine the target virtual device for data transmission via the communication channel includes:
[0044] Parse the communication control command to obtain the target device identifier corresponding to the communication control command;
[0045] The target virtual device for data transmission is determined by address lookup based on the target device identifier.
[0046] As described above, the target virtual device is stored in the memory of the data acquisition device, primarily characterized by its device identifier. Therefore, after parsing the communication control instructions, the communication type of the target device currently connected to the data acquisition device is determined, i.e., the target device identifier is identified. Identifying the target virtual device through its identifier facilitates subsequent configuration of the data acquisition device's communication mode based on the target virtual device.
[0047] Furthermore, obtaining the target communication parameters and target communication protocol file corresponding to the target virtual device includes:
[0048] Obtain the device channel table of the target virtual device as the target communication parameters;
[0049] Obtain the communication protocol file whose file name corresponds to the device identifier of the target virtual device as the target communication protocol file.
[0050] As described above, obtaining the device channel table as the target communication parameters ensures that the communication channel can be accurately configured with the communication parameters of the target virtual device. The device identifier of the virtual device corresponds one-to-one with the file name of the communication protocol file, facilitating quick lookup and location of the communication protocol file.
[0051] Further, the step of transmitting data with the target device in the configured communication channel according to the target communication protocol file includes:
[0052] Read the command processing function in the target communication protocol file, and parse the target command received or sent by the communication channel through the command processing function to obtain the standard command;
[0053] Perform data transmission operations according to the standard commands to collect target data from the target device.
[0054] As described above, due to the differences in commands defined under different communication protocols, commands from different protocols cannot be processed incompatiblely. Therefore, a command processing function is used to parse the target command to ensure that both communicating parties can use the same command rules for data transmission, thereby improving the reliability and accuracy of data transmission.
[0055] Furthermore, before parsing the target command received or sent by the communication channel through the command processing function, the following steps are also included:
[0056] The raw data handle that is about to be passed into or out of the communication channel is processed by a pre-created interface conversion class to obtain a standard data handle in a specified format;
[0057] After processing the target command received or sent by the communication channel based on the standard data handle, the step of parsing the target command received or sent by the communication channel through the command processing function to obtain the standard command is executed.
[0058] As described above, different types of communication interfaces correspond to different data formats. Therefore, data entering or leaving the communication channel requires interface data processing to ensure accurate data transmission. This invention uses an interface conversion class to uniformly process the original data handles, resulting in a standardized data handle with a unified format. This eliminates the need for communication protocol files to consider differences in interface data formats during data entry and exit, avoiding the need for configuration conversion of interface data formats in the communication protocol file and reducing the complexity of communication protocol file development.
[0059] Furthermore, the step of creating a listening thread based on the communication channel corresponding to each communication interface to listen for communication control commands in each communication channel includes:
[0060] Based on the MQTT message transmission protocol, a listening thread is created for each communication channel corresponding to each communication interface to listen for whether communication control commands are transmitted in each communication channel.
[0061] As described above, MQTT (Message Queuing Telemetry Transport) is a message transmission protocol based on the publish / subscribe model. It has low resource consumption, can achieve lightweight operation in resource-constrained data acquisition devices, and has high real-time performance, which can effectively ensure the efficiency of communication protocol adaptation.
[0062] Another embodiment of the present invention provides a communication protocol adaptive matching terminal, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the various steps of the above-described communication protocol adaptive matching method.
[0063] As described above, the beneficial effects of this invention are as follows: Multiple types of communication protocol files are pre-installed in the preset directory of the data acquisition device. By traversing all communication protocol files in the preset directory, communication information is directly obtained through the communication protocol files, thereby creating the corresponding virtual device. Simultaneously, a thread is created to listen for communication control commands on the communication channel corresponding to each communication interface to determine whether the current communication interface is connected to the target device. When a communication control command is detected, it is parsed to determine the target virtual device, i.e., to determine the communication type of the connected target device. Finally, data is transmitted with the target device based on the target communication parameters and target communication protocol of the target virtual device. This invention automatically configures the communication channel and data transmission operations through pre-installed communication protocol files and listening threads to adapt to electrical devices under different communication protocols, eliminating the need for manual adjustment of communication parameters and effectively improving the versatility and compatibility of the data acquisition device.
[0064] Embodiments of the present invention provide a communication protocol adaptive matching method and terminal, which can be applied to data acquisition in power systems. It can automatically adapt to electrical equipment under different communication protocols to achieve data acquisition and transmission, improving the versatility and compatibility of the data acquisition device. Specific embodiments are described below:
[0065] Please refer to Figure 1 Embodiment 1 of the present invention is as follows:
[0066] An adaptive matching method for communication protocols, applied to a data acquisition device, the method comprising:
[0067] S1. Traverse the communication protocol files in the preset directory, obtain communication information through the communication protocol files, and create a virtual device based on the communication information.
[0068] In some embodiments, the communication protocol file is an SO (Shared Object) file. An SO file is a binary file format primarily used to store program code and data. Simply copy the SO file to a directory accessible to the system or the program, such as the system's library directory or the application's installation directory, and other programs can find and load the corresponding SO file at runtime. When a program needs to use a function or class from an SO file, the program can dynamically load the SO file at runtime and call the function or access other public member variables within the SO file.
[0069] It should be noted that each time a communication protocol file is traversed, that file is loaded, and communication information is obtained through that file to create a virtual device. In other words, a corresponding virtual device is created for each communication protocol file traversed.
[0070] The communication information includes communication parameters and device identifier.
[0071] In some embodiments, different communication parameters correspond to different types of communication interfaces. In this embodiment, the communication interfaces of the data acquisition device include serial communication and network communication. The communication parameters for serial communication include baud rate, data bits, and stop bits; the communication parameters for network communication include transmission rate, IP address, and port number.
[0072] In some embodiments, the preset directory includes various communication protocol files, each corresponding to a different type of electrical device. Therefore, the file name of each communication protocol file corresponds to the device identifier of the electrical device. For example, if the device identifier of the electrical device is SHD, then the file name of the communication protocol file corresponding to that electrical device is libSHD.so, where libSHD represents the function library corresponding to the device identifier SHD.
[0073] Specifically, in step S1, obtaining communication information through the communication protocol file and creating a virtual device based on the communication information includes:
[0074] S11. Read the communication acquisition function in the communication protocol file, and obtain the communication parameters and device identifier recorded in the communication protocol file through the communication acquisition function.
[0075] In some embodiments, by dynamically loading an SO file, a communication acquisition function in the SO file is invoked to return the communication parameters and device identifier recorded in the SO file.
[0076] S12. Create a virtual device based on the device identifier, and generate a device channel table corresponding to the virtual device based on the communication parameters.
[0077] In some embodiments, the device identifier of an electrical device is SHD, and the file name of the communication protocol file corresponding to the electrical device is libSHD.so. Therefore, the device identifier obtained based on this file is also SHD, and consequently, the device identifier of the virtual device created based on this file is also SHD. That is, the device identifier of the electrical device is the same as the device identifier of the virtual device.
[0078] In some embodiments, after creating a virtual device based on a device identifier, a device information table corresponding to the virtual device is generated using the device identifier as the primary key. In addition to recording the device identifier of the virtual device, the device information table also records the device name of the electrical equipment corresponding to the SO file, as well as some extended fields. These extended fields are used to identify the enabling and disabling of other device functions. It should be noted that the aforementioned device information table and device channel table are not physical tables, but rather data structures representing the storage of related content in the device's memory.
[0079] Specifically, before obtaining communication information through the communication protocol file, the process also includes:
[0080] S101. Detect whether there are communication acquisition functions and command processing functions in the communication protocol file. If so, execute the step of acquiring communication information through the communication protocol file; otherwise, execute step S102.
[0081] Specifically, step S101 includes:
[0082] S1011. Read the standard interface of the communication protocol file and obtain a preset string from the communication protocol file through the standard interface; if the acquisition is successful, the communication protocol file contains a communication acquisition function and a command processing function; if the acquisition fails, the communication protocol file does not contain a communication acquisition function and a command processing function.
[0083] S102. Skip the communication protocol file and traverse the next communication protocol file in the preset directory.
[0084] It should be noted that when the system calls the standard interface to check the existence of the function, the detection results may be incorrect due to system version or environment incompatibility issues. Therefore, communication protocol files that do not have communication acquisition functions and command processing functions are skipped to preserve the files and avoid misprocessing of the files due to external factors.
[0085] S2. Create a listening thread based on the communication channel corresponding to each communication interface to listen for communication control commands in each communication channel.
[0086] Specifically, step S2 includes:
[0087] S21. Based on the MQTT message transmission protocol, create a listening thread for the communication channel corresponding to each communication interface to listen for whether communication control commands are transmitted in each communication channel.
[0088] In some embodiments, if the current data acquisition device has a total of 4 communication interfaces, of which 2 are serial ports and 2 are network ports, then the data acquisition device includes a total of 4 communication channels. An MQTT listening thread is created for each communication channel; therefore, the data acquisition device includes a total of 4 MQTT listening threads.
[0089] S3. If the communication control command is detected, the communication control command is parsed to determine the target virtual device for data transmission through the communication channel.
[0090] Specifically, step S3 includes:
[0091] S31. Parse the communication control command to obtain the target device identifier corresponding to the communication control command.
[0092] In some embodiments, the communication control command indicates the device that the current command needs to control.
[0093] S32. Perform an address lookup based on the target device identifier to determine the target virtual device for data transmission via the communication channel.
[0094] In some embodiments, since the device identifier of the virtual device is stored in the device memory, the target virtual device can be quickly determined by address lookup.
[0095] S4. Obtain the target communication parameters and target communication protocol file corresponding to the target virtual device.
[0096] Specifically, step S4 includes:
[0097] S41. Obtain the device channel table of the target virtual device as the target communication parameter.
[0098] S42. Obtain the communication protocol file whose file name corresponds to the device identifier of the target virtual device as the target communication protocol file.
[0099] S5. Configure the communication channel according to the target communication parameters, and transmit data with the target device in the configured communication channel according to the target communication protocol file.
[0100] In some embodiments, the communication channel corresponding to the listening thread that listens to the above communication control command is configured based on the target communication parameters.
[0101] Specifically, in step S5, transmitting data with the target device in the configured communication channel according to the target communication protocol file includes:
[0102] S51. Read the command processing function in the target communication protocol file, and parse the target command received or sent by the communication channel through the command processing function to obtain the standard command.
[0103] S52. Perform data transmission operation according to the standard command to collect target data in the target device.
[0104] Before parsing the target command received or sent by the communication channel through the command processing function, the following steps are also included:
[0105] S501. The raw data handle to be passed into or out of the communication channel is processed by a pre-created interface conversion class to obtain a standard data handle in a specified format.
[0106] S502. After processing the target command received or sent by the communication channel based on the standard data handle, execute the step of parsing the target command received or sent by the communication channel through the command processing function to obtain the standard command.
[0107] In some embodiments, the interface conversion class includes four data processing methods: establishing and reconnecting communication channels, and sending and receiving data. Various types of communication libraries are pre-encapsulated in the data acquisition device, such as network communication libraries, serial communication libraries, and other communication libraries. These communication libraries all inherit from the aforementioned interface conversion class, enabling them to possess the four data processing functions included in the interface conversion class and to convert the original data handles in a unified manner to obtain standard data handles in a specified format.
[0108] In some embodiments, if other types of electrical equipment are added to the current power system, the communication protocol file corresponding to the electrical equipment can be copied to the preset directory of the data acquisition device, and the data acquisition device can be restarted so that the data acquisition device can re-execute the above steps S1 to S5, thereby realizing the expansion and update of the communication protocol file.
[0109] Please refer to Figure 2 Embodiment two of the present invention is as follows:
[0110] A communication protocol adaptive matching terminal 100 includes a memory 101, a processor 102, and a computer program stored in the memory 101 and running on the processor 102. When the processor 102 executes the computer program, it implements a communication protocol adaptive matching method according to Embodiment 1.
[0111] In summary, the communication protocol adaptive matching method and terminal provided by this invention, when the data acquisition device starts, traverses all communication protocol files in a preset directory, obtains the corresponding communication parameters and device identifiers based on the communication acquisition functions in the communication protocol files, and thus creates a virtual device. When the MQTT listening thread detects communication control commands being transmitted through the communication channel, it parses the communication control commands to determine the target communication parameters and the target communication protocol file. Based on the target communication parameters, the communication channel is configured so that the transmission parameters of the data acquisition device correspond to those of the target device, and the target commands are parsed through the command processing function in the target communication protocol file, thereby completing data transmission with the target device. In this way, when the data acquisition device connects to the target device to collect data, the data acquisition device can automatically configure itself to be a device under the same communication protocol as the target device based on the communication protocol file, thus adapting to electrical devices under different communication protocols without the need for manual adjustment of communication parameters, effectively improving the versatility and compatibility of the data acquisition device.
[0112] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention's specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. An adaptive matching method for communication protocols, characterized in that, Applied to data acquisition equipment, the method includes: Traverse the communication protocol files in the preset directory, obtain communication information through the communication protocol files, and create virtual devices based on the communication information; A listening thread is created based on the communication channel corresponding to each communication interface to listen for communication control commands in each communication channel; If the communication control command is detected, the communication control command is parsed to determine the target virtual device for data transmission through the communication channel; Obtain the target communication parameters and target communication protocol file corresponding to the target virtual device; Configure the communication channel according to the target communication parameters, and transmit data with the target device in the configured communication channel according to the target communication protocol file.
2. The adaptive matching method for communication protocols according to claim 1, characterized in that, Before obtaining communication information through the communication protocol file, the process also includes: Check if the communication protocol file contains communication acquisition functions and command processing functions; If so, then perform the step of obtaining communication information through the communication protocol file; Otherwise, skip the communication protocol file and traverse the next communication protocol file in the preset directory.
3. The adaptive matching method for communication protocols according to claim 2, characterized in that, The step of detecting whether the communication protocol file contains communication acquisition functions and command processing functions includes: A standard interface for reading the communication protocol file is used to obtain a preset string from the communication protocol file. If the acquisition is successful, the communication protocol file contains a communication acquisition function and a command processing function; If the acquisition fails, it means that the communication acquisition function and command processing function do not exist in the communication protocol file.
4. The adaptive matching method for communication protocols according to claim 2, characterized in that, The communication information includes communication parameters and device identifier; The step of obtaining communication information through the communication protocol file and creating a virtual device based on the communication information includes: Read the communication acquisition function in the communication protocol file, and obtain the communication parameters and device identifier recorded in the communication protocol file through the communication acquisition function; A virtual device is created based on the device identifier, and a device channel table corresponding to the virtual device is generated based on the communication parameters.
5. The adaptive matching method for communication protocols according to claim 4, characterized in that, The step of parsing the communication control commands to determine the target virtual device for data transmission via the communication channel includes: Parse the communication control command to obtain the target device identifier corresponding to the communication control command; The target virtual device for data transmission is determined by address lookup based on the target device identifier.
6. The adaptive matching method for communication protocols according to claim 4, characterized in that, The step of obtaining the target communication parameters and target communication protocol file corresponding to the target virtual device includes: Obtain the device channel table of the target virtual device as the target communication parameters; Obtain the communication protocol file whose file name corresponds to the device identifier of the target virtual device as the target communication protocol file.
7. The adaptive matching method for communication protocols according to claim 2, characterized in that, The step of transmitting data with the target device in the configured communication channel according to the target communication protocol file includes: Read the command processing function in the target communication protocol file, and parse the target command received or sent by the communication channel through the command processing function to obtain the standard command; Perform data transmission operations according to the standard commands to collect target data from the target device.
8. The adaptive matching method for communication protocols according to claim 7, characterized in that, Before parsing the target command received or sent by the communication channel through the command processing function, the following steps are also included: The raw data handle that is about to be passed into or out of the communication channel is processed by a pre-created interface conversion class to obtain a standard data handle in a specified format; After processing the target command received or sent by the communication channel based on the standard data handle, the step of parsing the target command received or sent by the communication channel through the command processing function to obtain the standard command is executed.
9. The adaptive matching method for communication protocols according to claim 1, characterized in that, The step of creating a listening thread based on the communication channel corresponding to each communication interface to listen for communication control commands in each communication channel includes: Based on the MQTT message transmission protocol, a listening thread is created for each communication channel corresponding to each communication interface to listen for whether communication control commands are transmitted in each communication channel.
10. A communication protocol adaptive matching terminal, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements a communication protocol adaptive matching method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Multi-protocol adaptive IMS access network equipment remote management system and method
CN112714104A
Sensor communication protocol analysis method and system, storage medium and electronic equipment
CN115622986A