Search

CN-117041327-B - Service state notification method and device, computer equipment and storage medium

CN117041327BCN 117041327 BCN117041327 BCN 117041327BCN-117041327-B

Abstract

A method for notifying service state includes carrying out service discovery by DDS gateway and MCU group, receiving and storing entity ID information and service identification information sent by MCU in MCU group by DDS gateway, carrying out service discovery by DDS gateway and each MPU process, forwarding service identification information to each MPU process by DDS gateway to make each MPU process mark corresponding service as on-line state according to service identification contained in service identification information, updating stored entity ID information and service identification information when state change of any MCU in MCU group is detected by DDS gateway and retransmitting updated new service identification information to each MPU process to make each MPU process re-mark on-line state of each service according to new service identification information. The proposal provided by the invention solves the problem that when abnormal conditions occur in communication, the MPU continuously sends the message requesting the service to the MCU through the DDS gateway so as to occupy the network bandwidth.

Inventors

  • YANG ZHENYI
  • TANG GUANGYU
  • HUANG JIE
  • CHEN DERUI

Assignees

  • 重庆长安汽车股份有限公司

Dates

Publication Date
20260508
Application Date
20230810

Claims (10)

  1. 1. A service state notification method, the method being applied to an MPU, comprising: starting a DDS gateway and each MPU process; Performing DDS service discovery through the DDS gateway and the MCU group so that communication connection is established between the DDS gateway and the MCU in the MCU group, wherein the MCU group comprises one or more MCUs, and the communication connection is completed among the MCUs through the DDS service discovery; Receiving and storing entity ID information and service identification information sent by MCU in the MCU group through the DDS gateway; performing DDS service discovery through the DDS gateway and each MPU process so as to establish communication connection between the DDS gateway and each MPU process; Forwarding the service identification information to each MPU process through the DDS gateway so that each MPU process marks a corresponding service as an online state according to a service identification contained in the service identification information, wherein the service marked with the online state is used for representing the service of the MPU process capable of sending a request message; When detecting that any MCU in the MCU group has state change through the DDS gateway, updating the stored entity ID information and the service identification information, and resending the updated new service identification information to each MPU process so that each MPU process re-marks the online state of each service according to the new service identification information.
  2. 2. The method according to claim 1, wherein updating the stored entity ID information and the service identification information when a state change of any MCU in the MCU group is detected through the DDS gateway, comprises: When a first MCU which is newly electrified appears in the MCU group, DDS service discovery is carried out through the DDS gateway and the first MCU; and receiving a first entity ID and a first service identifier sent by the first MCU through the DDS gateway, and adding the first entity ID and the first service identifier into the entity ID information and the service identifier information.
  3. 3. The method according to claim 1, wherein updating the stored entity ID information and the service identification information when a state change of any MCU in the MCU group is detected through the DDS gateway, comprises: receiving a service request message sent by a target MPU process through the DDS gateway, and forwarding the service request message to a corresponding second MCU; when the preset deactivation time is over, if the message fed back by the second MCU in response to the service request message is not received through the DDS gateway, judging that the second MCU is offline; Deleting, by the DDS gateway, a second entity ID and a second service identifier belonging to the second MCU from the stored entity ID information and the service identifier information, so as to update the entity ID information and the service identifier information.
  4. 4. A method according to claim 3, wherein if the second MCU reboots successfully within the deactivation time, the method further comprises: taking the restarted second MCU as a new online MCU, and carrying out DDS service discovery with the second MCU through the DDS gateway; Receiving a third entity ID and a third service identifier sent by the second MCU through the DDS gateway, wherein the third entity ID is different from the second entity ID, and the third service identifier is the same as the second service identifier; adding the third entity ID and the third service identifier to the entity ID information and the service identifier information respectively through the DDS gateway; And when the third service identifier and the second service identifier are detected to be identical through the DDS gateway, deleting the second entity ID and the second service identifier belonging to the second MCU from the saved entity ID information and the service identifier information through the DDS gateway so as to update the entity ID information and the service identifier information, and then discarding the step of retransmitting the updated new service identifier information to each MPU process.
  5. 5. The method according to claim 1, wherein the method further comprises: when the DDS gateway is offline, after a service request message is sent by a target MPU process, controlling the target MPU process to detect whether preset deactivation time is passed; If the target MPU detects that the response message is not received after the deactivation time, controlling the target MPU process to mark the service corresponding to the service request message as an offline state; When the DDS gateway is restarted, the DDS service discovery is carried out again through the DDS gateway, the MCU group and each MPU process; receiving and storing second entity ID information and second service identification information sent by MCU in the MCU group through the DDS gateway again; Forwarding the second service identification information to each MPU process through the DDS gateway so that each MPU process re-marks the online state of each service according to the service identification contained in the second service identification information; and deleting the entity ID information and the service identification information stored before restarting the DDS gateway.
  6. 6. The method according to claim 1, wherein the method further comprises: When a first MPU process is disconnected and restarted, the DDS service discovery is carried out again through the DDS gateway and the first MPU process; and retransmitting the service identification information to each MPU process through the DDS gateway.
  7. 7. The method according to claim 1, wherein the method further comprises: When a second MPU process newly on line appears in the MPU, performing DDS service discovery through the DDS gateway and the second MPU process; and retransmitting the service identification information to each MPU process through the DDS gateway.
  8. 8. A service status notification apparatus, the apparatus being applied to an MPU, comprising: the power-on starting module is used for starting the DDS gateway and each MPU process; The first establishing module is used for carrying out DDS service discovery through the DDS gateway and the MCU group so as to enable the DDS gateway to establish communication connection with the MCU in the MCU group, wherein the MCU group comprises one or more MCU, and the communication connection among the MCU is completed through the DDS service discovery; The identification receiving module is used for receiving and storing entity ID information and service identification information sent by the MCU in the MCU group through the DDS gateway; the second connection establishing module is used for carrying out DDS service discovery through the DDS gateway and each MPU process so as to enable the DDS gateway and each MPU process to establish communication connection; The identifier forwarding module is used for forwarding the service identifier information to each MPU process through the DDS gateway so that each MPU process marks a corresponding service as an online state according to a service identifier contained in the service identifier information, wherein the service marked with the online state is used for representing the service of the MPU process capable of sending a request message; And the identification updating module is used for updating the stored entity ID information and the service identification information when detecting that any MCU in the MCU group has state change through the DDS gateway, and resending the updated new service identification information to each MPU process so as to enable each MPU process to re-mark the online state of each service according to the new service identification information.
  9. 9. A computer device, comprising: A memory and an MPU communicatively connected to each other, the memory having stored therein computer instructions, the MPU executing the computer instructions to perform the method of any one of claims 1 to 7.
  10. 10. A computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of claims 1 to 7.

