Data transmission method and device for heterogeneous equipment
Through the pre-established protocol adaptation model, the difficulties in accessing heterogeneous devices and data transmission are solved, the on-time access and data sharing of heterogeneous devices are realized, and the control and resource management of access devices are quickly realized.
Patent Information
- Application Number
- CN202411957816.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-09
AI Technical Summary
In a larger-scale usage scenario, there are difficulties in accessing, centralized control and resource management of heterogeneous devices, mainly due to the inconsistent communication protocols and interfaces of different devices, which leads to difficulties in interconnection of the physical layer and the information layer.
Through the pre-established protocol adaptation model, the first data packet sent by the heterogeneous device is obtained and converted into the corresponding second data packet to realize data transmission between different devices. This protocol adaptation model includes the relationships corresponding to the communication protocols of different devices, and uses a protocol adaptation algorithm modeled by finite state machine to build a protocol data conversion automaton.
It realizes on-time access and data sharing of heterogeneous devices, and quickly realizes control and resource management of access devices, avoiding the cumbersome process of transforming equipment.
Smart Images

Figure CN119967066A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of control technology, and in particular relates to a data transmission method and device for heterogeneous devices. Background Art
[0002] In recent years, various types of equipment have developed rapidly and are diverse. In a large-scale usage scenario, there may be a large number of heterogeneous devices that need to be accessed, centrally controlled, and resource managed. To achieve the access of a large number of heterogeneous devices, two problems need to be solved at the same time: one is the physical layer communication. Due to the inconsistency of communication equipment, methods, and interfaces used by different devices, it is difficult to achieve interconnection at the physical layer; the other is the information layer interaction. Due to the inconsistency of information interaction formats and contents followed by different electromagnetic devices, it is difficult to achieve organic integration and sharing of data at the information layer.
[0003] The traditional way to achieve integrated access is to transform existing equipment according to unified physical interfaces and communication protocols. The advantage of this method is that after the transformation, all devices follow the same interface and protocol standards, and seamless integration and communication can be achieved between devices; the disadvantage is that the transformation involves many factors, large workload, long cycle, and requires a lot of manpower and material resources. It is not suitable for solving the current practical problems faced by the access of a large number of heterogeneous devices. Therefore, how to connect new devices and achieve communication without changing the original software and hardware status of each device has become a technical problem that needs to be solved urgently in this field. Summary of the invention
[0004] The object of the present invention is to provide a data transmission method and device for heterogeneous devices.
[0005] According to a first aspect of the present invention, a data transmission method for heterogeneous devices is provided, comprising:
[0006] Acquire a first data message sent by a heterogeneous device through a first communication protocol;
[0007] Determine, according to a pre-established protocol adaptation model, a second communication protocol corresponding to the first communication protocol; wherein the pre-established protocol adaptation model includes a correspondence between communication protocols of different devices;
[0008] The first data packet is converted into a second data packet corresponding to the second communication protocol.
[0009] Optionally, the pre-established protocol adaptation model is obtained in the following manner:
[0010] Based on the protocol adaptation algorithm modeled by finite state machine, the protocol data conversion automaton corresponding to different devices is constructed according to the communication protocol interface rules, and a set of inter-process communication APIs are provided to the communicating parties.
[0011] Optionally, the method further comprises:
[0012] Generate a first protocol model tree according to a third communication protocol at the input end;
[0013] Generate a second protocol model tree according to the fourth communication protocol of the output end;
[0014] According to the first protocol model tree and the second protocol model tree, a conversion relationship between data types and operation functions is generated to obtain the protocol adaptation model.
[0015] Optionally, the method further comprises:
[0016] After generating a second data message corresponding to the second communication protocol, determining a preset application protocol driver corresponding to the second communication protocol; and using the application protocol driver to send the second data message.
[0017] Optionally, the method further comprises:
[0018] Receive a third message sent by the control device, wherein the third message includes a TCP message, a UDP message, an HTTP message or a serial communication protocol message;
[0019] The third message is converted into structured data according to the pre-established protocol adaptation model, or the structured data is converted into the third message according to the pre-established protocol adaptation model.
[0020] Optionally, the method further comprises:
[0021] According to the different openness levels of heterogeneous devices, a corresponding access mode is determined, and the access mode at least includes a command mode, a task mode or a plug-in mode.
[0022] According to a second aspect of the present invention, a data transmission device for heterogeneous devices is provided, comprising:
[0023] An acquisition module, used for acquiring a first data message sent by a heterogeneous device through a first communication protocol;
[0024] A determination module, configured to determine a second communication protocol corresponding to the first communication protocol according to a pre-established protocol adaptation model; wherein the pre-established protocol adaptation model includes a correspondence between communication protocols of different devices;
[0025] A transmission module is used to convert the first data message into a second data message corresponding to the second communication protocol.
[0026] Optionally, the pre-established protocol adaptation model is obtained in the following manner:
[0027] Based on the protocol adaptation algorithm modeled by finite state machine, the protocol data conversion automaton corresponding to different devices is constructed according to the communication protocol interface rules, and a set of inter-process communication APIs are provided to the communicating parties.
[0028] Optionally, the transmission module is used to:
[0029] Generate a first protocol model tree according to a third communication protocol at the input end;
[0030] Generate a second protocol model tree according to the fourth communication protocol of the output end;
[0031] According to the first protocol model tree and the second protocol model tree, a conversion relationship between data types and operation functions is generated to obtain the protocol adaptation model.
[0032] Optionally, the transmission module is used to:
[0033] After generating a second data message corresponding to the second communication protocol, determining a preset application protocol driver corresponding to the second communication protocol; and using the application protocol driver to send the second data message.
[0034] Optionally, the transmission module is used to:
[0035] Receive a third message sent by the control device, wherein the third message includes a TCP message, a UDP message, an HTTP message or a serial communication protocol message;
[0036] The third message is converted into structured data according to the pre-established protocol adaptation model, or the structured data is converted into the third message according to the pre-established protocol adaptation model.
[0037] Optionally, the transmission module is used to:
[0038] According to the different openness levels of heterogeneous devices, a corresponding access mode is determined, and the access mode at least includes a command mode, a task mode or a plug-in mode.
[0039] In a third aspect, the present application shows an electronic device, which includes: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the method described in any of the above aspects.
[0040] In a fourth aspect, the present application illustrates a non-temporary computer-readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute a method as described in any of the above aspects.
[0041] In a fifth aspect, the present application illustrates a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in any of the above aspects.
[0042] The beneficial effects brought by the present invention are as follows:
[0043] It can be seen from the above scheme that an embodiment of the present invention provides a data transmission method and apparatus for heterogeneous devices, including: obtaining a first data packet sent by a heterogeneous device through a first communication protocol; determining a second communication protocol corresponding to the first communication protocol according to a pre-established protocol adaptation model; wherein the pre-established protocol adaptation model includes the correspondence between communication protocols of different devices; converting the first data packet into a second data packet corresponding to the second communication protocol can solve the problem of temporary access of a large number of heterogeneous devices and can quickly realize control and resource management of access devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram of a flow chart of a data transmission method for heterogeneous devices provided according to an embodiment;
[0045] Figure 2 A protocol model tree directed graph provided according to an embodiment;
[0046] Figure 3 A software architecture for protocol adaptation provided according to an embodiment;
[0047] Figure 4 A schematic diagram of a device access method provided according to an embodiment;
[0048] Figure 5 A flowchart of heterogeneous device access provided according to an embodiment;
[0049] Figure 6 It is a structural block diagram of a data transmission device of a heterogeneous device of the present application;
[0050] Figure 7 is a block diagram of an electronic device of the present application;
[0051] Figure 8 It is a block diagram of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] Reference Figure 1 , shows a flowchart of a method for data transmission of heterogeneous devices of the present application, which can be applied to electronic devices, wherein the method can specifically include the following steps:
[0054] S101, obtaining a first data message sent by a heterogeneous device through a first communication protocol;
[0055] S102, determining a second communication protocol corresponding to the first communication protocol according to a pre-established protocol adaptation model; wherein the pre-established protocol adaptation model includes a correspondence between communication protocols of different devices;
[0056] S103: Convert the first data message into a second data message corresponding to the second communication protocol.
[0057] Another embodiment of the present application further supplements the data transmission method for heterogeneous devices provided in the above embodiment.
[0058] Optionally, the pre-established protocol adaptation model is obtained by:
[0059] Based on the protocol adaptation algorithm modeled by finite state machine, the protocol data conversion automaton corresponding to different devices is constructed according to the communication protocol interface rules, and a set of inter-process communication APIs are provided to the communicating parties.
[0060] Optionally, the method further comprises:
[0061] Generate a first protocol model tree according to a third communication protocol at the input end;
[0062] Generate a second protocol model tree according to the fourth communication protocol of the output end;
[0063] According to the first protocol model tree and the second protocol model tree, a conversion relationship between data types and operation functions is generated to obtain a protocol adaptation model.
[0064] Principle of protocol adapter software: Protocol adapter software mainly uses protocol adapter technology based on finite state machine modeling, builds corresponding protocol data conversion automata according to communication protocol interface rules, and provides a set of inter-process communication APIs to both parties for use. Without changing the software of both parties, it completes real-time protocol conversion and realizes interconnection and information sharing between the two parties. The basic theoretical basis of protocol adapter software is the finite state machine model. Finite state machine (FSM) is a mathematical model that represents a finite number of states and behaviors such as transitions and actions between these states. The basic concepts in finite state machines include state and action. The state stores information about the past, which reflects the input changes from the beginning of the system to the present moment; the action is a description of the activities to be performed at a given moment.
[0065] The logical structure of the communication protocol in the embodiment of the present application conforms to the tree structure. For this reason, all communication protocols can be abstracted into a corresponding tree semantic model - protocol model tree (PMT). PMT is a state machine, and a node of PMT is a state of the state machine. PMT is divided into input tree (IPWT) and output tree (OPWT) according to the flow direction of its data.
[0066] In protocol adaptation, when PMT describes the protocol of the input end, it is the input tree; when PMT describes the protocol of the output end, it is the output tree. The purpose of protocol adaptation is to convert the data elements of the input tree into the data elements of the output tree. A set of formulas including data types and operation functions y=f(x…) are defined to describe the conversion relationship. This set of formulas connects the two trees in a directed graph, such as Figure 2 shown.
[0067] Optionally, the method further comprises:
[0068] After generating the second data message corresponding to the second communication protocol, determining a preset application protocol driver corresponding to the second communication protocol; and using the application protocol driver to send the second data message.
[0069] Protocol adapter software architecture Figure 3As shown, it includes four components: model manager, device driver, application protocol adapter server and I / O communication module. The model manager establishes corresponding protocol adaptation models for the communication protocols of different devices, builds a protocol model tree by analyzing the composition of the protocol, establishes a mapping relationship between the protocols of different devices, and compiles and generates corresponding device drivers. The device driver is a dynamic link library generated for different complex devices. It identifies information that conforms to the device communication protocol, drives the application protocol adapter server to communicate with the other end of the communication device, thereby completing the seamless integration between the two device systems. The application protocol adapter server is an independent executable program that completes the mutual conversion of the communication protocols of the two devices by calling the device driver, thereby realizing the interconnection between the two. The I / O communication module completes the direct communication between the protocol adapter software and the device.
[0070] Optionally, the method further comprises:
[0071] receiving a third message sent by the control device, where the third message includes a TCP message, a UDP message, an HTTP message, or a serial communication protocol message;
[0072] The third message is converted into structured data according to a pre-established protocol adaptation model, or the structured data is converted into the third message according to a pre-established protocol adaptation model.
[0073] Heterogeneous device sensing and control technology supports the encapsulation and transmission of TCP, UDP, HTTP, serial communication and other protocols, and has two-way protocol conversion capabilities, one is to convert the collected original message into structured data according to the protocol definition, and the other is to convert the structured data into device push messages according to the protocol definition. It also manages and maintains the data channel.
[0074] Optionally, the method further comprises:
[0075] According to the different openness levels of heterogeneous devices, the corresponding access mode is determined, and the access mode at least includes a command mode, a task mode or a plug-in mode.
[0076] like Figure 4 As shown, the tool provided in the embodiment of the present application provides three modes of device access: command mode, task mode, and plug-in mode. The appropriate access mode is adopted according to the openness of the device, including:
[0077] Command mode: Based on this tool, the protocol access with heterogeneous devices is completed, and the command-level integrated access between the tool and the device is realized, and the behavior of the device is directly sensed and controlled. The command mode is the main mode of device access.
[0078] Task mode: For semi-open devices, when instruction-level integration cannot be achieved, the task docking mode is adopted to complete the task docking of the device through the open access of this system.
[0079] Plug-in mode: For closed devices or devices that cannot be connected, the plug-in mode is used to sense the location of the plug-in device instead of the real-time location of the device.
[0080] The present application embodiment formulates a set of standardized processes for heterogeneous device access to standardize the process of device access, debugging, and application. Figure 5 As shown, specifically including:
[0081] Protocol configuration: Based on this system, the device's protocol structure, collection protocol, and push protocol are solidified in the system;
[0082] Network configuration: Based on this system, the connection channels and data channels of the equipment are solidified in the system;
[0083] Docking development: Customize the secondary development interface based on the protocol of this system, conduct secondary development according to the protocol specificity and business requirements of the equipment, and complete the protocol compatibility work;
[0084] Joint debugging test: Test the perception and control capabilities of the device based on the test environment to verify the normality and stability of all interfaces and instructions;
[0085] Version release: Based on this system, the integrated device protocols and configurations are released to the formal environment and switched to the formal usage scenario.
[0086] Personalized protocol customization: Open API is the open service capability of this software platform, which supports developers to customize the protocol and connect data with upstream systems based on the basic capabilities of the platform. It supports two application layer protocols, HTTP and WebSocket, and supports SDK integration of Java language for secondary development. For some simple algorithms, it supports online dynamic scripting language.
[0087] For the control instructions of the equipment, the platform will provide the upper-layer business applications with http-Rest interfaces. For the collection instructions of the equipment, the platform will provide the upper-layer business applications with web socket data push channels to achieve real-time data arrival. The integrated access technology based on protocol adaptation is adopted to achieve the communication between the physical layer and information layer of different devices through "integrated access equipment + protocol adaptation software". The advantages of this method are:
[0088] First, the equipment does not need to be changed. Protocol conversion can be achieved by simply establishing a mapping model of the communication protocol between devices through protocol adaptation software;
[0089] Second, traditional protocol conversion work must be completed by programmers through programming, while users of protocol adaptation software only need to establish a protocol conversion model through a graphical interface, and the software will automatically generate a program in the background based on the model established by the user;
[0090] Third, the protocol conversion model has good inheritability and portability. For newly connected devices, as long as they comply with known protocol standards or are similar to known communication protocols, the protocol conversion of the newly connected devices can be completed by modifying the existing protocol conversion model.
[0091] An embodiment of the present invention provides a data transmission method for heterogeneous devices, including: obtaining a first data message sent by the heterogeneous device through a first communication protocol; determining a second communication protocol corresponding to the first communication protocol according to a pre-established protocol adaptation model; wherein the pre-established protocol adaptation model includes a correspondence between communication protocols of different devices; converting the first data message into a second data message corresponding to the second communication protocol can solve the problem of temporary access of a large number of heterogeneous devices and can quickly realize control and resource management of the access devices.
[0092] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any combination without conflict, and this application is not limited thereto.
[0093] Another embodiment of the present application provides a data transmission device for heterogeneous devices, which is used to execute the data transmission method for heterogeneous devices provided in the above embodiment.
[0094] like Figure 6 , which is a schematic diagram of the structure of a data transmission device for heterogeneous devices provided in an embodiment of the present application. The data transmission device for heterogeneous devices includes an acquisition module 601, a determination module 602 and a transmission module 603, wherein:
[0095] The acquisition module 601 is used to acquire a first data message sent by a heterogeneous device through a first communication protocol;
[0096] The determination module 602 is used to determine the second communication protocol corresponding to the first communication protocol according to the pre-established protocol adaptation model; wherein the pre-established protocol adaptation model includes the correspondence between the communication protocols of different devices;
[0097] The transmission module 603 is used to convert the first data message into a second data message corresponding to the second communication protocol.
[0098] Regarding the device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0099] Another embodiment of the present application further supplements the data transmission device for heterogeneous devices provided in the above embodiment.
[0100] Optionally, the pre-established protocol adaptation model is obtained by:
[0101] Based on the protocol adaptation algorithm modeled by finite state machine, the protocol data conversion automaton corresponding to different devices is constructed according to the communication protocol interface rules, and a set of inter-process communication APIs are provided to the communicating parties.
[0102] Optionally, the transmission module is used to:
[0103] Generate a first protocol model tree according to a third communication protocol at the input end;
[0104] Generate a second protocol model tree according to the fourth communication protocol of the output end;
[0105] According to the first protocol model tree and the second protocol model tree, a conversion relationship between data types and operation functions is generated to obtain a protocol adaptation model.
[0106] Optionally, the transmission module is used to:
[0107] After generating the second data message corresponding to the second communication protocol, determining a preset application protocol driver corresponding to the second communication protocol; and using the application protocol driver to send the second data message.
[0108] Optionally, the transmission module is used to:
[0109] receiving a third message sent by the control device, where the third message includes a TCP message, a UDP message, an HTTP message, or a serial communication protocol message;
[0110] The third message is converted into structured data according to a pre-established protocol adaptation model, or the structured data is converted into the third message according to a pre-established protocol adaptation model.
[0111] Optionally, the transmission module is used to:
[0112] According to the different openness levels of heterogeneous devices, the corresponding access mode is determined, and the access mode at least includes a command mode, a task mode or a plug-in mode.
[0113] An embodiment of the present invention provides a data transmission device for heterogeneous devices, including: obtaining a first data message sent by the heterogeneous device through a first communication protocol; determining a second communication protocol corresponding to the first communication protocol according to a pre-established protocol adaptation model; wherein the pre-established protocol adaptation model includes a correspondence between communication protocols of different devices; converting the first data message into a second data message corresponding to the second communication protocol can solve the problem of temporary access of a large number of heterogeneous devices and can quickly realize control and resource management of the access devices.
[0114] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0115] Optionally, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0116] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0117] Figure 7 800 is a block diagram of an electronic device 800 shown in the present application. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0118] Reference Figure 7 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0119] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0120] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, images, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0121] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
[0122] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0123] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0124] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0125] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0126] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast operation information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0127] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0128] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0129] Figure 819 is a block diagram of a computer-readable storage medium 1900 shown in the present application. For example, the computer-readable storage medium 1900 may be provided as a server.
[0130] Reference Figure 8 , the computer-readable storage medium 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as an application, that can be executed by the processing component 1922. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0131] The computer readable storage medium 1900 may also include a power supply component 1926 configured to perform power management of the computer readable storage medium 1900, a wired or wireless network interface 1950 configured to connect the computer readable storage medium 1900 to a network, and an input / output (I / O) interface 1958. The computer readable storage medium 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.
[0132] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0133] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0134] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0135] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0136] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0137] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0138] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0139] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0140] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0141] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0142] The above are preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A data transmission method for heterogeneous devices, characterized in that: include: Acquire a first data message sent by a heterogeneous device through a first communication protocol; Determine, according to a pre-established protocol adaptation model, a second communication protocol corresponding to the first communication protocol; wherein the pre-established protocol adaptation model includes a correspondence between communication protocols of different devices; The first data packet is converted into a second data packet corresponding to the second communication protocol.
2. The data transmission method for heterogeneous devices according to claim 1, characterized in that: The pre-established protocol adaptation model is obtained in the following manner: Based on the protocol adaptation algorithm modeled by finite state machine, the protocol data conversion automaton corresponding to different devices is constructed according to the communication protocol interface rules, and a set of inter-process communication APIs are provided to the communicating parties.
3. The data transmission method for heterogeneous devices according to claim 2, characterized in that: The method further comprises: Generate a first protocol model tree according to a third communication protocol at the input end; Generate a second protocol model tree according to the fourth communication protocol of the output end; According to the first protocol model tree and the second protocol model tree, a conversion relationship between data types and operation functions is generated to obtain the protocol adaptation model.
4. The data transmission method for heterogeneous devices according to claim 3, characterized in that: The method further comprises: After generating a second data message corresponding to the second communication protocol, determining a preset application protocol driver corresponding to the second communication protocol; and using the application protocol driver to send the second data message.
5. The data transmission method for heterogeneous devices according to claim 1, characterized in that: The method further comprises: Receive a third message sent by the control device, wherein the third message includes a TCP message, a UDP message, an HTTP message or a serial communication protocol message; The third message is converted into structured data according to the pre-established protocol adaptation model, or the structured data is converted into the third message according to the pre-established protocol adaptation model.
6. The data transmission method for heterogeneous devices according to claim 1, characterized in that: The method further comprises: According to the different openness levels of heterogeneous devices, a corresponding access mode is determined, and the access mode at least includes a command mode, a task mode or a plug-in mode.
7. A data transmission device for heterogeneous devices, characterized in that: include: An acquisition module, used for acquiring a first data message sent by a heterogeneous device through a first communication protocol; A determination module, configured to determine a second communication protocol corresponding to the first communication protocol according to a pre-established protocol adaptation model; wherein the pre-established protocol adaptation model includes a correspondence between communication protocols of different devices; A transmission module is used to convert the first data message into a second data message corresponding to the second communication protocol.
8. The data transmission device for heterogeneous devices according to claim 7, characterized in that: The pre-established protocol adaptation model is obtained in the following manner: Based on the protocol adaptation algorithm modeled by finite state machine, the protocol data conversion automaton corresponding to different devices is constructed according to the communication protocol interface rules, and a set of inter-process communication APIs are provided to the communicating parties.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the method according to any one of claims 1 to 6 when executed by the processor.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.