Protocol conversion method and device, equipment and storage medium

By introducing the protocol conversion method and device in the mineral system, the mineral system protocol is converted to the 103 protocol, and the 103 protocol is converted into the mineral system protocol to solve the problem of incompatibility between the agreement between the mineral system and the 103 protocol equipment. It realizes the compatibility and interoperability of the system and reduces maintenance costs.

CN119383238APending Publication Date: 2025-01-28HONGHU WANLIAN (JIANGSU) TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411498199.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

When the Minhong system communicates with a device using the 103 protocol, the data cannot be accurately transmitted, communication interrupts or delayed due to incompatibility, which affects information sharing and communication efficiency. The solution requires large-scale transformation or replacement of existing equipment. , increasing maintenance costs.

Method used

Provide a protocol conversion method and device that can convert the mineral system protocol to the 103 protocol, and convert the 103 protocol into the mineral system protocol, so as to realize the mutual conversion between the two, break the barrier barrier, realize the system compatibility of the system, realize the compatibility of the system And interoperability.

Benefits of technology

Through the conversion of the agreement, data errors and communication interruptions caused by the failure of the agreement have enhanced the stability and reliability of the system, reducing the cost of system upgrades and maintenance, and no large -scale transformation of existing equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119383238A_ABST
    Figure CN119383238A_ABST
Patent Text Reader

Abstract

The invention discloses a protocol conversion method, device and equipment and a storage medium, which are applied to a red-in-mine system and comprise the following steps: establishing a communication link with target equipment; acquiring a first system message of the application end, converting the first system message into a first 103 protocol message, and sending the first 103 protocol message to the target device based on the communication link; and obtaining a second 103 protocol message of the target device based on the communication link, converting the second 103 protocol message into a second system message, and sending the second system message to the application end. Through protocol conversion, the red-mine system can communicate with the target equipment adopting the 103 protocol, so that the protocol barrier between different systems is broken, the compatibility and interoperability of the systems are realized, data errors and communication interruption caused by protocol mismatching are reduced, and the stability and reliability of the operation of the whole system are enhanced. Hardware or software modification does not need to be carried out on an existing application end and equipment, and the system upgrading and maintenance cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data transmission, and in particular to a protocol conversion method, device, equipment and storage medium. Background Art

[0002] In the application practice of Kuanghong system, we often face the interaction with various devices. In the process of data transmission, different manufacturers often formulate different application layer communication protocols for different production scenarios. For example, in the substation automation system, the standard IDT.IEC60870-5-103 (referred to as 103 protocol) has become an indispensable bridge for the exchange of information between various devices and background systems.

[0003] At present, when the Kuanghong system needs to communicate with equipment using the 103 protocol, due to protocol incompatibility, problems such as inaccurate data transmission, communication interruption or delay often occur, which makes information sharing between different systems difficult and affects the overall communication efficiency. In order to solve the problem of protocol incompatibility, it may be necessary to carry out large-scale transformation or replacement of existing equipment, which increases the cost of equipment maintenance. Summary of the invention

[0004] The present invention provides a protocol conversion method, device, equipment and storage medium to achieve mutual conversion between 103 protocol and mining system protocol.

[0005] According to one aspect of the present invention, there is provided a protocol conversion method, which is applied to a mining system, and the method comprises: establishing a communication link with a target device;

[0006] Acquire a first system message from the application end, convert the first system message into a first 103 protocol message, and send the first 103 protocol message to the target device based on the communication link;

[0007] A second 103 protocol message of the target device is acquired based on the communication link, the second 103 protocol message is converted into a second system message, and the second system message is sent to the application end.

[0008] Optionally, establishing a communication link with the target device includes: establishing a communication channel with the target device, and sending its own node identification to the target device based on the communication channel; and determining to establish a communication link with the target device after receiving a response message from the target device.

