Communication protocol adaptive matching method and terminal
By traversing communication protocol files and monitoring threads automatically configure channels, the problem that traditional data collectors cannot adapt to communication protocols of different electrical equipment is solved, and the universality and compatibility of data collectors are improved.
Patent Information
- Application Number
- CN202411459292.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-10-18
AI Technical Summary
Traditional electrical data collectors cannot automatically adapt to the communication protocols of all electrical equipment in the power system, resulting in low data acquisition efficiency and high cost.
By traversing the communication protocol files in the preset directory, creating virtual devices, and creating a listening thread based on each communication interface, parsing communication control instructions to determine the target virtual device, obtaining the target communication parameters and protocol files, and automatically configuring the communication channel for data transmission .
Automatic adaptation of different communication protocols is realized, the universality and compatibility of data collectors are improved, and the need to manually adjust communication parameters is reduced.
Smart Images

Figure CN119276957A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a communication protocol adaptive matching method and a terminal. Background Art
[0002] In order to ensure the power supply quality and stability of the power system, it is usually necessary to conduct regular inspection, testing and maintenance of electrical equipment in the power system to ensure the safe operation of electrical equipment. Among them, the test data of electrical equipment is the basic information for evaluating its operating status. Therefore, its authenticity and reliability need to be determined during the process of collecting test data.
[0003] At present, test data is usually collected automatically using a dedicated electrical data collector to ensure the accuracy of data collection. However, in the power system, due to the wide variety of electrical equipment types and the different platforms of manufacturers producing these equipment, the communication protocols of electrical equipment are diverse. The non-uniformity of electrical equipment communication protocols requires that electrical data collectors need to consider multiple possible communication protocols during design and manufacturing, increasing the complexity and cost of data collector production. Even if the data collector can support multiple communication protocols, it is necessary to manually adjust the communication parameters of the data collector to adapt to the communication protocol of the current electrical equipment, resulting in low data collection efficiency.
[0004] In summary, traditional electrical data collectors cannot automatically adapt to the communication protocols of all electrical equipment in the power system to complete data collection 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 collection and transmission, and improve the versatility and compatibility of data collectors.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is: A communication protocol adaptive matching method, applied to a data acquisition device, comprising: Traversing the communication protocol files in a preset directory, obtaining communication information through the communication protocol files, and creating a virtual device according to the communication information; Creating a monitoring thread based on the communication channel corresponding to each communication interface to monitor the communication control instructions in each of the communication channels; If the communication control instruction is monitored, parsing the communication control instruction to determine the target virtual device for data transmission through the communication channel; Obtain target communication parameters and target communication protocol files corresponding to the target virtual device; The communication channel is configured according to the target communication parameters, and data is transmitted with the target device in the configured communication channel according to the target communication protocol file.
[0007] In order to solve the above technical problems, another technical solution adopted by the present invention is: A communication protocol adaptive matching terminal comprises a memory, a processor and a computer program stored in the memory and running on the processor. When the processor executes the computer program, each step of the communication protocol adaptive matching method is implemented.
[0008] The beneficial effects of the present invention are as follows: a plurality of types of communication protocol files are preset in a preset directory of a data acquisition device, all communication protocol files in the preset directory are traversed, and communication information is directly obtained through the communication protocol files, thereby creating a corresponding virtual device. At the same time, a thread for monitoring communication control instructions is created for the communication channel corresponding to each communication interface to determine whether the current communication interface is connected to a target device. When a communication control instruction is monitored, the target virtual device is determined by parsing the communication control instruction, that is, the communication type of the connected target device is determined. Finally, data is transmitted with the target device based on the target communication parameters and the target communication protocol of the target virtual device. The present invention automatically configures communication channels and data transmission operations through preset communication protocol files and monitoring threads to adapt to electrical equipment under different communication protocols, without the need to manually adjust communication parameters, thereby effectively improving the versatility and compatibility of the data collector. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 A flow chart of a communication protocol adaptive matching method provided by an embodiment of the present invention; Figure 2 A schematic diagram of the structure of a communication protocol adaptive matching terminal provided by an embodiment of the present invention; Description of labels: 100. A communication protocol adaptive matching terminal; 101. Memory; 102. Processor. DETAILED DESCRIPTION
[0010] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0011] An embodiment of the present invention provides a communication protocol adaptive matching method, which is applied to a data acquisition device, comprising: Traversing the communication protocol files in a preset directory, obtaining communication information through the communication protocol files, and creating a virtual device according to the communication information; Creating a monitoring thread based on the communication channel corresponding to each communication interface to monitor the communication control instructions in each of the communication channels; If the communication control instruction is monitored, parsing the communication control instruction to determine the target virtual device for data transmission through the communication channel; Obtain target communication parameters and target communication protocol files corresponding to the target virtual device; The communication channel is configured according to the target communication parameters, and data is transmitted with the target device in the configured communication channel according to the target communication protocol file.
[0012] From the above description, it can be seen that the beneficial effects of the present invention are: multiple types of communication protocol files are preset in the preset directory of the data acquisition device, all communication protocol files in the preset directory are traversed, and communication information is directly obtained through the communication protocol files, so as to create a corresponding virtual device. At the same time, the communication channel corresponding to each communication interface creates a thread that monitors the communication control instructions to determine whether the current communication interface is connected to the target device. When the communication control instruction is monitored, the target virtual device is determined by parsing the communication control instruction, that is, the communication type of the connected target device is determined. Finally, data is transmitted with the target device based on the target communication parameters and the target communication protocol of the target virtual device. The present invention automatically configures the communication channel and data transmission operation through preset communication protocol files and monitoring threads to adapt to electrical equipment under different communication protocols, without manually adjusting the communication parameters, and effectively improving the versatility and compatibility of the data collector.
[0013] Furthermore, before acquiring the communication information through the communication protocol file, it also includes: Detect whether there is a communication acquisition function and a command processing function in the communication protocol file; If yes, then executing 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.
[0014] From the above description, it can be seen that 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, so that the data acquisition device can convert the commands, so that the data acquisition device can clearly understand the specific operation content corresponding to the commands. The communication acquisition function and the command processing function are key functions for realizing communication configuration and control. If any one of the functions does not exist, the communication configuration and control cannot be successfully realized. Therefore, it is necessary to detect whether a specific function is contained in the file to verify whether the file has the expected function, thereby ensuring the integrity and correctness of the file, and avoiding the problem of device communication failure caused by reading files in the wrong format.
[0015] Further, the detecting whether there is a communication acquisition function and a command processing function in the communication protocol file includes: Reading a standard interface of the communication protocol file, and obtaining a preset character string in 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 acquisition function and the command processing function do not exist in the communication protocol file.
[0016] From the above description, it can be seen that the preset string is obtained in the communication protocol file through the standard interface of the communication protocol file, and the function name of the preset string is detected in the file. If it is obtained, it is determined that the corresponding function exists in the file. If it is not obtained, it is determined that the corresponding function does not exist in the file. The detection process does not require complex file parsing or code analysis, which effectively improves the detection efficiency. At the same time, because the function name can be accurately matched to a specific function, it avoids misjudgment due to complex file structure or irregular naming, and effectively improves the detection accuracy.
[0017] Furthermore, the communication information includes communication parameters and device identification; The acquiring of communication information through the communication protocol file and creating a virtual device according to the communication information comprises: Reading a communication acquisition function in the communication protocol file, and acquiring the communication parameters and device identification recorded in the communication protocol file through the communication acquisition function; A virtual device is created according to the device identification, and a device channel table corresponding to the virtual device is generated according to the communication parameters.
[0018] From the above description, it can be seen that since the positions and formats of the communication parameters and device identifications recorded in different communication protocol files are different, the communication parameters and device identifications are directly read through the set communication acquisition function, which improves the speed of communication adaptation and ensures the accuracy of data acquisition. Each communication protocol file corresponds to an electrical device of a communication type. In order to distinguish different communication protocol files, different communication types are represented by different device identifications. The communication parameters are stored in the form of a device channel table to facilitate the subsequent search for the corresponding communication parameters through the target virtual device.
[0019] Further, the parsing of the communication control instruction to determine the target virtual device for data transmission through the communication channel includes: Parsing the communication control instruction to obtain a target device identifier corresponding to the communication control instruction; An addressing query is performed according to the target device identifier to determine the target virtual device for data transmission through the communication channel.
[0020] As can be seen from the above description, the target virtual device is stored in the memory of the data acquisition device with the device identification as the main feature. Therefore, after parsing the communication control instruction, the communication type of the target device connected to the current data acquisition device is determined, that is, the target device identification is determined. The target virtual device is determined by the target device identification, so as to facilitate the subsequent configuration of the communication mode of the data acquisition device based on the target virtual device.
[0021] Further, the obtaining of target communication parameters and target communication protocol files corresponding to the target virtual device includes: Obtaining a device channel table of the target virtual device as a target communication parameter; A communication protocol file whose file name corresponds to the device identification of the target virtual device is obtained as the target communication protocol file.
[0022] From the above description, it can be seen that obtaining the device channel table as the target communication parameter 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 to the file name of the communication protocol file one by one, which facilitates quick query and location of the communication protocol file.
[0023] Further, performing data transmission with the target device in the configured communication channel according to the target communication protocol file includes: Reading a command processing function in the target communication protocol file, and parsing the target command received or sent by the communication channel through the command processing function to obtain a standard command; A data transmission operation is performed according to the standard command to collect target data in the target device.
[0024] From the above description, it can be seen that since the commands specified under different communication protocols are different, the commands between different communication protocols cannot be processed compatibly. Therefore, the target command is parsed through the command processing function to ensure that both parties can use the same command rules for data transmission, thereby improving the reliability and accuracy of data transmission.
[0025] Furthermore, before parsing the target command received or sent by the communication channel through the command processing function, it also includes: Processing the original data handle to be transmitted into or transmitted from the communication channel through a pre-created interface conversion class to obtain a standard data handle in a specified format; After data processing is performed on 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 a standard command is performed.
[0026] As can be seen from the above description, due to the differences in data formats corresponding to different types of communication interfaces, interface data processing is required for data entering or leaving the communication channel to ensure accurate data transmission. The present invention uniformly processes the original data handles through the interface conversion class to obtain a standard data handle in a unified format, so that during the process of data entering and leaving the communication channel, the communication protocol file does not need to consider the difference in interface data format, avoiding the communication protocol file from converting and configuring the interface data format of the communication channel, and reducing the complexity of communication protocol file development.
[0027] Further, the creating a monitoring thread based on the communication channel corresponding to each communication interface to monitor the communication control instructions in each communication channel includes: Based on the MQTT message transmission protocol, a monitoring thread is created for the communication channel corresponding to each communication interface to monitor whether a communication control instruction is transmitted in each of the communication channels.
[0028] From the above description, we can see that MQTT (Message Queuing Telemetry Transport) is a message transmission protocol based on the publish / subscribe model. It takes up low resources and can achieve lightweight operation in resource-constrained data acquisition devices. It has high real-time performance and can effectively ensure the efficiency of communication protocol adaptation.
[0029] 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, and when the processor executes the computer program, each step of the above-mentioned communication protocol adaptive matching method is implemented.
[0030] From the above description, it can be seen that the beneficial effects of the present invention are: multiple types of communication protocol files are preset in the preset directory of the data acquisition device, all communication protocol files in the preset directory are traversed, and communication information is directly obtained through the communication protocol files, so as to create a corresponding virtual device. At the same time, the communication channel corresponding to each communication interface creates a thread that monitors the communication control instructions to determine whether the current communication interface is connected to the target device. When the communication control instruction is monitored, the target virtual device is determined by parsing the communication control instruction, that is, the communication type of the connected target device is determined. Finally, data is transmitted with the target device based on the target communication parameters and the target communication protocol of the target virtual device. The present invention automatically configures the communication channel and data transmission operation through preset communication protocol files and monitoring threads to adapt to electrical equipment under different communication protocols, without manually adjusting the communication parameters, and effectively improving the versatility and compatibility of the data collector.
[0031] The embodiments of the present invention provide a communication protocol adaptive matching method and terminal, which can be applied to data acquisition in power systems, can automatically adapt to electrical equipment under different communication protocols to realize data acquisition and transmission, and improve the versatility and compatibility of data collectors. The following is an explanation through specific embodiments: Please refer to Figure 1 , Embodiment 1 of the present invention is: A communication protocol adaptive matching method is applied to a data acquisition device, the method comprising: S1. Traverse the communication protocol files in a preset directory, obtain communication information through the communication protocol files, and create a virtual device according to the communication information.
[0032] In some embodiments, the communication protocol file is a SO (Shared Object) file, which is a binary file format mainly used to store program code and data. You only need to copy the SO file to a directory accessible to the system or 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 in an SO file, the program can dynamically load the SO file at runtime and call functions in the SO file or access other public member variables.
[0033] It should be noted that each time a communication protocol file is traversed, the communication protocol file is loaded, so that communication information is obtained through the communication protocol file to create a virtual device. That is, each time a communication protocol file is traversed, a corresponding virtual device is created.
[0034] The communication information includes communication parameters and device identification.
[0035] In some embodiments, different types of communication interfaces have different corresponding communication parameters. In this embodiment, the communication interface of the data acquisition device includes serial communication and network communication. The communication parameters corresponding to the serial communication include baud rate, data bit, stop bit, etc.; the communication parameters corresponding to the network communication include transmission rate, IP address, port number, etc.
[0036] In some embodiments, the preset directory includes a plurality of different communication protocol files, each of which corresponds to an electrical device of a communication type, and therefore, the file name of each communication protocol file corresponds to the device identification of the electrical device. For example, if the device identification of the electrical device is SHD, then the file name of the communication protocol file corresponding to the electrical device is libSHD.so, where libSHD represents the function library corresponding to the device identification SHD.
[0037] Specifically, in step S1, obtaining communication information through the communication protocol file, and creating a virtual device according to the communication information includes: S11. Read a communication acquisition function in the communication protocol file, and acquire communication parameters and device identification recorded in the communication protocol file through the communication acquisition function.
[0038] In some embodiments, the SO file is dynamically loaded, thereby calling a communication acquisition function in the SO file to return the communication parameters and device identification recorded in the SO file.
[0039] S12: Create a virtual device according to the device identifier, and generate a device channel table corresponding to the virtual device according to the communication parameters.
[0040] In some embodiments, the device identification of the electrical device is SHD, and the file name of the communication protocol file corresponding to the electrical device is libSHD.so, then the device identification obtained based on the file is also SHD, and therefore, the device identification of the virtual device created based on the file is also SHD. That is, the device identification of the electrical device is the same as the device identification of the virtual device.
[0041] In some embodiments, after creating a virtual device according to the device identifier, a device information table corresponding to the virtual device is generated with the device identifier as the primary key information. In addition to recording the device identifier of the virtual device, the device information table also records the device name of the electrical device corresponding to the SO file and some extended fields. The extended fields are used to identify the opening and disabling of other functions of the device. It should be noted that the above-mentioned device information table and device channel table are not physical tables, but a data structure that represents the storage of related content in the device memory.
[0042] Specifically, before acquiring the communication information through the communication protocol file, the method further includes: S101, detecting whether there is a communication acquisition function and a command processing function in the communication protocol file, if so, executing the step of acquiring communication information through the communication protocol file, otherwise executing step S102.
[0043] Specifically, the step S101 includes: S1011. Read the standard interface of the communication protocol file, and obtain a preset character string in the communication protocol file through the standard interface; if the acquisition is successful, a communication acquisition function and a command processing function exist in the communication protocol file; if the acquisition fails, the communication acquisition function and the command processing function do not exist in the communication protocol file.
[0044] S102: Skip the communication protocol file and traverse the next communication protocol file in the preset directory.
[0045] It should be noted that when the system calls the standard interface to detect whether a function exists, the detection result may be wrong due to incompatibility issues with the system version or environment. Therefore, the communication protocol files that do not have communication acquisition functions and command processing functions are skipped to retain the files and avoid incorrect processing of the files due to external factors.
[0046] S2. Create a monitoring thread based on the communication channel corresponding to each communication interface to monitor the communication control instructions in each communication channel.
[0047] Specifically, the step S2 includes: S21. Create a monitoring thread for the communication channel corresponding to each communication interface based on the MQTT message transmission protocol to monitor whether a communication control instruction is transmitted in each of the communication channels.
[0048] In some embodiments, if the current data acquisition device has a total of 4 communication interfaces, of which 2 communication interfaces are serial ports and 2 communication interfaces are network interfaces, the data acquisition device includes a total of 4 communication channels. An MQTT listening thread is created for each communication channel, so the data acquisition device includes a total of 4 MQTT listening threads.
[0049] S3. If the communication control instruction is monitored, parse the communication control instruction to determine the target virtual device for data transmission through the communication channel.
[0050] Specifically, step S3 includes: S31. Parse the communication control instruction to obtain a target device identifier corresponding to the communication control instruction.
[0051] In some embodiments, the communication control instruction indicates the device that the current instruction needs to control.
[0052] S32: Perform an addressing query according to the target device identifier to determine a target virtual device for data transmission through the communication channel.
[0053] In some embodiments, since the device identification of the virtual device is stored in the device memory, the target virtual device can be quickly determined through addressing query.
[0054] S4. Obtain target communication parameters and target communication protocol files corresponding to the target virtual device.
[0055] Specifically, step S4 includes: S41. Obtain a device channel table of the target virtual device as a target communication parameter.
[0056] S42: Acquire a communication protocol file whose file name corresponds to the device identification of the target virtual device as the target communication protocol file.
[0057] S5. Configure the communication channel according to the target communication parameters, and perform data transmission with the target device in the configured communication channel according to the target communication protocol file.
[0058] In some embodiments, the communication channel corresponding to the listening thread that listens to the communication control instruction is configured based on the target communication parameters.
[0059] Specifically, in step S5, performing data transmission with the target device in the configured communication channel according to the target communication protocol file includes: S51, reading a command processing function in the target communication protocol file, and parsing the target command received or sent by the communication channel through the command processing function to obtain a standard command.
[0060] S52: Execute a data transmission operation according to the standard command to collect target data in the target device.
[0061] Before parsing the target command received or sent by the communication channel through the command processing function, it also includes: S501. Processing the original data handle to be transmitted into or transmitted from the communication channel through a pre-created interface conversion class to obtain a standard data handle in a specified format.
[0062] S502: After performing data processing on the target command received or sent by the communication channel based on the standard data handle, executing the step of parsing the target command received or sent by the communication channel through the command processing function to obtain a standard command.
[0063] In some embodiments, the interface conversion class includes four data processing methods, namely, establishing and reconnecting a communication channel and sending and receiving data. Various types of communication libraries are pre-packaged in the data acquisition device, such as a network communication library, a serial communication library, and other communication libraries, which inherit the above interface conversion class, so that these communication libraries have the four data processing functions included in the interface conversion class, and use a unified method to convert the original data handle to obtain a standard data handle in a specified format.
[0064] In some embodiments, if other types of electrical equipment are newly 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.
[0065] Please refer to Figure 2 , Embodiment 2 of the present invention is: 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, a communication protocol adaptive matching method of embodiment 1 is implemented.
[0066] In summary, the present invention provides a communication protocol adaptive matching method and terminal. When the data acquisition device is started, all communication protocol files under the preset directory are traversed, and the corresponding communication parameters and device identification are obtained based on the communication acquisition function in the communication protocol file, thereby creating a virtual device. When the MQTT listening thread listens to the communication channel transmitting a communication control instruction, the target communication parameters and the target communication protocol file are determined by parsing the communication control instruction. The communication channel is configured based on the target communication parameters so that the transmission parameters of the data acquisition device and the target device correspond, and the target command is parsed by the command processing function in the target communication protocol file, thereby completing the data transmission with the target device. In this way, when the data acquisition device is connected to the target device to be collected, the data acquisition device can be automatically configured as a device under the same communication protocol as the target device based on the communication protocol file, thereby adapting to electrical equipment under different communication protocols, without manually adjusting the communication parameters, and effectively improving the versatility and compatibility of the data collector.
[0067] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A communication protocol adaptive matching method, characterized in that: Applied to a data acquisition device, the method comprises: Traversing the communication protocol files in a preset directory, obtaining communication information through the communication protocol files, and creating a virtual device according to the communication information; Creating a monitoring thread based on the communication channel corresponding to each communication interface to monitor the communication control instructions in each communication channel; If the communication control instruction is monitored, parsing the communication control instruction to determine the target virtual device for data transmission through the communication channel; Obtain target communication parameters and target communication protocol files corresponding to the target virtual device; The communication channel is configured according to the target communication parameters, and data is transmitted with the target device in the configured communication channel according to the target communication protocol file.
2. A communication protocol adaptive matching method according to claim 1, characterized in that: Before acquiring the communication information through the communication protocol file, the method further includes: Detect whether there is a communication acquisition function and a command processing function in the communication protocol file; If yes, then executing 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. A communication protocol adaptive matching method according to claim 2, characterized in that: The detecting whether there is a communication acquisition function and a command processing function in the communication protocol file comprises: Reading a standard interface of the communication protocol file, and obtaining a preset character string in 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 acquisition function and the command processing function do not exist in the communication protocol file.
4. A communication protocol adaptive matching method according to claim 2, characterized in that: The communication information includes communication parameters and device identification; The acquiring of communication information through the communication protocol file and creating a virtual device according to the communication information comprises: Reading a communication acquisition function in the communication protocol file, and acquiring the communication parameters and device identification recorded in the communication protocol file through the communication acquisition function; A virtual device is created according to the device identification, and a device channel table corresponding to the virtual device is generated according to the communication parameters.
5. A communication protocol adaptive matching method according to claim 4, characterized in that: The step of parsing the communication control instruction to determine the target virtual device for data transmission through the communication channel comprises: Parsing the communication control instruction to obtain a target device identifier corresponding to the communication control instruction; An addressing query is performed according to the target device identifier to determine the target virtual device for data transmission through the communication channel.
6. A communication protocol adaptive matching method according to claim 4, characterized in that: The obtaining of the target communication parameters and the target communication protocol file corresponding to the target virtual device comprises: Obtaining a device channel table of the target virtual device as a target communication parameter; A communication protocol file whose file name corresponds to the device identification of the target virtual device is obtained as the target communication protocol file.
7. A communication protocol adaptive matching method according to claim 2, characterized in that: The performing data transmission with the target device in the configured communication channel according to the target communication protocol file comprises: Reading a command processing function in the target communication protocol file, and parsing the target command received or sent by the communication channel through the command processing function to obtain a standard command; A data transmission operation is performed according to the standard command to collect target data in the target device.
8. A communication protocol adaptive matching method according to claim 7, characterized in that: Before parsing the target command received or sent by the communication channel through the command processing function, it also includes: Processing the original data handle to be transmitted into or transmitted from the communication channel through a pre-created interface conversion class to obtain a standard data handle in a specified format; After data processing is performed on 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 a standard command is performed.
9. A communication protocol adaptive matching method according to claim 1, characterized in that: The step of creating a monitoring thread based on the communication channel corresponding to each communication interface to monitor the communication control instructions in each communication channel includes: Based on the MQTT message transmission protocol, a monitoring thread is created for the communication channel corresponding to each communication interface to monitor whether a communication control instruction is transmitted in each of the communication channels.
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, a communication protocol adaptive matching method according to any one of claims 1 to 9 is implemented.
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
Equipment control method and device, computer equipment and storage medium
CN115866003A
Equipment access method and device, equipment and storage medium
CN117097682A
Data transmission method, device, equipment, medium and program product
CN117271405A