Data processing method, data processing device and equipment
By obtaining the protocol packet analysis in the SCADA system and automatically determining the target interface, the problem of slow protocol stack development speed and unstable system when new devices are added is solved, and more efficient protocol development and more stable system operation is achieved.
Patent Information
- Application Number
- CN202211704538.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2042-12-29
AI Technical Summary
In the SCADA system, when adding new devices for data acquisition and control, it is necessary to independently develop the software and hardware interfaces corresponding to each device, resulting in slow development of the protocol stack and unstable system.
By obtaining the packet analysis of the protocol, the target interface (software and hardware interface) is automatically determined, so that there is no need to manually select the software and hardware interface during the protocol development, which improves the development speed and system stability.
This method reduces the instability of determining the target interface in specification development, improves the stability of the system, and improves the development speed of the protocol stack.
Smart Images

Figure CN115866104B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a data processing method, a data processing device, and a device. Background Art
[0002] With people's continuous pursuit of a safer, more energy-efficient, and more efficient power usage environment, the power management industry has emerged and developed into a new industry. Power management has become one of the fastest-growing industries in the electrical instrument and meter industry. In a power management system, the supervisory control and data acquisition (SCADA) system is the most widely used system, and this SCADA system is also the most mature in technology.
[0003] Currently, in a SCADA system, if new devices need to be added for data collection and control, since different devices can correspond to different software and hardware interfaces, it is necessary to independently develop the protocol for each device in the protocol stack development, determine the corresponding software and hardware interfaces of the devices, so that the newly added devices can communicate with the hardware layer and the communication layer in the SCADA system. That is, in a SCADA system, on the one hand, when developing the protocol stack, it is necessary to consider the communication problems of the software and hardware interfaces of each device, resulting in a low speed of protocol stack development; on the other hand, when developing the software and hardware interfaces in the protocol for each device, the most suitable software and hardware interfaces cannot be selected, resulting in the instability of the SCADA system. Summary of the Invention
[0004] In view of the above technical problems, this application provides a data processing method, a data processing device, and a device, which can improve the development speed of software protocols and the stability of software.
[0005] In a first aspect, an embodiment of this application provides a data processing method, and the data processing method includes: obtaining a message parsing of a protocol; the message parsing of the protocol is used to indicate the regulations that the devices in the protocol need to comply with; determining a target interface corresponding to the message parsing for communication; and performing communication according to the target interface.
[0006] It can be seen that in this method, only by obtaining the message parsing of the protocol, the target interface (software and hardware interface) corresponding to the message parsing of the protocol can be determined for communication, without obtaining the content of the software and hardware interface (target interface) of the protocol, reducing the instability of determining the target interface during protocol development, and thus improving the stability of the system. At the same time, when developing the protocol, there is no need to develop the software and hardware interface (target interface) of the protocol, improving the development speed of the protocol (that is, improving the development speed of the protocol stack).
[0007] In an alternative embodiment, determining the target interface corresponding to the message parsing communication includes: determining the hardware interface corresponding to the message parsing communication and determining the software communication interface corresponding to the message parsing communication; the hardware interface is used to indicate the physical interface of the device in the protocol, and the software communication interface is used to indicate the communication protocol interface used by the device in the protocol for communication; communicating according to the target interface includes: communicating according to the hardware interface and the software communication interface.
[0008] It can be seen that in this embodiment, the hardware interface and the software communication interface can be automatically determined for the message parsing corresponding communication, without having to determine the hardware interface and the software interface of the protocol during protocol development, which improves the development speed of the protocol and the stability of the software.
[0009] In an alternative embodiment, determining the hardware interface corresponding to the message parsing communication includes: determining the hardware interface corresponding to the message parsing communication according to the hardware operating parameters corresponding to the message parsing communication and the usage of the hardware interface corresponding to the communication.
[0010] In an alternative embodiment, the physical interface includes a serial communication interface and a network interface; the software communication interface includes a Transmission Control Protocol (TCP) interface, a User Datagram Protocol (UDP) interface, a Generic Object Oriented Substation Event (GOOSE) interface, and a Message Queuing Telemetry Transport (MQTT) interface.
[0011] In a second aspect, an embodiment of the present application provides a data processing device, which includes:
[0012] An acquisition module, configured to acquire the message parsing of the protocol; the message parsing of the protocol is used to indicate the regulations that the device in the protocol needs to comply with;
[0013] A determination module, configured to determine the target interface corresponding to the message parsing communication;
[0014] A communication module, configured to communicate according to the target interface.
[0015] In an alternative embodiment, when the determination module determines the target interface corresponding to the message parsing communication, it specifically is: determining the hardware interface corresponding to the message parsing communication and determining the software communication interface corresponding to the message parsing communication; the hardware interface is used to indicate the physical interface of the device in the protocol, and the software communication interface is used to indicate the communication protocol interface used by the device in the protocol for communication; when the communication module communicates according to the target interface, it specifically is: communicating according to the hardware interface and the software communication interface.
[0016] In an alternative embodiment, when the determination module determines the hardware interface corresponding to the message parsing communication, it specifically is: determining the hardware interface corresponding to the message parsing communication according to the hardware operating parameters corresponding to the message parsing communication and the usage of the hardware interface corresponding to the communication.
[0017] In an alternative embodiment, the physical interface includes a serial communication interface and a network interface; the software communication interface includes a Transmission Control Protocol (TCP) interface, a User Datagram Protocol (UDP) interface, a Generic Object Oriented Substation Event (GOOSE) interface, and a Message Queuing Telemetry Transport (MQTT) interface.
[0018] In a third aspect, an embodiment of the present application provides a computer device, including: a processor, a communication interface, and a memory, where the processor, the communication interface, and the memory are interconnected. Among them, the memory stores executable program code, and the processor is configured to call the executable program code to execute the method provided by the embodiment of the present application.
[0019] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed by a processor, the method provided by the embodiment of the present application is implemented.
[0020] Correspondingly, an embodiment of the present application further provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a terminal device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the terminal device executes the method provided by the embodiment of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0022] Figure 1 is a schematic structural diagram of a software architecture 100 of a protocol stack;
[0023] Figure 2 is a schematic structural diagram of a software architecture 200 of a protocol stack provided by an embodiment of the present application;
[0024] Figure 3 is a schematic flowchart of a data processing method provided by an embodiment of the present application;
[0025] Figure 4 is a schematic diagram of a data processing device provided by an embodiment of the present application;
[0026] Figure 5It is a schematic structural diagram of a computer device provided by an embodiment of the present application. Detailed implementation manners
[0027] Next, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0028] Please refer to Figure 1 , which is a schematic structural diagram of a software architecture 100 of a protocol stack. Those skilled in the art can understand that Figure 1 the software architecture 100 of the protocol stack shown in does not constitute a limitation. The software architecture of the protocol stack may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements. The software architecture of the protocol stack includes a specification layer 101, a hardware layer 102, and a communication layer 103.
[0029] Among them, the specification layer 101 is used to write the message parsing of the specification and the software and hardware interfaces corresponding to the message parsing for communication; the message parsing of the specification is used to indicate the regulations that the devices in the specification need to comply with; the software and hardware interfaces are used to indicate the physical interfaces and communication protocols required for communication. The hardware layer 102 is used to provide the physical interfaces of various devices, and the communication layer 103 is used to provide various software communication interfaces.
[0030] It can be seen that the specifications in the specification layer all need to determine the software and hardware interfaces corresponding to the communication. That is, when developing the specification, it is necessary to consider the issues of the software and hardware interfaces corresponding to the communication of the specification, resulting in slow development speed of the specification and poor software stability.
[0031] The embodiment of the present application provides a data processing method. Only by obtaining the message parsing of the specification can the target interfaces (software and hardware interfaces) be determined for the communication corresponding to the message parsing of the specification, without obtaining the content of the software and hardware interfaces (target interfaces) of the specification, reducing the instability caused by determining the target interfaces during the development of the specification, and thus improving the stability of the system. At the same time, when developing the specification, there is no need to develop the software and hardware interfaces (target interfaces) of the specification, improving the development speed of the specification (that is, improving the development speed of the protocol stack).
[0032] For ease of understanding, first, a software architecture of a protocol stack to which the data processing method provided by the embodiment of the present application may apply will be introduced. It should be noted that the present application does not limit the structure of the software architecture of the protocol stack to which the data processing method applies. Refer to Figure 2 , which is a schematic structural diagram of a software architecture 200 of a protocol stack provided by the present application. The software architecture 200 of the protocol stack is the same asFigure 1 Compared with the software architecture 100 of the protocol stack shown, in addition to including a specification layer 201, a hardware layer 204, and a communication layer 205, it also includes an interface layer 202 and a mapping layer 203.
[0033] Among them, the specification layer 201 is used for parsing the messages of the specification; the parsing of the messages of the specification is used to indicate the regulations that the devices in the specification need to comply with; the interface layer 202 is used to provide a unified application programming interface for the specification layer 201 to achieve communication with the specification layer 201; the mapping layer 203 is used to map the software communication interfaces in the communication layer 205 and the physical interfaces in the hardware layer 204 to the interface layer 202 to achieve the interoperability between the interface layer 202 and the communication layer 205 and the hardware layer 204; the communication layer 205 is used to provide various software communication interfaces; the hardware layer 204 is used to provide the physical interfaces of various devices.
[0034] The specifications in the specification layer can be the Modbus Remote Terminal Unit (Modbus RTU), the Modbus Transmission Control Protocol (Modbus TCP), IEC 104, DL645, CJ188, and the Cloud Message Queuing Telemetry Transport (Cloud MQTT).
[0035] It should be noted that the specifications in the specification layer are all developed based on the unified application programming interface of the interface layer.
[0036] It can be seen that in this software architecture, through the mapping layer 203, the software communication interfaces in the communication layer 205 and the physical interfaces in the hardware layer 204 are mapped to the interface layer 202, and the interface layer 202 provides a unified application programming interface for the specification layer 201. On the one hand, when the specifications in the specification layer 201 are developed based on the unified application programming interface, there is no need to consider the issues of software and hardware interfaces (software communication interfaces and physical interfaces), which improves the development speed of the specifications (that is, improves the development speed of the protocol stack); on the other hand, in this application, various software and hardware interfaces can be selected through the mapping layer 203, and there is no need to consider the issues of software and hardware interfaces during the specification development, avoiding the problem of unstable corresponding software caused by manual selection of software and hardware interfaces, making the software or system (SCADA system) containing this software architecture more stable.
[0037] In an alternative embodiment, the interface layer 202 includes a virtual hardware interface layer and a virtual software communication interface layer; the virtual hardware interface layer and the virtual software communication interface layer correspond to a unified application programming interface; the mapping layer 203 includes a hardware mapping layer and a communication mapping layer; the mapping layer is used to map the software communication interface in the communication layer and the physical interface in the hardware layer to the interface layer, so as to implement the interaction operation of the interface layer with the communication layer and the hardware layer, including: the hardware mapping layer is used to map the physical interface in the hardware layer to the interface layer to implement the control interaction operation of the virtual hardware interface layer with the hardware layer; the communication mapping layer is used to map the software communication interface in the communication layer to the interface layer to implement the data interaction operation of the virtual software communication interface layer with the communication layer.
[0038] Among them, the control interaction operation of the virtual hardware interface layer with the hardware layer may include opening and closing the hardware interface (physical interface) in the hardware layer 204, setting parameters in the hardware layer, etc. The data interaction operation of the virtual software communication interface layer with the communication layer may include operations such as reading and writing the software communication interface (such as reading and writing various communication protocols) in the communication layer 205.
[0039] It can be seen that in this embodiment, the interfaces in the hardware layer and the communication layer can be mapped to the corresponding virtual interface layers (virtual hardware interface layer and virtual software communication interface layer) in the interface layer through the corresponding mapping layers (hardware mapping layer and communication mapping layer), so that when developing software specifications, there is no need to consider the issues of software and hardware interfaces, which improves the development speed of software specifications and the stability of the software.
[0040] In an alternative embodiment, the virtual hardware layer is used to unify the physical interfaces in the hardware layer and generate a unified application programming interface; the virtual software communication interface layer is used to unify the software communication interfaces in the communication layer and generate a unified application programming interface.
[0041] In an alternative embodiment, the physical interfaces include serial communication interfaces and network interfaces; the software communication interfaces include Transmission Control Protocol (TCP) interfaces, User Datagram Protocol (UDP) interfaces, Generic Object Oriented Substation Event (GOOSE) interfaces, and Message Queuing Telemetry Transport (MQTT) interfaces. For example, the serial communication interfaces include Recommended Standard (RS) 232 interfaces, RS485 interfaces, and Controller Area Network (CAN) interfaces. The network interface refers to the interface connected through a network cable, simply referred to as a network port. It can be understood that the software communication interface refers to the network transmission method. For example, the network transmission method of the TCP interface is TCP.
[0042] It should be noted that the protocols included in the above protocol layer 201, the interfaces included in the hardware mapping layer in the mapping layer 203, the interfaces included in the hardware communication layer in the mapping layer 203, the interfaces included in the hardware layer 204, and the interfaces included in the communication layer 205 are only for corresponding explanations of the situations in the embodiments of the present application, and do not limit them.
[0043] It can be seen that in the software architecture shown in the embodiments of the present application, the protocol layer 201 communicates through a unified application programming interface and the interface layer 202, and the interface layer 202 communicates through the mapping layer 203, the hardware layer 204, and the communication layer 205, making the hardware interfaces corresponding to the protocols in the acquisition and forwarding protocol layer diverse (RS232, RS485, CAN, network port) and the software communication methods diverse (serial port, TCP, UDP, MQTT, HTTP). As a result, the protocols in the protocol layer do not need to consider the issues of software and hardware interfaces, improving the development speed of the protocols and the stability of the software.
[0044] Exemplarily, taking Figure 2 the software architecture 200 of the protocol stack shown (protocol layer, interface layer (virtual hardware interface layer, virtual software communication interface layer), mapping layer (hardware mapping layer, communication mapping layer), hardware layer, and communication layer) as an example to Figure 1 illustrate the beneficial effects of the software architecture (software architecture 200 of the protocol stack) in the embodiments of the present application, taking the protocol in the software architecture 100 of the protocol stack shown (protocol layer, communication layer, and hardware layer) as an example.
[0045] Beneficial effect 1: Using the software architecture in the embodiments of the present application (the software architecture 200 of the protocol stack) can improve the development speed of the protocol.
[0046] When developing a protocol using the software architecture 100 of the protocol stack, while developing the message of each protocol, it is also necessary to set the software and hardware interfaces of each protocol. Taking the example of sending a package from place A to place B, when developing the protocol, it is necessary to determine that the package is to be sent from place A to place B (the message of the protocol), and at the same time, it is necessary to determine the route from place A to place B (the software and hardware interfaces). This route can be water transportation, land transportation, air transportation, and mixed transportation methods (software interfaces), and it is also necessary to consider the starting point and ending point of the transportation method (hardware interfaces). For example, for water transportation, it is necessary to consider at which dock to load the goods and at which dock to unload the goods.
[0047] When developing a protocol using the software architecture 200 of the protocol stack, only the message of each protocol needs to be developed through a unified application programming interface, without considering the problems of the software and hardware interfaces of each protocol. Still taking the example of sending a package from place A to place B, the software architecture 200 of the protocol stack has an interface layer and a mapping layer more than the software architecture 100 of the protocol stack. When developing the protocol, only need to determine that the package is to be sent from place A to place B. Among them, the specific route from place A to place B is planned by the freight company (i.e., the interface layer and the mapping layer), reducing the development process of the software and hardware interfaces during protocol development and improving the development speed of the protocol.
[0048] Beneficial effect 2: Using the software architecture in the embodiments of the present application (the software architecture 200 of the protocol stack) can improve the stability of the software.
[0049] When developing a protocol using the software architecture 100 of the protocol stack, it is necessary to set the software and hardware interfaces of each protocol. Taking the example of sending a package from place A to place B, when developing the protocol, it is necessary to determine that the package is to be sent from place A to place B (the message of the protocol), and at the same time, it is necessary to determine the route from place A to place B (the software and hardware interfaces). This route can be water transportation, land transportation, air transportation, and mixed transportation methods (software interfaces), and it is also necessary to consider the starting point and ending point of the transportation method (hardware interfaces). For example, for water transportation, it is necessary to consider at which dock to load the goods and at which dock to unload the goods. If the route is not selected appropriately, it will prolong the time for the package to reach place B. For example, the best route from place A to place B is to first take water transportation, then air transportation, and finally land transportation, which is recognized. However, the section of the road for land transportation is closed during the time period when the package is being transported. According to the best route, the package will be stalled on the road, prolonging the time for the package to arrive, that is, the time for the package to reach place B is unstable.
[0050] When developing a specification using the software architecture 200 of the protocol stack, only the messages of each specification need to be developed through a unified application programming interface, without considering the software and hardware interfaces of each specification. Taking the example of sending a package from place A to place B, the software architecture 200 of the protocol stack has an additional interface layer and mapping layer compared to the software architecture 100 of the protocol stack. When developing a specification, it is only necessary to determine that the package needs to be sent from place A to place B, without determining the route from place A to place B. Among them, the specific route from place A to place B is planned by the freight company (i.e., the interface layer and mapping layer). For example, it is recognized that the best route from place A to place B is to first go by water, then by air, and finally by land. However, a section of the land route is closed during the package transportation period. When planning the route, the freight company will adjust the entire route and re-select a route from place A to place B to ensure that the arrival time of the package at place B does not vary too much. That is, the stability of the software using the software architecture in the embodiments of the present application is better than that of using the previous software architecture.
[0051] That is to say, compared with Figure 1 the software architecture 100 of the protocol stack shown, Figure 2 the software architecture 200 of the protocol stack shown adds an interface layer 202 (virtual hardware interface layer and virtual software communication interface layer) and a mapping layer 203 (hardware mapping layer and communication mapping layer). Thus, when developing a specification, it is not necessary to consider the software and hardware interface issues, which improves the development speed of the specification and the stability of the software.
[0052] To facilitate the understanding of the embodiments of the present application, the following will elaborate in detail on the specific implementation manners of the above data processing method.
[0053] Please refer to Figure 3 , Figure 3 which is a schematic flowchart of a data processing method provided by an embodiment of the present application. Figure 3 The data processing method shown can be applied to the software architecture of the protocol stack shown above Figure 2 or an electronic device including the software architecture of the protocol stack. The electronic device can be a portable device such as a smart watch, mobile phone, tablet computer, notebook computer, etc., or a household device such as a smart speaker, smart TV, etc., or an unmanned control device such as a drone, driverless car, robot, etc. The present application does not make a limitation. As Figure 3 shown, the data processing method can include but is not limited to the following steps:
[0054] S101. The electronic device obtains the message parsing of the specification.
[0055] Among them, the message parsing of the specification is used to indicate the regulations that the device in the specification needs to comply with.
[0056] In the embodiments of the present application, the electronic device only needs to obtain the message parsing of the protocol, and does not need to obtain the corresponding software and hardware interfaces of the protocol. That is, when developing the protocol, there is no need to consider the problem of the software and hardware interfaces of the protocol. Consequently, the development speed of the protocol is improved.
[0057] S102. The electronic device determines the target interface corresponding to the communication of the message parsing.
[0058] In the embodiments of the present application, after the electronic device obtains the message parsing of the protocol, the electronic device determines the target interface corresponding to the communication of the message parsing. The target interface refers to the interface of the communication method when the electronic device communicates with other devices, such as the physical interfaces (RS232, RS485, CAN, network interface, and Rola) of other devices and / or the communication protocol interfaces (serial port, TCP, UDP, GOOSE, and MQTT) in the network.
[0059] S103. The electronic device communicates according to the target interface.
[0060] In an alternative embodiment, the electronic device determines the target interface of the message parsing, including: the electronic device determines the hardware interface of the message parsing and determines the software communication interface of the message parsing; the electronic device communicates according to the target interface, including: the electronic device communicates according to the hardware interface and the software communication interface.
[0061] Among them, the hardware interface refers to the physical interfaces (RS232, RS485, CAN, network interface, and Rola) of other devices, and the software communication interface refers to the communication protocol interfaces (serial port, TCP, UDP, GOOSE, and MQTT) in the network.
[0062] Optionally, the electronic device determines the hardware interface corresponding to the communication of the message parsing, including: the electronic device determines the hardware interface corresponding to the communication of the message parsing according to the hardware operation parameters corresponding to the communication of the message parsing and the usage conditions of the hardware interface corresponding to the communication.
[0063] In an alternative embodiment, the hardware interface includes a serial communication interface and a network interface; the software communication interface includes a Transmission Control Protocol (TCP) interface, a User Datagram Protocol (UDP) interface, a Generic Object Oriented Substation Event (GOOSE) interface, and a Message Queuing Telemetry Transport (MQTT) interface. Among them, the serial communication interface includes an RS232 interface, an RS485 interface, and a CAN interface. The network interface refers to the interface connected by a network cable, abbreviated as the network interface.
[0064] It can be seen that in this method, after the electronic device obtains the message parsing of the protocol, the electronic device can select a target interface for the communication corresponding to the message parsing, without considering the software and hardware interface problems during protocol development, avoiding the problem of unstable corresponding software caused by manual selection of software and hardware interfaces, and improving the development speed of the protocol and the stability of the software.
[0065] Exemplarily, the electronic device obtains the message parsing of the protocol. The electronic device selects a hardware interface (such as RS232) for the communication corresponding to the message parsing and selects a software communication interface (such as TCP) for the communication corresponding to the message parsing. After the electronic device selects the hardware communication interface and the software communication interface, the electronic device communicates with other devices through the hardware communication interface and the software communication interface. For example, after the electronic device obtains the message parsing of the protocol, the electronic device selects an interface (such as RS232) from multiple hardware interfaces (RS232, RS485, CAN, network port, and Rola) as the hardware interface for the communication corresponding to the message parsing; the electronic device selects a software communication interface (such as TCP) from multiple software communication interfaces (serial port, TCP, UDP, GOOSE, and MQTT) as the software communication interface for the communication corresponding to the message parsing.
[0066] It can be seen that in this example, after the electronic device obtains the message parsing of the protocol, it is necessary to select a hardware interface and a software communication interface for the communication corresponding to the message parsing, avoiding the problem of instability of the system where the electronic device is located caused by manually determining the hardware interface and the software communication interface during protocol development.
[0067] Please refer to Figure 4 , Figure 4 which is a schematic diagram of a data processing device provided by an embodiment of the present application. As Figure 4 shown, the data processing device may include but is not limited to:
[0068] An obtaining module 401, configured to obtain the message parsing of the protocol; the message parsing of the protocol is used to indicate the regulations that the devices in the protocol need to comply with;
[0069] A determining module 402, configured to determine the target interface for the communication corresponding to the message parsing;
[0070] A communication module 403, configured to communicate according to the target interface.
[0071] In an optional implementation manner, the determining module 402 determines the target interface of the message parsing, specifically: determining the hardware interface of the message parsing and determining the software communication interface of the message parsing; the hardware interface is used to indicate the physical interface of the device in the protocol, and the software communication interface is used to indicate the communication protocol interface used by the device in the protocol for communication; the communication module 403 communicates according to the target interface, specifically: communicating according to the hardware interface and the software communication interface.
[0072] In an alternative embodiment, the determining module 402 determines the hardware interface corresponding to the message parsing communication, specifically for: determining the hardware interface corresponding to the message parsing communication according to the hardware operation parameters corresponding to the message parsing communication and the usage of the hardware interface corresponding to the communication.
[0073] In an alternative embodiment, the hardware interface includes a serial communication interface and a network interface; the software communication interface includes a Transmission Control Protocol (TCP) interface, a User Datagram Protocol (UDP) interface, a Generic Object Oriented Substation Event (GOOSE) interface, and a Message Queuing Telemetry Transport (MQTT) interface.
[0074] It can be understood that for the specific implementation of each module in the data processing device described in the embodiments of the present application and the beneficial effects that can be achieved, reference can be made to the description of the relevant embodiments of the foregoing Figure 3 shown method, which will not be elaborated here.
[0075] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of a computer device provided by an embodiment of the present application. The computer device described in the embodiments of the present application includes: a processor 501, a communication interface 502, and a memory 503. Among them, the processor 501, the communication interface 502, and the memory 503 can be connected through a bus or other means. In the embodiments of the present application, taking the connection through a bus as an example.
[0076] Among them, the processor 501 (or CPU) is the computing core and control core of the electronic device, which can parse various instructions in the electronic device and process various data of the electronic device. For example: the CPU can be used to parse the power-on and power-off instructions sent by the object to the electronic device and control the electronic device to perform power-on and power-off operations; for another example: the CPU can transmit various interaction data between the internal structures of the electronic device, and so on. The communication interface 502 can optionally include a standard wired interface, a wireless interface (such as Wireless Fidelity (Wi-Fi), a mobile communication interface, etc.), and is controlled by the processor 501 to send and receive data. The memory 503 is the memory device in the electronic device, used to store programs and data. It can be understood that the memory 503 here can include both the built-in memory of the electronic device and, of course, the extended memory supported by the electronic device. The memory 503 provides a storage space, and this storage space stores the operating system of the electronic device, which can include but is not limited to: Android system, Windows Phone system, etc. The present application does not make any limitations in this regard.
[0077] In an alternative embodiment, the processor 501 can be used to execute the computer programs or commands stored in the memory 503, so that the computer device performs the following:
[0078] Obtain the parsing of the protocol message; the parsing of the protocol message is used to indicate the regulations that the devices in the protocol need to comply with; determine the target interface corresponding to the communication of the message parsing; and perform communication according to the target interface.
[0079] In a specific implementation, the processor 501, communication interface 502, and memory 503 described in the embodiments of the present application can execute the implementation manner of the computer device described in the Figure 3 application program update method shown, which will not be elaborated here.
[0080] The embodiments of the present application further provide a computer-readable storage medium. The computer-readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, the information processing method provided by the embodiments of the present application is implemented. For the specific implementation manner, reference can be made to the implementation manners provided in the above steps, which will not be elaborated here.
[0081] The embodiments of the present application further provide a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided by the embodiments of the present application. For the specific implementation manner, reference can be made to the previous description, which will not be elaborated here.
[0082] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0083] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium, and the storage medium can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc.
[0084] The above disclosure is only a part of the embodiments of the present application. Of course, the scope of rights of the present application cannot be limited thereby. Therefore, equivalent changes made according to the claims of the present application still fall within the scope covered by the present application.
Claims
1. A data processing method, characterized in that, applied to an electronic device, the electronic device includes a software architecture of a protocol stack, the software architecture of the protocol stack includes a specification layer, an interface layer, a mapping layer, a hardware layer and a communication layer, the specification layer is used for parsing messages of the specification, the message parsing of the specification is used to indicate the regulations that the devices in the specification need to comply with, the interface layer is used to provide a unified application programming interface for the specification layer, and the specifications in the specification layer are all developed based on the unified application programming interface of the interface layer. The mapping layer includes a hardware mapping layer and a communication mapping layer, and is used to map the software communication interface in the communication layer and the hardware interface in the hardware layer to the interface layer. The communication layer is used to provide a software communication interface, and the hardware layer is used to provide a hardware interface. The method includes: Obtaining the message parsing of the specification; Determining the target interface corresponding to the communication of the message parsing, including: determining the hardware interface corresponding to the communication of the message parsing and determining the software communication interface corresponding to the communication of the message parsing; Performing communication according to the target interface, including: mapping the hardware interface corresponding to the communication of the message parsing to the interface layer through the hardware mapping layer, and mapping the software communication interface corresponding to the communication of the message parsing to the interface layer through the communication mapping layer, and performing communication with the specification layer through the unified application programming interface of the interface layer.
2. The method according to claim 1, characterized in that: The hardware interface is used to indicate the physical interface of the device in the specification, and the software communication interface is used to indicate the communication protocol interface used by the device in the specification when communicating.
3. The method according to claim 1, characterized in that, The determining the hardware interface corresponding to the communication of the message parsing includes: Determining the hardware interface corresponding to the communication of the message parsing according to the hardware operation parameters corresponding to the communication of the message parsing and the usage of the hardware interface corresponding to the communication.
4. The method according to claim 3, characterized in that, The hardware interface includes a serial communication interface and a network interface; The software communication interface includes a Transmission Control Protocol (TCP) interface, a User Datagram Protocol (UDP) interface, a Generic Object Oriented Substation Event (GOOSE) interface and a Message Queuing Telemetry Transport (MQTT) interface.
5. A data processing device, characterized in that, Applied to an electronic device, the electronic device includes a software architecture of a protocol stack, the software architecture of the protocol stack includes a specification layer, an interface layer, a mapping layer, a hardware layer, and a communication layer. The specification layer is used for parsing messages of the specification, and the message parsing of the specification is used to indicate the regulations that the devices in the specification need to comply with. The interface layer is used to provide a unified application programming interface for the specification layer, and all the specifications in the specification layer are developed based on the unified application programming interface of the interface layer. The mapping layer includes a hardware mapping layer and a communication mapping layer, and is used to map the software communication interface in the communication layer and the hardware interface in the hardware layer to the interface layer. The communication layer is used to provide a software communication interface, and the hardware layer is used to provide a hardware interface. The device includes: An acquisition module, configured to acquire the message parsing of the specification; A determination module, configured to determine the target interface corresponding to the communication of the message parsing, including: determining the hardware interface corresponding to the communication of the message parsing and determining the software communication interface corresponding to the communication of the message parsing; A communication module, configured to communicate according to the target interface, including: mapping the hardware interface corresponding to the communication of the message parsing to the interface layer through the hardware mapping layer, and mapping the software communication interface corresponding to the communication of the message parsing to the interface layer through the communication mapping layer, and communicating with the specification layer through the unified application programming interface of the interface layer.
6. The device according to claim 5, wherein: The hardware interface is used to indicate the physical interface of the device in the specification, and the software communication interface is used to indicate the communication protocol interface used by the device in the specification for communication.
7. The device according to claim 5, wherein, The determination module determines the hardware interface corresponding to the communication of the message parsing, and specifically is configured to: Determine the hardware interface corresponding to the communication of the message parsing according to the hardware operation parameters corresponding to the communication of the message parsing and the usage of the hardware interface corresponding to the communication.
8. The device according to claim 7, wherein, The hardware interface includes a serial communication interface and a network interface; The software communication interface includes a Transmission Control Protocol (TCP) interface, a User Datagram Protocol (UDP) interface, a Generic Object Oriented Substation Event (GOOSE) interface, and a Message Queuing Telemetry Transport (MQTT) interface.
9. A computer device, wherein, it includes: A processor, a communication interface, and a memory. The processor, the communication interface, and the memory are interconnected. Among them, the memory stores executable program code, and the processor is configured to call the executable program code to execute the method according to any one of claims 1 to 4.
10. A computer-readable storage medium, wherein, The computer-readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to execute the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Multi-channel protocol adaptation processing method, system and device
CN114745448A