[0009] Optionally, converting the first system message into a first 103 protocol message includes: reading the instance number of the first system message, and determining a first data type corresponding to the first system message according to the instance number; determining a target data encapsulation function pointer corresponding to the first data type; encapsulating the first system message through the target data encapsulation function pointer to generate a first encapsulation message; obtaining a preset 103 application layer message header, and adding the preset 103 application layer message header to the first encapsulation message to generate a first 103 protocol message.

[0010] Optionally, determining a target data encapsulation function pointer corresponding to a first data type includes: obtaining a data encapsulation list, wherein the data encapsulation list includes data encapsulation function pointers corresponding to each data type; matching the first data type through the data encapsulation list to determine a target data encapsulation function pointer corresponding to the first data type.

[0011] Optionally, before converting the second 103 protocol message into the second system message, the method also includes: performing integrity and legality verification on the second 103 protocol message, and determining the verification result; judging whether the verification result is normal, and if so, converting the second 103 protocol message into the second system message; otherwise, generating a prompt message according to the verification result.

[0012] Optionally, converting the second 103 protocol message into a second system message includes: determining target data and target data parsing rules corresponding to the second 103 protocol message; parsing the target data based on the target data parsing rules to generate parsed data; obtaining a group number identifier, and serializing the parsed data according to the group number identifier to generate a second system message.

[0013] Optionally, determining target data and target data parsing rules corresponding to the second 103 protocol message includes: determining the message type and second data type of the second 103 protocol message by specifying fields; obtaining target data based on the message type, wherein the target data includes an information sequence number, a data set number, and a return information identifier; obtaining a data parsing list, wherein the data parsing list includes data parsing rules corresponding to each data type; matching the second data type through the data parsing rules to obtain target data parsing rules corresponding to the second data type.

[0014] According to another aspect of the present invention, a protocol conversion device is provided, which is applied to a mining system, and the device comprises:

[0015] A communication link establishing module, used to establish a communication link with a target device;

[0016] A control direction protocol conversion module, used for acquiring a first system message from an application end, converting the first system message into a first 103 protocol message, and sending the first 103 protocol message to a target device based on a communication link;

[0017] The monitoring direction protocol conversion module is used to obtain the second 103 protocol message of the target device based on the communication link, convert the second 103 protocol message into a second system message, and send the second system message to the application end.

[0018] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0019] at least one processor;

[0020] and a memory communicatively coupled to the at least one processor;

[0021] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a protocol conversion method described in any embodiment of the present invention.

[0022] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a protocol conversion method described in any embodiment of the present invention when executed.

[0023] The technical solution of the embodiment of the present invention enables the Kuanghong system to communicate with the target device using the 103 protocol through protocol conversion, breaking the protocol barriers between different systems, achieving system compatibility and interoperability, reducing data errors and communication interruptions caused by protocol mismatch, and enhancing the stability and reliability of the entire system operation. There is no need for large-scale hardware or software modifications to existing applications and devices, reducing the cost of system upgrades and maintenance.

[0024] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0026] Figure 1 is a flowchart of a protocol conversion method provided according to Embodiment 1 of the present invention;

[0027] Figure 2 is a flowchart of another protocol conversion method provided according to Embodiment 2 of the present invention;

[0028] Figure 3 is a schematic diagram of the structure of a protocol conversion device provided according to Embodiment 3 of the present invention;

[0029] Figure 4 The present invention is a schematic diagram of the structure of an electronic device for implementing a protocol conversion method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme 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 only 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 ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] Embodiment 1

[0033] Figure 1 A flowchart of a protocol conversion method is provided for the first embodiment of the present invention. This embodiment is applicable to the scenario of mutual conversion between the 103 protocol and the mining system protocol. The method can be executed by a protocol conversion device, which can be implemented in the form of hardware and / or software. The protocol conversion device can be configured in a computer controller installed with the mining system. Figure 1 As shown, the method includes:

[0034] S110: Establish a communication link with the target device.

