Service status notification methods, devices, electronic devices and storage media
By initializing the target service in the in-vehicle SOA architecture, creating target domain participants and data readers/writers, executing the discovery process, and marking the service status, the problem of universality and accuracy of service status notification in the DDS standard is solved, and real-time and accurate service status updates are achieved.
Patent Information
- Application Number
- CN202510040232.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-01-10
AI Technical Summary
In the automotive SOA architecture, existing technologies struggle to accurately and efficiently notify service state changes within the DDS standard, resulting in insufficient universality and accuracy of service state notifications.
The application layer calls the service initialization interface of the SOA interface layer to initialize the target service, and the SOA interface layer calls the data distribution service interface to initialize the data distribution service layer. This process creates target domain participants, service quality policies, topics, and data readers/writers, executes the data distribution service discovery process, determines the data readers and writers under the target service, and marks the service status based on the matching results.
It improves the universality and accuracy of service status notifications, ensures real-time updates of service status, complies with data distribution service standards, and enhances the reliability of service status notifications.
Smart Images

Figure CN119854357B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, specifically to a service status notification method, apparatus, electronic device, and storage medium. Background Technology
[0002] The addition of automotive Ethernet has significantly changed the in-vehicle network architecture. Meanwhile, in the automotive field, service-oriented architecture (SOA) is gaining increasing popularity as it helps achieve high modularity, scalability, and maintainability of automotive software systems. In automotive SOA architecture, communication middleware is needed to decouple upper-layer design from lower-layer transmission. Data Distribution Service (DDS), due to its data-related characteristics, has become the choice of many OEMs.
[0003] In practical applications, SOA service users (clients) need to know the status of the service, i.e. whether the service is available. In some related solutions, service identification information is used to announce the service's online / offline status. However, in the DDS standard, normal communication can only be achieved after the topic is successfully matched. Therefore, using service identification information to announce the service's online / offline status has certain limitations, and there is an urgent need for a service status notification method that conforms to the DDS standard. Summary of the Invention
[0004] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, this application provides a service status notification method, apparatus, electronic device and storage medium.
[0005] Firstly, this application provides a service status notification method, the method comprising:
[0006] The target service is initialized by calling the service initialization interface of the SOA interface layer from the application layer.
[0007] The data distribution service layer is initialized by calling the data distribution service interface through the SOA interface layer; wherein, the data distribution service layer is used to distribute data to the target service, and the initialization of the data distribution service layer includes creating at least one target domain participant, creating the target service quality policy, target topic, first data reader and first data writer corresponding to the target service under the target domain participant;
[0008] The data distribution service discovery process is performed by the data distribution service layer to determine the second data reader and the second data writer under the discovered target service;
[0009] The matching results of the target data reader and the target data writer are notified to the SOA interface layer; wherein, the target data reader includes the first data reader and the second data reader, and the target data writer includes the first data writer and the second data writer;
[0010] The SOA interface layer marks the service status of the target service based on the matching result.
[0011] Optionally, after the SOA interface layer marks the service status of the target service based on the matching result, the method further includes:
[0012] The data distribution service layer monitors the matching status between the target data reader and the target data writer.
[0013] If the matching status changes, the SOA interface layer will be notified of the matching change information;
[0014] The SOA interface layer updates the matching result based on the matching change information, and updates the service status of the target service based on the matching result.
[0015] Optionally, the data distribution service layer is initialized by calling the data distribution service interface through the SOA interface layer, including:
[0016] Identify the target domain within the same process that has not yet created a domain participant;
[0017] For each target domain, create a target domain participant corresponding to that target domain;
[0018] Under the target domain participants, the target service quality policy, target topic, first data reader, and first data writer are created for the target service.
[0019] Optionally, the discovery process of the data distribution service is performed through the data distribution service layer to determine the discovered second data reader and second data writer under the target service, including:
[0020] The simple participant discovery protocol and simple endpoint discovery protocol of the data distribution service are used to discover all second data readers and all second data writers under the target service;
[0021] The first data reader and the second data reader are designated as target data readers, and the first data writer and the second data writer are designated as target data writers;
[0022] The target data reader and the target data writer are matched to obtain the matching result.
[0023] Optionally, matching the target data reader and the target data writer to obtain the matching result includes:
[0024] Obtain the first target topic, first target data type, and first target quality of service policy corresponding to the target data reader;
[0025] Obtain the second target topic, second target data type, and second target quality of service policy corresponding to the target data writer;
[0026] If the first target topic is consistent with the second target topic, the first target data type is consistent with the second target data type, and the first target quality of service policy is consistent with the second target quality of service policy, then the match is determined to be successful.
[0027] If the first target topic is inconsistent with the second target topic, and / or the first target data type is inconsistent with the second target data type, and / or the first target quality of service policy is inconsistent with the second target quality of service policy, the matching is determined to be unsuccessful.
[0028] Accordingly, the SOA interface layer marks the service status of the target service based on the matching result, including:
[0029] If all matching results between the target data reader and the target data writer indicate a successful match, then the service status of the target service is marked as online.
[0030] If either the target data reader or the target data writer indicates a match failure, then the service status of the target service is marked as offline.
[0031] Optionally, the initialization of the data distribution service layer further includes creating a topic; wherein the topic is named according to a preset rule; the preset rule includes at least two of the following: service name, interface name, and communication type.
[0032] Optionally, the data distribution service layer includes a first communication node; other data distribution service layers under the target service include a second communication node; after notifying the SOA interface layer of the matching results between the target data reader and the target data writer, the method further includes:
[0033] The first communication node and the second communication node perform heartbeat detection; wherein, the first communication node is associated with the first data reader and the first data writer; the second communication node is associated with the third data reader among the second data readers and the third data writer among the second data writers;
[0034] If the first communication node does not receive a heartbeat packet from the second communication node within a preset time period, a first matching result is determined; wherein the first matching result includes the first data reader failing to match the third data writer, and the first data writer failing to match the third data reader;
[0035] Update the service status of the target service based on the first matching result.
[0036] Secondly, this application provides a service status notification device, the device comprising:
[0037] The first initialization module is used to initialize the target service by calling the service initialization interface of the SOA interface layer through the application layer;
[0038] The second initialization module is used to initialize the data distribution service layer by calling the data distribution service interface through the SOA interface layer; wherein, the data distribution service layer is used to distribute data to the target service, and the initialization of the data distribution service layer includes creating at least one target domain participant, and creating the target service quality policy, target topic, first data reader and first data writer corresponding to the target service under the target domain participant.
[0039] The matching module is used to perform the discovery process of the data distribution service through the data distribution service layer, and to determine the second data reader and the second data writer under the discovered target service;
[0040] The notification module is used to notify the SOA interface layer of the matching results between the target data reader and the target data writer; wherein, the target data reader includes the first data reader and the second data reader, and the target data writer includes the first data writer and the second data writer;
[0041] The service status marking module is used by the SOA interface layer to mark the service status of the target service based on the matching result.
[0042] Thirdly, this application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0043] Memory, used to store computer programs;
[0044] When a processor executes a program stored in memory, it implements the steps of the service status notification method described in any embodiment of the first aspect.
[0045] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the service status notification method as described in any embodiment of the first aspect.
[0046] The beneficial effects of this application are:
[0047] The method provided in this application embodiment initializes a target service by calling the service initialization interface of the SOA interface layer through the application layer; initializes the data distribution service layer by calling the data distribution service interface through the SOA interface layer; wherein, the data distribution service layer is used to distribute data to the target service, and the initialization of the data distribution service layer includes creating at least one target domain participant, and creating a target service quality policy, target topic, first data reader, and first data writer corresponding to the target service under the target domain participant; the data distribution service layer executes a data distribution service discovery process to determine the discovered second data reader and second data writer under the target service; the matching result of the target data reader and the target data writer is notified to the SOA interface layer; wherein, the target data reader includes the first data reader and the second data reader, and the target data writer includes the first data writer and the second data writer; the SOA interface layer marks the service status of the target service according to the matching result. This method initializes the target service by calling the service initialization interface of the SOA interface layer through the application layer, and initializes the data distribution service layer by calling the data distribution service interface through the SOA interface layer. Next, the data distribution service layer performs the discovery process of the data distribution service, matching the discovered second data reader and second data writer under the target service with the first data reader and first data writer created during the initialization, and marking the service status of the target service according to the matching results. The marking process conforms to the data distribution service standard, which improves the universality and accuracy of service status notification. Attached Figure Description
[0048] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0049] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 A system architecture diagram of a service status notification method provided in one embodiment of this application;
[0051] Figure 2 A flowchart illustrating a service status notification method provided in one embodiment of this application;
[0052] Figure 3 This is a schematic diagram of the structure of an SOA application provided in one embodiment of this application;
[0053] Figure 4 A schematic diagram illustrating a service status notification method provided in another embodiment of this application;
[0054] Figure 5 A schematic diagram of the structure of a service status notification device provided in one embodiment of this application;
[0055] Figure 6 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation
[0056] The embodiments of this application will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be understood that the preferred embodiments are only for illustrating this application and are not intended to limit the scope of protection of this application.
[0057] The first embodiment of this application provides a service status notification method, which can be applied to, for example... Figure 1 The system architecture shown includes multiple SOA applications that communicate with each other via in-vehicle Ethernet. Specifically, the system architecture can be a vehicle, and there are no restrictions on the type of vehicle, such as a gasoline-powered car, a pure electric car, a hybrid electric car, or a fuel cell car, etc.
[0058] Next, based on this system architecture, the service status notification method will be described in detail, such as... Figure 2 The methods include:
[0059] Step 201: Initialize the target service by calling the service initialization interface of the SOA interface layer through the application layer.
[0060] SOA applications can be like Figure 3The SOA application architecture comprises the application layer, SOA interface layer, and data distribution service layer (DDS layer or DDS protocol layer). The SOA interface layer sits between the data distribution service layer and the application layer, encapsulating the interfaces or information of the data distribution service layer and providing the application with encapsulated SOA service interfaces for it to call. The application layer only sees the defined SOA service interfaces and does not need to concern itself with the details of the data distribution service layer. The SOA interface layer can be integrated into the SOA application as source code, a static library, or a dynamic library. For flexibility, dynamic libraries are preferred. The data distribution service layer can also be integrated into the SOA application as source code, a static library, or a dynamic library. The application layer is the logical implementation of the SOA application itself. The application layer, SOA interface layer, and data distribution service layer run within a single process.
[0061] Step 202: Initialize the data distribution service layer by calling the data distribution service interface through the SOA interface layer; wherein, the data distribution service layer is used to distribute data to the target service.
[0062] The initialization of the data distribution service layer includes creating at least one target domain participant, and under the target domain participant, the target service quality policy (Qos), target topic, first data reader (DataReader), and first data writer (DataWriter) corresponding to the target service. Specifically, publishers and subscribers can also be created.
[0063] Specifically, during the creation of a topic, the topic is named according to preset rules; the preset rules include at least two of the following: service name, interface name, and communication type.
[0064] In this embodiment, the initialization of the data distribution service layer includes creating domain participants, creating QoS, creating topics, creating DataReaders, and creating DataWriters, thereby completing the initialization of the data distribution service layer. When creating a topic, it can be named according to preset rules. For example, topics can be divided into three categories according to communication type: Requests, Replies, and Notifications (NTF). Topic names can be named using the format service name_communication type, such as: Basc_ACOperation_reques, Basc_ACOperation_reply, Basc_ACOperation_ntf, where Basc_ACOperation represents the service name, and requests, replies, and ntf represent the communication types, respectively. Topics can also be named according to service name + interface name + communication type, such as: Basc_ACOperation_Get_ACState_request, Basc_ACOperation_Get_ACState_reply, Basc_ACOperation_Ntf_ACState_ntf, where Get_ACState represents the interface name. Of course, topics can also support other rules of division without restriction, but topic names should be globally unique.
[0065] In one embodiment, the data distribution service layer is initialized by calling the data distribution service interface through the SOA interface layer, including: determining the target domains in the same process that have not yet created domain participants; creating a target domain participant for each target domain; and creating the target service quality policy, target topic, first data reader, and first data writer corresponding to the target service under the target domain participant.
[0066] In this embodiment, a domain participant is created in the same process and within the same domain. If the creation of a domain participant has already been completed, no new domain participant will be created to avoid increased complexity and resource waste caused by multiple domain participants in one domain.
[0067] Step 203: The data distribution service discovery process is executed through the data distribution service layer to determine the second data reader and the second data writer under the discovered target service.
[0068] In one embodiment, the discovery process of the data distribution service is performed by the data distribution service layer to determine the second data reader and the second data writer under the target service. This includes: performing the simple participant discovery protocol and the simple endpoint discovery protocol of the data distribution service to discover all second data readers and all second data writers under the target service; designating the first data reader and the second data reader as target data readers, and designating the first data writer and the second data writer as target data writers; and matching the target data readers and the target data writers to obtain a matching result.
[0069] In this embodiment, the Simple Participant Discovery Protocol (SPDP) and the Simple Endpoint Discovery Protocol (SEDP) are executed by the data distribution service layer to discover all second data readers (DataReaders) and second data writers (DataWriters) under the target service. Then, combined with the first data readers (DataReaders) and first data writers (DataWriters) from the initialization, all DataWriters and DataReaders are matched to obtain the matching results, which include successful matching and failed matching.
[0070] In one embodiment, matching the target data reader and the target data writer to obtain a matching result includes: obtaining a first target topic, a first target data type, and a first target quality of service policy corresponding to the target data reader; obtaining a second target topic, a second target data type, and a second target quality of service policy corresponding to the target data writer; determining a successful match if the first target topic and the second target topic are consistent, the first target data type and the second target data type are consistent, and the first target quality of service policy and the second target quality of service policy are consistent; and determining a failed match if the first target topic and the second target topic are inconsistent, and / or the first target data type and the second target data type are inconsistent, and / or the first target quality of service policy and the second target quality of service policy are inconsistent.
[0071] In this embodiment, when matching DataWriter and DataReader, the topic, data type, and QoS between DataWriter and DataReader can be matched. If the topic, data type, and QoS are all consistent, the matching is considered successful. If any of the topic, data type, and QoS are inconsistent, the matching is considered to have failed. This ensures that the matching process meets the data distribution service standard and improves the universality and accuracy of service status notifications.
[0072] Specifically, SOA services can be divided into client and server sides. The client is the caller of the service, and the server is the implementer of the service. The server calls the SOA service initialization interface to announce the supported DataWriters and DataReaders and related information on the in-vehicle Ethernet. The client calls the SOA service initialization interface to announce its supported DataWriters and DataReaders and related information on the in-vehicle Ethernet. Relying on the DDS standard discovery protocol, DataWriters and DataReaders are matched, and the matching results are informed to the upper layer. For example, if all DataWriters and DataReaders under this service match successfully, the SOA interface layer can mark the service as online; otherwise, it can mark the service as offline. After marking the service status, the application layer can be notified via callback.
[0073] Step 204: Notify the SOA interface layer of the matching results between the target data reader and the target data writer; wherein the target data reader includes a first data reader and a second data reader, and the target data writer includes a first data writer and a second data writer.
[0074] Step 205: The SOA interface layer marks the service status of the target service based on the matching results.
[0075] In one embodiment, the SOA interface layer marks the service status of the target service based on the matching results, including: if all matching results of the target data reader and the target data writer indicate successful matching, then the service status of the target service is marked as online; if any matching result of the target data reader and the target data writer indicates failed matching, then the service status of the target service is marked as offline.
[0076] This method initializes the target service by calling the service initialization interface of the SOA interface layer through the application layer, and initializes the data distribution service layer by calling the data distribution service interface through the SOA interface layer. Next, the data distribution service layer performs the discovery process of the data distribution service, matching the discovered second data reader and second data writer under the target service with the first data reader and first data writer created during the initialization, and marking the service status of the target service according to the matching results. The marking process conforms to the data distribution service standard, which improves the universality and accuracy of service status notification.
[0077] In one embodiment, after the SOA interface layer marks the service status of the target service based on the matching result, the method further includes: the data distribution service layer monitoring the matching status of the target data reader and the target data writer; if the matching status changes, notifying the SOA interface layer of the matching change information; the SOA interface layer updating the matching result based on the matching change information, and updating the service status of the target service based on the matching result.
[0078] In this embodiment, after the SOA interface layer marks the service status of the target service based on the matching results, the data distribution service layer can monitor the matching status of the target data reader and the target data writer. If the matching status changes, the SOA interface layer will notify the SOA interface layer of the matching change information. The SOA interface layer can update the matching results based on the matching change information and update the service status of the target service based on the matching results, so that the service status is always up-to-date and the accuracy of service status notification is improved.
[0079] In one embodiment, the data distribution service layer includes a first communication node; other data distribution service layers under the target service include a second communication node; after notifying the SOA interface layer of the matching results of the target data reader and the target data writer, the method further includes: the first communication node and the second communication node performing heartbeat detection; wherein, the first communication node is associated with the first data reader and the first data writer; the second communication node is associated with the third data reader among the second data readers and the third data writer among the second data writers; if the first communication node does not receive a heartbeat packet from the second communication node within a preset time period, a first matching result is determined; wherein the first matching result includes the first data reader and the third data writer failing to match, and the first data writer and the third data reader failing to match; the service status of the target service is updated according to the first matching result.
[0080] In this embodiment, the first communication node can be a domain participant, and the second communication node can be a domain participant in other data distribution service layers under the same domain ID of the target service. The first and second communication nodes in different data distribution service layers corresponding to the same domain ID can perform heartbeat detection to check if the other end is online. For example, both parties can send heartbeat packets at a certain frequency; if no heartbeat packet is received from the other party for a predetermined preset time, it is considered that the connection has been lost. When the data distribution service layer detects that the other end has lost connection, it informs the SOA interface layer of the change. The SOA interface layer marks the matching of the related DataWriter and DataReader as failed and updates the service status according to the changed matching status. It actively notifies the application layer of the changed service status, thereby improving the response speed after the service status changes based on heartbeat detection, enabling the service status to be updated quickly and accurately.
[0081] In one specific embodiment, the service status notification method is as follows: Figure 4 ,include:
[0082] Step 401: The application layer calls the service initialization interface provided by the SOA interface layer to initialize the service. The SOA interface layer calls the DDS interface to create domain participants, create QoS, create a topic, create a DataReader, create a DataWriter, and perform DDS initialization. Specifically, publishers and subscribers can also be created during initialization.
[0083] Step 402, DDS discovery process: The DDS layer informs the SOA interface layer of the matching result (success / failure) between the DataWriter and DataReader. The DDS discovery process typically involves SPDP (Simple Participant Discovery Protocol) and SEDP (Simple Endpoint Discovery Protocol). If SPDP has already been completed, only the SEDP process is performed at this stage. After the above processes are completed, the DDS layer informs the SOA interface layer of the matching result (success / failure) between the DataWriter and DataReader (the topic, data type, and the QoS associated with that topic must be consistent).
[0084] Step 403: The SOA interface layer records the matching results of each DataWriter and DataReader. If all DataWriters and DataReaders under this service match successfully, the service is marked as online; otherwise, it is offline, and the application layer is notified via a callback.
[0085] In step 404, the DDS layer detects a change in the matching status of DataWriter and DataReader, and proactively informs the SOA interface layer of the change. The SOA interface layer updates the matching status of DataWriter and DataReader, updates the relevant SOA service status based on the changed matching status, and notifies the application layer of the changed service status.
[0086] In this embodiment, by matching DataWriter and DataReader in the DDS layer, the service status of SOA services can be marked according to the matching results. The marking process conforms to the data distribution service standard, which improves the universality and accuracy of service status notification.
[0087] In this embodiment, a domain participant is created within the same process and the same domain. If the creation of a domain participant has already been completed, no new domain participant will be created.
[0088] For example, let's define an air conditioning service called Basc_ACOperation. ACService contains the following interfaces:
[0089] Get_ACState(); Ntf_ACState(); Set_ACOpen();
[0090] InitService();CancelService();
[0091] registerOnlineCallback(); Get_Online();
[0092] The application layer can obtain the air conditioner status information by calling Get_ACState(), control the air conditioner to turn on by calling Set_ACOpen(), and initialize the service by calling InitService().
[0093] Furthermore, the application layer can also proactively obtain the service status through the Get interface.
[0094] Based on the same technical concept, the second embodiment of this application provides a service status notification device, such as... Figure 5 The device includes:
[0095] The first initialization module 501 is used to initialize the target service by calling the service initialization interface of the SOA interface layer through the application layer;
[0096] The second initialization module 502 is used to initialize the data distribution service layer by calling the data distribution service interface through the SOA interface layer; wherein, the data distribution service layer is used to distribute data to the target service, and the initialization of the data distribution service layer includes creating at least one target domain participant, and creating the target service quality policy, target topic, first data reader and first data writer corresponding to the target service under the target domain participant.
[0097] Matching module 503 is used to perform the discovery process of data distribution service through data distribution service layer, and to determine the second data reader and the second data writer under the discovered target service;
[0098] The notification module 504 is used to notify the SOA interface layer of the matching results between the target data reader and the target data writer; wherein, the target data reader includes the first data reader and the second data reader, and the target data writer includes the first data writer and the second data writer;
[0099] The service status marking module 505 is used by the SOA interface layer to mark the service status of the target service based on the matching result.
[0100] This device initializes the target service by calling the service initialization interface of the SOA interface layer through the application layer, and initializes the data distribution service layer by calling the data distribution service interface through the SOA interface layer. Next, the data distribution service layer performs the data distribution service discovery process, matching the discovered second data reader and second data writer under the target service with the first data reader and first data writer created during the initialization, and marking the service status of the target service according to the matching results. The marking process conforms to the data distribution service standard, which improves the universality and accuracy of service status notification.
[0101] like Figure 6 As shown, the third embodiment of this application provides an electronic device, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0102] Memory 113 is used to store computer programs;
[0103] In one embodiment, when the processor 111 executes the program stored in the memory 113, it implements the service status notification method provided in any of the foregoing method embodiments.
[0104] The memory and processor in the aforementioned electronic devices communicate with each other via a communication bus and communication interface. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc.
[0105] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0106] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0107] The fourth embodiment of this application provides a computer-readable medium having processor-executable non-volatile program code.
[0108] Optionally, in embodiments of this application, the computer-readable medium is configured to store program code for a processor to execute the above-described methods.
[0109] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.
[0110] In specific implementation, the embodiments of this application can be referred to the above embodiments and have corresponding technical effects.
[0111] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions of this application, or combinations thereof.
[0112] For software implementation, the techniques described herein can be implemented through units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented within the processor or external to the processor.
[0113] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0114] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0115] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0116] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0117] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0118] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0119] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0120] The above embodiments are merely preferred embodiments provided to fully illustrate this application, and the scope of protection of this application is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on this application are all within the scope of protection of this application.
Claims
1. A service status notification method, characterized in that, The method includes: The target service is initialized by calling the service initialization interface of the SOA interface layer from the application layer. The data distribution service layer is initialized by calling the data distribution service interface through the SOA interface layer; wherein, the data distribution service layer is used to distribute data to the target service, and the initialization of the data distribution service layer includes creating at least one target domain participant, and creating the target service quality policy, target topic, first data reader and first data writer corresponding to the target service under the target domain participant. The data distribution service discovery process is performed by the data distribution service layer to determine the second data reader and the second data writer under the discovered target service; The matching results of the target data reader and the target data writer are notified to the SOA interface layer; wherein, the target data reader includes the first data reader and the second data reader, and the target data writer includes the first data writer and the second data writer; The SOA interface layer marks the service status of the target service based on the matching result.
2. The method according to claim 1, characterized in that, After the SOA interface layer marks the service status of the target service based on the matching result, the method further includes: The data distribution service layer monitors the matching status between the target data reader and the target data writer. If the matching status changes, the SOA interface layer will be notified of the matching change information; The SOA interface layer updates the matching result based on the matching change information, and updates the service status of the target service based on the matching result.
3. The method according to claim 1, characterized in that, The data distribution service layer is initialized by calling the data distribution service interface through the SOA interface layer, including: Identify the target domain within the same process that has not yet created a domain participant; For each target domain, create a target domain participant corresponding to that target domain; Under the target domain participants, the target service quality policy, target topic, first data reader, and first data writer are created for the target service.
4. The method according to claim 1, characterized in that, The discovery process of the data distribution service is performed through the data distribution service layer to determine the second data reader and the second data writer under the discovered target service, including: The simple participant discovery protocol and simple endpoint discovery protocol of the data distribution service are used to discover all second data readers and all second data writers under the target service; The first data reader and the second data reader are designated as target data readers, and the first data writer and the second data writer are designated as target data writers; The target data reader and the target data writer are matched to obtain the matching result.
5. The method according to claim 4, characterized in that, Matching the target data reader and the target data writer to obtain the matching result includes: Obtain the first target topic, first target data type, and first target quality of service policy corresponding to the target data reader; Obtain the second target topic, second target data type, and second target quality of service policy corresponding to the target data writer; If the first target topic is consistent with the second target topic, the first target data type is consistent with the second target data type, and the first target quality of service policy is consistent with the second target quality of service policy, then the match is determined to be successful. If the first target topic is inconsistent with the second target topic, and / or the first target data type is inconsistent with the second target data type, and / or the first target quality of service policy is inconsistent with the second target quality of service policy, the matching is determined to be unsuccessful. Accordingly, the SOA interface layer marks the service status of the target service based on the matching result, including: If all matching results between the target data reader and the target data writer indicate a successful match, then the service status of the target service is marked as online. If either the target data reader or the target data writer indicates a match failure, then the service status of the target service is marked as offline.
6. The method according to claim 1, characterized in that, The initialization of the data distribution service layer also includes creating topics; wherein the topics are named according to preset rules; the preset rules include at least two of the following: service name, interface name, and communication type.
7. The method according to claim 1, characterized in that, The data distribution service layer includes a first communication node; other data distribution service layers under the target service include a second communication node; after notifying the SOA interface layer of the matching results of the target data reader and the target data writer, the method further includes: The first communication node and the second communication node perform heartbeat detection; wherein, the first communication node is associated with the first data reader and the first data writer; the second communication node is associated with the third data reader among the second data readers and the third data writer among the second data writers; If the first communication node does not receive a heartbeat packet from the second communication node within a preset time period, a first matching result is determined; wherein the first matching result includes the first data reader failing to match the third data writer, and the first data writer failing to match the third data reader; Update the service status of the target service based on the first matching result.
8. A service status notification device, characterized in that, The device includes: The first initialization module is used to initialize the target service by calling the service initialization interface of the SOA interface layer through the application layer; The second initialization module is used to initialize the data distribution service layer by calling the data distribution service interface through the SOA interface layer; wherein, the data distribution service layer is used to distribute data to the target service, and the initialization of the data distribution service layer includes creating at least one target domain participant, and creating the target service quality policy, target topic, first data reader and first data writer corresponding to the target service under the target domain participant. The matching module is used to perform the discovery process of the data distribution service through the data distribution service layer, and to determine the second data reader and the second data writer under the discovered target service; The notification module is used to notify the SOA interface layer of the matching results between the target data reader and the target data writer; wherein, the target data reader includes the first data reader and the second data reader, and the target data writer includes the first data writer and the second data writer; The service status marking module is used by the SOA interface layer to mark the service status of the target service based on the matching result.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.
Citation Information
Patent Citations
Heterogeneous data integration system for service-oriented architecture (SOA) multi-message mechanism
CN102402507A
Service monitoring method, service monitoring device, computer equipment and storage medium
CN107888444A