Service state notification method and device, electronic equipment and storage medium
By initializing the target service and data distribution service layers in the on-board SOA architecture, matching data readers and data writers, the problem of limitations of service status notification under the DDS standard is solved, and efficient and accurate service status notification is achieved.
Patent Information
- Application Number
- CN202510040232.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-01-10
AI Technical Summary
In the on-board SOA architecture, the DDS standard requires successful topic matching to communicate normally, resulting in the use of service identification information to inform the service upstream and downstream status and cannot effectively solve the problem of service status notification.
The target service is initialized through the application layer calling the service initialization interface of the SOA interface layer, and the data distribution service layer is initialized through the SOA interface layer calling the data distribution service interface, creating target domain participants, target service quality policy, target topic, data reader and data writer. Then, the discovery process of the data distribution service is performed through the data distribution service layer, the second data reader and the second data writer under the target service are determined, and they are matched with the first data reader and the first data writer created in the initialization, and the service status of the target service is marked according to the matching result.
The service status notification that complies with the DDS standard is realized, the universality and accuracy of service status notification is improved, and the problem of limitations of service status notification in the prior art is solved.
Smart Images

Figure CN119854357A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a service status notification method, device, electronic device and storage medium. Background Art
[0002] The addition of in-vehicle Ethernet has greatly changed the in-vehicle network architecture. At the same time, in the automotive field, service-oriented architecture (SOA) can help achieve high modularity, scalability and maintainability of automotive software systems, and has been increasingly used. In the in-vehicle SOA architecture, communication middleware is needed to decouple the upper-layer design and underlying transmission issues. Data Distribution Service (DDS) as a communication middleware has become the choice of more OEMs because of its data characteristics.
[0003] In actual applications, SOA service users (clients) need to know the status of the service, that is, whether the service is available. In some related solutions, service identification information is used to notify the online and offline status of the service. However, in the DDS standard, normal communication is possible only after the topic is successfully matched. Therefore, using service identification information to notify the online and offline status of the service has certain limitations. 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 technical problem or at least partially solve the above technical problem, the present application provides a service status notification method, device, electronic device and storage medium.
[0005] In a first aspect, the present application provides a service status notification method, the method comprising:
[0006] Initialize the target service by calling the service initialization interface of the SOA interface layer through 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 a target service quality policy, a target subject, a first data reader and a first data writer corresponding to the target service under the target domain participant;
[0008] Performing a discovery process of the data distribution service through the data distribution service layer to determine the second data reader and the second data writer under the target service that are discovered;
[0009] Notifying the SOA interface layer of the matching result of 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;
[0010] The SOA interface layer marks the service status of the target service according to the matching result.
[0011] Optionally, after the SOA interface layer marks the service status of the target service according to the matching result, the method further includes:
[0012] The data distribution service layer monitors the matching status of the target data reader and the target data writer;
[0013] In the case where the matching state changes, notifying the SOA interface layer of the matching change information;
[0014] The SOA interface layer updates the matching result according to the matching change information, and updates the service status of the target service according to 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] Determine the target domains in the same process where no domain participants have been created;
[0017] For each of the target domains, create a target domain participant corresponding to the target domain;
[0018] A target service quality policy, a target topic, a first data reader, and a first data writer corresponding to the target service are created under the target domain participant.
[0019] Optionally, performing a discovery process of the data distribution service through the data distribution service layer to determine the discovered second data reader and second data writer under the target service includes:
[0020] Execute a simple participant discovery protocol and a simple endpoint discovery protocol of a data distribution service to discover all second data readers and all second data writers under the target service;
[0021] taking the first data reader and the second data reader as target data readers, and taking the first data writer and the second data writer as target data writers;
[0022] The target data reader is matched with the target data writer to obtain the matching result.
[0023] Optionally, matching the target data reader with the target data writer to obtain the matching result includes:
[0024] Acquire a first target topic, a first target data type, and a first target quality of service policy corresponding to the target data reader;
[0025] Acquire a second target topic and a second target data type and a second target service quality policy corresponding to the target data writer;
[0026] In the case where the first target subject is consistent with the second target subject, 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, determining that the match is successful;
[0027] In the case where the first target subject is inconsistent with the second target subject, 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, determining that the match fails;
[0028] Correspondingly, the SOA interface layer marks the service status of the target service according to the matching result, including:
[0029] If all the matching results of the target data reader and the target data writer indicate a successful match, marking the service status of the target service as service online;
[0030] If any matching result of the target data reader and the target data writer indicates a matching failure, the service status of the target service is marked as service offline.
[0031] Optionally, the initialization of the data distribution service layer also includes creating a topic; wherein the topic is named according to a preset rule; the preset rule includes at least two of a service name, an interface name and a 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 result between the target data reader and the target data writer, the method further includes:
[0033] The first communication node performs heartbeat detection with the second communication node; wherein the first communication node associates the first data reader with the first data writer; the second communication node associates a third data reader among the second data readers with a third data writer among the second data writers;
[0034] If the first communication node does not receive the heartbeat packet of the second communication node within the preset time, a first matching result is determined; wherein the first matching result includes that the first data reader fails to match the third data writer, and the first data writer fails to match the third data reader;
[0035] The service status of the target service is updated according to the first matching result.
[0036] In a second aspect, the present 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] A 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 a target service quality policy, a target subject, a first data reader, and a first data writer corresponding to the target service under the target domain participant;
[0039] A matching module, used for performing a discovery process of a data distribution service through a data distribution service layer, and determining a second data reader and a second data writer under the target service that is discovered;
[0040] A notification module, used to notify the SOA interface layer of the matching result 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 for marking the service status of the target service at the SOA interface layer according to the matching result.
[0042] In a third aspect, the present 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 via the communication bus;
[0043] Memory, used to store computer programs;
[0044] The processor is used to implement the steps of the service status notification method described in any one of the embodiments of the first aspect when executing the program stored in the memory.
[0045] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the service status notification method as described in any one of the embodiments of the first aspect are implemented.
[0046] Beneficial effects of this application:
[0047] The method provided by the embodiment of the present application initializes the 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, a target subject, a first data reader and a first data writer corresponding to the target service under the target domain participant; executing the discovery process of the data distribution service through the data distribution service layer to determine the second data reader and the second data writer under the discovered target service; notifying the SOA interface layer of the matching result of 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 SOA interface layer marks the service status of the target service according to the matching result. The 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 discovery process is performed through the data distribution service layer, and the second data reader and the second data writer under the discovered target service are matched with the first data reader and the first data writer created by the initialization, and the service status of the target service is marked according to the matching result. The marking process complies with the data distribution service standard, and improves the universality and accuracy of the service status notification. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0050] Figure 1 A system architecture diagram of a service status notification method provided by an embodiment of the present application;
[0051] Figure 2 A flowchart of a service status notification method provided by an embodiment of the present application;
[0052] Figure 3 A schematic diagram of the structure of an SOA application provided in one embodiment of the present application;
[0053] Figure 4 A schematic diagram of a service status notification method provided by another embodiment of the present application;
[0054] Figure 5 A schematic diagram of the structure of a service status notification device provided by an embodiment of the present application;
[0055] Figure 6 A schematic diagram of the structure of an electronic device provided in accordance with an embodiment of the present application. DETAILED DESCRIPTION
[0056] The following will describe the implementation methods of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.
[0057] The first embodiment of the present application provides a service status notification method, which can be applied to Figure 1 The system architecture shown includes multiple SOA applications, and the multiple SOA applications are communicated and connected via the vehicle Ethernet. Specifically, the system architecture can be a vehicle, and the type of vehicle is not limited, for example, it can be a fuel vehicle, a pure electric vehicle, a hybrid vehicle or a fuel cell vehicle, etc.
[0058] Next, based on the system architecture, the service status notification method is described in detail, such as Figure 2 , methods include:
[0059] Step 201, initializing the target service by calling the service initialization interface of the SOA interface layer through the application layer.
[0060] SOA applications can be Figure 3, including the application layer, SOA interface layer and data distribution service layer (which can be referred to as DDS layer or DDS protocol layer), among which the SOA interface layer is located between the data distribution service layer and the application layer, and is used to encapsulate the interface or information of the data distribution service layer, and provide the encapsulated SOA service interface to the application for its call. For the application layer, all it sees is the defined SOA service interface, and it does not have to care about the details of the data distribution service layer. The SOA interface layer can be integrated into the SOA application in the form of source code, static library, or dynamic library. Considering the flexibility of integration, it can be integrated in the form of dynamic library. The data distribution service layer can be integrated into the SOA application in the form of source code, static library, or dynamic library. Considering the flexibility of integration, it can be integrated in the form of 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 in one process.
[0061] Step 202, calling the data distribution service interface through the SOA interface layer to initialize the data distribution service 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, the target topic topic, the first data reader DataReader and the first data writer DataWriter corresponding to the target service. Specifically, a publisher publisher and a subscriber subscriber can also be created.
[0063] Specifically, during the process of creating a topic, the topic is named according to a preset rule; the preset rule includes at least two of a service name, an interface name, and a 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 the preset rules. For example, topics can be divided into three categories according to the communication type: requests (Reques), responses (Reply), and notifications (NTF). The topic name can be named with the service name_communication type, such as: Basc_ACOperation_reques, Basc_ACOperation_reply, Basc_ACOperation_ntf, where Basc_ACOperation represents the service name, and reques, reply, and ntf represent the communication type respectively. Topic can also be named according to service name + interface name + communication type, for example: Basc_ACOperation_Get_ACState_request, Basc_ACOperation_Get_ACState_reply, Basc_ACOperation_Ntf_ACState_ntf, where Get_ACState represents the interface name. Of course, topic can also support division according to other rules without restriction, but the topic name 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 domain in which no domain participant has been created in the same process; creating a target domain participant corresponding to the target domain for each target domain; creating a target service quality policy, a target topic, a first data reader, and a first data writer corresponding to the target service under the target domain participant.
[0066] In this embodiment, in the same process, a domain participant is created in the same domain. If the domain participant creation has been completed, no new domain participant is created to avoid increased complexity and resource waste caused by multiple domain participants in one domain.
[0067] Step 203: executing a discovery process of the data distribution service 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, a discovery process of a data distribution service is executed through a data distribution service layer to determine the second data readers and second data writers under the discovered target service, including: executing a simple participant discovery protocol and a simple endpoint discovery protocol of the data distribution service to discover all second data readers and all second data writers under the target service; using the first data reader and the second data reader as target data readers, and using the first data writer and the second data writer as target data writers; 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 through the data distribution service layer to discover all second data readers DataReader and second data writers DataWriter under the target service, and then combined with the first data reader DataReader and the first data writer DataWriter initialized previously, all DataWriters and DataReaders are matched to obtain matching results, which include matching success and matching failure.
[0070] In one embodiment, a target data reader and a target data writer are matched to obtain a matching result, including: obtaining a first target subject, a first target data type, and a first target service quality policy corresponding to the target data reader; obtaining a second target subject, a second target data type, and a second target service quality policy corresponding to the target data writer; determining that the match is successful when the first target subject is consistent with the second target subject, the first target data type is consistent with the second target data type, and the first target service quality policy is consistent with the second target service quality policy; determining that the match fails when the first target subject is inconsistent with the second target subject, and / or the first target data type is inconsistent with the second target data type, and / or the first target service quality policy is inconsistent with the second target service quality policy.
[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 consistent, it can be determined that the match is successful. If any one of the topic, data type and Qos is inconsistent, it is determined that the match failed, so that the matching process meets the data distribution service standard and improves the universality and accuracy of service status notification.
[0072] Specifically, SOA services can be divided into clients and servers. The client is the calling end of the service, and the server is the implementation end of the service. The server calls the SOA service initialization interface to announce the DataWriter and DataReader supported by the service and related information on the vehicle Ethernet. The client calls the SOA service initialization interface to announce the DataWriter and DataReader supported by the service and related information on the vehicle Ethernet. Relying on the DDS standard discovery protocol, the DataWriter and DataReader are matched, and the matching results are notified to the upper layer. For example, if all DataWriters and DataReaders under the service are matched successfully, the SOA interface layer can mark the service online, otherwise the service can be marked offline. After marking the service status, the application layer can be notified through callback.
[0073] Step 204, notifying the SOA interface layer of the matching result of 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.
[0074] Step 205: The SOA interface layer marks the service status of the target service according to the matching result.
[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 a successful match, 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 a failed match, then the service status of the target service is marked as offline.
[0076] The 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 discovery process is performed through the data distribution service layer, and the second data reader and the second data writer under the discovered target service are matched with the first data reader and the first data writer created by the initialization, and the service status of the target service is marked according to the matching result. The marking process complies with the data distribution service standard, and improves the universality and accuracy of the service status notification.
[0077] In one embodiment, after the SOA interface layer marks the service status of the target service according to the matching result, the method also includes: the data distribution service layer monitors the matching status of the target data reader and the target data writer; when the matching status changes, notifies the SOA interface layer of the matching change information; the SOA interface layer updates the matching result according to the matching change information, and updates the service status of the target service according to the matching result.
[0078] In this embodiment, after the SOA interface layer marks the service status of the target service according to the matching results, the data distribution service layer can monitor the matching status of the target data reader and the target data writer. When the matching status changes, the SOA interface layer is notified of the matching change information. The SOA interface layer can update the matching results according to the matching change information, and update the service status of the target service according to the matching results, thereby keeping the service status up to date at all times and improving the accuracy of service status notifications.
[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 result of the target data reader and the target data writer, the method also includes: the first communication node and the second communication node perform heartbeat detection; wherein the first communication node associates the first data reader and the first data writer; the second communication node associates 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 the heartbeat packet of the second communication node within a preset time period, a first matching result is determined; wherein the first matching result includes a failure to match the first data reader with the third data writer, and a failure to match the first data writer with the third data reader; and the service status of the target service is updated according to the first matching result.
[0080] In this embodiment, the first communication node may be a domain participant, and the second communication node may be a domain participant in other data distribution service layers under the same domain ID of the target service. Heartbeat detection may be performed between the first communication node and the second communication node in different data distribution service layers corresponding to the same domain ID to detect whether the other party is online. For example, both parties may send heartbeat packets at a certain frequency. When the heartbeat packet of the other party is not received for more than a predetermined preset time, it is considered that the connection with the other party has been disconnected. When the data distribution service layer finds that the other party is disconnected, it notifies 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. The changed service status is actively notified to the application layer, thereby improving the response speed after the service status changes according to the heartbeat detection, so that the service status can be updated quickly and accurately.
[0081] In a 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, and the SOA interface layer calls the DDS interface to create domain participants, create QoS, create topics, create DataReaders, create DataWriters, and perform DDS initialization. Specifically, publishers and subscribers can also be created during initialization.
[0083] Step 402, DDS discovery process, the DDS layer notifies the SOA interface layer of the result (success / failure) of the matching of DataWriter and DataReader. The DDS discovery process is usually SPDP (Simple Participant Discovery Protocol) and SEDP (Simple Endpoint Discovery Protocol). If SPDP has been completed, only the SEDP process is performed. After the above process is completed, the DDS layer notifies the SOA interface layer of the result (success / failure) of the matching of DataWriter and DataReader (topic, data type and QoS associated with the 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 the service are successfully matched, the service is marked as online, otherwise it is offline and notified to the application layer through a callback.
[0085] Step 404, the DDS layer discovers that the matching status of the DataWriter and DataReader has changed, and actively informs the SOA interface layer of the change information. The SOA interface layer updates the matching status of the DataWriter and DataReader, and updates the related 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 the SOA service can be marked according to the matching result. The marking process complies with the data distribution service standard, which improves the universality and accuracy of the service status notification.
[0087] In this embodiment, in the same process, a domain participant is created in the same Domain. If the domain participant creation has been completed, no new domain participant is created.
[0088] For example, define an air conditioning service 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 service air conditioning status information by calling Get_ACState(), call Set_ACOpen() to control the air conditioning to turn on, and call InitService() to initialize the service.
[0093] Furthermore, the application layer can also actively obtain the service status through the Get interface.
[0094] Based on the same technical concept, the second embodiment of the present application provides a service status notification device, such as Figure 5 , the device comprises:
[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 a target service quality policy, a target subject, a first data reader, and a first data writer corresponding to the target service under the target domain participant;
[0097] A matching module 503 is used to perform a discovery process of a data distribution service through a data distribution service layer, and determine a second data reader and a second data writer under the target service that are discovered;
[0098] A notification module 504, used to notify the SOA interface layer of the matching result of 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 for the SOA interface layer to mark the service status of the target service according to the matching result.
[0100] The 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 discovery process is performed through the data distribution service layer, and the second data reader and the second data writer under the discovered target service are matched with the first data reader and the first data writer created by the initialization, and the service status of the target service is marked according to the matching result. The marking process complies with the data distribution service standard, and improves the universality and accuracy of the service status notification.
[0101] like Figure 6 As shown, the third embodiment of the present 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, used for storing computer programs;
[0103] In one embodiment, the processor 111 is configured to implement the service status notification method provided by any one of the aforementioned method embodiments when executing a program stored in the memory 113 .
[0104] The memory and processor in the above electronic device communicate through the communication bus and the communication interface. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus can be divided into an address bus, a data bus, a control bus, etc.
[0105] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0106] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0107] A fourth embodiment of the present application provides a computer-readable medium having a non-volatile program code executable by a processor.
[0108] Optionally, in an embodiment of the present application, a computer-readable medium is configured to store program code for a processor to execute the above method.
[0109] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0110] When the embodiments of the present application are specifically implemented, reference may be made to the above-mentioned embodiments, which have corresponding technical effects.
[0111] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions of the present application, or a combination thereof.
[0112] For software implementation, the technology of this article can be implemented by a unit that performs the functions of this article. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0113] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0114] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0115] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0117] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0118] If the function is implemented in the form of 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 solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for 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 of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0119] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0120] The above embodiments are only preferred embodiments for fully illustrating the present application, and the protection scope of the present application is not limited thereto. Any equivalent substitution or change made by a person skilled in the art based on the present application is within the protection scope of the present application.
Claims
1. A service status notification method, characterized in that: The method comprises: Initialize the target service by calling the service initialization interface of the SOA interface layer through 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 a target service quality policy, a target subject, a first data reader, and a first data writer corresponding to the target service under the target domain participant; Performing a discovery process of the data distribution service through the data distribution service layer to determine the second data reader and the second data writer under the target service that are discovered; Notifying the SOA interface layer of the matching result of 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 SOA interface layer marks the service status of the target service according to 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 according to the matching result, the method further includes: The data distribution service layer monitors the matching status of the target data reader and the target data writer; In the case where the matching state changes, notifying the SOA interface layer of the matching change information; The SOA interface layer updates the matching result according to the matching change information, and updates the service status of the target service according to the matching result.
3. The method according to claim 1, characterized in that Initialize the data distribution service layer by calling the data distribution service interface through the SOA interface layer, including: Determine the target domains in the same process where no domain participants have been created; For each of the target domains, create a target domain participant corresponding to the target domain; A target service quality policy, a target topic, a first data reader, and a first data writer corresponding to the target service are created under the target domain participant.
4. The method according to claim 1, characterized in that: Performing a discovery process of the data distribution service through the data distribution service layer to determine the second data reader and the second data writer under the discovered target service includes: Execute a simple participant discovery protocol and a simple endpoint discovery protocol of a data distribution service to discover all second data readers and all second data writers under the target service; taking the first data reader and the second data reader as target data readers, and taking the first data writer and the second data writer as target data writers; The target data reader is matched with the target data writer 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: Acquire a first target topic, a first target data type, and a first target quality of service policy corresponding to the target data reader; Acquire a second target topic and a second target data type and a second target service quality policy corresponding to the target data writer; In the case where the first target subject is consistent with the second target subject, 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, determining that the match is successful; In the case where the first target subject is inconsistent with the second target subject, 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, determining that the match fails; Correspondingly, the SOA interface layer marks the service status of the target service according to the matching result, including: If all the matching results of the target data reader and the target data writer indicate a successful match, marking the service status of the target service as service online; If any matching result of the target data reader and the target data writer indicates a matching failure, the service status of the target service is marked as service offline.
6. The method according to claim 1, characterized in that The initialization of the data distribution service layer also includes creating a topic; wherein the topic is named according to a preset rule; the preset rule includes at least two of a service name, an interface name, and a communication type.
7. The method according to claim 1, characterized in that The data distribution service layer includes a first communication node; the other data distribution service layers under the target service include a second communication node; after notifying the SOA interface layer of the matching result between the target data reader and the target data writer, the method further includes: The first communication node performs heartbeat detection with the second communication node; wherein the first communication node associates the first data reader with the first data writer; the second communication node associates a third data reader among the second data readers with a third data writer among the second data writers; If the first communication node does not receive the heartbeat packet of the second communication node within the preset time, a first matching result is determined; wherein the first matching result includes that the first data reader fails to match the third data writer, and the first data writer fails to match the third data reader; The service status of the target service is updated according to the first matching result.
8. A service status notification device, characterized in that: The device comprises: 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; A 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 a target service quality policy, a target subject, a first data reader, and a first data writer corresponding to the target service under the target domain participant; A matching module, used for performing a discovery process of a data distribution service through a data distribution service layer, and determining a second data reader and a second data writer under the target service that is discovered; A notification module, used to notify the SOA interface layer of the matching result 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 for marking the service status of the target service at the SOA interface layer according to 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, for implementing the method according to any one of claims 1 to 7 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
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
Pattern matching based dataset extraction
CN108780485A
Service model based on SOA and DDS and distributed data communication method
CN111698308A
Service providing method and device, service consumption method and device, and equipment
CN113055415A
Cited By
Topic-centered discovery mechanism in lightweight DDS
CN120639852A