[0035] The target device refers to the device that the controller needs to communicate and exchange data with. The communication link refers to the communication channel that connects two or more devices, which is responsible for transmitting data signals and ensuring reliable communication between devices.

[0036] Specifically, the establishment of a communication link is the basis for data transmission. The communication link can be established through a wired connection (such as Ethernet) or a wireless connection (such as Wi-Fi, Bluetooth, etc.). The specific establishment method depends on the type of target device and the available communication interface. For example, if the connection is through Ethernet, network parameters such as IP address, subnet mask and gateway may need to be configured to ensure that the device can be correctly identified and communicate in the network.

[0037] Optionally, establishing a communication link with the target device includes: establishing a communication channel with the target device, and sending its own node identification to the target device based on the communication channel; and determining to establish a communication link with the target device after receiving a response message from the target device.

[0038] Specifically, the controller can establish a virtual TCP link with each device to provide a transmission channel, and then create a UDP SOCKET on both the local server and device sides as a search socket for dynamically binding online IP addresses. The UDP port number is unified as 0X408, and the IP address uses a Class B network address (consistent with the factory network).

[0039] Furthermore, after establishing the communication channel, the local server can send its own node identifier to the target device through the communication channel. After receiving the node identifier of the sender, the target device will process it according to the communication protocol and send a response message. The response message indicates that the target device has received the request of the sender and is ready to establish a communication link. After receiving the response message from the target device, the local server determines whether the communication link is successfully established based on the content of the response message. If the response message meets expectations, it indicates that the communication link has been established and subsequent data transmission and communication operations can be performed. If the response message does not meet expectations, it may be necessary to resend the node identifier or take other measures to establish the communication link.

[0040] S120: Acquire a first system message from the application end, convert the first system message into a first 103 protocol message, and send the first 103 protocol message to a target device based on a communication link.

[0041] The application end refers to a running application program, and the first system message may be a JSON (JavaScript Object Notation) message, which is a lightweight data exchange format. The 103 protocol refers to the standard IDT.IEC60870-5-103 protocol in the substation automation system.

[0042] Specifically, the controller can obtain the first system message of the application end through AP call, message queue or direct network communication, etc. The controller refers to a computer controller that performs protocol conversion. The protocol conversion process needs to be mapped and encoded according to the structure of the system message and the specification of the 103 protocol.

[0043] Optionally, converting the first system message into a first 103 protocol message includes: reading the instance number of the first system message, and determining a first data type corresponding to the first system message according to the instance number; determining a target data encapsulation function pointer corresponding to the first data type; encapsulating the first system message through the target data encapsulation function pointer to generate a first encapsulation message; obtaining a preset 103 application layer message header, and adding the preset 103 application layer message header to the first encapsulation message to generate a first 103 protocol message.

[0044] A JSON message is usually composed of a key-value pair, which may contain one or more fields for representing different data information. The instance number can be used as one of the specific fields to uniquely identify the data type represented by the JSON message.

[0045] Specifically, through programming means, a specific JSON parsing library or tool can be used to read the instance number field in the JSON message. According to predefined rules or mapping tables, the controller can match the read instance number with a known data type to determine the first data type corresponding to the first JSON message, including remote control switch, electronic sign, system operation, fixed value operation, pressure plate operation, call history report, etc.

[0046] Among them, the function pointer is a variable that stores the address of the function. In the program, a specific function can be called through the function pointer. For different data types, different encapsulation methods may be required to convert them into specific protocol messages. According to the data type of the first JSON message, the corresponding target data encapsulation function pointer can be found from the pre-defined function pointer list.

[0047] Furthermore, the target data encapsulation function pointer can be used to call the corresponding encapsulation function. The first JSON message is passed as a parameter to the encapsulation function. The encapsulation function encapsulates the first JSON message according to specific data types and protocol requirements to generate a first encapsulation message. It should be noted that the 103 protocol usually has a specific message format, in which the application layer message header contains some protocol-related information, such as message type identifier, variable structure qualifiers, transmission reasons, etc. The controller can add the acquired preset 103 application layer message header to the beginning of the first encapsulation message. After adding the message header, the first encapsulation message becomes the first 103 protocol message that conforms to the 103 protocol format.

