Data transmission method and device, computer equipment and storage medium
By receiving data compliant with the first transmission protocol and converting based on pre-configured protocol conversion rules, the two-way communication problem between the Bluetooth module and the mobile device supporting different communication protocols is solved, and seamless conversion and device interoperability between multiple communication protocols is achieved.
Patent Information
- Application Number
- CN202412000430.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-15
AI Technical Summary
The prior art is difficult to realize two-way communication between Bluetooth modules and mobile devices that support different communication protocols, mainly because hardware gateway devices can only realize one-way multi-protocol conversion, making it difficult to realize two-way designated conversion.
By receiving data that complies with the first transmission protocol and converting the data into functional instruction data that complies with the preset general protocol based on preconfigured protocol conversion rules, seamless conversion between multiple communication protocols is achieved.
Two-way communication between Bluetooth modules and mobile devices that support different communication protocols is realized, improving interoperability between devices and systems, and reducing device compatibility issues.
Smart Images

Figure CN119835342A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data communication technology, and in particular to a data transmission method, device, computer equipment and storage medium. Background Art
[0002] Bluetooth is a short-range wireless communication technology that is not only widely used in personal mobile devices such as smartphones, headphones, and smart watches, but also has very wide applications in industrial automation, medical equipment, and smart homes. In practical applications, the system of a device usually needs to support multiple communication protocols to achieve interoperability between different devices. The Bluetooth module only supports a single communication protocol, so the Bluetooth module of the mobile device needs to be able to support the Bluetooth Classic protocol (Bluetooth Classic). Among them, the Bluetooth Classic protocol is a Bluetooth protocol and standard that supports a higher data transmission rate, which is suitable for scenarios such as audio transmission and data synchronization. There are many types of IoT devices, and the communication protocols supported by the devices are also different. In this regard, in the relevant technology, hardware gateway devices are usually used to achieve multiple protocol conversions, and embedded multi-protocol conversion chips are equipped to achieve transmission and conversion that supports multiple protocols. However, the multiple protocol conversions supported by the hardware gateway device are usually one-way conversions, which convert multiple protocols into a standard communication protocol, and it is difficult to achieve two-way designated conversion use. Therefore, how to achieve two-way communication between the Bluetooth module and mobile devices that support different communication protocols has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] In view of this, the present invention provides a data transmission method, apparatus, computer device and storage medium to solve the technical problem of how to achieve communication between a Bluetooth module and mobile devices supporting different communication protocols, which needs to be solved urgently.
[0004] In a first aspect, the present invention provides a data transmission method, the method comprising:
[0005] receiving first data conforming to a first transmission protocol, where the first transmission protocol is one of a plurality of preset transmission protocols;
[0006] Based on a pre-configured first protocol conversion rule corresponding to the first transmission protocol, the first data is converted into second data that conforms to a preset universal protocol, where the second data is used to represent a functional instruction of the first data;
[0007] The second data is sent.
[0008] The data transmission method of the embodiment of the present invention receives first data that conforms to a first transmission protocol, and based on a pre-configured first protocol conversion rule corresponding to the first transmission protocol, converts the first data into second data that conforms to a preset general protocol, and sends out the second data, wherein the first transmission protocol is one of a plurality of preset transmission protocols, and the second data is used to characterize the functional instructions of the first data. Thus, for different protocols, corresponding protocol conversion rules are pre-configured, and the first data is directly converted into the second data that conforms to the preset general protocol, and the second data is an executable functional instruction, which can support multiple communication protocols, effectively ensure seamless connection and data exchange between different devices and systems, reduce device compatibility issues, and improve the overall interoperability of the system.
[0009] In some optional implementations, before receiving the first data that complies with the first transmission protocol, the method further includes:
[0010] Obtain a first protocol document of a first transmission protocol;
[0011] The first protocol document is converted into a first protocol conversion rule.
[0012] In some optional implementations, the first protocol document includes at least one of the following: a protocol channel address, a protocol data format, a protocol data packet format, a protocol data function table, and a Bluetooth connection rule.
[0013] In some optional implementations, converting the first protocol document into a first protocol conversion rule includes:
[0014] Convert the protocol channel address to a configuration file;
[0015] Splitting the first protocol document according to the data structure of the preset general protocol;
[0016] A function table is generated for the first protocol document.
[0017] The data transmission method of the embodiment of the present invention obtains a first protocol document of a first transmission protocol and automatically converts the first protocol document into a first protocol conversion rule. The method realizes automatic generation of protocol conversion rules for multiple communication protocols, flexibly adapts to the communication between devices supporting different communication protocols, and effectively improves the scalability of the solution.
[0018] In some optional implementations, after converting the first data into second data that complies with a preset universal protocol, the method further includes:
[0019] Based on the first protocol conversion rule and the first data, consistency between the second data and the first data is determined.
[0020] The data transmission method of the embodiment of the present invention performs protocol conversion on the first data to obtain the second data, and then promptly determines the data consistency, thereby effectively improving the accuracy of data transmission.
[0021] In some optional implementations, determining the consistency of the second data with the first data based on the first protocol conversion rule and the first data includes:
[0022] receiving a first protocol conversion rule;
[0023] Parsing the first protocol conversion rule to obtain a protocol channel address, a protocol data format, a protocol data packet format, a protocol data function table and a Bluetooth connection rule;
[0024] Determining whether the second data complies with the parsed rule;
[0025] When the second data meets the rule obtained by parsing, it is determined that the second data meets the consistency requirement with the first data.
[0026] In some optional implementations, after determining the consistency between the second data and the first data, the method further includes:
[0027] Based on the data consistency between the plurality of second data and the corresponding first data, the first protocol conversion rule is updated.
[0028] The data transmission method of the embodiment of the present invention updates the first protocol conversion rule based on the data consistency between multiple second data and the corresponding first data, continuously improves the accuracy of data conversion through multiple self-learning optimization processes, ensures the consistency before and after data conversion, and significantly improves the accuracy of data transmission.
[0029] In a second aspect, the present invention provides a data transmission device, the device comprising:
[0030] A receiving module, configured to receive first data conforming to a first transmission protocol, where the first transmission protocol is one of a plurality of preset transmission protocols;
[0031] A conversion module, configured to convert the first data into second data that conforms to a preset universal protocol based on a pre-configured first protocol conversion rule corresponding to the first transmission protocol, wherein the second data is used to represent a functional instruction of the first data;
[0032] The sending module is used to send second data.
[0033] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the data transmission method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0034] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the data transmission method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 is a flow chart of a data transmission method according to an embodiment of the present invention;
[0037] Figure 2 is a flow chart of another data transmission method according to an embodiment of the present invention;
[0038] Figure 3 is a flowchart of a specific application example of a data transmission method according to an embodiment of the present invention;
[0039] Figure 4 is a flowchart of another specific application example of the data transmission method according to an embodiment of the present invention;
[0040] Figure 5 is a structural block diagram of a data transmission device according to an embodiment of the present invention;
[0041] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0043] In order to solve the problem of how to achieve two-way communication between a Bluetooth module and a mobile device supporting different communication protocols, it becomes an urgent technical problem to be solved. The present invention provides a data transmission method, device, computer device and storage medium. For example, the data transmission method of the embodiment of the present invention can be applied to mobile communication devices in the Internet of Things, and the various communication protocols of mobile communication devices in the Internet of Things can be converted into the universal standard of Bluetooth Classic communication.
[0044] According to an embodiment of the present invention, a data transmission method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0045] In this embodiment, a data transmission method is provided, which can be used for an independent Bluetooth module, as well as a mobile terminal such as a mobile phone, a tablet computer, or other devices with a Bluetooth module. Figure 1 is a flow chart of a data transmission method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0046] Step S101, receiving first data conforming to a first transmission protocol, where the first transmission protocol is one of a plurality of preset transmission protocols.
[0047] In some optional embodiments, the preset transmission protocols may include CAN (Controller Area Network, bus), Modbus (serial communication protocol for industrial automation), Zigbee (low-power wireless communication protocol), etc., and the first transmission protocol may be one of multiple preset transmission protocols.
[0048] Step S102, based on a pre-configured first protocol conversion rule corresponding to a first transmission protocol, convert the first data into second data that complies with a preset universal protocol, where the second data is used to represent a functional instruction of the first data.
[0049] For each preset transmission protocol, a protocol conversion rule corresponding to the preset transmission protocol can be pre-configured based on the protocol channel address, protocol data format, protocol data packet format, protocol data function table and Bluetooth connection rules that conform to the protocol.
[0050] Here, it mainly refers to converting data conforming to a preset transmission protocol into data conforming to the Bluetooth Classic protocol, or converting data conforming to the Bluetooth Classic protocol into data conforming to the preset transmission protocol. For example, a first protocol conversion rule corresponding to a first transmission protocol may be preconfigured.
[0051] In some optional implementations, the preset universal protocol may be a Bluetooth Classic protocol.
[0052] Step S103, sending second data.
[0053] In some optional implementations, the second data obtained in step S102 can represent the functional instructions of the first data, so the second data can be directly sent out here.
[0054] The data transmission method of the embodiment of the present invention receives first data that conforms to a first transmission protocol, and based on a pre-configured first protocol conversion rule corresponding to the first transmission protocol, converts the first data into second data that conforms to a preset general protocol, and sends out the second data, wherein the first transmission protocol is one of a plurality of preset transmission protocols, and the second data is used to characterize the functional instructions of the first data. Thus, for different protocols, corresponding protocol conversion rules are pre-configured, and the first data is directly converted into the second data that conforms to the preset general protocol, and the second data is an executable functional instruction, which can support multiple communication protocols, effectively ensure seamless connection and data exchange between different devices and systems, reduce device compatibility issues, and improve the overall interoperability of the system.
[0055] In this embodiment, a data transmission method is provided, which can be used for an independent Bluetooth module, as well as a mobile terminal such as a mobile phone, a tablet computer, or other devices with a Bluetooth module. Figure 2 is a flow chart of a data transmission method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0056] Step S201: Acquire a first protocol document of a first transmission protocol.
[0057] In some optional implementations, the first protocol document includes at least one of the following: a protocol channel address, a protocol data format, a protocol data packet format, a protocol data function table, and a Bluetooth connection rule.
[0058] Specifically, the protocol channel address may include a read channel address, a write data channel address, and a broadcast data channel address. The protocol data format may include a data request header, a data request type, a data bit, and a data check bit, etc. The protocol data packet format may include a data packet header, a data packet tail, and a data packet length, etc. The protocol data function table may be the specific data content of sending data to the Bluetooth module or a device including the Bluetooth module, and different data represent different functions. The protocol data function table may also be the content of the data replied by the Bluetooth module or a device including the Bluetooth module, representing replies of different functions. The Bluetooth connection rules may include whether specific data needs to be sent for handshake to verify whether it is a secure device connection.
[0059] Step S202: converting the first protocol document into a first protocol conversion rule.
[0060] In some optional implementations, step S202 may include:
[0061] Step S2021, converting the protocol channel address into a configuration file.
[0062] Specifically, here, in order to accurately and quickly parse the data that conforms to the first transmission protocol, it is necessary to configure a configuration file for characterizing the meaning of each frame and each bit of the first data. Therefore, the protocol channel address can be converted into a configuration file here, so that when receiving data that conforms to the first transmission protocol, data of different protocol channels can be identified, thereby accurately and quickly parsing the received data.
[0063] In some optional implementations, the protocol channel address may be converted into a configuration file, wherein the protocol channel remains unchanged and is sequentially a write, read, and broadcast channel.
[0064] Step S2022: split the first protocol document according to the data structure of the preset general protocol.
[0065] Specifically, according to the first protocol document, the first protocol document is split according to the general data structure of the preset general protocol, and the data structure is converted into a data header, a data footer, and data content in sequence.
[0066] Step S2023: Generate a function table for the first protocol document.
[0067] Specifically, according to the protocol document, individual functions included in the first protocol document may be executed in sequence to generate a function table, and the function table is used to represent a data function table that complies with the first transmission protocol.
[0068] The data transmission method of the embodiment of the present invention obtains a first protocol document of a first transmission protocol and automatically converts the first protocol document into a first protocol conversion rule. The method realizes automatic generation of protocol conversion rules for multiple communication protocols, flexibly adapts to the communication between devices supporting different communication protocols, and effectively improves the scalability of the solution.
[0069] Step S203, receiving first data conforming to a first transmission protocol, where the first transmission protocol is one of a plurality of preset transmission protocols.
[0070] For details, please see Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0071] Step S204: based on a pre-configured first protocol conversion rule corresponding to the first transmission protocol, convert the first data into second data that complies with a preset universal protocol, where the second data is used to represent a functional instruction of the first data.
[0072] For details, please see Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0073] Step S205, sending the second data.
[0074] For details, please see Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0075] Step S206: determining the consistency of the second data with the first data based on the first protocol conversion rule and the first data.
[0076] In some optional implementations, step S206 may include:
[0077] Step S2061: Receive a first protocol conversion rule.
[0078] Here, the first protocol conversion rule is equivalent to a specified input, for example: a Bluetooth protocol channel address, a Bluetooth protocol data packet format, a Bluetooth data function, and the like.
[0079] Step S2062, parsing the first protocol conversion rule to obtain a protocol channel address, a protocol data format, a protocol data packet format, a protocol data function table and a Bluetooth connection rule.
[0080] For example, the parsed content may include the channel address, data packet format, and data function list of the Bluetooth protocol.
[0081] Step S2063, determining whether the second data conforms to the rules obtained by parsing.
[0082] For example, whether the channel address, data packet format and data function table of the second data are consistent with the requirements in the first transmission protocol. If they are consistent, it is determined that the second data meets the rules obtained by parsing.
[0083] Step S2064: when the second data meets the rules obtained by analysis, it is determined that the second data meets the consistency requirement with the first data.
[0084] The purpose of parsing the first protocol conversion rule is to determine whether the second data complies with the parsed rule. If the second data complies with the parsed rule, it is determined that the second data complies with the consistency requirement of the first data, and the second data can be sent. If it does not comply, the corresponding error log is output.
[0085] The data transmission method of the embodiment of the present invention performs protocol conversion on the first data to obtain the second data, and then promptly determines the data consistency, thereby effectively improving the accuracy of data transmission.
[0086] Step S207: updating the first protocol conversion rule based on the data consistency between the plurality of second data and the corresponding first data.
[0087] After completing the conversion of multiple data, statistics can be collected on multiple first data and corresponding second data according to the first transmission protocol and the corresponding first protocol conversion rule, and the first protocol conversion rule can be optimized after analysis using AI (Artificial Intelligence).
[0088] For example, the first transmission protocol and the corresponding first protocol conversion rule can be counted, the number of channels used, whether the number of channels can be optimized, the success rate and failure rate of the current data transmission packet can be counted, the maximum length of the current protocol transmission packet can be counted, whether the length can be optimized, and whether the success rate of packet transmission can be improved.
[0089] For example, the formats of data packets such as the packet header, packet tail, check bit, number of frames, and number of blank character bits can be adjusted based on the statistics of the success rate and failure rate of the current data transmission packets.
[0090] Similarly, other preset transmission protocols may also be optimized and updated using the above steps.
[0091] The data transmission method of the embodiment of the present invention updates the first protocol conversion rule based on the data consistency between multiple second data and the corresponding first data, continuously improves the accuracy of data conversion through multiple self-learning optimization processes, ensures the consistency before and after data conversion, and significantly improves the accuracy of data transmission.
[0092] Furthermore, the embodiments of the present invention can also utilize a cross-platform programming language to automatically convert protocol rules between two protocols to generate a platform plug-in tool corresponding to Windows, Mac, Android, iOS, Web, etc. that supports cross-platforms.
[0093] In this embodiment, a data transmission method is provided, which can be used for an independent Bluetooth module, as well as a mobile terminal such as a mobile phone, a tablet computer, or other devices with a Bluetooth module. Figure 3 is a flow chart of a specific application example of a data transmission method according to an embodiment of the present invention. In this specific application example, Figure 3 As shown, the process includes the following steps:
[0094] Step S301, receiving a protocol to be converted.
[0095] The protocol to be converted can be one of a variety of transmission protocols. Here, in order to directly convert the first data conforming to the protocol to be converted into the second data conforming to the Bluetooth protocol, a protocol document for the protocol to be converted is first generated based on the protocol text of the protocol to be converted, and the protocol document is equivalent to the first protocol conversion rule mentioned above.
[0096] Specifically, the protocol to be converted includes a protocol channel address, a protocol data format, a protocol data packet format, a protocol data function table and a Bluetooth connection rule. The protocol channel address may include a read channel address, a write data channel address and a broadcast data channel address. The protocol data format may include a data request header, a data request type, a data bit, and a data check bit, etc. The protocol data packet format may include a data packet header, a data packet tail, and a data packet length, etc. The protocol data function table may be the specific data content of sending data to a Bluetooth module or a device including a Bluetooth module, and different data represent different functions. The protocol data function table may also be the content of the data replied by the Bluetooth module or a device including a Bluetooth module, representing replies of different functions. The Bluetooth connection rule may include whether specific data needs to be sent for handshake to verify whether it is a secure device connection.
[0097] Step S302: configuring a protocol document based on the protocol to be converted.
[0098] Specifically, the configuration protocol document can be implemented through the following operations:
[0099] Step a1, convert the protocol channel address into a configuration file, the protocol channel remains unchanged, and the order is write, read and broadcast channels.
[0100] Step a2, protocol data format conversion configuration. Specifically, according to the prepared protocol text, the protocol text is split according to the common data structure, and the data structure is converted into a data header, a tail, and a data part in sequence.
[0101] Step a3, protocol data function table configuration: generate a function table by executing individual functions in sequence according to the protocol text table.
[0102] Step S303, receiving first data.
[0103] Step S304: convert the first data.
[0104] Here, the first data is converted into second data that complies with a preset universal protocol. The preset universal protocol is a Bluetooth protocol.
[0105] Specifically, it can be converted into a universal Bluetooth protocol according to the corresponding configuration. For example, the data at a fixed position in the data packet returned by the data is used to determine our Bluetooth configuration, and then the Bluetooth protocol channel, protocol data format, and content of the protocol data packet are converted into a universal protocol in turn.
[0106] Step S305, output the second data.
[0107] In this embodiment, a data transmission method is provided, which can be used for an independent Bluetooth module, as well as a mobile terminal such as a mobile phone, a tablet computer, or other devices with a Bluetooth module. Figure 4 FIG. 1 is a flow chart of another specific application example of the data transmission method according to an embodiment of the present invention. This application example focuses on the process of converting data conforming to the Bluetooth protocol into data conforming to the preset transmission protocol and sending it. Figure 4 As shown, the process includes the following steps:
[0108] Step S401, input a preset transmission protocol.
[0109] This is a Figure 3 The embodiment shown in FIG. 1 is a reverse process, so here we can also Figure 3 The protocol to be converted is shown as the preset transmission protocol.
[0110] Step S402: parsing the preset transmission rule.
[0111] Step S403: analyzing the second data based on the parsing result of the preset transmission rule.
[0112] The purpose of the analysis is to determine whether it complies with the current protocol. If it does, the data will be parsed. If it does not, the corresponding error log will be output.
[0113] Step S404, outputting the second data.
[0114] Step S405, sorting, statistically analyzing and optimizing the conversion rules of the preset transmission protocol.
[0115] For details, please refer to the above step S207, which will not be described in detail here.
[0116] Step S406: outputting the optimized conversion rule of the preset transmission protocol.
[0117] Therefore, the data transmission method of the embodiment of the present invention can select the supported communication protocol according to the specific needs of the user, and configure and convert it through the tool, so that the system is more flexible and easy to expand new devices and protocols. By managing multiple protocols through a unified Bluetooth adapter tool, the complexity of device and system configuration is effectively reduced, the management and maintenance costs are significantly reduced, and the maintainability of the system using the data transmission method of the embodiment of the present invention is effectively improved.
[0118] In this embodiment, a data transmission device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0119] This embodiment provides a data transmission device, such as Figure 5 As shown, including:
[0120] A receiving module 501, configured to receive first data conforming to a first transmission protocol, where the first transmission protocol is one of a plurality of preset transmission protocols;
[0121] A conversion module 502, configured to convert the first data into second data conforming to a preset universal protocol based on a pre-configured first protocol conversion rule corresponding to the first transmission protocol, wherein the second data is used to represent a functional instruction of the first data;
[0122] The sending module 503 is used to send the second data.
[0123] In some optional embodiments, the device further comprises:
[0124] A protocol acquisition module, used for acquiring a first protocol document of a first transmission protocol before receiving first data conforming to the first transmission protocol;
[0125] The rule conversion module is used to convert the first protocol document into a first protocol conversion rule.
[0126] In some optional implementations, the first protocol document includes at least one of the following: a protocol channel address, a protocol data format, a protocol data packet format, a protocol data function table, and a Bluetooth connection rule.
[0127] In some optional implementations, the rule conversion module includes:
[0128] Channel unit, used to convert the protocol channel address into a configuration file;
[0129] A splitting unit, used for splitting the first protocol document according to a data structure of a preset general protocol;
[0130] The generating unit is used to generate a function table for the first protocol document.
[0131] In some optional embodiments, the device further comprises:
[0132] The consistency module is used to determine the consistency of the second data with the first data based on the first protocol conversion rule and the first data after converting the first data into the second data that conforms to the preset general protocol.
[0133] In some optional implementations, the consistency module includes:
[0134] A rule receiving unit, configured to receive a first protocol conversion rule;
[0135] A rule parsing unit, used to parse the first protocol conversion rule to obtain a protocol channel address, a protocol data format, a protocol data packet format, a protocol data function table and a Bluetooth connection rule;
[0136] A compliance unit, used to determine whether the second data complies with the parsed rule;
[0137] The determination unit is used to determine whether the second data meets the consistency requirement with the first data when the second data meets the rule obtained by the analysis.
[0138] In some optional embodiments, the device further comprises:
[0139] The updating module is used to update the first protocol conversion rule based on the data consistency of the plurality of second data and the corresponding first data after determining the consistency of the second data and the first data.
[0140] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0141] The data transmission device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0142] The embodiment of the present invention also provides a computer device having the above Figure 5 The data transmission device shown.
[0143] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0144] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0145] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0146] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0147] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0148] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0149] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0150] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0151] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0152] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A data transmission method, characterized in that: The method comprises: receiving first data conforming to a first transmission protocol, wherein the first transmission protocol is one of a plurality of preset transmission protocols; Based on a pre-configured first protocol conversion rule corresponding to the first transmission protocol, converting the first data into second data that complies with a preset universal protocol, wherein the second data is used to represent a functional instruction of the first data; The second data is sent out.
2. The method according to claim 1, characterized in that Before receiving the first data conforming to the first transmission protocol, the method further includes: Obtain a first protocol document of a first transmission protocol; The first protocol document is converted into the first protocol conversion rule.
3. The method according to claim 2, characterized in that The first protocol document includes at least one of the following: a protocol channel address, a protocol data format, a protocol data packet format, a protocol data function table, and a Bluetooth connection rule.
4. The method according to claim 3, characterized in that The converting the first protocol document into the first protocol conversion rule comprises: Convert the protocol channel address into a configuration file; Splitting the first protocol document according to the data structure of the preset general protocol; A function table is generated for the first protocol document.
5. The method according to claim 1, characterized in that After converting the first data into second data conforming to a preset universal protocol, the method further includes: Based on the first protocol conversion rule and the first data, consistency between the second data and the first data is determined.
6. The method according to claim 5, characterized in that The determining, based on the first protocol conversion rule and the first data, the consistency of the second data and the first data includes: receiving the first protocol conversion rule; Parsing the first protocol conversion rule to obtain a protocol channel address, a protocol data format, a protocol data packet format, a protocol data function table and a Bluetooth connection rule; Determining whether the second data complies with the parsed rule; When the second data meets the rule obtained by parsing, it is determined that the second data meets the consistency requirement with the first data.
7. The method according to claim 5, characterized in that After determining the consistency between the second data and the first data, the method further includes: The first protocol conversion rule is updated based on data consistency between the plurality of second data and the corresponding first data.
8. A data transmission device, characterized in that: The device comprises: A receiving module, configured to receive first data conforming to a first transmission protocol, wherein the first transmission protocol is one of a plurality of preset transmission protocols; a conversion module, configured to convert the first data into second data conforming to a preset universal protocol based on a pre-configured first protocol conversion rule corresponding to the first transmission protocol, wherein the second data is used to represent a functional instruction of the first data; The sending module is used to send the second data.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the data transmission method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data transmission method according to any one of claims 1 to 7.