Industrial software protocol proxy method and system based on swan mongolian operating system
By introducing industrial software application agent equipment into the Hongmeng operating system, the protocol adaptation problem between Hongmeng application and industrial communication protocol is solved, cross-protocol calls are realized, diverse industrial protocol needs are met, and the system flexibility and compatibility are improved.
Patent Information
- Application Number
- CN202411094398.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-11-29
AI Technical Summary
In industrial software systems, applications based on Hongmeng operating system are difficult to directly meet the needs of diversified industrial protocols and face the challenges of protocol adaptation mechanism.
By introducing industrial software application agent equipment into the Hongmeng operating system, format conversion and adaptation of industrial software protocols is realized, allowing Hongmeng applications to call industrial software applications across protocols, avoiding direct support of all industrial communication protocols.
The compatibility between Hongmeng applications and multiple industrial software protocols is realized, so that the Hongmeng operating system does not need to directly support all types of industrial communication protocols. Each proxy device specifically handles a type of protocol, realizing flexible inter-application communication.
Smart Images

Figure CN119052331A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an industrial software protocol proxy method and system based on the Hongmeng operating system. Background Art
[0002] Currently, in the open source Hongmeng operating system (OpenHarmony), SOA (Service Oriented Architecture) and bus mechanism serve as the underlying supporting technologies, which can support hardware communication and system interaction based on preset protocols (such as Wi-Fi, Bluetooth, Ethernet, etc.) in the PC and server fields, providing a solid foundation for seamless connection and resource sharing between devices.
[0003] However, in industrial software systems, faced with a wide variety of industrial communication protocols (such as CAN, Modbus, OPC-UA, etc.), applications based on the HarmonyOS face the challenge of protocol adaptation mechanisms when working collaboratively with applications of these industrial communication protocols, making it difficult to directly meet the diverse industrial protocol requirements. Summary of the Invention
[0004] The present invention provides an industrial software protocol proxy method and system based on the Hongmeng operating system, which is used to solve the problem in the prior art that applications based on the Hongmeng operating system face challenges in the protocol adaptation mechanism when working in collaboration with applications of these industrial communication protocols, and it is difficult to directly meet the diverse industrial protocol requirements.
[0005] The present invention provides an industrial software protocol proxy method based on the Hongmeng operating system, which is applied to a first industrial software application proxy device. The method includes: Receiving a first request sent by a first Hongmeng application through the Hongmeng service bus, wherein the first request is generated by the first Hongmeng application based on a first industrial software application under an industrial software protocol to be called, and the first industrial software application proxy device is an industrial software application proxy device corresponding to the industrial software protocol to be called; Based on the industrial software protocol corresponding to the first industrial software application agent device, convert the format of the first message in the first request to obtain a second message; Sending a second request corresponding to the second message to the first industrial software application, and receiving a first processing result returned by the first industrial software application; Based on a HarmonyOS application specification corresponding to the first HarmonyOS application, convert the first processing result into a second processing result; Send the second processing result to the first Harmony application through the Harmony service bus.
[0006] According to the industrial software protocol proxy method based on the Harmony operating system provided by the present invention, the first request carries the service name of the first industrial software application proxy device, and the Harmony service bus sends the first request to the first industrial software application proxy device based on the service name of the industrial software application proxy device in the first request.
[0007] According to the industrial software protocol proxy method based on the Hongmeng operating system provided by the present invention, the industrial software protocol corresponding to the first industrial software application proxy device is used to convert the format of the first message in the first request, and before obtaining the second message, the method further includes: The first request is parsed to obtain the application name of the industrial software application, the message type of the first message, and the message content of the message type carried in the first request, wherein the message type is pre-defined based on the industrial software protocol.
[0008] The present invention also provides an industrial software protocol proxy method based on the Hongmeng operating system, which is applied to a first Hongmeng application, and the method includes: Determine a first industrial software application and a first industrial software application proxy device under an industrial software protocol to be called, and generate a corresponding first request, where the first industrial software application proxy device is an industrial software application proxy device corresponding to the industrial software protocol; Sending the first request to the first industrial software application agent device through the Hongmeng service bus; The second processing result sent by the first industrial software application through the first industrial software application agent device is received through the Harmony service bus, and the second processing result is used in the business logic of the first Harmony application. The second processing result is obtained by the first industrial software application agent device after format conversion of the first processing result returned by the first industrial software application based on the Harmony application specification corresponding to the first Harmony application.
[0009] According to the industrial software protocol proxy method based on the Hongmeng operating system provided by the present invention, the second processing result is obtained by: Based on the industrial software protocol, converting the format of the first message in the first request by the first industrial software application agent device to obtain a second message; Sending a second request corresponding to the second message to the first industrial software application through the first industrial software application proxy device, and receiving a first processing result returned by the first industrial software application; Based on the Harmony application specification corresponding to the first Harmony application, the first processing result is format-converted through the first industrial software application agent device to obtain the second processing result, and the second processing result is used in the business logic. The second processing result is obtained by the first industrial software application agent device after format-converting the first processing result returned by the first industrial software application based on the Harmony application specification corresponding to the first Harmony application.
[0010] According to the industrial software protocol proxy method based on the Hongmeng operating system provided by the present invention, the method further includes: Determine a service name of a first industrial software application agent device corresponding to the industrial software protocol to be called; A first request is generated that carries the service name of the first industrial software application agent device.
[0011] The present invention also provides an industrial software protocol proxy system based on the Hongmeng operating system, comprising: at least one first industrial software application proxy device, at least one first industrial software application under the industrial software protocol corresponding to each of the first industrial software application proxy devices, at least one first Hongmeng application, and a Hongmeng service bus, wherein: The first industrial software application agent device can implement any of the above-mentioned industrial software protocol agent methods based on the Hongmeng operating system; The first HarmonyOS application can implement any of the above-mentioned industrial software protocol proxy methods based on the HarmonyOS operating system.
[0012] According to the industrial software protocol proxy system based on the Hongmeng operating system provided by the present invention, the first industrial software application proxy device includes a Hongmeng communication transceiver, a Hongmeng communication controller, an industrial software transceiver, an industrial software controller, a microprocessor and a protocol conversion program, wherein: The Hongmeng communication transceiver is used to establish communication with the first Hongmeng application through the Hongmeng service bus; The industrial software transceiver is used to establish communication with the first industrial software application via an industrial software communication bus; The microprocessor is used to run the protocol conversion program; The protocol conversion program is used to call the HarmonyOS communication controller or the industrial software controller to perform adaptation protocol conversion between the HarmonyOS application specification and the industrial software protocol.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, it implements the industrial software protocol agent method based on the HarmonyOS operating system as described in any one of the above.
[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the industrial software protocol agent method based on the Hongmeng operating system as described in any one of the above.
[0015] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the industrial software protocol agent method based on the Hongmeng operating system as described above.
[0016] The present invention provides an industrial software protocol proxy system and method based on the Hongmeng operating system. After the first industrial software application proxy device receives the first request sent by the first Hongmeng application through the Hongmeng service bus, it first converts the format of the first message in the first request based on the industrial software protocol corresponding to the first industrial software application proxy device and sends it to the first industrial software application, and receives the first processing result returned by the first industrial software application; then, based on the Hongmeng application specification corresponding to the first Hongmeng application, it converts the format of the first processing result to obtain the second processing result, and finally sends the second processing result to the first Hongmeng application through the Hongmeng service bus, thereby realizing the cross-protocol call of the Hongmeng application to the industrial software application. In this way, the present invention introduces an extensible industrial software application proxy device, so that the Hongmeng operating system application does not need to directly support all types of industrial communication protocols. Each industrial software application proxy device is specifically responsible for processing calls under a type of industrial software protocol, thereby realizing the call of the Hongmeng application and industrial software applications under multiple industrial software protocols. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 This is one of the flow charts of the industrial software protocol proxy method based on the Hongmeng operating system provided by the present invention.
[0019] Figure 2 This is the second flow chart of the industrial software protocol proxy method based on the Hongmeng operating system provided by the present invention.
[0020] Figure 3 This is an application scenario diagram of the industrial software protocol proxy system based on the Hongmeng operating system provided by the present invention.
[0021] Figure 4 It is a schematic diagram of the entity structure of the first industrial software application agent device provided by the present invention.
[0022] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0023] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0024] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first" and "second" are generally of the same type, and do not limit the number of objects. For example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.
[0025] The embodiment of the present invention proposes an industrial software protocol proxy method based on the Hongmeng operating system, which is applied to the first industrial software application proxy device. Figure 1 As shown, the process includes the following steps 110 to 150.
[0026] Step 110: Receive a first request sent by a first Harmony application through the Harmony service bus, wherein the first request is generated by the first Harmony application based on the first industrial software application under the industrial software protocol to be called, and the first industrial software application agent device is the industrial software application agent device corresponding to the industrial software protocol to be called.
[0027] Here, the "first HarmonyOS application" refers to an application implemented in accordance with the HarmonyOS SOA (Service-Oriented Architecture) architecture standard. In the process of executing its business logic, the application needs to call the first industrial software application under the industrial software protocol served by the first industrial software application proxy device. Furthermore, the "first industrial software application" specifically refers to the industrial software application that complies with the industrial software protocol that the first HarmonyOS application calls.
[0028] It should be understood that the HarmonyOS Service Bus is responsible for routing and delivering messages between applications in the system. Through the HarmonyOS Service Bus, a HarmonyOS application A can send a request to an industrial software application proxy device (B) that matches an industrial software application (C) that follows a specific industrial software protocol (B).
[0029] Specifically, the request includes the identification information of the industrial software application agent device (B) (which may be a name, ID or other unique identifier), the specific information conveyed by HarmonyOS application A to a specific application (C) under a certain industrial software (B), and the identification information about the application (C) (which may be a name, ID or other unique identifier), so that the industrial software application agent device (B) can identify and send the corresponding information to the application (C).
[0030] Step 120: Based on the industrial software protocol corresponding to the first industrial software application agent device, the first message in the first request is formatted and a second message is obtained.
[0031] Here, the first message refers to a message encoded according to the Harmony application specification corresponding to the first Harmony application.
[0032] It should be noted that when HarmonyOS application (A) communicates with industrial software application (C) through industrial software application proxy device (B), since HarmonyOS application (A) and industrial software application (C) follow different communication protocols, before sending the message in the request to industrial software application (C), the industrial software application proxy device (B) needs to convert the format of the first message according to the industrial software protocol corresponding to the industrial software application (C), such as adjusting the message structure, converting the data type, re-encoding the message, etc., so as to recompile the message content into a message that the industrial software application (C) can understand and process, that is, the second message.
[0033] Step 130: Sending a second request corresponding to the second message to the first industrial software application, and receiving a first processing result returned by the first industrial software application; Here, the first processing result refers to the processing result encapsulated or formatted by the first industrial software application according to the industrial software protocol that the first industrial software application complies with.
[0034] After converting the first message into a second message, the industrial software application proxy device (B) sends the converted second message as part of a second request to the industrial software application (C). Upon receiving the second request, the industrial software application (C) processes the second message in the second request according to its own business logic and generates a first processing result. The industrial software application (C) then returns this first processing result to the industrial software application proxy device (B).
[0035] Step 140: Based on the HarmonyOS application specification corresponding to the first HarmonyOS application, convert the first processing result into a second processing result. Here, HarmonyOS application specifications refer to a series of rules and standards that applications developed in accordance with the HarmonyOS SOA (Service-Oriented Architecture) architecture standards should meet.
[0036] After the industrial software application agent device (B) receives the first processing result returned by the industrial software application (C), it again converts the format of the first processing result according to the Harmony application specification followed by the Harmony application (A) to recompile the message into a message that complies with the Harmony specification, that is, the second processing result.
[0037] Furthermore, in this embodiment, before converting the format of the first message in the first request based on the industrial software protocol corresponding to the first industrial software application agent device to obtain the second message, the method further includes: The first request is parsed to obtain the application name of the industrial software application, the message type of the first message, and the message content of the message type carried in the first request, wherein the message type is pre-defined based on the industrial software protocol.
[0038] Specifically, the first request is parsed to extract key information, including the application name of the target industrial software application, the message type of the first message carried in the request, and the specific message content of this message type. This ensures that subsequent format conversion can be performed accurately and efficiently.
[0039] It should be understood that industrial software protocols generally define a series of standard message types for transmitting different types of information between different systems or applications. By parsing the request, the message type of the first message included in the request can be identified.
[0040] Step 150: Send the second processing result to the first Harmony application through the Harmony service bus.
[0041] Finally, the second processing result is sent to the HarmonyOS service bus, so that the second processing result is fed back to the HarmonyOS application (A) through the HarmonyOS service bus.
[0042] In this embodiment of the HarmonyOS-based industrial software protocol proxy method, by introducing scalable industrial software application proxy devices, HarmonyOS applications no longer need to directly support all types of industrial communication protocols. Each industrial software application proxy device is specifically responsible for processing calls under a type of industrial software protocol, thereby enabling HarmonyOS applications to call industrial software applications under multiple industrial software protocols.
[0043] In some embodiments, the first request carries the service name of the first industrial software application agent device, and the HarmonyOS service bus sends the first request to the first industrial software application agent device based on the service name of the industrial software application agent device in the first request.
[0044] It's important to note that each industrial software application proxy device has a unique service name (or service ID), which is the key used by the HarmonyOS Service Bus to identify and route messages. When a HarmonyOS application (A) needs to call a specific application (C) under a certain industrial software (B), A constructs a request. This request not only includes the specific information to be sent to the application (C), the application (C)'s identification information (which may be a name, ID, or other unique identifier), but also explicitly specifies the service name of the industrial software application proxy device (B) to be called.
[0045] After receiving a request from a HarmonyOS application (A), the HarmonyOS Service Bus parses the request and extracts the service name of the industrial software application proxy device (B) to be called. Based on this service name, the HarmonyOS Service Bus then searches for and locates the corresponding industrial software application proxy device (B) among the multiple industrial software application proxy devices communicating with the HarmonyOS Service Bus. The bus then forwards the request from the HarmonyOS application (A) to the industrial software application proxy device (B), which then processes the request.
[0046] In the industrial software protocol proxy method based on the Harmony operating system of this embodiment, flexible communication between different applications is achieved in this way, so that the Harmony application can flexibly interact with industrial software application proxy devices and industrial software applications that comply with different industrial software protocols through the Harmony service bus.
[0047] An embodiment of the present invention further provides an industrial software protocol proxy method based on the Hongmeng operating system, which is applied to a first Hongmeng application. The following describes the industrial software protocol proxy method based on the Hongmeng operating system and applied to the first Hongmeng application provided in an embodiment of the present invention. The industrial software protocol proxy method based on the Hongmeng operating system and applied to the first Hongmeng application described below can be referenced in conjunction with the industrial software protocol proxy method based on the Hongmeng operating system and applied to the first industrial software application proxy device described above.
[0048] The industrial software protocol proxy method based on the Hongmeng operating system applied to the first Hongmeng application of the embodiment of the present invention is as follows Figure 2 As shown, the process includes the following steps 210 to 230.
[0049] Step 210: Determine a first industrial software application and a first industrial software application proxy device under an industrial software protocol to be called, and generate a corresponding first request, where the first industrial software application proxy device is an industrial software application proxy device corresponding to the industrial software protocol; It should be understood that the first HarmonyOS application refers to an application implemented in accordance with the HarmonyOS SOA (Service-Oriented Architecture) architecture standard. In the process of executing its business logic, the application needs to call the first industrial software application under the industrial software protocol served by the first industrial software application proxy device. Furthermore, the first industrial software application specifically refers to the industrial software application that complies with the industrial software protocol that the first HarmonyOS application calls.
[0050] Here, the first request includes the identification information of the first industrial software application agent device (which may be a name, ID or other unique identifier), the specific information conveyed by the first Harmony application to a specific application under a certain industrial software, and the identification information about this application (which may be a name, ID or other unique identifier), so that the first industrial software application agent device can identify and send the corresponding information to this application.
[0051] Step 220: Sending the first request to the first industrial software application agent device through the Hongmeng service bus; It should be understood that the Hongmeng service bus is responsible for routing and delivering messages between various applications in the system. Through the Hongmeng service bus, a first Hongmeng application can send a request to a first industrial software application proxy device that matches a first industrial software application that complies with a specific industrial software protocol.
[0052] Step 230: Receive the second processing result sent by the first industrial software application through the first industrial software application agent device through the Harmony service bus, and use the second processing result in the business logic of the first Harmony application. The second processing result is obtained by the first industrial software application agent device after format conversion of the first processing result returned by the first industrial software application based on the Harmony application specification corresponding to the first Harmony application.
[0053] Here, the second processing result refers to the processing result encapsulated or formatted according to the Harmony application specification followed by the first Harmony application.
[0054] It should be noted that when the first Harmony application communicates with the first industrial software application through the first industrial software application proxy device, since the first Harmony application and the first industrial software application follow different communication protocols, after the first industrial software application proxy device receives the first processing result returned by the first industrial software application, it is necessary to convert the format of the first processing result according to the Harmony application specification followed by the first Harmony application, so as to recompile the message content into a message that the first Harmony application can understand and process, that is, the second processing result.
[0055] Finally, the request corresponding to the second processing result is sent to the HarmonyOS service bus, so that the second processing result is fed back to the first HarmonyOS application through the HarmonyOS service bus.
[0056] The HarmonyOS-based industrial software protocol proxy method of this embodiment introduces scalable industrial software application proxy devices, eliminating the need for HarmonyOS applications to directly support all industrial communication protocols. Each industrial software application proxy device is specifically responsible for handling calls under a specific type of industrial software protocol, thereby enabling HarmonyOS applications to call industrial software applications under multiple industrial software protocols.
[0057] In some embodiments, the second processing result is obtained by: Based on the industrial software protocol, converting the format of the first message in the first request by the first industrial software application agent device to obtain a second message; Sending a second request corresponding to the second message to the first industrial software application through the first industrial software application proxy device, and receiving a first processing result returned by the first industrial software application; Based on the Harmony application specification corresponding to the first Harmony application, the first processing result is format converted through the first industrial software application agent device to obtain the second processing result.
[0058] Here, the first industrial software application proxy device performs two protocol conversions. The first is when receiving the first request from the first HarmonyOS application, performing format conversion on the first message in the first request, converting the corresponding message format from the format specified by the HarmonyOS application specification to the format specified by the industrial software protocol. The second is when receiving the first processing result returned by the first industrial software application, performing format conversion on the first processing result, converting the corresponding message format from the format specified by the industrial software protocol to the format specified by the HarmonyOS application specification.
[0059] In some embodiments, the method further comprises: Determine a service name of a first industrial software application agent device corresponding to the industrial software protocol to be called; A first request is generated that carries the service name of the first industrial software application agent device.
[0060] It's important to note that each industrial software application proxy device has a unique service name (or service ID), which is the key used by the HarmonyOS service bus to identify and route messages. When a HarmonyOS application (A) needs to call a specific application (C) under a piece of industrial software (B), it constructs a request. This request includes not only the specific information to be sent to application (C), the identification information of application (C) (which may be a name, ID, or other unique identifier), but also explicitly specifies the service name of the industrial software application proxy device (B) to be called.
[0061] In this way, after receiving the request from HarmonyOS Application (A), the HarmonyOS Service Bus will parse the request and extract the service name of the industrial software application proxy device (B) to be called. Then, based on this service name, the HarmonyOS Service Bus will search and locate the corresponding industrial software application proxy device (B) among the multiple industrial software application proxy devices that have established communication with the HarmonyOS Service Bus. It will then forward the request from HarmonyOS Application (A) to the industrial software application proxy device (B), which will then further process the request.
[0062] In the industrial software protocol proxy method based on the Harmony operating system of this embodiment, flexible communication between different applications is achieved in this way, so that the Harmony application can flexibly interact with industrial software application proxy devices and industrial software applications that comply with different industrial software protocols through the Harmony service bus.
[0063] The embodiment of the present invention also provides an industrial software protocol agent system based on the Hongmeng operating system, comprising: at least one first industrial software application agent device, at least one first industrial software application under the industrial software protocol corresponding to each of the first industrial software application agent devices, at least one first Hongmeng application, and a Hongmeng service bus, wherein, with reference to Figure 3 ,refer to Figure 3 This is an application scenario diagram of the industrial software protocol proxy system based on the Hongmeng operating system provided in an embodiment of the present invention.
[0064] Specifically, the first industrial software application agent device can implement the industrial software protocol agent method based on the Harmony operating system as described in the above embodiments, and the first Harmony application can implement the industrial software protocol agent method based on the Harmony operating system as described in the above embodiments, which will not be detailed here.
[0065] Figure 4 An example of a physical structure diagram of a first industrial software application agent device is shown as follows: Figure 4 As shown, the first industrial software application agent device may include: a Hongmeng communication transceiver 410, a Hongmeng communication controller 420, an industrial software transceiver 430, an industrial software controller 440, a microprocessor 450, and a protocol conversion program 460, wherein: The Hongmeng communication transceiver 410 is used to establish communication with the first Hongmeng application through the Hongmeng service bus; The industrial software transceiver 430 is used to establish communication with the first industrial software application via the industrial software communication bus; The microprocessor 450 is used to run the protocol conversion program; The protocol conversion program 460 is used to call the Harmony communication controller 420 or the industrial software controller 440 to perform adaptation protocol conversion between the Harmony application specification and the industrial software protocol.
[0066] Specifically, for ease of understanding, this embodiment is explained by taking the example of HarmonyOS application (A) communicating with industrial software application (C) through industrial software application proxy device (B).
[0067] In this embodiment, HarmonyOS application A establishes communication with the HarmonyOS communication transceiver 410 in the industrial software application agent device (B) through the HarmonyOS service bus, and the industrial software application (C) establishes communication with the industrial software transceiver 430 in the industrial software application agent device (B) through the industrial software communication bus. When HarmonyOS application A needs to call industrial software application (C), HarmonyOS application A sends a request to the HarmonyOS service bus that carries the service name of the industrial software application agent device (B), the application name of the industrial software application (C) and the message content to be transmitted. After receiving the request, the HarmonyOS service bus identifies the service name of the industrial software application agent device (B) in the request and forwards the request to the HarmonyOS communication transceiver 410 of the industrial software application agent device (B). Then the microprocessor 450 of the industrial software application agent device (B) runs the protocol conversion program 460. The running of the protocol conversion program 460 will further call the HarmonyOS communication controller 420 to parse the message packet in the HarmonyOS application specification format carried in the request, and call the industrial software controller 440 to further encapsulate the parsed message into a message packet in the industrial software protocol format. The industrial software transceiver 430 sends the request corresponding to this message packet to the specified industrial software application (C) through the industrial software communication bus. After the industrial software transceiver 430 receives the request for the processing result returned by the industrial software application (C), the microprocessor 450 runs the protocol conversion program 460. Running the protocol conversion program 460 will further call the industrial software controller 440 to parse the message packet in the industrial software protocol format in the request, and further encapsulate the parsed processing result into a message packet in the Harmony application specification format, and send it to the Harmony service bus through the Harmony communication transceiver 410. Finally, the Harmony service bus forwards it to the Harmony application A, thereby realizing cross-protocol communication between the Harmony application A and the industrial software application (C).
[0068] Figure 5 An example of a physical structure diagram of an electronic device is shown below. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the industrial software protocol proxy method based on the Hongmeng operating system, which includes the following steps: Receiving a first request sent by a first Hongmeng application through the Hongmeng service bus, wherein the first request is generated by the first Hongmeng application based on a first industrial software application under an industrial software protocol to be called, and the first industrial software application proxy device is an industrial software application proxy device corresponding to the industrial software protocol to be called; Based on the industrial software protocol corresponding to the first industrial software application agent device, convert the format of the first message in the first request to obtain a second message; Sending a second request corresponding to the second message to the first industrial software application, and receiving a first processing result returned by the first industrial software application; Based on a HarmonyOS application specification corresponding to the first HarmonyOS application, convert the first processing result into a second processing result; Send the second processing result to the first Harmony application through the Harmony service bus.
[0069] or,
[0070] Determine a first industrial software application and a first industrial software application proxy device under an industrial software protocol to be called, and generate a corresponding first request, where the first industrial software application proxy device is an industrial software application proxy device corresponding to the industrial software protocol; Sending the first request to the first industrial software application agent device through the Hongmeng service bus; The second processing result sent by the first industrial software application through the first industrial software application agent device is received through the Harmony service bus, and the second processing result is used in the business logic of the first Harmony application. The second processing result is obtained by the first industrial software application agent device after format conversion of the first processing result returned by the first industrial software application based on the Harmony application specification corresponding to the first Harmony application.
[0071] Furthermore, the logic instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0072] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the industrial software protocol agent method based on the Harmony operating system provided by the above methods. The method includes the following steps.
[0073] Receiving a first request sent by a first Hongmeng application through the Hongmeng service bus, wherein the first request is generated by the first Hongmeng application based on a first industrial software application under an industrial software protocol to be called, and the first industrial software application proxy device is an industrial software application proxy device corresponding to the industrial software protocol to be called; Based on the industrial software protocol corresponding to the first industrial software application agent device, convert the format of the first message in the first request to obtain a second message; Sending a second request corresponding to the second message to the first industrial software application, and receiving a first processing result returned by the first industrial software application; Based on a HarmonyOS application specification corresponding to the first HarmonyOS application, convert the first processing result into a second processing result; Send the second processing result to the first Harmony application through the Harmony service bus.
[0074] or,
[0075] Determine a first industrial software application and a first industrial software application proxy device under an industrial software protocol to be called, and generate a corresponding first request, where the first industrial software application proxy device is an industrial software application proxy device corresponding to the industrial software protocol; Sending the first request to the first industrial software application agent device through the Hongmeng service bus; The second processing result sent by the first industrial software application through the first industrial software application agent device is received through the Harmony service bus, and the second processing result is used in the business logic of the first Harmony application. The second processing result is obtained by the first industrial software application agent device after format conversion of the first processing result returned by the first industrial software application based on the Harmony application specification corresponding to the first Harmony application.
[0076] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for executing an industrial software protocol agent based on the HarmonyOS operating system provided by the above-mentioned methods is implemented, and the method includes the following steps.
[0077] Receiving a first request sent by a first Hongmeng application through the Hongmeng service bus, wherein the first request is generated by the first Hongmeng application based on a first industrial software application under an industrial software protocol to be called, and the first industrial software application proxy device is an industrial software application proxy device corresponding to the industrial software protocol to be called; Based on the industrial software protocol corresponding to the first industrial software application agent device, convert the format of the first message in the first request to obtain a second message; Sending a second request corresponding to the second message to the first industrial software application, and receiving a first processing result returned by the first industrial software application; Based on a HarmonyOS application specification corresponding to the first HarmonyOS application, convert the first processing result into a second processing result; Send the second processing result to the first Harmony application through the Harmony service bus.
[0078] or,
[0079] Determine a first industrial software application and a first industrial software application proxy device under an industrial software protocol to be called, and generate a corresponding first request, where the first industrial software application proxy device is an industrial software application proxy device corresponding to the industrial software protocol; Sending the first request to the first industrial software application agent device through the Hongmeng service bus; The second processing result sent by the first industrial software application through the first industrial software application agent device is received through the Harmony service bus, and the second processing result is used in the business logic of the first Harmony application. The second processing result is obtained by the first industrial software application agent device after format conversion of the first processing result returned by the first industrial software application based on the Harmony application specification corresponding to the first Harmony application.
[0080] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0081] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. An industrial software protocol proxy method based on Hongmeng operating system, characterized in that: Applied to the first industrial software application agent device, the method comprises: Receive a first request sent by a first Hongmeng application through the Hongmeng service bus, wherein the first request is generated by the first Hongmeng application based on a first industrial software application under an industrial software protocol to be called, and the first industrial software application proxy device is an industrial software application proxy device corresponding to the industrial software protocol to be called; Based on the industrial software protocol corresponding to the first industrial software application agent device, convert the format of the first message in the first request to obtain a second message; Sending a second request corresponding to the second message to the first industrial software application, and receiving a first processing result returned by the first industrial software application; Based on the Hongmeng application specification corresponding to the first Hongmeng application, convert the first processing result into a second processing result; Send the second processing result to the first Harmony application through the Harmony service bus.
2. The industrial software protocol proxy method based on Hongmeng operating system according to claim 1 is characterized in that: The first request carries the service name of the first industrial software application agent device, and the HarmonyOS service bus sends the first request to the first industrial software application agent device based on the service name of the industrial software application agent device in the first request.
3. The industrial software protocol proxy method based on Hongmeng operating system according to claim 1 is characterized in that: The step of converting the format of the first message in the first request based on the industrial software protocol corresponding to the first industrial software application proxy device to obtain the second message further includes: The first request is parsed to obtain the application name of the industrial software application carried in the first request, the message type of the first message, and the message content of the message type, wherein the message type is pre-defined based on the industrial software protocol.
4. An industrial software protocol proxy method based on Hongmeng operating system, characterized in that: Applied to the first Hongmeng application, the method includes: Determine a first industrial software application and a first industrial software application proxy device under an industrial software protocol to be called, and generate a corresponding first request, wherein the first industrial software application proxy device is an industrial software application proxy device corresponding to the industrial software protocol; Sending the first request to the first industrial software application agent device through the Hongmeng service bus; A second processing result sent by the first industrial software application through the first industrial software application agent device is received through the Harmony service bus, and the second processing result is used in the business logic of the first Harmony application, wherein the second processing result is obtained by the first industrial software application agent device after format conversion of the first processing result returned by the first industrial software application based on the Harmony application specification corresponding to the first Harmony application.
5. The industrial software protocol proxy method based on Hongmeng operating system according to claim 4 is characterized in that: The second processing result is obtained by: Based on the industrial software protocol, converting the format of the first message in the first request by the first industrial software application proxy device to obtain a second message; Sending a second request corresponding to the second message to the first industrial software application through the first industrial software application proxy device, and receiving a first processing result returned by the first industrial software application; Based on the HarmonyOS application specification corresponding to the first HarmonyOS application, the first processing result is format converted through the first industrial software application agent device to obtain the second processing result.
6. The industrial software protocol proxy method based on Hongmeng operating system according to claim 4 is characterized in that: The method further comprises: Determine a service name of a first industrial software application proxy device corresponding to the industrial software protocol to be called; Generate a first request carrying the service name of the first industrial software application agent device.
7. An industrial software protocol proxy system based on Hongmeng operating system, characterized in that: include: At least one first industrial software application proxy device, at least one first industrial software application under the industrial software protocol corresponding to each of the first industrial software application proxy devices, at least one first Hongmeng application, and a Hongmeng service bus, wherein: The first industrial software application agent device can implement the industrial software protocol agent method based on the Hongmeng operating system as described in any one of claims 1 to 3; The first Hongmeng application can implement the industrial software protocol proxy method based on the Hongmeng operating system as described in any one of claims 4 to 6.
8. The industrial software protocol proxy system based on Hongmeng operating system according to claim 7 is characterized in that: The first industrial software application agent device includes a Hongmeng communication transceiver, a Hongmeng communication controller, an industrial software transceiver, an industrial software controller, a microprocessor and a protocol conversion program, wherein: The Hongmeng communication transceiver is used to establish communication with the first Hongmeng application through the Hongmeng service bus; The industrial software transceiver is used to establish communication with the first industrial software application via an industrial software communication bus; The microprocessor is used to run the protocol conversion program; The protocol conversion program is used to call the Hongmeng communication controller or the industrial software controller to perform adaptation protocol conversion between the Hongmeng application specification and the industrial software protocol.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements the industrial software protocol proxy method based on the Hongmeng operating system as described in any one of claims 1 to 3 or the industrial software protocol proxy method based on the Hongmeng operating system as described in any one of claims 4 to 6.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the industrial software protocol proxy method based on the Hongmeng operating system as described in any one of claims 1 to 3 or the industrial software protocol proxy method based on the Hongmeng operating system as described in any one of claims 4 to 6.
Citation Information
Cited By
AI component calling method and device, medium and computer program product
CN120909681A
Artificial intelligence component invocation method, device, medium, and computer program product
CN120909681B