[0048] Optionally, determining a target data encapsulation function pointer corresponding to a first data type includes: obtaining a data encapsulation list, wherein the data encapsulation list includes data encapsulation function pointers corresponding to each data type; matching the first data type through the data encapsulation list to determine a target data encapsulation function pointer corresponding to the first data type.

[0049] It should be noted that in data communication, different data types usually need to be encapsulated in a specific format so that they can be transmitted in the network or processed by a specific device or system. Data encapsulation is to package the original data according to certain rules and formats, add necessary header information, checksums, etc., so that it meets the requirements of specific communication protocols or data formats.

[0050] The data encapsulation list is a list that stores various data types and corresponding data encapsulation function pointers. When different types of data need to be converted into a message in a specific format, the appropriate encapsulation function can be found by querying the data encapsulation list.

[0051] Specifically, when the first system message needs to be converted into the first 103 protocol message, the first data type of the first system message is first determined. Then, the data encapsulation list is traversed, and the first data type is compared with each data type in the list to determine the target data encapsulation function pointer corresponding to the first data type.

[0052] S130. Acquire a second 103 protocol message of the target device based on the communication link, convert the second 103 protocol message into a second system message, and send the second system message to the application end.

[0053] Specifically, by continuously monitoring the communication link, the 103 protocol message sent by the target device can be obtained. In contrast to the process of converting the system JSON message into the 103 protocol message, the message content is parsed according to the specification of the 103 protocol and converted into a data structure in JSON format.

[0054] Optionally, before converting the second 103 protocol message into the second system message, the method also includes: performing integrity and legality verification on the second 103 protocol message, and determining the verification result; judging whether the verification result is normal, and if so, converting the second 103 protocol message into the second system message; otherwise, generating a prompt message according to the verification result.

[0055] Among them, the purpose of the integrity check is to ensure that the received second 103 protocol message is not damaged or part of the data is lost during the transmission process. The integrity check can use a cyclic redundancy check (CRC), a checksum, etc. Taking CRC as an example, before sending the message, the sender calculates the CRC value of the message according to a specific algorithm, and attaches it to the back of the message and sends it together. After receiving the message, the receiver also uses the same algorithm to calculate the message to obtain a new CRC value. Then compare this new CRC value with the received CRC value. If the two are consistent, it means that the message has not been damaged during the transmission process and the integrity check passes.

[0056] Specifically, the legitimacy check mainly checks whether the message complies with the specifications and requirements of the 103 protocol. This includes checking the format of the message, the range of field values, the setting of specific flag bits, etc. For example, the 103 protocol may stipulate that the message must contain specific fields, and the values ​​of these fields must be within a certain range. The receiver can parse the message according to the protocol specification to check whether each field meets the requirements. If any non-compliance is found, the legitimacy check fails. Finally, the controller can determine whether the check is normal based on the results of the integrity and legitimacy checks. If both the integrity and legitimacy checks pass, the check result is a normal check; if any of the checks fail, the check result is an abnormal check. If the check result is a normal check, the second 103 protocol message can be converted into a second JSON message.

[0057] Furthermore, if the verification result is a verification abnormality, a prompt message needs to be generated so that the user or system administrator can understand the problem and take corresponding measures. The prompt message can be generated according to the specific situation of the verification result. For example, if the integrity check fails, a prompt message of "message integrity check failed, please check data transmission" can be generated; if the legitimacy check fails, a prompt message of "message legitimacy check failed, please check the message format or field value" can be generated.