Description

Service state notification method and device, computer equipment and storage medium Technical Field The present invention relates to the field of automotive ethernet communications technologies, and in particular, to a service state notification method, apparatus, computer device, and storage medium. Background With the rising of automobile communication data volume and the continuous development of the internet of vehicles technology, the occupied proportion of the ethernet technology in an automobile communication mode is gradually increased, and the whole automobile network structure of an automobile is complicated compared with a traditional CAN (controller area network) and LIN (local area network) communication network. Meanwhile, many automobile manufacturers adopt a distributed architecture, namely, service-Oriented Architecture (Service-based architecture), to refine application programs of various ECUs (Elecmal Control Unit, electronic control units) of the automobile into various services so as to reduce the complexity of communication between the various ECUs. The DDS (Data Distribution Service) is used as a middleware protocol, and forms a data publishing/subscribing model by defining different types of data transceiving entities (such as a participant participant, a publisher, a subscriber and a topic for data transmission), so that the communication requirement between ECUs is met, and the DDS is gradually popularized in whole vehicle network communication due to the advantages of high reliability, strong real-time performance and the like. For an ECU of an automobile, the ECU may be an MCU (MicroController Unit, a microcontroller) or an MPU (MicroProcessor Unit, a microprocessor), and because each DDS data transceiver entity needs to occupy the memory resources of the ECU, considering that the memory resources of the MPU are sufficient, the DDS protocol stack communication between the MPUs may adopt a conventional DDS communication rule, but the memory resources on the MCU are relatively tight, and do not support the creation of a large number of data transceiver entities on the MCU, and in the service discovery stage of the DDS, the ECU also creates a remote entity of an opposite entity at the local end and occupies the memory of the local end, so that the conventional DDS communication method not only causes the entities existing on the MCU to be excessive and occupies the memory of the MCU, but also causes the MCU to receive a large number of invalid message data, increases the data processing pressure of the MCU, and limits the operation effect of the DDS on the whole automobile. In order to solve the above problems, chinese patent CN115913809a discloses a data distribution communication method, system, computer device and storage medium, which combines the communication data types of the automobile according to the characteristics of the service based on the SOA architecture adopted by the automobile, and combines multiple services into one topic, so as to reduce the number of topics, thereby dividing the service into three major categories of request, response and notification, dividing three topics, and for other data which are not suitable for SOA service, dividing topics according to other standards or independently, thus reducing the number of data receiving and transmitting entities, and reducing the memory occupation of the MCU. Based on the scheme disclosed in the aforesaid chinese patent CN115913809a, chinese patent CN116248775A further discloses an interaction method, device, electronic equipment and storage medium of the DDS gateway, which can further solve the problem of high DDS communication pressure. This patent deploys a data transceiving entity responsible for providing services within each MCU, deploys a DDS gateway process within each MPU, and deploys several MPU processes within each MPU, including a data transceiving entity for executing services. The DDS gateway is interposed between the MCU and the MPU and is used for communicating each MCU with each MPU process in any MPU, the entity ID of each entity in each MCU is maintained in the DDS gateway, the service identifier of each service contained in each entity is also maintained, and the DDS gateway can forward the service identifier to each MPU process. After entering a data communication stage, an MPU process serving as a client side sends a service request message to a data receiving and sending entity providing service for a certain MCU, the message carries a service identifier hoped by the MPU process, when the message passes through a DDS gateway, the DDS gateway searches according to the service identifier, if the service identifier exists in the DDS gateway, the DDS gateway searches for an entity ID to which the service identifier belongs, and the message can reach the data receiving and sending entity of the MCU according to the entity ID. Similarly, when the MCU entity sends the response message, the tar