[0058] The technical solution of the embodiment of the present invention enables the Kuanghong system to communicate with the target device using the 103 protocol through protocol conversion, breaking the protocol barriers between different systems, achieving system compatibility and interoperability, reducing data errors and communication interruptions caused by protocol mismatch, and enhancing the stability and reliability of the entire system operation. There is no need for large-scale hardware or software modifications to existing applications and devices, reducing the cost of system upgrades and maintenance.

[0059] Embodiment 2

[0060] Figure 2This is a flowchart of a protocol conversion method provided in the second embodiment of the present invention. This embodiment adds a specific process of converting the second 103 protocol message into the second system message on the basis of the above-mentioned first embodiment. Among them, the specific contents of steps S210-S220 are roughly the same as steps S110-S120 in the first embodiment, so they will not be repeated in this embodiment. Figure 2 As shown, the method includes:

[0061] S210: Establish a communication link with the target device.

[0062] Optionally, establishing a communication link with the target device includes: establishing a communication channel with the target device, and sending its own node identification to the target device based on the communication channel; and determining to establish a communication link with the target device after receiving a response message from the target device.

[0063] S220, obtaining a first system message from the application end, converting the first system message into a first 103 protocol message, and sending the first 103 protocol message to the target device based on the communication link.

[0064] Optionally, converting the first system message into a first 103 protocol message includes: reading the instance number of the first system message, and determining a first data type corresponding to the first system message according to the instance number; determining a target data encapsulation function pointer corresponding to the first data type; encapsulating the first system message through the target data encapsulation function pointer to generate a first encapsulation message; obtaining a preset 103 application layer message header, and adding the preset 103 application layer message header to the first encapsulation message to generate a first 103 protocol message.

[0065] Optionally, determining a target data encapsulation function pointer corresponding to a first data type includes: obtaining a data encapsulation list, wherein the data encapsulation list includes data encapsulation function pointers corresponding to each data type; matching the first data type through the data encapsulation list to determine a target data encapsulation function pointer corresponding to the first data type.

[0066] S230. Acquire a second 103 protocol message of the target device based on the communication link.

[0067] Optionally, before converting the second 103 protocol message into the second system message, the method also includes: performing integrity and legality verification on the second 103 protocol message, and determining the verification result; judging whether the verification result is normal, and if so, converting the second 103 protocol message into the second system message; otherwise, generating a prompt message according to the verification result.

[0068] S240. Determine the target data and target data parsing rules corresponding to the second 103 protocol message.

[0069] Optionally, determining target data and target data parsing rules corresponding to the second 103 protocol message includes: determining the message type and second data type of the second 103 protocol message by specifying fields; obtaining target data based on the message type, wherein the target data includes an information sequence number, a data set number, and a return information identifier; obtaining a data parsing list, wherein the data parsing list includes data parsing rules corresponding to each data type; matching the second data type through the data parsing rules to obtain target data parsing rules corresponding to the second data type.

[0070] Specifically, by reading a specific field in the second 103 protocol message, the type of the message can be determined. For example, the value of a specific byte or a group of bytes may represent different message types, such as a request message, a response message, a confirmation message, etc. Different types of messages may carry different target data. For example, a request message may contain a requested information sequence number, and a response message may contain a data set number and a return information identifier, etc. According to the message type, it can be determined which target data needs to be extracted from the message. Similarly, by reading another specified field, the type of data carried in the message can be determined. Data types may include ASCII 8-bit code, integer, floating point number, IEEE standard 754 short real number, double point information, measured value with quality description, binary time, double point information with time stamp, data structure, complex number, double point information with time stamp, BCD code, etc.

[0071] The message sequence number can be used to identify a specific request or response. The number of data sets indicates the number of data sets contained in the message. The return information identifier can be used to indicate the status or result of the message. For example, a successful response message may have a specific return information identifier, while an error response message may have another identifier. The return information identifier can be obtained by reading the relevant fields in the message.

[0072] Specifically, the data parsing list is a list that stores various data types and corresponding data parsing rules. When different types of data need to be parsed, the appropriate parsing rules can be found by querying the data parsing list. After the second data type is determined, the target data parsing rule corresponding to the second data type can be found from the data parsing list by traversing the data parsing list.

[0073] S250: Parse the target data based on the target data parsing rule to generate parsed data.

[0074] S260: Obtain a group number identifier, perform data serialization processing on the parsed data according to the group number identifier to generate a second system message, and send the second system message to the application end.

[0075] The group number identifier may be a designated field or a flag bit used to distinguish different types of data or data groups. Data serialization is the process of converting parsed data into a format that can be transmitted and stored between different systems. In this embodiment, the parsed data is serialized into JSON format.

[0076] The technical solution of the embodiment of the present invention enables the Kuanghong system to communicate with the target device using the 103 protocol through protocol conversion, breaking the protocol barriers between different systems, achieving system compatibility and interoperability, reducing data errors and communication interruptions caused by protocol mismatch, and enhancing the stability and reliability of the entire system operation. There is no need for large-scale hardware or software modifications to existing applications and devices, reducing the cost of system upgrades and maintenance.

[0077] Embodiment 3

[0078] Figure 3 This is a schematic diagram of the structure of a protocol conversion device provided in Embodiment 3 of the present invention. Figure 3 As shown, the apparatus includes: a communication link establishing module 310, for establishing a communication link with a target device;

[0079] A control direction protocol conversion module 320, configured to obtain a first system message from an application end, convert the first system message into a first 103 protocol message, and send the first 103 protocol message to a target device based on a communication link;

[0080] The monitoring direction protocol conversion module 330 is used to obtain the second 103 protocol message of the target device based on the communication link, convert the second 103 protocol message into a second system message, and send the second system message to the application end.

[0081] Optionally, the communication link establishing module 310 is specifically used to: establish a communication channel with the target device, and send its own node identification to the target device based on the communication channel; after receiving a response message from the target device, determine to establish a communication link with the target device.

[0082] Optionally, the control direction protocol conversion module 320 specifically includes: a 103 protocol message conversion unit, which is used to: read the instance number of the first system message, and determine the first data type corresponding to the first system message according to the instance number; determine the target data encapsulation function pointer corresponding to the first data type; encapsulate the first system message through the target data encapsulation function pointer to generate a first encapsulation message; obtain a preset 103 application layer message header, and add the preset 103 application layer message header to the first encapsulation message to generate a first 103 protocol message.

[0083] Optionally, the 103 protocol message conversion unit specifically includes: a target data encapsulation function pointer subunit, used to: obtain a data encapsulation list, wherein the data encapsulation list includes data encapsulation function pointers corresponding to each data type; match the first data type through the data encapsulation list to determine the target data encapsulation function pointer corresponding to the first data type.

[0084] Optionally, the device also includes: a message verification module, which is used to perform integrity and legality verification on the second 103 protocol message before converting the second 103 protocol message into the second system message, and determine the verification result; determine whether the verification result is normal, and if so, convert the second 103 protocol message into the second system message; otherwise, generate a prompt message according to the verification result.

[0085] Optionally, the monitoring direction protocol conversion module 330 specifically includes: a system protocol message conversion unit, used to: determine the target data and target data parsing rules corresponding to the second 103 protocol message; parse the target data based on the target data parsing rules to generate parsed data; obtain a group number identifier, and serialize the parsed data according to the group number identifier to generate a second system message.

[0086] Optionally, the system protocol message conversion unit specifically includes: a target data and parsing rule determination subunit, used to: determine the message type and second data type of the second 103 protocol message by specifying a field; obtain target data based on the message type, wherein the target data includes an information sequence number, a data set number, and a return information identifier; obtain a data parsing list, wherein the data parsing list includes data parsing rules corresponding to each data type; match the second data type through the data parsing rules to obtain target data parsing rules corresponding to the second data type.

[0087] The technical solution of the embodiment of the present invention enables the Kuanghong system to communicate with the target device using the 103 protocol through protocol conversion, breaking the protocol barriers between different systems, achieving system compatibility and interoperability, reducing data errors and communication interruptions caused by protocol mismatch, and enhancing the stability and reliability of the entire system operation. There is no need for large-scale hardware or software modifications to existing applications and devices, reducing the cost of system upgrades and maintenance.

[0088] A protocol conversion device provided in an embodiment of the present invention can execute a protocol conversion method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

[0089] Embodiment 4

[0090] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0091] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0092] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0093] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a protocol conversion method.

[0094] In some embodiments, a protocol conversion method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of a protocol conversion method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform a protocol conversion method in any other appropriate manner (e.g., by means of firmware).

[0095] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0096] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0097] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0098] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0099] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0100] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0101] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0102] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A protocol conversion method, applied to a mining system, characterized in that: include: Establishing a communication link with the target device; Acquire a first system message from the application end, convert the first system message into a first 103 protocol message, and send the first 103 protocol message to the target device based on the communication link; A second 103 protocol message of the target device is acquired based on the communication link, the second 103 protocol message is converted into a second system message, and the second system message is sent to the application end.

2. The method according to claim 1, characterized in that The establishing of a communication link with the target device comprises: Establishing a communication channel with a target device, and sending its own node identification to the target device based on the communication channel; After receiving the response message from the target device, it is determined to establish a communication link with the target device.

3. The method according to claim 1, characterized in that The converting the first system message into a first 103 protocol message includes: Reading an instance number of the first system message, and determining a first data type corresponding to the first system message according to the instance number; Determine a target data encapsulation function pointer corresponding to the first data type; Encapsulating the first system message through the target data encapsulation function pointer to generate a first encapsulation message; Obtain a preset 103 application layer message header, and add the preset 103 application layer message header to the first encapsulation message to generate the first 103 protocol message.

4. The method according to claim 3, characterized in that The determining of a target data encapsulation function pointer corresponding to the first data type includes: Obtaining a data encapsulation list, wherein the data encapsulation list includes data encapsulation function pointers corresponding to each data type; The first data type is matched through the data encapsulation list to determine a target data encapsulation function pointer corresponding to the first data type.

5. The method according to claim 1, characterized in that Before converting the second 103 protocol message into a second system message, the method further includes: Performing integrity and legality verification on the second 103 protocol message, and determining the verification result; Determine whether the verification result is normal, and if so, convert the second 103 protocol message into a second system message; Otherwise, a prompt message is generated according to the verification result.

6. The method according to claim 1, characterized in that The converting the second 103 protocol message into a second system message includes: Determine the target data and target data parsing rule corresponding to the second 103 protocol message; Parsing the target data based on the target data parsing rule to generate parsed data; A group number identifier is obtained, and data serialization processing is performed on the parsed data according to the group number identifier to generate a second system message.

7. The method according to claim 6, characterized in that The determining of the target data and the target data parsing rule corresponding to the second 103 protocol message includes: Determine the message type and the second data type of the second 103 protocol message by specifying a field; Acquire target data based on the message type, wherein the target data includes a message sequence number, a data set number, and a return message identifier; Obtaining a data analysis list, wherein the data analysis list includes data analysis rules corresponding to each data type; The second data type is matched through the data parsing rule to obtain a target data parsing rule corresponding to the second data type.

8. A protocol conversion device, applied to a mining system, characterized in that: include: A communication link establishing module, used to establish a communication link with a target device; A control direction protocol conversion module, used for acquiring a first system message from an application end, converting the first system message into a first 103 protocol message, and sending the first 103 protocol message to a target device based on the communication link; The monitoring direction protocol conversion module is used to obtain the second 103 protocol message of the target device based on the communication link, convert the second 103 protocol message into a second system message, and send the second system message to the application end.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method according to any one of claims 1 to 7 when executed.