Event subscription method and related apparatus

By including information about the event sending method in the subscription request, the frequency and content of event sending can be controlled, thus resolving the bus bandwidth consumption problem caused by invalid events in the domain controller, reducing the probability of target function failure, and improving the accuracy and compatibility of event subscription.

WO2026037356A1PCT designated stage Publication Date: 2026-02-19YINWANG INTELLIGENT TECHNOLOGIES CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/114570
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-15
Filing Date
2025-08-14
Publication Date
2026-02-19

AI Technical Summary

Technical Problem

When a domain controller calls a service through the service publish/subscribe function, the target function may fail. Existing technologies are unable to effectively reduce the probability of failure caused by invalid events consuming bus bandwidth.

Method used

By including information indicating the event sending method in the subscription request, the frequency and content of event sending can be controlled, the probability of invalid events being sent can be reduced, the applicable scope can be expanded by adopting a flexible information representation method, and the bus bandwidth usage can be reduced.

Benefits of technology

It reduces the probability of domain controller target function failures, improves the accuracy and compatibility of event subscriptions, and reduces the bus bandwidth consumption of invalid event transmissions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025114570_19022026_PF_FP_ABST
    Figure CN2025114570_19022026_PF_FP_ABST
Patent Text Reader

Abstract

The embodiments of the present application relate to the technical field of onboard management. Provided are an event subscription method and a related apparatus. In the method, first information used for indicating an event sending mode is carried in a sent first subscription request, such that when the first subscription request is used to subscribe to an event occurring in a domain controller in an electronic and electrical architecture of a vehicle, the domain controller is instructed to send the event in the event sending mode indicated in the first subscription request. In this way, the probability of occurrence of an invalid event can be reduced, thereby reducing the occupation for the bus bandwidth in the electronic and electrical architecture of the vehicle caused by the transmission of the invalid event, and reducing the probability of occurrence of a target functional fault of the domain controller.
Need to check novelty before this filing date? Find Prior Art

Description

Event subscription method and related apparatus

[0001] The present application claims priority to the Chinese patent application No. 202411127185.2, filed on August 15, 2024, and entitled "Event subscription method and related apparatus", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] The present application relates to the technical field of vehicle management, and in particular to an event subscription method and related apparatus. BACKGROUND

[0003] The electronic and electrical architecture of some vehicles can include a domain controller (DC) corresponding to each functional domain in a plurality of functional domains of the vehicle. The plurality of functional domains of the vehicle can include a powertrain domain, a chassis domain, a body domain, a cabin domain, an intelligent driving domain, etc. The domain controller can be used to manage and control the related functions of the corresponding functional domain.

[0004] In some implementations, the electronic and electrical architecture adopts a service oriented architecture (SOA). The SOA architecture can implement encapsulation of the functions of each domain controller in the electronic and electrical architecture in the form of services, and assign specific internet protocol (IP) addresses and standardized interfaces to each service, so that the domain controllers in the electronic and electrical architecture can call the encapsulated services at any time, and thus achieve the target function through the combination of multiple services. Exemplarily, the communication protocol of the SOA architecture can include a scalable service-oriented middleware over IP (SOME / IP) protocol. The SOME / IP protocol has a service publishing / subscription function. The domain controllers in the electronic and electrical architecture can achieve the calling of the encapsulated services through the service publishing / subscription function, and thus achieve the combination of multiple services.

[0005] However, in the scenario where the domain controller calls the service through the service publishing / subscription function to achieve the target function, the situation of failure of the target function can occur. SUMMARY

[0006] The present application provides an event subscription method and related apparatus, which can be applied to the technical field of vehicle management, and can reduce the probability of occurrence of the failure of the target function of the domain controller.

[0007] In a first aspect, an event subscription method is provided. The method comprises: sending a first subscription request, the first subscription request being used to subscribe to an event occurring in a first electronic device in a vehicle, the first subscription request comprising first information, the first information being used to indicate a sending manner of the event. An event subscribed based on the first subscription request is included in the event occurring in the first electronic device.

[0008] According to the above scheme, by carrying the first information used to indicate the sending manner of the event in the first subscription request, the first electronic device can send the event associated with the first information to the electronic device sending the first subscription request (or the electronic device subscribing to the event) in the sending manner of the event indicated by the first information. In this way, the probability that the first electronic device sends the event at a frequency higher than the demand frequency of the electronic device subscribing to the event can be reduced, and the probability that the invalid event occurs can be reduced, and the probability that the target function of the electronic device subscribing to the event fails due to the transmission of the invalid event occupying the bus bandwidth can be reduced.

[0009] In combination with the first aspect, in some implementations of the first aspect, the first information comprises a sending manner of each event in at least one event, and the at least one event is included in the event occurring in the first electronic device. Alternatively, the first information comprises a sending manner of each event group in at least one event group, and the at least one event group is included in the event occurring in the first electronic device, and the event group comprises at least one event.

[0010] According to the above scheme, the flexibility of the representation or expression of the first information can be achieved, and the application range of the event subscription method provided by the embodiments of the present application can be expanded.

[0011] In combination with the first aspect, in some implementations of the first aspect, the first information comprises an identifier of the event and the sending manner of the corresponding event. Alternatively, the first information comprises indication information of the event group and the sending manner of the corresponding event group, wherein the indication information of the event group is information indicating the event group, and the event group comprises at least one event.

[0012] According to the above scheme, the flexibility of the representation or expression of the first information can also be achieved, and the application range of the event subscription method provided by the embodiments of the present application can be expanded.

[0013] In combination with the first aspect, in some implementations of the first aspect, the first information can be represented in the following manner: <key, value>, wherein the key comprises an identifier of the event, and the value comprises the sending manner of the event. Alternatively, the key comprises indication information of the event group, and the value comprises the sending manner of the event group.

[0014] According to the above scheme, the flexibility of the first information representation or expression can be realized, and the application range of the event subscription method provided by the embodiments of the present application can be expanded.

[0015] In combination with the first aspect, in some implementations of the first aspect, the sending manner of the event includes an identifier of the sending manner of the event, and the sending manner of the event group includes an identifier of the sending manner of the event group.

[0016] According to the above scheme, compared with the first information containing the specific content of the sending manner of the event or the specific content of the sending manner of the event group, the sending manner of the event in the first information is represented by the identifier of the sending manner of the event, and the sending manner of the event group is represented by the identifier of the sending manner of the event group, which can reduce the data amount of the first information, and further reduce the occupation of the bus bandwidth by the transmission of the first subscription request.

[0017] In combination with the first aspect, in some implementations of the first aspect, the sending manner includes any one of a first manner, a second manner or a third manner. The first manner is used to indicate that the event is sent periodically, the second manner is used to indicate that the event is sent when the event reaches a preset threshold, and the third manner is used to indicate that the event is sent when the event changes. The first information includes at least one of the following: an event sending period, the event sending period being associated with the first manner. Alternatively, an identifier of the first manner and the event sending period, the event sending period being associated with the first manner. Alternatively, an identifier of the second manner and the preset threshold of the second manner. Alternatively, an identifier of the third manner.

[0018] According to the above scheme, the sending manner of the event indicated in the first information can be any one of the first manner, the second manner or the third manner.

[0019] In combination with the first aspect, in some implementations of the first aspect, the first subscription request further includes second information, and the second information is used to indicate part of events in the event group. The event group includes at least one event, and the event group is included in the events occurred in the first electronic device.

[0020] According to the above scheme, the first subscription request further includes the second information, which can make the first electronic device send the events associated with the second information to the electronic device subscribing to the events. The events associated with the second information are part of the events in the event group, instead of all the events in the event group. In this way, the probability of the first electronic device sending the events that are not needed by the electronic device subscribing to the events to the electronic device subscribing to the events can be reduced, and the occupation of the bus bandwidth by the invalid events can be further reduced.

[0021] In combination with the first aspect, in some implementations of the first aspect, the second information includes an identifier of each event in the part of events.

[0022] According to the above scheme, the first electronic device can send the events required by the electronic device subscribing to the events to the electronic device subscribing to the events. The second information includes the identifiers of the events in the part of the events, as shown in S802.

[0023] In combination with the first aspect, in some implementations of the first aspect, the second information further includes the first identifier, and the first identifier is used to indicate the part of the events in the event group.

[0024] According to the above scheme, the first electronic device can send the events required by the electronic device subscribing to the events to the electronic device subscribing to the events.

[0025] In combination with the first aspect, in some implementations of the first aspect, the second information is represented in the form of <key, value>, where the key includes the first identifier, and the value includes the identifiers of the events in the part of the events.

[0026] According to the above scheme, the first electronic device can send the events required by the electronic device subscribing to the events to the electronic device subscribing to the events. The representation of the second information can be referred to S802.

[0027] In combination with the first aspect, in some implementations of the first aspect, the first information indicates that the events are pre-registered on the vehicle before the vehicle is running, or are registered on the vehicle when the vehicle is running.

[0028] According to the above scheme, the first subscription request can carry the accurate first information or the first information meeting the requirements of the electronic device subscribing to the events.

[0029] In combination with the first aspect, in some implementations of the first aspect, before the first subscription request is sent, the method further includes: receiving a first service publishing packet from the first electronic device, the first service publishing packet being used to indicate a service provided by the first electronic device, the service including at least one event group, the event group including at least one event, and the at least one event group being included in the events occurred by the first electronic device.

[0030] According to the above scheme, the first service publishing packet is used to indicate the service provided by the first electronic device, the service including at least one event group, the event group including at least one event, and the at least one event group being included in the events occurred by the first electronic device. The first service publishing packet sent by the first electronic device can be used to notify the electronic device subscribing to the events to subscribe to the events, and to inform the electronic device subscribing to the events of the events that can be provided by the first electronic device, so as to facilitate the electronic device subscribing to the events to subscribe.

[0031] In some implementations of the first aspect, the first service publishing message includes third information indicating at least one sending mode supported by the event. The sending mode of the event indicated by the first information is selected from the third information.

[0032] According to the above scheme, the first service publishing message includes third information indicating at least one sending mode supported by the event, so that the electronic device subscribing to the event can select a suitable sending mode of the event from the sending modes of the event provided by the first service publishing message to subscribe to the event. On the other hand, the electronic device subscribing to the event can carry an identifier of the selected sending mode of the event in the first subscription request sent to the first electronic device, so as to reduce the data amount of the first subscription request, and further reduce the occupation amount of the bus bandwidth by the transmission of the first subscription request. In addition, the sending modes in the third information are all sending modes supported by the event of the first electronic device, and the sending mode of the event indicated by the first information is selected from the third information, so as to reduce the probability of occurrence of the sending mode of the event not supported by the first electronic device.

[0033] In some implementations of the first aspect, the sending mode of the event indicated by the first information is selected from a preset first set, and the first set includes at least one sending mode supported by the event occurred by the first electronic device.

[0034] According to the above scheme, the sending mode of the event indicated by the first information is selected from the preset first set, and the sending mode of the event can not be carried in the service publishing message sent by the first electronic device, so as to reduce the data amount of the service publishing message.

[0035] In some implementations of the first aspect, the first set includes any of the following: at least one sending mode supported by each event in at least one event. Or, at least one sending mode supported by each event group in at least one event group. Or, at least one sending mode supported by each service in at least one service, the service including at least one event group. Or, at least one sending mode supported by each electronic device in at least one electronic device, the electronic device providing at least one service. Or, at least one sending mode supported by each project in at least one project, the project being associated with at least one electronic device.

[0036] According to the above scheme, the first set includes the sending mode supported by each event in the at least one event, and the sending mode of the events in the first set can be represented in the form of event granularity. The first set includes the sending mode supported by each event group in the at least one event group, and the sending mode of all events in the event group in the first set can be represented in the form of event group granularity. The first set includes the sending mode supported by each service in the at least one service, and the sending mode of all events included in the service in the first set can be represented in the form of service granularity. The first set includes the sending mode supported by each electronic device in the at least one electronic device, and the sending mode of all events occurring in the communication node in the first set can be represented in the form of communication node granularity. The first set includes the sending mode supported by each project in the at least one project, and the sending mode of all events occurring in the communication node associated with the project in the first set can be represented in the form of project granularity.

[0037] In combination with the first aspect, in some implementations of the first aspect, the method further includes: sending a first subscription request, the first subscription request being used to subscribe to events occurring in a second electronic device in the vehicle, the first subscription request including fourth information, or the first subscription request including the fourth information and fifth information, the fourth information being used to indicate the sending mode of the events, and the fifth information being used to indicate part of events in a subscription event group, the subscription event group including at least one event, and the subscription event group being included in the events occurring in the second electronic device; receiving a first response used to indicate a subscription denial; marking the identity of the second electronic device as a second identity; sending a second subscription request, the second subscription request being used to subscribe to an event group of the second electronic device; and obtaining all events in an event group associated with the second subscription request.

[0038] According to the above scheme, in the case that the preset parsing rule of the second electronic device is not applicable to parsing the first subscription request, the electronic device subscribing to the events can subscribe to all events in the target event group of the second electronic device. The occurrence probability of the failure of the electronic device subscribing to the events in the case that the preset parsing rule of the second electronic device is not applicable to parsing the first subscription request is reduced. The compatibility of the event subscription of the second electronic device is improved.

[0039] In combination with the first aspect, in some implementations of the first aspect, the method further includes: sending a first subscription request, the first subscription request being used to subscribe to events occurring in a third electronic device in the vehicle, the first subscription request including sixth information, or the first subscription request including the sixth information and seventh information, the sixth information being used to indicate the sending mode of the events, and the seventh information being used to indicate part of events in a subscription event group, the subscription event group including at least one event, and the subscription event group being included in the events occurring in the third electronic device; and obtaining all events in an event group associated with the first subscription request, the event group associated with the first subscription request being included in the events occurring in the third electronic device.

[0040] According to the above scheme, in the case that the preset parsing rule of the third electronic device is not applicable to parsing the first subscription request, the electronic device subscribing to the events can subscribe to all events in the target event group of the third electronic device. The probability of failure of the electronic device subscribing to the events in the case that the preset parsing rule of the third electronic device is not applicable to parsing the first subscription request is reduced. The compatibility of the event subscription of the third electronic device is improved.

[0041] In a second aspect, an event subscription method is provided. The method comprises: receiving a first subscription request, the first subscription request being used for subscribing to an event occurring in a first electronic device in a vehicle, the first subscription request comprising first information or the first subscription request comprising first information and second information, the first information being used for indicating a sending mode of the event, and the second information being used for indicating part of events in a subscription event group, the subscription event group comprising at least one event, and the subscription event group being included in the event occurring in the first electronic device. Based on the first information or based on the first information and the second information, the event indicated by the first subscription request is distributed.

[0042] According to the above scheme, by carrying the first information used for indicating the sending mode of the event in the first subscription request, the first electronic device can send the event associated with the first information to the electronic device sending the first subscription request (or the electronic device subscribing to the event) according to the sending mode of the event indicated by the first information. In this way, the probability that the frequency of the first electronic device sending the event is higher than the demand frequency of the electronic device subscribing to the event for the event can be reduced, and the probability that the invalid event occurs can be reduced. The probability that the target function of the electronic device subscribing to the event fails due to the transmission of the invalid event occupying the bus bandwidth can be reduced.

[0043] In combination with the second aspect, in some implementations of the second aspect, the first information comprises a sending mode of a target event, and the sending mode of the target event comprises information used for indicating a first period of periodically sending the target event. The target event is any event in the event indicated by the first subscription request. Based on the first information or based on the first information and the second information, the event indicated by the first subscription request is distributed, comprising: setting a first distribution condition of the target event according to the first period of the target event and a preset period of the target event, the preset period of the target event being a preset period used for indicating the periodic sending of the target event. Based on the first distribution condition of the target event, the target event is transmitted to the electronic device sending the first subscription request.

[0044] According to the above scheme, since the target event is any event in the event indicated by the first subscription request, the event subscribed by the electronic device subscribing to the event can be transmitted based on the first information or based on the first information and the second information, so as to reduce the probability that the invalid event occurs.

[0045] With reference to the second aspect, in some implementations of the second aspect, the first distribution condition of the target event comprises a first factor of the target event. The first factor of the target event is positively correlated with the first period of the target event and negatively correlated with a preset period of the target event. Based on the first distribution condition of the target event, the target event is transmitted to the electronic device that sends the first subscription request, comprising: when the number of times that the first electronic device occurs the target event reaches the first factor, the target event is sent. The number of times that the first electronic device occurs the target event is counted from the first target event after subscribing to the target event, or counted from the first target event after sending the target event.

[0046] According to the above scheme, the event subscribed by the electronic device can be transmitted based on the first information or the first information and the second information, so as to reduce the probability of occurrence of invalid events.

[0047] With reference to the second aspect, in some implementations of the second aspect, the first factor δ of the target event satisfies: δ = max(1,‖T C / T S ‖)

[0048] max(1,‖T C / T S ‖) represents taking the maximum value from 1 and ‖T C / T S ‖, ‖‖ represents the integer part, T C is the first period, and T S is the preset period.

[0049] According to the above scheme, the event subscribed by the electronic device can be transmitted based on the first information or the first information and the second information, so as to reduce the probability of occurrence of invalid events. In addition, when the first period T C of the target event is less than the preset period T S of the target event, T C / T S is less than 1, and δ = 1. δ = 1 can represent that the first electronic device can send the target event to the electronic device that subscribes to the target event according to the preset period of the target event. It should be understood that the electronic device that subscribes to the target event refers to the electronic device that indicates the first period of the target event. The first period T C of the target event is less than the preset period T S of the target event, which can be understood as: the sending mode of the target event preset by the first electronic device cannot meet the demand frequency of the target event of the electronic device that subscribes to the target event.

[0050] With reference to the second aspect, in some implementations of the second aspect, the first distribution condition of the target event further comprises: a third identifier and an identifier of the electronic device subscribing to the event, the third identifier being used to indicate that the event has been subscribed.

[0051] According to the above scheme, since the event associated with the second information is an event required by the electronic device subscribing to the event. In the case that the first subscription request comprises the first information and the second information, if the distribution condition of the target event comprises the third identifier, when the target event meets the distribution condition of the target event, the first electronic device can transmit the target event to the electronic device subscribing to the event. If the distribution condition of the target event does not comprise the third identifier, it can be indicated that the target event is not an event required by the electronic device subscribing to the event, and when the target event meets the distribution condition of the target event, the first electronic device can not transmit the target event to the electronic device subscribing to the event. In this way, the probability of the first electronic device transmitting an event not required by the client to the electronic device subscribing to the event can be reduced, and the probability of occurrence of invalid events can be reduced.

[0052] With reference to the second aspect, in some implementations of the second aspect, the first information comprises a sending manner of the target event, the sending manner of the target event is a second manner, the target event is any one of the events indicated by the first subscription request to subscribe to, and the second manner is used to indicate that the event is sent when the event reaches a preset threshold. Based on the first information, or based on the first information and the second information, the events indicated by the first subscription request to subscribe to are distributed, comprising: setting a second distribution condition of the target event, the second distribution condition of the target event being used to indicate that the target event is sent when the target event reaches a preset threshold. Based on the second distribution condition of the target event, the target event is transmitted to the electronic device sending the first subscription request.

[0053] According to the above scheme, the first electronic device can transmit the target event to the electronic device subscribing to the event according to the second distribution condition of the target event, so as to reduce the probability of occurrence of invalid events.

[0054] With reference to the second aspect, in some implementations of the second aspect, the second distribution condition of the target event further comprises: a third identifier and an identifier of the electronic device subscribing to the event, the third identifier being used to indicate that the event has been subscribed.

[0055] According to the above scheme, since the event associated with the second information is an event required by the electronic device subscribing to the event. In the case that the first subscription request includes the first information and the second information, if the distribution condition of the target event includes the third identifier, the first electronic device can transmit the target event to the electronic device subscribing to the event when the target event meets the distribution condition of the target event. If the distribution condition of the target event does not include the third identifier, it can be indicated that the target event is not an event required by the electronic device subscribing to the event, and the first electronic device can not transmit the target event to the electronic device subscribing to the event when the target event meets the distribution condition of the target event. To reduce the probability of the first electronic device transmitting events that the client does not need to the electronic device subscribing to the event, to reduce the probability of occurrence of invalid events.

[0056] In combination with the second aspect, in some implementations of the second aspect, the first information includes a sending manner of the target event, the sending manner of the target event is a third manner, the target event is any one of the events indicated by the first subscription request to subscribe to, and the third manner is used to indicate that the event is sent when the event changes. Based on the first information, or based on the first information and the second information, the events indicated by the first subscription request to subscribe to are distributed, including: setting a third distribution condition of the target event, the third distribution condition of the target event is used to indicate that the target event is sent when the target event changes. Based on the third distribution condition of the target event, the target event is transmitted to the electronic device sending the first subscription request.

[0057] According to the above scheme, the first electronic device can transmit the target event to the electronic device subscribing to the event according to the third distribution condition of the target event, so as to reduce the probability of occurrence of invalid events.

[0058] In combination with the second aspect, in some implementations of the second aspect, the second distribution condition of the target event further includes: a third identifier and an identifier of the electronic device subscribing to the event, and the third identifier is used to indicate that the event has been subscribed.

[0059] According to the above scheme, since the event associated with the second information is an event required by the electronic device subscribing to the event. In the case that the first subscription request includes the first information and the second information, if the distribution condition of the target event includes the third identifier, the first electronic device can transmit the target event to the electronic device subscribing to the event when the target event meets the distribution condition of the target event. If the distribution condition of the target event does not include the third identifier, it can be indicated that the target event is not an event required by the electronic device subscribing to the event, and the first electronic device can not transmit the target event to the electronic device subscribing to the event when the target event meets the distribution condition of the target event. To reduce the probability of the first electronic device transmitting events that the client does not need to the electronic device subscribing to the event, to reduce the probability of occurrence of invalid events.

[0060] With reference to the second aspect, in some implementations of the second aspect, before receiving the first subscription request, the method further includes: sending a first service publishing message. The first service publishing message is used to indicate a service provided by the first electronic device, the service including at least one event group, and the event group associated with the service provided by the first electronic device including at least one event occurring in the first electronic device.

[0061] According to the above scheme, the first service publishing message is used to indicate a service provided by the first electronic device, the service including at least one event group, the event group including at least one event, and the at least one event group including events occurring in the first electronic device. The first service publishing message sent by the first electronic device can be used to notify an electronic device subscribing to events to subscribe to events and to inform the electronic device subscribing to events of events that can be provided by the first electronic device, so as to facilitate the electronic device subscribing to events to subscribe.

[0062] With reference to the second aspect, in some implementations of the second aspect, the first service publishing message includes third information used to indicate at least one sending mode supported by the event, the at least one sending mode supported by the event indicated by the third information being selected from a second set of pre-registered sending modes, and the second set of pre-registered sending modes including at least one sending mode supported by the event occurring in the first electronic device. The second set of pre-registered sending modes is pre-registered on the vehicle before the vehicle is in operation, or the second set of pre-registered sending modes is registered on the vehicle in the case where the vehicle is in operation. The sending mode of the event indicated by the first information in the first subscription request is selected from the third information.

[0063] According to the above scheme, the first service publishing message includes third information used to indicate at least one sending mode supported by the event, so that the electronic device subscribing to events can select a suitable sending mode of the event from the sending modes of the event provided by the first service publishing message to subscribe to the event. On the other hand, the electronic device subscribing to events can carry an identifier of the selected sending mode of the event in the first subscription request sent to the first electronic device, so as to reduce the data amount of the first subscription request, and thereby the total bus bandwidth occupied by the transmission of the first subscription request can be reduced.

[0064] In a third aspect, an electronic device is provided, which includes one or more processors and a memory. The memory is coupled to the one or more processors, and the memory is configured to store computer program codes including computer instructions. The one or more processors invoke the computer instructions to cause the electronic device to perform the method in the first aspect, any possible implementation of the first aspect, the second aspect, and any possible implementation of the second aspect.

[0065] In a fourth aspect, a chip system is provided. The chip system is applied to an electronic device. The chip system includes one or more processors configured to invoke computer instructions to cause the electronic device to perform the method of the first aspect, any possible implementation of the first aspect, the second aspect, and any possible implementation of the second aspect.

[0066] In a fifth aspect, a computer-readable storage medium is provided. The computer-readable storage medium includes computer instructions. When the computer instructions are run on an electronic device, the electronic device is caused to perform the method of the first aspect, any possible implementation of the first aspect, the second aspect, and any possible implementation of the second aspect.

[0067] In a sixth aspect, a computer program product is provided. The computer program product includes computer program code. When the computer program code is run on an electronic device, the electronic device is caused to perform the method of the first aspect, any possible implementation of the first aspect, the second aspect, and any possible implementation of the second aspect.

[0068] It should be understood that the third aspect to the sixth aspect of the present application correspond to the technical solutions of the first aspect or the second aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding possible implementation are similar, which will not be described again. BRIEF DESCRIPTION OF DRAWINGS

[0069] FIG. 1 is a flow diagram of an event subscription and distribution according to an embodiment of the present application;

[0070] FIG. 2 is a schematic diagram of an electronic and electrical architecture of a vehicle according to an embodiment of the present application;

[0071] FIG. 3 is a schematic diagram of a software-related architecture of a communication node according to an embodiment of the present application;

[0072] FIG. 4 is another schematic diagram of a software-related architecture of a communication node according to an embodiment of the present application;

[0073] FIG. 5 is a schematic diagram of a static registration mechanism according to an embodiment of the present application;

[0074] FIG. 6 is another schematic diagram of a static registration mechanism according to an embodiment of the present application;

[0075] FIG. 7 is a schematic diagram of a dynamic registration mechanism according to an embodiment of the present application;

[0076] FIG. 8 is a schematic diagram of an event subscription flow according to an embodiment of the present application;

[0077] FIG. 9 is another schematic diagram of an event subscription and distribution flow according to an embodiment of the present application;

[0078] FIG. 10 is a schematic diagram of an effect of event distribution according to an embodiment of the present application;

[0079] FIG. 11 is a schematic diagram of another event subscription process according to an embodiment of the present application;

[0080] FIG. 12 is a schematic diagram of still another event subscription process according to an embodiment of the present application;

[0081] FIG. 13 is a schematic diagram of still another event subscription process according to an embodiment of the present application;

[0082] FIG. 14 is a schematic diagram of still another event subscription process according to an embodiment of the present application. DETAILED DESCRIPTION

[0083] In order to clearly describe the technical solutions of the embodiments of the present application, the following briefly introduces some terms and technologies involved in the embodiments of the present application:

[0084] 1. Service oriented architecture (SOA)

[0085] SOA can be understood as a method of designing, developing, deploying and managing discrete models in a computer environment. In the SOA architecture, all functions are defined as independent services, and all services can be connected through an enterprise service bus (ESB) or a process manager.

[0086] 2. Protocol stack

[0087] The protocol stack can be understood as a hierarchical combination of a series of protocols for implementing network communication. Each layer of protocol is responsible for different functions, and through the layer-by-layer combination and cooperative work of the protocol stack, the reliability, effectiveness and security of network communication are achieved.

[0088] The protocol stack can be divided into multiple layers according to different functions, and each layer is responsible for a specific function. Among them, the multiple layers of the protocol stack are, for example, the physical layer, the data link layer, the network layer, the transport layer, the application layer, etc.

[0089] The protocol stack can perform data encapsulation, data transmission and data processing.

[0090] Exemplarily, in network communication, data needs to be processed and encapsulated in multiple layers, and each layer of protocol can add corresponding header information in the data, so as to correctly parse and process the data at the receiving end. The protocol stack can transmit and forward data between different layers to ensure that the data can correctly reach the destination in the network. Each layer of the protocol stack can process and convert the data, such as data segmentation, recombination, error detection and correction, and the like, to achieve data processing.

[0091] Some protocol layers in the protocol stack can also perform network security function control such as encryption, authentication and access control on the data, to ensure the security of network communication.

[0092] 3. SOME / IP protocol

[0093] The SOME / IP protocol can be understood as an application layer communication protocol based on Ethernet. The SOME / IP protocol is a communication protocol for a vehicle-mounted SOA architecture.

[0094] SOME / IP provides communication mechanisms such as method (method), event (event) and data field (field).

[0095] The method can be understood as a method call. For example, a client sends a request to a server, and the server executes the request.

[0096] The event adopts a communication mechanism of subscription or publication. For example, a client can subscribe to an event from a server, and the server can send the event subscribed by the client to the client.

[0097] The field defines the structure and content of the data associated with the service method and event, so that the client and the server can process the data exchanged between the client and the server. The field can include getters, setters and notifiers. The communication mechanism corresponding to the getters and setters is a method call. The communication mechanism corresponding to the notifier is a communication mechanism of subscription or publication.

[0098] For the service publication / subscription function of the SOME / IP protocol, for example, a server publishes a service, and a client subscribes to an event group of the service according to the needs of the client, and then obtains the events in the subscribed event group. The event group contains one or more events. The event in the embodiment of the present application can be the event described above, or the notifier in the field described above.

[0099] The process that the client subscribes to the event group published by the server and obtains the event in the subscribed event group can include the subscription and distribution process of the event. In some embodiments of the present application, SOME / IP can also be referred to as SOMEIP.

[0100] 4、Client and server

[0101] In the embodiments of the present application, the client can be understood as one end of subscribing to the event, one end of calling the service or one end of sending the request. The server can be understood as one end of providing the event, one end of providing the service or one end of executing the request.

[0102] For example, in the electronic and electrical architecture of the automobile, the A-domain controller can subscribe to the event of the B-domain controller, and the B-domain controller can send the event subscribed by the A-domain controller to the A-domain controller. In this scenario, the A-domain controller is the client and the B-domain controller is the server.

[0103] Alternatively, in the scenario that the A-domain controller calls the service of the B-domain controller, the A-domain controller is the client and the B-domain controller is the server.

[0104] For example, the B-domain controller can subscribe to the event of the A-domain controller, and the A-domain controller can send the event subscribed by the B-domain controller to the B-domain controller. In this scenario, the B-domain controller is the client and the A-domain controller is the server.

[0105] Alternatively, in the scenario that the B-domain controller calls the service of the A-domain controller, the B-domain controller is the client and the A-domain controller is the server.

[0106] It can be seen that the A-domain controller can be the client or the server. The B-domain controller can be the server or the client.

[0107] 5、Other terms

[0108] In the embodiments of the present application, the same items or similar items with basically the same functions and effects are distinguished by using "first", "second", etc. For example, the first chip and the second chip are only used to distinguish different chips, and do not limit the sequence. Those skilled in the art can understand that "first", "second", etc. do not limit the quantity and execution sequence, and "first", "second", etc. also do not limit that they must be different.

[0109] It should be noted that in the embodiments of the present application, the words "exemplary" or "for example" are used to mean "an example of" or "an example, not necessarily the only example" of something. Any embodiment or design solution described as "exemplary" or "for example" in the present application should not be construed as preferred or advantageous over other embodiments or design solutions. Rather, the use of "exemplary" or "for example" is intended to present concepts in a particular manner.

[0110] In the embodiments of the present application, "at least one" means one or more, and "multiple" means two or more. The relationship between the associated objects described by "and / or" indicates that there can be three relationships, for example, A and / or B, which can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can represent a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.

[0111] 6、Electronic device

[0112] The electronic device of the embodiments of the present application can include a handheld device with communication function, a vehicle-mounted device, etc. The electronic device can be a module or a module group in a vehicle. It can also be a component part of a vehicle.

[0113] By way of example and not limitation, in the embodiments of the present application, the electronic device can also be a domain controller, a gateway, a sensor, an actuator, or an electronic control unit (ECU) in a vehicle, etc.

[0114] In addition, in the embodiments of the present application, the electronic device can also be a terminal device in an Internet of Things (IoT) system. IoT is an important part of future information technology development, and its main technical feature is to connect objects through communication technology and network, so as to realize the intelligent network of man-machine interconnection and object-object interconnection.

[0115] The electronic device in the embodiments of the present application can also be referred to as a terminal device or a user device, etc.

[0116] In the embodiments of the present application, the electronic device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as an electronic control unit (ECU), a central processing unit (CPU), a memory management unit (MMU), and a memory (also referred to as main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a windows operating system.

[0117] FIG. 1 shows a flowchart of event subscription and distribution according to an embodiment of the present application.

[0118] As shown in FIG. 1, taking a server, a client 1, and a client 2 as examples, in some possible implementations, the flow of event subscription and distribution can include the following steps.

[0119] S100, the server can multicast a second service offer message. Correspondingly, the client 1 and the client 2 can respectively receive the second service offer message from the server.

[0120] The server, the client 1, and the client 2 can all be domain controllers in the electronic and electrical architecture of a vehicle. For example, the server can be a vehicle domain controller (VDC) of the vehicle. The client 1 can be an integrated cockpit controller (ICC) of the vehicle. The client 2 can be a mobile data center (MDC) of the vehicle. The electronic and electrical architecture of the vehicle can refer to the architecture shown in FIG. 2 described later. For ease of understanding, FIG. 2 is described later.

[0121] The second service offer message can include identification information of the service. The identification information of the service can include an identification (ID) of the service and a version of the service. The service can include at least one event group. The event group can include at least one event, for example, the event group can include at least one event occurring in a functional domain managed by the server. Illustratively, the service can be understood as one of at least one service provided by the server.

[0122] It should be understood that at least one event occurring in the function domain managed by the server can be referred to as at least one event occurring at the server. The event can be a notification of a state value. The state value can include any of: multimedia volume, vehicle speed, air conditioner temperature, etc. The state value can be obtained by the server at any time. The event can also be an abnormal event occurring. The abnormal event occurring, for example, is a collision or a fault, etc.

[0123] Taking the service in the second service publishing message multicast by the server shown in FIG. 1 as service 1, the service 1 includes event group 1, the event group 1 can include event A and event B, and event A is a vehicle speed event or a vehicle speed. In the case where both client 1 and client 2 need to obtain event A of the server to achieve their respective target functions, client 1 can execute S101-S102 to obtain event A, and client 2 can execute S103-S104 to obtain event A.

[0124] S101, the client 1 can send a second subscription request (subscribe) to the server. The second subscription request can include: the ID of the service 1, the ID of the event group 1. Correspondingly, the server can receive the second subscription request from the client 1.

[0125] S102, the server can send a subscription confirmation (subscribe ACK) to the client 1. The subscription confirmation can include: the ID of the service 1 and the ID of the event group 1.

[0126] In this way, through S100-S102, the client 1 realizes subscribing to all events in the event group 1 in the service 1 at the server. The server can respectively send each event in the event group 1 to the client 1 according to the preset sending mode of each event in the event group 1.

[0127] S103, the client 2 can send a second subscription request (subscribe) to the server. The second subscription request can include: the ID of the service 1, the ID of the event group 1. Correspondingly, the server can receive the second subscription request from the client 2.

[0128] S104, the server can send a subscription confirmation (subscribe ACK) to the client 2. The subscription confirmation can include: the ID of the service 1 and the ID of the event group 1.

[0129] In this way, through S100, S103-S104, the client 2 realizes subscribing to all events in the event group 1 in the service 1 at the server. It can be understood that the time of S101 and S103 can be the same or different. The server can respectively send each event in the event group 1 to the client 2 according to the preset sending mode of each event in the event group 1.

[0130] The preset sending mode of each event in the event group 1 can be a first mode. The first mode is used to indicate that the event is sent periodically. The first mode can be referred to as cyclic.

[0131] For example, in the case that the sending mode of event A is the first mode and the sending period is 10 milliseconds (ms), and the sending mode of event B is the first mode and the sending period is 40 ms, in the case that the server sends a subscription confirmation to the client 1, the server can send event A to the client 1 at a sending period of 10 ms, and send event B to the client 1 at a sending period of 40 ms. In the case that the server sends a subscription confirmation to the client 2, the server can send event A to the client 2 at a sending period of 10 ms, and send event B to the client 2 at a sending period of 40 ms.

[0132] Since the client 1 acquires event A (such as vehicle speed) for display on a large screen (i.e., a display screen of the vehicle), for example, to display the vehicle speed on the large screen. That is, the client 1 acquires event A of the server to achieve a target function of large screen display. The refresh rate of the large screen can be to refresh once every few hundred milliseconds. The client 1 only needs to acquire event A once every few hundred milliseconds to meet the display requirement of the large screen.

[0133] The acquisition of event A once every few hundred milliseconds can be understood as the requirement frequency of event A of the client 1.

[0134] The client 2 acquires event A to implement an intelligent driving function. That is, the client 2 acquires event A of the server to achieve a target function of the intelligent driving function. The intelligent driving function requires high sensitivity to the vehicle speed. For example, the client 2 needs to acquire event A once every few tens of milliseconds for intelligent driving adjustment. That is, the client 2 only needs to acquire event A once every few tens of milliseconds to meet the requirement of the intelligent driving function.

[0135] The acquisition of event A once every few tens of milliseconds can be understood as the requirement frequency of event A of the client 2.

[0136] As shown in FIG. 1, in a possible implementation, the client 1 and the client 2 both acquire event A by subscribing to the event group 1 of the server. Subscribing to the event group 1 means subscribing to all events in the event group 1. In the case that the client 1 and the client 2 both subscribe to the event group 1 associated with the server 1, the server sends event A to the client 1 and the client 2 respectively according to the preset sending mode of event A (such as a sending period of 10 ms), and sends event B to the client 1 and the client 2 respectively according to the preset sending mode of event B (such as a sending period of 40 ms).

[0137] The sending frequency of event A is higher than the demand frequency of event A by client 1, and the sending frequency of event A is higher than the demand frequency of event A by client 2. For example, for client 1, client 1 only needs to use the latest received event A to display the large screen when the large screen is refreshed. The event A received by client 1 between the two events A used by the large screen in the adjacent two times of refreshing or between the adjacent two times of refreshing of the large screen is an invalid event, that is, an event that is not required by client 1. For client 2, client 2 only needs to use the latest received event A to adjust intelligent driving. The event A received by client 2 between the two events A used by the intelligent driving in the adjacent two times of intelligent driving adjustment or between the adjacent two times of intelligent driving adjustment is an invalid event, that is, an event that is not required by client 2.

[0138] In addition, as shown in FIG. 1, both client 1 and client 2 obtain event A to achieve their respective target functions without event B. That is, event B is not an event required by client 1, nor is it an event required by client 2. For client 1 and client 2, event B is an invalid event.

[0139] As shown in FIG. 1, in a possible implementation, the sending frequency of the target event (such as event A) by the server is higher than the demand frequency of the target event (such as event A) by the client (such as client 1 or client 2), resulting in that the server sends events that are not required by the client to the client, and then more invalid events and more transmission of invalid events occur. Since the client obtains the target event in the subscribed event group by subscribing to the event group from the server, the server sends all events in the event group to the client, resulting in that the server sends events that are not required by the client to the client, and then more invalid events and more transmission of invalid events occur.

[0140] The transmission of invalid events can occupy more bus bandwidth for event transmission, can affect the transmission of the target event by the bus, and then the transmission failure of the target event can occur. For example, the client does not receive the target event sent by the server. In this way, the situation that the target function of the client cannot be implemented (or target function failure) can occur. The bus can be an Ethernet (Eth) bus, a controller area network (CAN) bus, and / or a local interconnect network (LIN) bus.

[0141] In addition, the client needs to process the event every time it receives an event from the server. For example, the client parses or stores the event sent by the server. More invalid events result in that the processing overhead of the client for the event is large, which can affect the running efficiency of the client.

[0142] Therefore, an event subscription method is provided in the embodiments of the present application. A first subscription request is sent by a client to a server. The client obtains a subscribed event based on the first subscription request. The first subscription request is used to subscribe to an event occurred in the server. The first subscription request comprises first information used to indicate a sending mode of the event. The subscribed event is included in the event occurred in the server. The server and the client can be electronic devices in a vehicle. Since the first subscription request comprises the first information used to indicate the sending mode of the event, the server can send the event subscribed by the client to the client according to the sending mode of the event indicated by the client, so as to reduce the probability that the sending frequency of the event subscribed by the client is higher than the demand frequency of the event, and further reduce the probability that the invalid event occurs. By reducing the probability that the invalid event occurs, the probability that the target function of the client fails due to the invalid event transmission occupying the bus bandwidth can be reduced, and the influence on the running efficiency of the client can also be reduced.

[0143] FIG. 2 shows an electronic and electrical architecture of a vehicle according to an embodiment of the present application.

[0144] As shown in FIG. 2, the electronic and electrical architecture of the vehicle can include at least one domain controller 201, at least one gateway 202, at least one sensor 203 and at least one actuator 204. The domain controller 201 and the gateway 202 can communicate with each other through an Eth bus. The gateways 202 can also communicate with each other through the Eth bus. The gateway 202 and the sensor 203 can communicate with each other through any one of an Eth bus, a CAN bus or a LIN bus. The gateway 202 and the actuator 204 can also communicate with each other through any one of the Eth bus, the CAN bus or the LIN bus.

[0145] The sensor 203 can transmit the data received by the sensor 203 to the gateway 202 through the bus between the sensor 203 and the gateway 202. The gateway 202 can encapsulate the data transmitted by the sensor 203 to obtain encapsulated data. The gateway 202 can transmit the encapsulated data to the domain controller 201 through the bus between the gateway 202 and the domain controller 201. The domain controller 201 can perform operation processing on the encapsulated data to obtain an operation result. The domain controller 201 can encapsulate the operation result as encapsulated operation result and transmit the encapsulated operation result to the gateway 202 through the bus between the domain controller 201 and the gateway 202. The gateway 202 can transmit the encapsulated operation result to the actuator 204 through the bus between the gateway 202 and the actuator 204. The actuator 204 can perform a function corresponding to the encapsulated operation result.

[0146] The communication protocol adopted by the application of the communication node of the Eth network is the SOME / IP protocol. The encapsulated data can be a SOME / IP message. The encapsulated operation result can also be a SOME / IP message.

[0147] In the case that the bus between the gateway 202 and the sensor 203 is a CAN bus or a LIN bus, and the bus between the gateway 202 and the actuator 204 is a CAN bus or a LIN bus, the communication node of the Eth network (i.e., the Eth bus) in the electronic and electrical architecture of the automobile can include the domain controller 201 and the gateway 202.

[0148] Optionally, in an embodiment of the present application, the bus between the gateway 202 and the sensor 203 is an Eth bus, and the bus between the gateway 202 and the actuator 204 is also an Eth bus. Then, in the electronic and electrical architecture of the automobile, the communication node of the Eth network can include the domain controller 201, the gateway 202, the sensor 203 and the actuator 204.

[0149] It can be understood that, in an embodiment of the present application, the electronic and electrical architecture of the vehicle can include at least one domain controller 201, at least one sensor 203, and at least one actuator 204. The electronic and electrical architecture of the vehicle can not include the gateway 202. The domain controllers 201 can communicate with each other through an Ethernet (Eth) bus. The domain controller 201 and the sensor 203 can communicate with each other through any one of the Eth bus, the CAN bus, or the LIN bus. The domain controller 201 and the actuator 204 can also communicate with each other through any one of the Eth bus, the CAN bus, or the LIN bus. The sensor 203 can transmit data received by the sensor 203 to the domain controller 201 through the bus between the sensor 203 and the domain controller 201. The domain controller 201 can perform operation processing on the data transmitted by the sensor 203 to obtain an operation result. The domain controller 201 can transmit the operation result to the actuator 204 through the bus between the domain controller 201 and the actuator 204. The actuator 204 can perform a function corresponding to the operation result. The domain controller 201 can encapsulate the data transmitted by the sensor 203 as encapsulated data. The domain controller 201 can transmit the encapsulated data to another domain controller 201 through the bus between the domain controllers 201, so as to enable the another domain controller 201 to perform operation processing on the encapsulated data to achieve a target function of the another domain controller 201.

[0150] In the case where the electronic and electrical architecture of the vehicle adopts the SOA architecture, the functions of the communication nodes of the Eth network in the electronic and electrical architecture can be encapsulated in the form of services, and each service can be assigned a specific IP address and a standardized interface. The communication protocol of the SOA architecture can include the SOME / IP protocol. The SOME / IP protocol is an application layer communication protocol based on Ethernet. The SOME / IP protocol can provide communication mechanisms such as event subscription and event publishing. Therefore, a communication node on the Eth network can call the service of another communication node by subscribing to an event of the another communication node. Correspondingly, the another communication node can distribute an event to the one communication node by event publishing. In this way, the communication nodes on the Eth network in the electronic and electrical architecture can call the encapsulated services at any time, and further achieve a target function through the combination of multiple services. It should be understood that the event occurring in the communication node can be data received by a sensor in a functional domain managed by the communication node. For example, the event occurring in the communication node can be the state value or the abnormal event described above.

[0151] It can be understood that the server in the embodiment of the present application can be any communication node of the Eth network in the electronic and electrical architecture of the vehicle as shown in FIG. 2. The client can also be any communication node of the Eth network in the electronic and electrical architecture of the vehicle as shown in FIG. 2.

[0152] FIG. 3 shows a software-related architecture diagram of a communication node according to an embodiment of the present application.

[0153] As shown in FIG. 3, the communication node can include an application software layer, an operating system and hardware.

[0154] The application software layer can include at least one application program (APP). The at least one APP is, for example, APP1, APP2 and APP3 shown in FIG. 3. The application program can be referred to as an application for short.

[0155] The application program can include at least one software component (SWC). The software component can be understood as a basic unit constituting the application program. The software component is used to implement a specific function. For example, as shown in FIG. 3, APP1 can include SWC1, SWC2 and SWC3. APP2 can include SWC4 and SWC5. APP3 can include SWC6 and SWC7.

[0156] The operating system can include a runtime environment (RTE) and a basic software (BSW).

[0157] The RTE provides a runtime environment for the running of the SWC. The RTE can be used to implement communication between the SWCs, or can be used to implement communication between the SWC and the BSW.

[0158] The BSW can include a protocol stack. The protocol stack in the BSW can include a SOME / IP protocol stack. The BSW can be used to provide various basic capabilities for the SWC of the application software layer, such as communication capability, memory management capability, hardware abstraction capability or driver, etc.

[0159] For example, taking the implementation of Ethernet communication of the SWC by the BSW as an example, the SWC can transmit a signal to the BSW through the RTE. The BSW converts and encapsulates the signal from the SWC and sends it out by the SOME / IP protocol stack. The signal receiving process is opposite to the signal sending process.

[0160] The event occurring in the communication node can be an event occurring in the application program of the communication node. For example, the event occurring in the communication node can be an event occurring in the SWC in the application program of the communication node.

[0161] As shown in FIG. 3, the SOME / IP protocol stack of the communication node can implement the transmission of the event between the communication nodes. The implementation of the transmission of the event between the communication nodes by the SOME / IP protocol stack can be referred to FIG. 4.

[0162] FIG. 4 shows another software-related architecture of a communication node according to an embodiment of the present application.

[0163] It can be understood that the server and the client shown in FIG. 4 can be communication nodes in an Eth network in an electronic and electrical architecture of a vehicle.

[0164] As shown in FIG. 4, the SOME / IP protocol stack can include a SOME / IP layer, a transport layer, an IP layer, a media access control (MAC) layer, and a physical layer.

[0165] The SOME / IP layer belongs to an application layer of the protocol stack. The SOME / IP layer can include a service discovery module and a message transceiving module.

[0166] The service discovery module can be configured to transmit a service publishing message and / or receive a subscription request. The service publishing message can include a first service publishing message or a second service publishing message. The subscription request can include a first subscription request or a second subscription request. The first service publishing message and the first subscription request are described later.

[0167] The service discovery module can also be configured to register a sending mode of an event and / or register a subscription requirement. The subscription requirement can include an event to be subscribed, a sending mode of the event to be subscribed, or a requirement frequency of the event to be subscribed.

[0168] The sending mode of the event can include any one of a first mode, a second mode, or a third mode.

[0169] The first mode is configured to indicate that the event is sent periodically. The first mode can be referred to as cyclic.

[0170] The second mode is configured to indicate that the event is sent when the event reaches a preset threshold. The second mode can be referred to as epsilon on change (EOC). For example, taking an event occurring at the server as a temperature event and a preset threshold corresponding to the temperature event as 40°C as an example, the server can obtain the temperature of a functional area associated with the server in real time. If the sending mode of the temperature event preset by the server is the second mode, the server can send the temperature event to a client subscribing to the temperature event when the temperature reaches or exceeds 40°C. The temperature event can include a specific value of the temperature.

[0171] The third mode is used to indicate sending an event when an event changes. The third mode can be referred to as a change-on-change (UOC). For example, taking a service-side event including a door status event as an example, if the service side presets the sending mode of the door status event as the third mode, the service side can send the door status event to the client subscribing to the door status event when the door status changes. The door status change is, for example, the door changes from a closed state to an open state, or the door changes from an open state to a closed state. The door status event can include information indicating the door status. It should be understood that the door status includes an open state or a closed state.

[0172] The message transceiver module can be used to receive the distribution condition of the event transmitted by the service discovery module. It can also be used to receive the event transmitted by the APP and distribute the event according to the distribution condition of the event. It can also receive the event.

[0173] The IP layer belongs to the network layer of the protocol stack. The IP layer can be used for transmission and routing of data packets in the network.

[0174] The transport layer can be used to provide data transmission services. The transport layer can include a user datagram protocol (UDP) and / or a transmission control protocol (TCP).

[0175] The MAC layer belongs to the data link layer of the protocol stack. The MAC layer can be used to provide reliability and error detection for data transmission above the physical layer.

[0176] As shown in FIG. 4, before the service side runs or in the case of the service side running, the design device of the communication node designer or the application software layer of the service side can register the sending mode of each event in the event provided by the service side and the event provided by the service side to the service discovery module of the service side, so as to facilitate the service side to send the service publishing message to the client. Before the client runs or in the case of the client running, the design device of the communication node designer or the application software layer of the client can register the subscription demand to the service discovery module of the client, so as to facilitate the client to send the first subscription request to the client.

[0177] The specific implementation principle of registering the sending mode of each event in the event provided by the service side and the event provided by the service side to the service discovery module of the service side can be referred to the embodiments shown in FIGS. 5-7. The specific implementation principle of registering the subscription demand to the service discovery module of the client can be referred to the embodiments shown in FIGS. 5-7. For ease of understanding, the embodiments shown in FIGS. 5-7 are described later.

[0178] It can be understood that the second service publishing packet can include identification information of each of the at least one service. The identification information can include an ID of the service and a version of the service. The at least one service is any one of the services provided by the service end.

[0179] Exemplarily, the second service publishing packet can include identification information of a target service. The identification information of the target service includes, for example, an ID of the target service and a version of the target service. The target service can be any one of the at least one service provided by the service end.

[0180] Exemplarily, still taking that the second service publishing packet can include identification information of a target service as an example, in a case where the service discovery module of the service end completes registration of the sending mode of the event, the service discovery module of the service end can send the second service publishing packet to the physical layer of the client through the transport layer of the service end, the IP layer of the service end, the MAC layer of the service end and the physical layer of the service end. Correspondingly, the physical layer of the client receives the second service publishing packet from the service end.

[0181] The physical layer of the client transmits the second service publishing packet to the service discovery module of the client through the MAC layer of the client, the IP layer of the client and the transport layer of the client.

[0182] It should be understood that in the embodiments of the present application, the client and the service end can both maintain a third set. The third set can include identification information of services provided by each of a plurality of service ends associated with the electronic and electrical architecture of the automobile, an event group contained by the identification information corresponding service and all events contained by the event group. In this way, in a case where the client receives the service publishing packet sent by the service end, the client can determine the event group or the event of the event group to be subscribed based on the service publishing packet and the third set.

[0183] In a case where the service discovery module of the client completes registration of the subscription requirement and receives the second service publishing packet from the service end, the service discovery module of the client can send a first subscription request to the physical layer of the service end through the transport layer of the client, the IP layer of the client, the MAC layer of the client and the physical layer of the client. Correspondingly, the physical layer of the service end receives the first subscription request from the client.

[0184] The first subscription request can include an ID of a target service, an ID of a target event group and first information. The first information can be related to all events or part of events of the target event group. For example, the first information is used to indicate the sending mode of each event of all events of the target event group, or the first information is used to indicate the sending mode of each event of part of events of the target event group.

[0185] The physical layer of the server transmits the first subscription request to the service discovery module of the server through the MAC layer of the server, the IP layer of the server and the transport layer of the server.

[0186] The service discovery module of the server parses the first subscription request to obtain the ID of the target service, the ID of the target event group and the first information. The service discovery module of the server converts the first information into the distribution condition of each event associated with the first information.

[0187] The service discovery module of the server transmits the distribution condition of each event associated with the first information to the message transceiver module of the server.

[0188] The message transceiver module of the server sets the distribution condition of each event associated with the first information.

[0189] The message transceiver module of the server receives the target event sent by the APP of the server. The target event can be any event in the events associated with the first information.

[0190] When the target event meets the distribution condition of the target event, the message transceiver module of the server sends the target event to the physical layer of the client through the transport layer of the server, the IP layer of the server, the MAC layer of the server and the physical layer of the server. Correspondingly, the physical layer of the client receives the target event from the server.

[0191] The physical layer of the client transmits the target event to the message transceiver module of the client through the MAC layer of the client, the IP layer of the client and the transport layer of the client.

[0192] The message transceiver module of the client transmits the target event to the APP of the client, so that the APP of the client implements the target function by using the target event.

[0193] As shown in FIG. 4, the client can carry the first information in the first subscription request sent to the server, to indicate the sending mode of the event subscribed by the client to the server. The server can convert the first information sent by the client into the distribution condition of the event associated with the first information. The server can distribute the event subscribed by the client to the client when the event reaches the distribution condition of the subscribed event. In this way, the server sends the event subscribed by the client to the client according to the sending mode of the event indicated by the client, reduces the probability that the sending frequency of the event subscribed by the client by the server is higher than the demand frequency of the subscribed event by the client, and further reduces the probability of occurrence of invalid events. Therefore, the probability of failure of the target function of the client caused by the transmission of invalid events occupying the bus bandwidth can be reduced, and the impact on the running efficiency of the client can also be reduced.

[0194] FIG. 5 shows a schematic diagram of a static registration mechanism provided by an embodiment of the present application.

[0195] As shown in FIG. 5, before the designer of the communication node completes the design of the APP of the communication node and the communication node is running (or started), the SWC design tool for the APP design can transmit a general configuration file or a database file of an automotive open system architecture (AUTOSAR) to a bottom software configuration tool. The SWC design tool can be a framework modeling tool or a behavior modeling tool, etc. The framework modeling tool can be referred to as a SWC framework modeling tool.

[0196] The general configuration file or the database file of the AUTOSAR can be an AUTOSAR extensible markup language (AUTOSAR XML, ARXML) file. The ARXML file can include a sending manner of each event provided by the communication node and / or a subscription requirement of the communication node. The ARXML file can also include information of software components, interfaces, data types and configuration parameters, etc.

[0197] The sending manner of each event provided by the communication node and / or the subscription requirement of the communication node can refer to the representation manner shown in any one of signal 1: 100 ms, signal 2: 500 ms or signal 3: UOC shown in FIG. 5. Each of the signal 1, the signal 2 and the signal 3 corresponds to a different event. The signal 1: 100 ms can represent that the sending manner of the event corresponding to the signal 1 is periodic sending and the sending period is 100 ms. The signal 2: 500 ms can represent that the sending manner of the event corresponding to the signal 2 is periodic sending and the sending period is 500 ms. The signal 3: UOC can represent that the sending manner of the event corresponding to the signal 3 is UOC.

[0198] The bottom software configuration tool can generate configuration code of the SOME / IP protocol stack based on the ARXML file and transmit the configuration code of the SOME / IP protocol stack to an operating system of the communication node. A service discovery module in the operating system of the communication node adopts the configuration code of the SOME / IP protocol stack to register the sending manner of each event provided by the communication node and / or the subscription requirement of the communication node.

[0199] Thus, the static registration of the sending manner of each event provided by the communication node and / or the static registration of the subscription requirement of the communication node is achieved. The sending manner of each event provided by the communication node and / or the subscription requirement of the communication node registered by the static registration will not be cleared due to the power-off of the communication node. Therefore, the communication node can send the first service publishing message based on the registered sending manner of each event provided by the communication node. In addition, the communication node can send the first subscription request based on the registered subscription requirement of the communication node. In addition, in the AUTOSAR CP architecture, the static registration mechanism shown in FIG. 6 can be used to achieve the convenient registration of the sending manner of each event provided by the communication node and / or the subscription requirement of the communication node.

[0200] FIG. 6 shows a schematic diagram of another static registration mechanism provided by an embodiment of the present application.

[0201] As shown in FIG. 6, before the designer of the communication node completes the design of the APP of the communication node and the communication node is running (or started), the design device used for the APP design can transmit a configuration file to the operating system of the communication node. The configuration file can include the sending manner of each event provided by the communication node and / or the subscription requirement of the communication node. The representation manner of the sending manner of each event provided by the communication node and / or the subscription requirement of the communication node can refer to any one of the representation manners shown in signal 1: 100 ms, signal 2: 500 ms or signal 3: UOC shown in FIG. 6. The configuration file can be a configuration file readable by the SOME / IP protocol stack. The configuration file can be a java script object notation (JSON) file.

[0202] The service discovery module in the operating system of the communication node can read the content in the configuration file to register the sending manner of each event provided by the communication node and / or the subscription requirement of the communication node.

[0203] Thus, the static registration of the sending manner of each event provided by the communication node and / or the static registration of the subscription requirement of the communication node is achieved. The sending manner of each event provided by the communication node and / or the subscription requirement of the communication node registered by the static registration will not be cleared due to the power-off of the communication node. Therefore, the communication node can send the first service publishing message based on the registered sending manner of each event provided by the communication node. In addition, the communication node can send the first subscription request based on the registered subscription requirement of the communication node. In addition, in the AUTOSAR CP architecture, the static registration mechanism shown in FIG. 6 can be used to achieve the convenient registration of the sending manner of each event provided by the communication node and / or the subscription requirement of the communication node.

[0204] FIG. 7 shows a schematic diagram of a dynamic registration mechanism according to an embodiment of the present application.

[0205] As shown in FIG. 7, when the communication node is running (or started), the application software layer can register the sending manner of each event provided by the communication node and / or the subscription requirement of the communication node to the service discovery module in the operating system.

[0206] For example, the application software layer can set a SOME / IP subscription option (someip_set subscribe option) to the service discovery module in the operating system. The SOME / IP subscription option can include a service ID, an event group ID, an event ID and a subscription policy. The subscription policy can be, for example, the sending manner of the event or the required frequency of the event.

[0207] For example, when the SWC in the application software layer is running, the SWC can call an application programming interface (API) provided by the SOME / IP protocol stack to dynamically set the sending manner of the event associated with the SWC or the subscription requirement of the SWC.

[0208] In this way, the dynamic registration of the sending manner of each event provided by the communication node and / or the dynamic registration of the subscription requirement of the communication node are achieved. In the AUTOSAR CP architecture or the AUTOSAR AP architecture, the dynamic registration mechanism shown in FIG. 7 can achieve real-time registration and / or flexible registration of the sending manner of each event provided by the communication node and / or the subscription requirement of the communication node.

[0209] Next, the event subscription method provided by the embodiments of the present application will be described in combination with some embodiments.

[0210] FIG. 8 shows a schematic diagram of an event subscription process according to an embodiment of the present application.

[0211] For example, still taking the example that the second service publishing packet can include the identification information of the target service, as shown in FIG. 8, the event subscription method provided by the embodiments of the present application can include the following steps.

[0212] S801, the server can multicast or unicast the second service publishing packet. Correspondingly, the client can receive the second service publishing packet from the server.

[0213] S802, the client can send a first subscription request to the server. Correspondingly, the server can receive the first subscription request from the client.

[0214] The first subscription request is used to subscribe to events occurring on the server. The first subscription request can include an ID of a target service, an ID of a target event group, and a subscription policy. The target event group is any event group in at least one event group of the target service.

[0215] The subscription policy can include first information and / or second information.

[0216] The first information is used to indicate a sending manner of events.

[0217] The second information is used to indicate part of events in a subscription event group. The subscription event group includes at least one event. The events in the subscription event group can be events occurring on the server, i.e., the subscription event group is included in the events occurring on the server. The subscription event group can be the target event group.

[0218] The first information includes:

[0219] The sending manner of events indicated by the first information can be a sending manner of events indicated in the form of event granularity.

[0220] The first information can include a sending manner of each event in at least one event. The events in the at least one event can be events occurring on the server, i.e., the at least one event is included in the events occurring on the server.

[0221] The first information can include an identifier of an event and a sending manner of the event corresponding to the identifier. For example, the first information can include a key-value pair in which an identifier of an event is a key and a sending manner of the event corresponding to the identifier is a value.

[0222] The sending manner of events indicated by the first information can also be a sending manner of all events in an event group indicated in the form of event group granularity.

[0223] The first information can include a sending manner of each event group in at least one event group. The events included in the at least one event group can be events occurring on the server, i.e., the at least one event group is included in the events occurring on the server. It should be understood that an event group can include at least one event.

[0224] The first information can include indication information of an event group and a sending manner of the event group corresponding to the indication information. The indication information of the event group is information indicating the event group. For example, the first information can include a key-value pair in which the indication information of the event group is a key and a sending manner of the event group indicated by the indication information is a value. The indication information of the event group can be an identifier.

[0225] Since the sending manner of the event can be any one of the first manner, the second manner or the third manner. Therefore, the first information can include at least one of the following:

[0226] an event sending period, the event sending period being associated with the first manner;

[0227] or, an identification of the first manner and an event sending period, the event sending period being associated with the first manner;

[0228] or, an identification of the second manner and a preset threshold of the second manner;

[0229] or, an identification of the third manner.

[0230] Wherein, the event sending period can also be represented by the sending frequency of the event. The event sending period can be referred to as the sending period. The sending period is used in the first manner.

[0231] The subscription policy includes the first information for indicating the sending manner of the event, which can make the server send the events associated with the first information to the client according to the sending manner of the event indicated by the first information. In this way, the probability of the server sending events at a frequency higher than the demand frequency of the client for the events can be reduced, and thus the occupation of the bus bandwidth by the invalid events can be reduced.

[0232] The second information:

[0233] The second information can include the identification of each event in the part of events. The second information can also include the first identification. The first identification is used to indicate the part of events in the subscription event group. The subscription event group can be the target event group corresponding to the ID of the target event group in the first subscription request. The first identification can be an event filter. The event filter is a string. The event filter can be referred to as an event filter. The event filter is only a string representing the first identification. The first identification can be other strings.

[0234] For example, the second information can include a key-value pair with the first identification as the key and the identification of each event in the part of events as the value. Taking an example in which the part of events includes event a, event b and event c, the identification of event a is 8001, the identification of event b is 8002, the identification of event c is 8003, and the first identification is event filter, the second information can be represented in the following manner: <event filter, 8001 8002 8003>, or event filter=8001 8002 8003.

[0235] The subscription policy includes second information used to indicate part of events in the subscription event group, and the server can send an event associated with the second information to the client. The event associated with the second information is part of the events in the subscription event group, instead of all the events in the subscription event group. In this way, the probability of the server sending events that the client does not need to the client can be reduced, and the occupation of the bus bandwidth by invalid events can be reduced.

[0236] Optionally, the subscription request can be a subscription message. The first subscription request can be a first subscription message. For ease of understanding, the format of the subscription message is described below.

[0237] S803, the server can parse the first subscription request to obtain the subscription policy in the first subscription request.

[0238] For example, the server can use a preset parsing rule or parsing manner of the server to parse the first subscription request to obtain the first information and / or the second information in the first subscription request.

[0239] S804, the server can set a distribution condition of an event associated with the subscription policy according to the subscription policy.

[0240] The subscription policy can include the following three cases:

[0241] Case one: the subscription policy includes the first information.

[0242] Case two: the subscription policy includes the first information and the second information.

[0243] Case three: the subscription policy includes the second information.

[0244] For case one, that is, in the case where the subscription policy includes the first information, the server can set a distribution condition of an event associated with the first information according to the first information.

[0245] For example, the first information can include a transmission mode of a target event. The transmission mode of the target event can include information used to indicate a first period for periodically transmitting the target event. The target event is any event indicated by the first subscription request, or the target event is any event associated with the subscription policy of the first subscription request. The target event can be understood as an event needed by the client or an event needed to be subscribed by the client.

[0246] The server can set a first distribution condition of the target event according to the first period of the target event and a preset period of the target event. The preset period of the target event is a period preset by the server to indicate the periodic transmission of the target event.

[0247] In this way, the server can transmit the target event to the client based on the first distribution condition of the target event.

[0248] For example, the first distribution condition of the target event can include a first factor of the target event. The first factor can be referred to as a frequency factor. The first factor of the target event is positively correlated with a first period of the target event, and is negatively correlated with a preset period of the target event. For example, the first factor δ of the target event can satisfy: δ = max(1,‖T C / T S ‖)

[0249] max(1,‖T C / T S ‖) represents taking the maximum value from 1 and‖T c / T s ‖, ‖‖ represents an integer part, T c is the first period of the target event, and T s is the preset period of the target event.

[0250] The server can transmit the target event to the client based on the first distribution condition of the target event. For example, when the number of times of occurrence of the target event on the server reaches the first factor, the server sends the target event to the client.

[0251] The number of times of occurrence of the target event on the server can be counted from the first target event after the client subscribes to the target event, or can be counted from the first target event after the target event is sent.

[0252] When the first period T c of the target event is less than the preset period T s of the target event, T C / T s is less than 1, δ = 1. δ = 1 can indicate that the server can send the target event to the client according to the preset period of the target event. The first period T c of the target event is less than the preset period T s of the target event, it can be understood that the preset sending mode of the target event on the server cannot meet the demand frequency of the client for the target event.

[0253] That is, when the preset sending mode of the target event on the server cannot meet the demand frequency of the client for the target event, the server can send the target event to the client according to the preset period of the target event.

[0254] Optionally, the sending mode of the target event included in the first information can be a second mode. The second mode is used to indicate that the event is sent when the event reaches a preset threshold.

[0255] The server can set a second distribution condition of the target event. The second distribution condition of the target event is used to indicate that the target event is sent when the target event reaches a preset threshold.

[0256] In this way, the server can transmit the target event to the client according to the second distribution condition of the target event.

[0257] Optionally, the sending mode of the target event included in the first information can be a third mode. The third mode is used to indicate that the event is sent when the event changes.

[0258] The server can set a third distribution condition of the target event. The third distribution condition of the target event is used to indicate that the target event is sent when the target event changes.

[0259] In this way, the server can transmit the target event to the client according to the third distribution condition of the target event.

[0260] For case two, that is, in the case where the subscription policy includes not only the first information but also the second information, the server can set the distribution condition of the event associated with the subscription policy according to the first information and the second information. That is, the third identifier and the identifier of the client are set in the distribution condition of the event associated with the second information. The distribution condition of the event associated with the second information can be the distribution condition set based on the first information.

[0261] It should be understood that the number of events associated with the first information can be greater than the number of events associated with the second information. In the case where the subscription policy contains the second information, the event associated with the second information can be understood as the event required by the client.

[0262] Taking the case where the target event belongs to the event associated with the second information as an example, based on the first information, if the distribution condition of the target event is the first distribution condition, the first distribution condition of the target event can further include the third identifier and the identifier of the client. The third identifier is used to indicate that the event has been subscribed.

[0263] Based on the first information, if the distribution condition of the target event is the second distribution condition, the second distribution condition of the target event can further include the third identifier and the identifier of the client.

[0264] Based on the first information, if the distribution condition of the target event is the third distribution condition, the third distribution condition of the target event can further include the third identifier and the identifier of the client.

[0265] In this way, in the case where the subscription policy includes the first information and the second information, if the distribution condition of the target event includes the third identifier, the server transmits the target event to the client when the target event meets the distribution condition of the target event.

[0266] Since the event associated with the second information is the event required by the client. If the distribution condition of the target event does not include the third identifier, it can be indicated that the target event is not the event required by the client. When the target event meets the distribution condition of the target event, the server can not transmit the target event to the client. So as to reduce the probability of the server transmitting the event not required by the client to the client.

[0267] Optionally, for case two, that is, in the case where the subscription policy includes not only the first information but also the second information, the server can set the first distribution condition, the second distribution condition or the third distribution condition for the event associated with the second information. The event irrelevant to the second information will not be set with a distribution condition.

[0268] Taking event i as an example, which is one of the at least one event associated with the second information, the first distribution condition, the second distribution condition or the third distribution condition is set for event i associated with the second information, for example:

[0269] If the sending mode of event i in the first information is the first mode, the first distribution condition of event i is set.

[0270] If the sending mode of event i in the first information is the second mode, the second distribution condition of event i is set.

[0271] If the sending mode of event i in the first information is the third mode, the third distribution condition of event i is set.

[0272] Wherein, the specific implementation principle of setting the first distribution condition, the second distribution condition or the third distribution condition of event i can refer to the specific implementation principle of setting the first distribution condition, the second distribution condition or the third distribution condition of the target event for case one, which will not be repeated here.

[0273] For case three, that is, in the case where the subscription policy includes the second information but does not include the first information, the server can set the fourth distribution condition of the event associated with the second information based on the second information. The fourth distribution condition can include: the third identifier and the identifier of the client.

[0274] Taking the target event as an example, the server can send the target event to the client when the target event meets the fourth distribution condition. The target event meeting the fourth distribution condition can be understood as: the target event meets the sending mode of the target event preset by the server, and the target event is the event subscribed by the client.

[0275] S805, the server can send a second response for indicating the subscription confirmation to the client. Correspondingly, the client can receive the second response from the server. Wherein, the second response can include: the ID of the target service and the ID of the target event group.

[0276] Optionally, the step of setting the distribution condition by the server in S805 can be performed concurrently with S804.

[0277] The server can notify the client of the success of the event subscription by performing S805, which can reduce the probability of the client repeatedly sending the first subscription request to the server, and reduce the interaction between the client and the server.

[0278] In this way, the client subscribes to the event of the server, and the server can transmit the event associated with the subscription policy of the first subscription request to the client according to the distribution condition of the event associated with the subscription policy of the first subscription request. The server can transmit the event according to the event sending mode indicated by the client, which can reduce the probability that the frequency of the server sending the event is higher than the frequency of the client demanding the event, and can reduce the occupation of the bus bandwidth by the invalid event. It can also achieve sending the event required by the client to the client, reduce the probability of sending the event that the client does not need to the client, and also reduce the occupation of the bus bandwidth by the invalid event. It can also reduce the impact on the running efficiency of the client.

[0279] As shown in FIG. 8, the event subscription method provided by the embodiment of the application comprises the following steps: sending a first subscription request to a server. The first information is carried in the first subscription request to indicate the event sending mode of the client to the server, and / or the second information is carried in the first subscription request to indicate the sending of part of the events in the subscription event group to the server. The part of the events are the events required by the client.

[0280] In the case where the first subscription request includes the first information, the server sets the distribution condition of the event associated with the first information based on the first information, and distributes the subscribed event to the client when the subscribed event reaches the distribution condition of the subscribed event. The server can transmit the subscribed event of the client to the client according to the event sending mode indicated by the client, which can reduce the probability that the frequency of the server sending the subscribed event of the client is higher than the frequency of the client demanding the subscribed event, so as to reduce the probability of the occurrence of the invalid event, and further can reduce the probability of the target function failure of the client caused by the invalid event transmission occupying the bus bandwidth, and also can reduce the impact on the running efficiency of the client.

[0281] In a case that the first subscription request further comprises the second information, the distribution condition associated with the first information can further comprise a third identifier, and the server can distribute the event to the client according to the distribution condition comprising the third identifier. In a case that the distribution condition of the event does not comprise the third identifier, even if the event satisfies the distribution condition of the event, the server will not transmit the event to the client. The server can send the event required by the client to the client, and reduce the probability of the server transmitting the event not required by the client to the client, so as to reduce the probability of occurrence of invalid events.

[0282] In a case that the first subscription request comprises the second information and does not comprise the first information, the server can set the fourth distribution condition of the target event associated with the second information based on the second information. The server can transmit the target event to the client according to the fourth distribution condition of the target event. The server can send the event required by the client to the client, and reduce the probability of the server transmitting the event not required by the client to the client, so as to reduce the probability of occurrence of invalid events.

[0283] FIG. 9 shows a flow diagram of another event subscription and distribution provided by an embodiment of the present application.

[0284] As shown in FIG. 9, the event subscription method provided by an embodiment of the present application can comprise:

[0285] S901, the service discovery module of the server can receive the first subscription request from the client.

[0286] S902, the service discovery module of the server can generate the distribution condition of the event associated with the subscription policy in the first subscription request based on the first subscription request. The service discovery module of the server can transmit the distribution condition of the event associated with the subscription policy to the message transceiver module of the server. The message transceiver module of the server can set the distribution condition of the event associated with the subscription policy in the message transceiver module.

[0287] For example, the first subscription request comprises the first information, and the first information comprises the sending mode of the target event.

[0288] If the sending mode of the target event comprises the information indicating the first period of periodically sending the target event. The service discovery module of the server can calculate the first period of the target event and the preset period of the target event to obtain the first factor of the target event. The service discovery module of the server can transmit the first factor of the target event and the identifier of the client subscribing the target event to the message transceiver module of the server.

[0289] The message transceiving module of the server can set a first distribution condition of the target event in the message transceiving module based on the first factor of the target event and the identity of the client subscribing to the target event. The first distribution condition can include the first factor of the target event and the identity of the client subscribing to the target event.

[0290] If the sending mode of the target event can be the second mode. The service discovery module of the server can transmit the identity of the target event, the identity of the second mode and the identity of the client subscribing to the target event to the message transceiving module of the server.

[0291] The message transceiving module of the server can set a second distribution condition of the target event in the message transceiving module based on the identity of the target event, the identity of the second mode and the identity of the client subscribing to the target event. The identity of the second mode can include a preset threshold corresponding to the target event. The identity of the second mode can also include the identity EOC. The second distribution condition can include the identity of the target event, the identity of the second mode and the identity of the client subscribing to the target event.

[0292] If the sending mode of the target event can be the third mode. The service discovery module of the server can transmit the identity of the target event, the identity of the third mode and the identity of the client subscribing to the target event to the message transceiving module of the server.

[0293] The message transceiving module of the server can set a third distribution condition of the target event in the message transceiving module based on the identity of the target event, the identity of the third mode and the identity of the client subscribing to the target event. The identity of the third mode can be the identity UOC. The third distribution condition can include the identity of the target event, the identity of the third mode and the identity of the client subscribing to the target event.

[0294] Optionally, if the first subscription request further includes second information, the event associated with the second information includes the target event. The service discovery module of the server can further transmit a third identity to the message transceiving module of the server. The distribution condition of the target event set in the message transceiving module of the server can further include the third identity. The distribution condition of the target event can be any one of the first distribution condition, the second distribution condition or the third distribution condition.

[0295] Optionally, if the first subscription request includes the second information and does not include the first information. Taking the event associated with the second information as an example, the service discovery module of the server can transmit the identity of the target event, the third identity and the identity of the client subscribing to the target event to the message transceiving module of the server.

[0296] The message transceiving module of the server can set a fourth distribution condition of the target event in the message transceiving module based on the identification of the target event, the third identification, and the identification of the client subscribing to the target event. The fourth distribution condition can include the identification of the target event, the third identification, and the identification of the client subscribing to the target event.

[0297] It should be understood that the message transceiving module of the server can parse the first subscription request by using a preset parsing rule of the server to obtain the content in the first subscription request.

[0298] S903, the service discovery module of the server can send a second response for indicating the subscription confirmation to the service discovery module of the client sending the first subscription request.

[0299] S904, the SWC of the server can transmit the target event to the message transceiving module of the server. When the target event meets the distribution condition of the target event set by the message transceiving module of the server, the message transceiving module of the server can send the target event to the client subscribing to the target event. The client subscribing to the target event is, for example, the client 1, the client 2, or the client 3 shown in FIG. 9.

[0300] The specific implementation principles of S901-S903 can refer to the specific implementation principles of S802-S805 in the embodiment of FIG. 8, which will not be described here again.

[0301] The distribution condition of the event in S904 can be any one of the first distribution condition, the second distribution condition, the third distribution condition, or the fourth distribution condition.

[0302] As shown in FIG. 9, the event subscription method provided by the embodiments of the present application, the service discovery module of the server can receive the first subscription request from the client, and generate the distribution condition of the event associated with the subscription strategy in the first subscription request based on the first subscription request. The service discovery module of the server can transmit the distribution condition of the event associated with the subscription strategy to the message transceiving module of the server. The message transceiving module of the server can set the distribution condition of the event associated with the subscription strategy in the message transceiving module. The SWC of the server can transmit the target event to the message transceiving module of the server. When the target event meets the distribution condition of the target event set by the message transceiving module of the server, the message transceiving module of the server can send the target event to the client subscribing to the target event. In this way, the message transceiving module of the server sends the event subscribed by the client to the client according to the indication of the first information and / or the second information, which can reduce the probability that the frequency of the message transceiving module of the server sending the event to the client is higher than the demand frequency of the client for the event, so as to reduce the probability of sending invalid events, or reduce the probability that the server sends the event (or event message) that the client does not need to the client, and thus the occupation of the bus bandwidth by the invalid event can be reduced.

[0303] FIG. 10 shows an effect diagram of event distribution provided by an embodiment of the present application.

[0304] The server, the client 1 and the client 2 shown in FIG. 10 can correspond to the same as the server, the client 1 and the client 2 shown in FIG. 1. For example, the server shown in FIG. 10 is the same as the server shown in FIG. 1. The client 1 shown in FIG. 10 is the same as the client 1 shown in FIG. 1. The client 2 shown in FIG. 10 is the same as the client 2 shown in FIG. 1.

[0305] As shown in FIG. 10, still taking the service 1 provided by the server as an example, the service 1 includes an event group 1, the event group 1 includes an event A and an event B, the server presets a sending mode of the event A as a first mode and a sending period of the event A as 10 milliseconds (ms), the server presets a sending mode of the event B as the first mode and a sending period of the event B as 40 ms, the client 1 acquires the event A for large-screen display, and the demand frequency of the client 1 for the event A is acquiring the event A every 200 ms, and the client 2 acquires the event A for implementing a smart driving function, and the demand frequency of the client 2 for the event A is acquiring the event A every 40 ms.

[0306] The client 1 and the client 2 can both subscribe to the event A in the event group 1 by using the event subscription method provided by an embodiment of the present application. The server can be caused to send the event A to the client 1 every 200 ms, and the server can be caused to send the event A to the client 2 every 40 ms. The server will not send the event B to the client 1 and the client 2. In this way, the demand of the client 1 and the client 2 for the event A is met, and the occurrence probability of the server sending invalid events to the client 1 and the client 2 is reduced, and then the occupation of the bus bandwidth by the invalid events can be reduced.

[0307] FIG. 11 shows another event subscription flow diagram provided by an embodiment of the present application.

[0308] Taking the first information included in the subscription policy of the first subscription request as an example, as shown in FIG. 11, the event subscription method provided by an embodiment of the present application can include the following steps.

[0309] S1101, the server can multicast or unicast a first service publishing message. Correspondingly, the client can receive the first service publishing message from the server.

[0310] The first service publishing message can be used to indicate a service provided by the server. The service includes at least one event group. The event group includes at least one event. The at least one event group includes events occurred in the server. The first service publishing message can include identification information of a target service and third information. The third information is used to indicate at least one sending mode supported by the event.

[0311] For example, the third information can be a first subscription policy list. The first subscription policy list can include at least one sending mode supported by each of at least one event associated with the target service.

[0312] In this way, the client can select the sending mode of the event to be subscribed from the third information.

[0313] For example, the third information can be selected by the server from a second set preset by the server. The second set can include at least one sending mode supported by each of at least one event occurred on the server. The second set can be pre-registered on the service discovery module of the server by a static registration mode as shown in FIG. 5 or FIG. 6 before the server is running (or started). Alternatively, the second set can be registered on the service discovery module of the server by a dynamic registration mode as shown in FIG. 7 when the server is running (or started).

[0314] S1102, the client parses the first service publishing packet to obtain the third information, and selects the sending mode of the event to be subscribed from the third information.

[0315] For example, the client parses the first service publishing packet to obtain the first subscription policy list. The client can select the sending mode of the event matching the subscription requirement of the client from the first subscription policy list.

[0316] For example, it is assumed that the subscription requirement of the client includes the sending mode of the target event.

[0317] If the sending mode of the target event is the first mode and the sending period of the target event is the first period in the subscription requirement of the client, the client can select, as the sending mode of the target event indicated to the server, the sending mode with the first mode and the sending period less than or equal to the first period from the at least one sending mode supported by the target event in the first subscription policy list.

[0318] If the sending mode of the target event is the second mode and the preset threshold corresponding to the target event is the first threshold in the subscription requirement of the client, the client can select, as the sending mode of the target event indicated to the server, the sending mode with the second mode and the preset threshold less than or equal to the first threshold from the at least one sending mode supported by the target event in the first subscription policy list.

[0319] If the sending mode of the target event is the third mode in the subscription requirement of the client, the client can select, as the sending mode of the target event indicated to the server, the sending mode with the third mode from the at least one sending mode supported by the target event in the first subscription policy list.

[0320] The target event is any one of at least one event to be subscribed to by the client from the server. That is, the target event can be an event that the client needs to subscribe to. The target event belongs to an event associated with the target service.

[0321] S1103, the client can send a first subscription request to the server. Correspondingly, the server can receive the first subscription request from the client.

[0322] The subscription policy in the first subscription request includes first information, and the first information can include an identifier of a sending mode of an event selected by the client in S1102 to match the subscription demand of the client. That is, the sending mode of the event indicated by the first information is selected from the third information. The identifier of the sending mode of the event that matches the subscription demand of the client belongs to the subscription policy identifier.

[0323] For example, the first information can include an identifier of a sending mode selected by the client from at least one sending mode supported by the target event in the first subscription policy list.

[0324] Compared with the first information including the content of the sending mode of the event, the first information in the embodiment of the application can include the identifier of the sending mode of the event, without including the specific content of the sending mode of the event. In this way, the data amount of the first subscription request can be reduced, and then the occupation of the bus bandwidth by the first subscription request can be reduced.

[0325] S1104, the server can parse the first subscription request to obtain the subscription policy in the first subscription request.

[0326] Exemplarily, the server can parse the first subscription request by using a parsing rule preset by the server to obtain the first information in the first subscription request.

[0327] The server obtains the sending mode of the event indicated by the first information based on the identifier of the sending mode of the event in the first information.

[0328] S1105, the server can set a distribution condition of an event associated with the subscription policy according to the subscription policy.

[0329] Exemplarily, the server can set a distribution condition of an event associated with the first information according to the first information.

[0330] The specific implementation principles and technical effects of this step can be referred to the specific implementation principles and technical effects of the server setting the distribution condition of the event associated with the first information according to the first information in S804, which will not be described herein.

[0331] S1106, the server can send a second response for indicating the subscription confirmation to the client. Correspondingly, the client can receive the second response from the server. The second response can include the ID of the target service and the ID of the target event group.

[0332] Optionally, S1106 and S1105 can be executed concurrently.

[0333] The specific implementation principle and technical effects of this step are similar to those of S805, and will not be described here.

[0334] As shown in FIG. 11, the event subscription method provided by the embodiments of the present application can be used to send a first subscription request to the server. The first subscription request carries first information, and the first information includes the identifier of the sending mode of the event but does not include the content of the sending mode of the event, thereby reducing the data amount of the first subscription request and realizing the indication of the sending mode of the event subscribed by the client to the server. The server obtains the sending mode of the event indicated by the client based on the first information, and sets the distribution condition of the event associated with the first information. When the event subscribed by the client reaches the distribution condition of the event, the event is distributed to the client. The server sends the event subscribed by the client to the client according to the sending mode of the event indicated by the client, thereby reducing the probability that the sending frequency of the event subscribed by the client is higher than the demand frequency of the event by the client, and further reducing the probability of sending invalid events. The probability of the target function failure of the client caused by the invalid event transmission occupying the bus bandwidth can be reduced.

[0335] FIG. 12 shows another event subscription flowchart provided by the embodiments of the present application.

[0336] Taking the first subscription request as an example, the event subscription method provided by the embodiments of the present application can include S801, S1201, S1103-S1106, as shown in FIG. 12.

[0337] The difference between the embodiment shown in FIG. 12 and the embodiment shown in FIG. 11 is that in the embodiment shown in FIG. 12, the server multicasts or unicasts the second service publishing message. Correspondingly, the client can receive the second service publishing message from the server. The server and the client jointly maintain a first set. The first set can include at least one sending mode supported by each event in at least one event occurred in each server of at least one server of the vehicle (such as a car). The first set can be referred to as a second subscription strategy list. The client can select the sending mode of the event to be subscribed from the second subscription strategy list. For details, please refer to S801 and S1201.

[0338] S801, the server can multicast or unicast the second service publishing message. Correspondingly, the client can receive the second service publishing message from the server. The second service publishing message includes the identification information of the target service.

[0339] S1201, the client parses the second service publishing message, obtains the identification information of the target service, and selects the sending mode of the event to be subscribed from the preset second subscription strategy list.

[0340] It can be understood that the event to be subscribed by the client is contained in the event associated with the target service.

[0341] The specific implementation principle of the client selecting the sending mode of the event to be subscribed from the preset second subscription strategy list in this step is similar to the specific implementation principle of the client selecting the sending mode of the event matching the subscription demand of the client from the first subscription strategy list in S1102, which will not be described here.

[0342] As described above, the first set can include at least one sending mode supported by each event in at least one event occurred in each service end of at least one service end of the vehicle (such as a car). Wherein, the at least one sending mode supported by the event in the first set can be:

[0343] the sending mode of the event expressed in the form of event granularity for each event;

[0344] or, the sending mode of all events in the event group expressed in the form of event group granularity;

[0345] or, the sending mode of all events contained in the service expressed in the form of service granularity;

[0346] or, the sending mode of all events occurred in the communication node expressed in the form of communication node granularity;

[0347] or, the sending mode of all events occurred in the communication node associated with the project expressed in the form of project granularity.

[0348] For example, the first set (or the second subscription strategy list) can include at least one of the following:

[0349] the sending mode supported by each event in at least one event of the vehicle;

[0350] or, the sending mode supported by each event group in at least one event group of the vehicle;

[0351] or, the sending mode supported by each service in at least one service of the vehicle, the service can include at least one event group;

[0352] Alternatively, the service end supports a sending mode supported by at least one item of the vehicle, and the item is associated with the at least one service end.

[0353] Alternatively, the service end supports a sending mode supported by at least one item of the vehicle, and the item is associated with the at least one service end.

[0354] In this way, the convenience and flexibility of maintaining the first set can be achieved.

[0355] As shown in FIG. 12, the event subscription method provided by the embodiment of the application can include that the service end sends a second service publishing message to the client. The second service publishing message does not contain a subscription policy list. The data amount of the second service publishing message can be reduced. The client can select an identifier of a sending mode of an event to be subscribed from a preset second policy list. The client sends a first subscription request to the service end. The first information is carried in the first subscription request, and the first information contains the identifier of the sending mode of the event selected by the client from the second subscription policy list, and does not contain the content of the sending mode of the event. In this way, the data amount of the first subscription request is reduced, and the sending mode of the event subscribed by the client is indicated to the service end. The service end obtains the sending mode of the event indicated by the client based on the first information, and sets a distribution condition of the event associated with the first information. When the event subscribed by the client reaches the distribution condition of the event, the event is distributed to the client. In this way, the service end sends the event subscribed by the client to the client according to the sending mode of the event indicated by the client, the probability that the sending frequency of the event subscribed by the client is higher than the demand frequency of the client for the subscribed event is reduced, and the probability that the invalid event is sent is further reduced. The probability that the target function of the client fails due to the bus bandwidth occupied by the transmission of the invalid event can be reduced.

[0356] In a possible implementation, there can be a situation that the analysis rule (or analysis mode) preset by the service end is not applicable to the analysis of the first subscription request. The analysis rule can be understood as a rule or mode used for analyzing the subscription request (or subscription message) sent by the client.

[0357] To this end, in order to realize the compatibility of the communication nodes in the electronic and electrical architecture of the vehicle, FIG. 9 and FIG. 10 show the interaction flow related to the event subscription method provided by the embodiment of the application.

[0358] FIG. 13 shows another event subscription flowchart provided by the embodiment of the application.

[0359] As shown in FIG. 13, the event subscription method provided by the embodiment of the application can include:

[0360] S801, the service end can multicast or unicast the second service publishing message. Correspondingly, the client can receive the second service publishing message from the service end.

[0361] S802, the client can send a first subscription request to the server. Correspondingly, the server can receive the first subscription request from the client.

[0362] The specific implementation principles of S801 and S802 are similar to those of S801 and S802 in the embodiment shown in FIG. 8, and will not be described here.

[0363] S1301, the server can parse the first subscription request and ignore the unknown field in the first subscription request, and obtain the ID of the target service and the ID of the target event group in the first subscription request.

[0364] For example, in the case where the preset parsing rule of the server is not applicable to the parsing of the first subscription request, the server can parse the ID of the target service and the ID of the target event group in the first subscription request by using the preset parsing rule, but cannot parse the subscription policy in the first subscription request. That is, the subscription policy in the first subscription request is an unknown field.

[0365] In the case where the preset parsing rule of the server uses a weak verification strategy, the server can ignore the field that cannot be parsed (i.e., the unknown field).

[0366] The server can use the content that has been parsed, such as the ID of the target service and the ID of the target event group, to implement the subscription of events.

[0367] For example, the server can send each event in the target event group to the client according to the preset sending mode of each event in the target event group.

[0368] S805, the server can send a second response for indicating the subscription confirmation to the client. Correspondingly, the client can receive the second response from the server. The second response can include the ID of the target service and the ID of the target event group.

[0369] For example, the server can execute S805 to notify the client that the event subscription is successful after completing the parsing of the first subscription request and obtaining the ID of the target service and the ID of the target event group in the first subscription request, which can reduce the probability of the client repeatedly sending the first subscription request to the server multiple times and reduce the interaction between the client and the server.

[0370] As shown in FIG. 13, in the event subscription method provided by the embodiment of the present application, in the case that the ID of the target service and the ID of the target event group in the first subscription request can be parsed by the preset parsing rule of the server, but the subscription policy in the first subscription request cannot be parsed, the server can perform event subscription by using the ID of the target service and the ID of the target event group, and send each event in the target event group to the client according to the preset sending mode of each event in the target event group. The server sends all the events in the target event group to the client, thereby reducing the probability of failure of the event subscription of the client in the case that the preset parsing rule of the server is not applicable to the parsing of the first subscription request.

[0371] FIG. 14 shows another event subscription flowchart provided by the embodiment of the present application.

[0372] As shown in FIG. 14, the event subscription method provided by the embodiment of the present application can include:

[0373] S801, the server can multicast or unicast the second service publishing message. Correspondingly, the client can receive the second service publishing message from the server.

[0374] S802, the client can send the first subscription request to the server. Correspondingly, the server can receive the first subscription request from the client.

[0375] The specific implementation principles of S801 and S802 are similar to those of S801 and S802 in the embodiment shown in FIG. 8, which will not be described here.

[0376] S1401, the server can parse the first subscription request, and in the case that an unknown field is identified, the server can trigger an exception handling.

[0377] For example, in the case that the preset parsing rule of the server is not applicable to the parsing of the first subscription request, if the server parses the first subscription request by using the preset parsing rule and identifies an unknown field, the server can trigger an exception handling to interrupt the event subscription of the client. The unknown field is, for example, the subscription policy in the first subscription request.

[0378] For example, in the case that the preset parsing rule of the server uses a strong verification strategy, if the server parses the first subscription request by using the preset parsing rule, parses the ID of the target service and the ID of the target event group in the first subscription request, but identifies an unknown field when parsing the subscription policy in the first subscription request, the server can perform S1402 to implement the exception handling.

[0379] S1402, the server can send a first response to the client, the first response indicating a subscription denial. Correspondingly, the client can receive the first response from the server. The first response can include an ID of the target service and an ID of the target event group.

[0380] S1403, the client can mark the identity of the server as a second identity. The second identity can indicate that the server does not support resolving the subscription policy, or can indicate that the first subscription request cannot be resolved.

[0381] S1404, the client can send a second subscription request to the server. Correspondingly, the server can receive the second subscription request from the client. The second subscription request can include an ID of the target service and an ID of the target event group.

[0382] S1405, the server can send a second response to the client, the second response indicating a subscription confirmation. Correspondingly, the client can receive the second response from the server. The second response can include an ID of the target service and an ID of the target event group.

[0383] For example, the second subscription request does not include a subscription policy. When the server receives the second subscription request from the client, the server can resolve all the contents in the second subscription request using a preset resolution rule without triggering an exception handling, so that the client successfully subscribes to the event.

[0384] The server can send each event in the target event group to the client according to a preset sending mode of each event in the target event group.

[0385] In this way, the client can subscribe to all events in the target event group from the server. The server can send each event in the target event group to the client according to a preset sending mode of each event in the target event group.

[0386] As shown in FIG. 14, in the event subscription method provided by the embodiment of the present application, in the case that the ID of the target service and the ID of the target event group in the first subscription request can be parsed by the service server using the preset parsing rule, but the subscription policy in the first subscription request cannot be parsed, the service server can interrupt the event subscription of the client and send the first response indicating the subscription denial to the client. The client can mark the identity of the service server as the second identity based on the first response. In this way, when the client subscribes to the event from the service server marked with the second identity, the client sends the second subscription request to the service server to realize the subscription to all events in the target event group. Since the second subscription request does not include the subscription policy, in the case that the service server receives the second subscription request from the client, the service server can parse all contents in the second subscription request using the preset parsing rule without triggering the exception processing, so that the event subscription of the client is successful. The service server can send each event in the target event group to the client according to the preset sending mode of each event in the target event group, realize the sending of all events in the target event group from the service server to the client, and reduce the occurrence probability of the event subscription failure of the client in the case that the preset parsing rule of the service server is not applicable to the parsing of the first subscription request.

[0387] Optionally, before the client performs S802, the client can determine whether the identity of the service server contains the second identity. If yes, it can be indicated that the parsing rule of the service server does not support the parsing of the first subscription request, and then the client can send the second subscription request to the service server to subscribe to the event. If not, it can be indicated that the parsing rule of the service server supports the parsing of the first subscription request, and then the client can perform S802 to subscribe to the event.

[0388] In the embodiment of the present application, the form of each of the subscription request, the service publishing message, the first response and the second response can be the form of a message. The subscription request is, for example, the first subscription request or the second subscription request. The service publishing message is, for example, the first service publishing message or the second service publishing message.

[0389] It should be understood that the specific form of the subscription request, the service publishing message, the first response or the second response is not limited in the embodiment of the present application.

[0390] For example, the form of each of the subscription request, the service publishing message, the first response and the second response can be the form of a SOME / IP service discovery (SD) message. The SOME / IP service discovery message can be referred to as a SOME / IP-SD message.

[0391] The SOME / IP-SD message can include a SOME / IP header, a SOME / IP SD header, an entry, and an option, etc.

[0392] The entry can be used to represent a specific service discovery behavior. The service discovery behavior can be, for example, service offer, subscribe, or subscribe ack, etc. The entry part can include a service ID and a service version, etc. The entry part can be associated with one or more options.

[0393] The option can be used to represent additional content of the entry. The additional content of the entry can be, for example, an IPv4 or IPv6 address, etc.

[0394] Exemplarily, the message format of the SOME / IP-SD message can be as shown in Table 1.

[0395] Table 1: SOME / IP-SD message format

[0396] In Table 1, the first row represents a bit. The entry array length in bytes and the entry array belong to the entry part. The option array length in bytes and the option array belong to the option part.

[0397] In the embodiments of the present application, in the case that the first subscribe request is in the form of the SOME / IP-SD message, the subscribe strategy in the first subscribe request can be arranged in the option part of the SOME / IP-SD message.

[0398] Exemplarily, the first information in the subscribe strategy can be in the form as shown in Table 2 in the SOME / IP-SD message.

[0399] Table 2: The first information in the first subscribe request in the form of the SOME / IP-SD message

[0400] Table 2 shows a way of carrying the content of the subscription policy in the custom option of the SOME / IP-SD message. In Table 2, the first row represents a bit. The length is the length, which can represent the length of the option whose type is 0 x 01. The type (= 0 x 01) can represent that the option type is a configuration option. The [len] in the [len] id = value can represent the length of the entry id = value. The entry id = value can be used to represent the sending manner of an event, or can be used to represent the sending manner of an event group. The [0] can be used to represent the termination position of the custom option. The reserved is a reserved field. The reserved (= 0 x 00) can represent that the reserved field of the custom option is 0 x 00. The zero-terminated configuration string is a zero-terminated custom string.

[0401] Exemplarily, taking the entry id = value used to represent the sending manner of an event as an example. In the entry id = value, the id can be the identifier of the event, and the value can be the sending manner of the event corresponding to the id. The specific style of the entry id = value used to represent the sending manner of an event can be seen from the style shown in Table 3 below.

[0402] Taking the entry id = value used to represent the sending manner of an event group as an example. In the entry id = value, the id can be the indication information of the event group, and the value can be the sending manner of the event group indicated by the id. The specific style of the entry id = value used to represent the sending manner of an event group can be seen from the style shown in Table 4 below.

[0403] It can be understood that the entry id = value can belong to a key-value pair.

[0404] Exemplarily, taking the first information in the first subscription request indicating the sending manner of an event as an example, the first information in the first subscription request in the form of the SOME / IP-SD message shown in Table 2 can be seen from Table 3.

[0405] Another example of the first information in the first subscription request in the form of the SOME / IP-SD message

[0406] In Table 3, the first row indicates bit positions. The respective meanings of length, type (= 0 x 01) and reserved (= 0 x 00) can be found in Table 2, and are not repeated here. event 8001 is the identification of event 8001, cyclic indicates that the transmission mode is the first mode, and 100 is the transmission period.

[0020] is the length of the entry event 8001 = cyclic: 100. [0] can be used to indicate the end position of the custom option shown in Table 3.

[0407] Table 3 can indicate that the transmission mode of the event group in the first subscription request is the first mode and the transmission period is 100 (ms).

[0408] Exemplarily, the first information in the first subscription request indicates the transmission mode of one event group, and the first information in the first subscription request in the form of the SOME / IP-SD message shown in Table 2 can be seen from Table 4.

[0409] Table 4 Another example of first information in the first subscription request in the form of the SOME / IP-SD message

[0410] In Table 4, the first row indicates bit positions. The respective meanings of length, type (= 0 x 01) and reserved (= 0 x 00) can be found in Table 2, and are not repeated here. time filter is a string. time filter can indicate the indication information of the event group. time filter can be used to indicate the target event group corresponding to the ID of the target event group in the first subscription request. The ID of the target event group is not shown in Tables 1-4. cyclic indicates that the transmission mode is the first mode, and 100 is the transmission period.

[0022] is the length of the entry time filter = cyclic: 100. [0] can be used to indicate the end position of the custom option shown in Table 4. It should be understood that the indication information of the event group can also be represented by other strings.

[0411] Table 4 can indicate that the transmission mode of the target event group in the first subscription request is the first mode and the transmission period is 100 (ms). That is, it indicates that the transmission mode of all events in the target event group in the first subscription request is the first mode and the transmission period is 100 (ms).

[0412] As shown in Tables 2-4, the content of the subscription policy can be carried in the custom option of the SOME / IP-SD message.

[0413] Optionally, the option type and field of the SOME / IP-SD message can also be redefined, and the redefined option type and field can be used to carry the content of the subscription policy. As shown in Table 5.

[0414] Another example of the first information in the first subscription request in the form of the SOME / IP-SD message

[0415] In Table 5, the first row represents a bit. The length is the length, and the length can represent the length of the option with the type (type) of 0x0F. The type (= 0x0F) can represent the option type (type) of the redefined 0 x 0F type. The option of the 0 x 0F type can be referred to as a subscription policy option (subpolicy option). The event ID is the identification of the event. The time filter represents the subscription policy content, and the time filter can be a variable value. The time filter is represented by 2 bytes. The high 2 bits in the time filter can represent the type of the sending manner, and the remaining 14 bits in the time filter can represent the period or preset threshold related to the sending manner. The time filter in the same row as the event ID can represent the sending manner of the event corresponding to the event ID. It should be understood that the subscription policy content can also be represented by other strings.

[0416] Among them, the high 2 bits in the time filter can be understood as the first two bits in the bit of the time filter.

[0417] For example, the high 2 bits in the time filter can be any one of 00, 01 or 10. Among them, 00 can represent that the type of the sending manner is the first manner (or cyclic). 01 can represent that the type of the sending manner is the third manner (or UOC). 10 can represent that the type of the sending manner is the second manner (or EOC).

[0418] If the high 2 bits in the time filter are 00, the remaining 14 bits in the time filter can represent the period related to the sending manner.

[0419] If the high 2 bits in the time filter are 10, the remaining 14 bits in the time filter can represent the preset threshold related to the sending manner, that is, the preset threshold of the event corresponding to the time filter.

[0420] It can be understood that the event ID in Table 5 can also be replaced by an identifier of an event group (event group ID). The time filter in the same row as the event group ID can represent a sending manner of the event group corresponding to the event group ID.

[0421] Optionally, the event ID in Table 5 can be an identifier of an event group. In the case that the event ID in Table 5 is an identifier of an event group, the event ID can include information for indicating that the event ID is an identifier of an event group.

[0422] It should be understood that Table 1 is only one example of the format of the SOME / IP-SD message in the embodiments of the present application, and is not a limitation on the format of the SOME / IP-SD message in the embodiments of the present application. Tables 2-5 are only examples of the first information in the embodiments of the present application, and are not a limitation on the first information in the embodiments of the present application.

[0423] The subscription confirmation in the embodiments of the present application can be understood as a successful subscription, and the subscription denial can be understood as a failed subscription.

[0424] The embodiments of the present application also provide an event subscription method, which comprises:

[0425] sending a first subscription request, the first subscription request being used for subscribing to an event occurring in a first electronic device in a vehicle, the first subscription request comprising first information, the first information being used for indicating a sending manner of the event.

[0426] obtaining a subscribed event based on the first subscription request, the subscribed event being included in the event occurring in the first electronic device.

[0427] By way of example, the execution subject of the embodiments of the present application can be a client in the embodiments shown in any one of Figures 1-14. The vehicle in the embodiments of the present application can be the automobile in the embodiment shown in Figure 1, and the first electronic device in the embodiments of the present application can also be a server in the embodiments shown in any one of Figures 1-14. The execution subject and the first electronic device in the embodiments of the present application can both be the communication node in Figure 1.

[0428] Taking the first electronic device as the server in the embodiment shown in Figure 8 as an example, the first subscription request in the embodiments of the present application can be the first subscription request in the embodiment shown in Figure 8. The event occurring in the first electronic device in the embodiments of the present application can be an event occurring in the server in the embodiment shown in Figure 8. The at least one event occurring in the server can be understood as at least one event or at least one event instance occurring in a functional domain managed by the server. The first information in the embodiments of the present application can be the first information in the embodiment shown in Figure 8.

[0429] The specific implementation principle of the embodiment of the application can refer to the specific implementation principle of the embodiment shown in FIG. 8, the embodiment shown in FIG. 9, the embodiment shown in FIG. 11, or the embodiment shown in FIG. 12.

[0430] By carrying the first information for indicating the sending mode of the event in the first subscription request, the first electronic device can send the event associated with the first information to the electronic device sending the first subscription request (or the electronic device subscribing to the event) in the sending mode of the event indicated by the first information. In this way, the probability of the first electronic device sending the event at a frequency higher than the demand frequency of the electronic device subscribing to the event can be reduced, and the probability of occurrence of invalid events can be reduced, and the probability of the target function failure of the electronic device subscribing to the event caused by the invalid event transmission occupying the bus bandwidth can be reduced.

[0431] Optionally, the first information includes the sending mode of each event in the at least one event, and the at least one event is included in the event occurred by the first electronic device.

[0432] Alternatively, the first information includes the sending mode of each event group in the at least one event group, the at least one event group is included in the event occurred by the first electronic device, and the event group includes at least one event.

[0433] Exemplarily, the first information includes the sending mode of each event in the at least one event, which can represent that the sending mode of the event indicated by the first information is the sending mode of the event represented in the form of event granularity for each event.

[0434] The first information includes the sending mode of each event group in the at least one event group, which can represent that the sending mode of the event indicated by the first information is the sending mode of all events in the event group represented in the form of event group granularity.

[0435] In this way, the flexibility of the representation or expression of the first information can be realized, and the application range of the event subscription method provided by the embodiment of the application can be expanded.

[0436] Optionally, the first information includes the identification of the event and the sending mode of the corresponding event.

[0437] Alternatively, the first information includes the indication information of the event group and the sending mode of the corresponding event group, wherein the indication information of the event group is information indicating the event group, and the event group includes at least one event.

[0438] Exemplarily, the first information can include an identification of the event, and a sending manner of the event corresponding to the identification of the event, as shown in Table 2, Table 3 or Table 5. Alternatively, the first information can include indication information of the event group, and a sending manner of the event group corresponding to (or indicated by) the indication information of the event group, as shown in Table 4. The indication information of the event group can be the time filter shown in Table 4.

[0439] In this way, flexibility of the representation or expression of the first information can be achieved, and the application range of the event subscription method provided by the embodiments of the present application can be extended.

[0440] Alternatively, the first information can be represented in the form of <key, value>, where the key includes the identification of the event, and the value includes the sending manner of the event. Alternatively, the key includes the indication information of the event group, and the value includes the sending manner of the event group.

[0441] In this way, flexibility of the representation or expression of the first information can be achieved, and the application range of the event subscription method provided by the embodiments of the present application can be extended.

[0442] Alternatively, the sending manner of the event includes an identification of the sending manner of the event, and the sending manner of the event group includes an identification of the sending manner of the event group.

[0443] In this way, compared with the case where the first information includes the specific content of the sending manner of the event or the specific content of the sending manner of the event group, the sending manner of the event in the first information is represented by the identification of the sending manner of the event, and the sending manner of the event group is represented by the identification of the sending manner of the event group, which can reduce the data amount of the first information, and further reduce the occupation of the bus bandwidth by the transmission of the first subscription request.

[0444] Alternatively, the sending manner includes any one of a first manner, a second manner or a third manner. The first manner is used to indicate periodic sending of the event, the second manner is used to indicate sending of the event when the event reaches a preset threshold, and the third manner is used to indicate sending of the event when the event changes.

[0445] The first information includes at least one of the following:

[0446] an event sending period, the event sending period being associated with the first manner. Alternatively,

[0447] an identification of the first manner and an event sending period, the event sending period being associated with the first manner. Alternatively,

[0448] an identification of the second manner and a preset threshold of the second manner. Alternatively,

[0449] an identification of the third manner.

[0450] Exemplarily, the first mode in the embodiments of the present application can be the first mode (or cyclic) in the embodiment shown in FIG. 1. The second mode in the embodiments of the present application can be the second mode (or EOC) in the embodiment shown in FIG. 4. The third mode in the embodiments of the present application can be the third mode (or UOC) in the embodiment shown in FIG. 4. The preset threshold in the embodiments of the present application can be the preset threshold in the embodiment shown in FIG. 4. The event sending period is associated with the first mode. For example, when the sending mode of the event A in the embodiment shown in FIG. 1 is the first mode and the sending period is 10 milliseconds (ms), the first mode of the event A is associated with the sending period 10 milliseconds (ms) of the event A. The identification of the first mode can be cyclic. The identification of the second mode can be EOC. The identification of the third mode can be UOC.

[0451] Optionally, the identification of the first mode can be the high 2 bits 00 in the time filter in the embodiment shown in Table 5. The identification of the second mode can be the high 2 bits 10 in the time filter in the embodiment shown in Table 5. The identification of the third mode can be the high 2 bits 01 in the time filter in the embodiment shown in Table 5.

[0452] The first information includes the event sending period, or the identification of the first mode and the pattern of the event sending period can refer to the embodiments shown in Table 3 or Table 4.

[0453] In this way, the sending mode of the event indicated in the first information can be any one of the first mode, the second mode or the third mode.

[0454] Optionally, the first subscription request further includes second information, and the second information is used to indicate part of events in a subscription event group. The subscription event group includes at least one event, and the subscription event group contains events occurring in the first electronic device.

[0455] Exemplarily, the second information in the embodiments of the present application can be the second information in the embodiment shown in FIG. 8. The subscription event group in the embodiments of the present application can be the subscription event group in the embodiment shown in FIG. 8. The subscription event group in the embodiments of the present application can also be the target event group in the embodiment shown in FIG. 8.

[0456] The first subscription request further includes the second information, so that the first electronic device sends events associated with the second information to the electronic device subscribing to the events. The events associated with the second information are part of the events in the subscription event group, rather than all the events in the subscription event group. In this way, the probability of the first electronic device sending events that are not needed by the electronic device subscribing to the events to the electronic device subscribing to the events can be reduced, and the occupation of the bus bandwidth by invalid events can be reduced.

[0457] Optionally, the second information comprises the identification of each event in the partial events.

[0458] The second information comprises the identification of each event in the partial events, as shown in S802.

[0459] In this way, the first electronic device can send the events required by the electronic device subscribing to the events to the electronic device subscribing to the events with accuracy.

[0460] Optionally, the second information further comprises the first identification, which is used to indicate the partial events in the event group.

[0461] For example, the first identification in the embodiment of the present application can be the string event filter shown in S802. The representation of the second information can refer to S802.

[0462] In this way, the first electronic device can send the events required by the electronic device subscribing to the events to the electronic device subscribing to the events with accuracy.

[0463] Optionally, the second information is represented in the form of <key, value>, wherein the key comprises the first identification, and the value comprises the identification of each event in the partial events.

[0464] In this way, the first electronic device can send the events required by the electronic device subscribing to the events to the electronic device subscribing to the events with accuracy. The representation of the second information can refer to S802.

[0465] Optionally, the sending manner of the event indicated by the first information is pre-registered on the vehicle before the vehicle is operated, or is registered on the vehicle in the case that the vehicle is operated.

[0466] For example, the subscription requirement of the client in the embodiment shown in FIG. 5, the embodiment shown in FIG. 6 or the embodiment shown in FIG. 7 can comprise the sending manner of the event indicated by the first information.

[0467] The specific implementation principle of pre-registering the sending manner of the event indicated by the first information on the vehicle before the vehicle is operated can refer to the specific implementation principle of the embodiment shown in FIG. 5 or the specific implementation principle of the embodiment shown in FIG. 6.

[0468] The specific implementation principle of registering the sending manner of the event indicated by the first information on the vehicle in the case that the vehicle is operated can refer to the specific implementation principle of the embodiment shown in FIG. 7.

[0469] In this way, the first subscription request can carry the accurate first information or the first information meeting the requirement of the electronic device subscribing to the events.

[0470] Optionally, before sending the first subscription request, the method further includes:

[0471] receiving a first service publishing packet from the first electronic device, the first service publishing packet being used to indicate a service provided by the first electronic device, the service including at least one event group, the event group including at least one event, and the at least one event group each including an event occurred by the first electronic device.

[0472] Exemplarily, the first service publishing packet in the embodiment of the application can be the second service publishing packet in S801 or the first service publishing packet in S1101.

[0473] In this way, the first service publishing packet is used to indicate a service provided by the first electronic device, the service including at least one event group, the event group including at least one event, and the at least one event group each including an event occurred by the first electronic device. The first service publishing packet sent by the first electronic device can be used to notify an electronic device subscribing to an event to subscribe to the event and to inform the electronic device subscribing to the event of events that can be provided by the first electronic device, so as to facilitate the electronic device subscribing to the event to subscribe to the event.

[0474] Optionally, the first service publishing packet includes third information, the third information being used to indicate at least one sending mode supported by the event. The sending mode of the event indicated by the first information is selected from the third information.

[0475] Exemplarily, the first service publishing packet in the embodiment of the application can be the first service publishing packet in S1101. The third information can be the third information or the first subscription policy list in the embodiment shown in FIG. 11.

[0476] In this way, the first service publishing packet includes third information used to indicate at least one sending mode supported by the event, so that the electronic device subscribing to the event can select a suitable sending mode of the event from the sending modes of the events provided by the first service publishing packet to subscribe to the event. On the other hand, the electronic device subscribing to the event can carry an identifier of the selected sending mode of the event in the first subscription request sent to the first electronic device, so as to reduce the data amount of the first subscription request, and further to reduce the occupation amount of the bus bandwidth by the transmission of the first subscription request. In addition, the sending modes in the third information are all sending modes supported by the event of the server, the sending mode of the event indicated by the first information is selected from the third information, and the probability of occurrence of a sending mode not supported by the server can be reduced.

[0477] Optionally, the sending mode of the event indicated by the first information is selected from a preset first set, and the first set includes at least one sending mode supported by the event occurred by the first electronic device.

[0478] Exemplarily, the first set in the embodiment of the present application can be the first set in the embodiment shown in FIG. 12.

[0479] In this way, the sending mode of the event indicated by the first information is selected from the preset first set, and the service publishing message sent by the first electronic device can not carry the sending mode of the event, so that the data amount of the service publishing message can be reduced.

[0480] Optionally, the first set includes any of the following:

[0481] the sending mode supported by each event in the at least one event. Or,

[0482] the sending mode supported by each event group in the at least one event group. Or,

[0483] the sending mode supported by each service in the at least one service, the service including the at least one event group. Or,

[0484] the sending mode supported by each electronic device in the at least one electronic device, the electronic device providing the at least one service. Or,

[0485] the sending mode supported by each project in the at least one project, the project being associated with the at least one electronic device.

[0486] In this way, the first set includes the sending mode supported by each event in the at least one event, and the sending mode of the event in the first set can be represented in the form of event granularity.

[0487] The first set includes the sending mode supported by each event group in the at least one event group, and the sending mode of all events of the event group in the first set can be represented in the form of event group granularity.

[0488] The first set includes the sending mode supported by each service in the at least one service, and the sending mode of all events contained in the service in the first set can be represented in the form of service granularity.

[0489] The first set includes the sending mode supported by each electronic device in the at least one electronic device, and the sending mode of all events occurred in the communication node in the first set can be represented in the form of communication node granularity.

[0490] The first set includes the sending mode supported by each project in the at least one project, and the sending mode of all events occurred in the communication node associated with the project in the first set can be represented in the form of project granularity.

[0491] Optionally, the method further includes:

[0492] sending a first subscription request, the first subscription request being used to subscribe to events occurred in the second electronic device, the first subscription request comprising fourth information, or the first subscription request comprising the fourth information and fifth information, the fourth information being used to indicate a sending manner of the events, and the fifth information being used to indicate part of events in a subscription event group, the subscription event group comprising at least one event, and the subscription event group being included in the events occurred in the second electronic device.

[0493] receiving a first response used to indicate a subscription denial.

[0494] marking the identity of the second electronic device as a second identity.

[0495] sending a second subscription request, the second subscription request being used to subscribe to an event group of the second electronic device.

[0496] obtaining all events in an event group associated with the second subscription request.

[0497] Exemplarily, the second electronic device in the embodiment of the present application can be the server in the embodiment shown in FIG. 14. The first subscription request in the embodiment of the present application can be the first subscription request in the embodiment shown in FIG. 14. The fourth information in the embodiment of the present application can be the first information included in the subscription policy in the embodiment shown in FIG. 14. The fifth information in the embodiment of the present application can be the second information included in the subscription policy in the embodiment shown in FIG. 14. The first response in the embodiment of the present application can be the first response in S1402. The second subscription request in the embodiment of the present application can be the second subscription request in the embodiment shown in FIG. 14. The specific implementation principles and technical effects of the embodiment of the present application can refer to the specific implementation principles and technical effects of the embodiment shown in FIG. 14.

[0498] In this way, in the case that the preset analysis rule of the second electronic device is not applicable to the analysis of the first subscription request, the electronic device subscribing to the events can subscribe to all events in the target event group of the second electronic device. The occurrence probability of the failure of the electronic device subscribing to the events in the case that the preset analysis rule of the second electronic device is not applicable to the analysis of the first subscription request is reduced. The compatibility of the event subscription of the second electronic device is improved.

[0499] Optionally, the method further comprises:

[0500] sending a first subscription request, the first subscription request being used to subscribe to events occurred in the second electronic device, the first subscription request comprising fourth information, or the first subscription request comprising the fourth information and fifth information, the fourth information being used to indicate a sending manner of the events, and the fifth information being used to indicate part of events in a subscription event group, the subscription event group comprising at least one event, and the subscription event group being included in the events occurred in the second electronic device.

[0501] obtaining all events in the first subscription request associated event group, the first subscription request associated event group being contained in events occurred in the third electronic device.

[0502] Exemplarily, the third electronic device in the embodiment of the present application can be the server in the embodiment shown in FIG. 13. The first subscription request in the embodiment of the present application can be the first subscription request in the embodiment shown in FIG. 13. The sixth information in the embodiment of the present application can be the first information contained in the subscription policy in the embodiment shown in FIG. 13. The seventh information in the embodiment of the present application can be the second information contained in the subscription policy in the embodiment shown in FIG. 13. The specific implementation principle and technical effects of the embodiment of the present application can refer to the specific implementation principle and technical effects of the embodiment shown in FIG. 13.

[0503] In this way, in the case that the preset analysis rule of the third electronic device is not applicable to the analysis of the first subscription request, the electronic device subscribing events can subscribe all events in the target event group in the third electronic device. The occurrence probability of the failure of the electronic device subscribing events in the case that the preset analysis rule of the third electronic device is not applicable to the analysis of the first subscription request is reduced. The compatibility of the event subscription of the third electronic device is improved.

[0504] The embodiment of the present application further provides an event subscription method, which comprises:

[0505] receiving a first subscription request, the first subscription request being used for subscribing events occurred in a first electronic device in a vehicle, the first subscription request comprising first information or the first subscription request comprising first information and second information, the first information being used for indicating a sending mode of events, and the second information being used for indicating part of events in a subscription event group, the subscription event group comprising at least one event, and the subscription event group being contained in events occurred in the first electronic device.

[0506] distributing events indicated by the first subscription request based on the first information or based on the first information and the second information.

[0507] Exemplarily, the execution subject of the embodiment of the present application can be the first electronic device. The first electronic device can be the server in the embodiment shown in any one of FIG. 1 to FIG. 14. The first electronic device can be the communication node in FIG. 2. The vehicle in the embodiment of the present application can be the automobile in the embodiment shown in FIG. 2,

[0508] Taking the first electronic device as the server in the embodiment shown in FIG. 8 as an example, the first subscription request in the embodiment of the application can be the first subscription request in the embodiment shown in FIG. 8. The event occurring in the first electronic device in the embodiment of the application can be the event occurring in the server in the embodiment shown in FIG. 8. At least one event occurring in the server can be understood as at least one event or at least one event instance occurring in a functional domain managed by the server. The first information in the embodiment of the application can be the first information in the embodiment shown in FIG. 8. The second information in the embodiment of the application can be the second information in the embodiment shown in FIG. 8. The subscription event group in the embodiment of the application can be the target event group in the embodiment shown in FIG. 8. The subscription event group in the embodiment of the application can also be the target event group in the embodiment shown in FIG. 8.

[0509] The specific implementation principle of the embodiment of the application can refer to the specific implementation principle of the embodiment shown in FIG. 8, the embodiment shown in FIG. 9, the embodiment shown in FIG. 11 or the embodiment shown in FIG. 12.

[0510] By carrying the first information for indicating the sending mode of the event in the first subscription request, the first electronic device can send the event associated with the first information to the electronic device sending the first subscription request (or the electronic device subscribing to the event) in the sending mode of the event indicated by the first information. In this way, the probability of the first electronic device sending the event at a frequency higher than the demand frequency of the electronic device subscribing to the event can be reduced, and the probability of the occurrence of the invalid event can be reduced, and the probability of the target function failure of the electronic device subscribing to the event caused by the invalid event transmission occupying the bus bandwidth can be reduced.

[0511] Optionally, the first information includes the sending mode of the target event, and the sending mode of the target event includes information for indicating a first period of periodically sending the target event. The target event is any one of the events indicated by the first subscription request to subscribe to.

[0512] Distributing the event indicated by the first subscription request to subscribe to based on the first information or based on the first information and the second information includes:

[0513] According to the first period of the target event and a preset period of the target event, a first distribution condition of the target event is set, and the preset period of the target event is a preset period for indicating periodically sending the target event.

[0514] Based on the first distribution condition of the target event, the target event is transmitted to the electronic device sending the first subscription request.

[0515] Exemplarily, the target event in the embodiment of the present application can be the target event in S804. The first period of the target event in the embodiment of the present application can be the first period of the target event in S804. The specific implementation principle of the embodiment of the present application can refer to the specific implementation principle of S804.

[0516] In this way, since the target event is any one of the events indicated by the first subscription request to subscribe to, the event to which the electronic device subscribes can be transmitted based on the first information, or based on the first information and the second information, to reduce the probability of occurrence of invalid events.

[0517] Optionally, the first distribution condition of the target event includes a first factor of the target event. The first factor of the target event is positively correlated with the first period of the target event and negatively correlated with a preset period of the target event.

[0518] Based on the first distribution condition of the target event, the target event is transmitted to the electronic device sending the first subscription request, including:

[0519] When the number of times of occurrence of the target event of the first electronic device reaches the first factor, the target event is sent. The number of times of occurrence of the target event of the first electronic device is counted from the first target event after subscribing to the target event, or counted from the first target event after sending the target event.

[0520] Exemplarily, the first factor of the target event in the embodiment of the present application can be the first factor of the target event in S804. The preset period of the target event in the embodiment of the present application can be the preset period of the target event in S804. The specific implementation principle of the embodiment of the present application can refer to the specific implementation principle of S804.

[0521] In this way, the event to which the electronic device subscribes can be transmitted based on the first information, or based on the first information and the second information, to reduce the probability of occurrence of invalid events.

[0522] Optionally, the first factor δ of the target event satisfies: δ=max(1,‖T c / T s ‖)

[0523] max(1,‖T c / T s ‖) represents taking the maximum value from 1 and ‖T c / T s ‖, ‖‖ represents the integer part, T c is the first period, and T S is the preset period.

[0524] In this way, the event to which the electronic device subscribes can be transmitted to the electronic device subscribing to the event based on the first information or based on the first information and the second information, so as to reduce the probability of occurrence of invalid events. In addition, when the first period T C of the target event is less than the preset period T S of the target event, T C / T S is less than 1, δ = 1. δ = 1 can indicate that the first electronic device can send the target event to the electronic device subscribing to the target event according to the preset period of the target event. It should be understood that the electronic device subscribing to the target event refers to the electronic device indicating the first period of the target event. The first period T C of the target event is less than the preset period T S of the target event. It can be understood that the sending mode of the target event preset by the first electronic device cannot meet the demand frequency of the target event of the electronic device subscribing to the target event.

[0525] Optionally, the first distribution condition of the target event further includes a third identifier and an identifier of the electronic device subscribing to the event, and the third identifier is used to indicate that the event has been subscribed.

[0526] For example, the third identifier in the embodiment of the application can be the third identifier in S804. The electronic device subscribing to the event in the embodiment of the application can be the client in S804. The specific implementation principle of the embodiment of the application can refer to the specific implementation principle of S804.

[0527] In this way, since the event associated with the second information is the event required by the electronic device subscribing to the event, in the case that the first subscription request includes the first information and the second information, if the distribution condition of the target event includes the third identifier, the first electronic device can transmit the target event to the electronic device subscribing to the event when the target event meets the distribution condition of the target event. If the distribution condition of the target event does not include the third identifier, it can be indicated that the target event is not the event required by the electronic device subscribing to the event, and the first electronic device can not transmit the target event to the electronic device subscribing to the event when the target event meets the distribution condition of the target event. In order to reduce the probability of occurrence of invalid events, the first electronic device transmits the event required by the client to the electronic device subscribing to the event.

[0528] Optionally, the first information includes a sending mode of the target event, the sending mode of the target event is a second mode, the target event is any one of the events indicated by the first subscription request to subscribe to, and the second mode is used to indicate that the event is sent when the event reaches a preset threshold.

[0529] The event indicated by the first subscription request to subscribe to is distributed based on the first information or based on the first information and the second information, including:

[0530] a second distribution condition of the target event is set, the second distribution condition of the target event being used to indicate sending the target event when the target event reaches a preset threshold.

[0531] based on the second distribution condition of the target event, the target event is transmitted to the electronic device sending the first subscription request.

[0532] Exemplarily, the second manner in the embodiment of the application can be the second manner in S804. The preset threshold in the embodiment of the application can be the preset threshold in S804. The specific implementation principle of the embodiment of the application can be referred to the specific implementation principle of S804. The second distribution condition in the embodiment of the application can be the second distribution condition in S804.

[0533] In this way, the first electronic device can transmit the target event to the electronic device subscribing to the event according to the second distribution condition of the target event, so as to reduce the probability of occurrence of invalid events.

[0534] Optionally, the second distribution condition of the target event further includes a third identifier and an identifier of the electronic device subscribing to the event, the third identifier being used to indicate that the event has been subscribed.

[0535] In this way, since the event associated with the second information is the event required by the electronic device subscribing to the event, in the case that the first subscription request includes the first information and the second information, if the distribution condition of the target event includes the third identifier, the first electronic device can transmit the target event to the electronic device subscribing to the event when the target event meets the distribution condition of the target event. If the distribution condition of the target event does not include the third identifier, it can be indicated that the target event is not the event required by the electronic device subscribing to the event, and the first electronic device can not transmit the target event to the electronic device subscribing to the event when the target event meets the distribution condition of the target event. In this way, the probability of the first electronic device transmitting the event not required by the client to the electronic device subscribing to the event can be reduced, and the probability of occurrence of invalid events can be reduced.

[0536] Optionally, the first information includes a sending manner of the target event, the sending manner of the target event being a third manner, the target event being any event indicated by the first subscription request to subscribe to, and the third manner being used to indicate sending the event when the event changes.

[0537] based on the first information, or based on the first information and the second information, the event indicated by the first subscription request to subscribe to is distributed, including:

[0538] a third distribution condition of the target event is set, the third distribution condition of the target event being used to indicate sending the target event when the target event changes.

[0539] transmit the target event to the electronic device sending the first subscription request according to the third distribution condition of the target event.

[0540] Exemplarily, the third manner in the embodiment of the application can be the third manner in S804. The preset threshold in the embodiment of the application can be the preset threshold in S804. The specific implementation principle of the embodiment of the application can refer to the specific implementation principle of S804. The third distribution condition in the embodiment of the application can be the third distribution condition in S804.

[0541] In this way, the first electronic device can transmit the target event to the electronic device subscribing to the event according to the third distribution condition of the target event, so as to reduce the probability of occurrence of invalid events.

[0542] Optionally, the second distribution condition of the target event further includes a third identifier and an identifier of the electronic device subscribing to the event, the third identifier being used to indicate that the event has been subscribed.

[0543] In this way, since the event associated with the second information is the event required by the electronic device subscribing to the event. In the case that the first subscription request includes the first information and the second information, if the distribution condition of the target event includes the third identifier, the first electronic device can transmit the target event to the electronic device subscribing to the event when the target event meets the distribution condition of the target event. If the distribution condition of the target event does not include the third identifier, it can be indicated that the target event is not the event required by the electronic device subscribing to the event, and the first electronic device can not transmit the target event to the electronic device subscribing to the event when the target event meets the distribution condition of the target event. In this way, the probability of the first electronic device transmitting the event not required by the client to the electronic device subscribing to the event can be reduced, and the probability of occurrence of invalid events can be reduced.

[0544] Optionally, before receiving the first subscription request, the method further includes:

[0545] sending a first service publishing message. The first service publishing message is used to indicate a service provided by the first electronic device, the service including at least one event group, and the event group associated with the service provided by the first electronic device including at least one event occurring in the first electronic device.

[0546] Exemplarily, the first service publishing message in the embodiment of the application can be the second service publishing message in S801, or can be the first service publishing message in S1101.

[0547] In this way, the first service publishing message is used to indicate the service provided by the first electronic device, the service includes at least one event group, the event group includes at least one event, and the at least one event group includes events generated by the first electronic device. The first service publishing message sent by the first electronic device can be used to notify the electronic device subscribing to the event to subscribe to the event, and to inform the electronic device subscribing to the event of events that can be provided by the first electronic device, so that the electronic device subscribing to the event can subscribe.

[0548] Optionally, the first service publishing message includes third information used to indicate at least one sending mode supported by the event, the at least one sending mode supported by the event indicated by the third information is selected from a second set pre-registered, and the second set includes at least one sending mode supported by the event generated by the first electronic device. The second set is pre-registered on the vehicle before the vehicle is running, or the second set is registered on the vehicle in the case of running of the vehicle. The sending mode of the event indicated by the first information in the first subscription request is selected from the third information.

[0549] For example, the first service publishing message in the embodiment of the application can be the first service publishing message in S1101. The third information in the embodiment of the application can be the third information or the first subscription policy list in the embodiment shown in FIG. 11. The second set in the embodiment of the application can be the second set in the embodiment shown in FIG. 11. The specific implementation principle of pre-registering the second set on the vehicle before the vehicle is running can refer to the specific implementation principle of the embodiment shown in FIG. 5 or the specific implementation principle of the embodiment shown in FIG. 6. The specific implementation principle of registering the second set on the vehicle in the case of running of the vehicle can refer to the specific implementation principle of the embodiment shown in FIG. 7.

[0550] In this way, the first service publishing message includes third information used to indicate at least one sending mode supported by the event, so that the electronic device subscribing to the event can select a suitable sending mode of the event from the sending modes of the events provided by the first service publishing message to subscribe to the event. On the other hand, the electronic device subscribing to the event can carry the identifier of the selected sending mode of the event in the first subscription request sent to the first electronic device, so as to reduce the data amount of the first subscription request, and further reduce the occupation amount of the bus bandwidth by the transmission of the first subscription request.

[0551] It should be noted that the names of the modules involved in the embodiments of the application can be defined as other names, as long as the functions of the modules can be implemented, and the names of the modules are not limited specifically.

[0552] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.

[0553] The event subscription method of the embodiments of the present application has been described above, and the device provided by the embodiments of the present application for executing the above method will be described below. Those skilled in the art can understand that the method and the device can be combined and referred to each other, and the related device provided by the embodiments of the present application can execute the steps in the above event subscription method.

[0554] The event subscription method provided by the embodiments of the present application can be applied in an electronic device with communication function. The electronic device can include a terminal device, and the specific device form of the terminal device can refer to the above related description, which will not be repeated here.

[0555] The embodiments of the present application provide an electronic device, which includes: an electronic device includes one or more processors and a memory. The memory is coupled with the one or more processors, and the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors invoke the computer instructions to make the electronic device execute the above method.

[0556] The embodiments of the present application provide a chip. The chip includes a processor, and the processor is used to invoke a computer program in a memory to execute the technical solutions in the above embodiments. The implementation principle and technical effects are similar to those of the above related embodiments, which will not be repeated here.

[0557] The embodiments of the present application provide a chip system. The chip system includes at least one processor and a communication interface, the communication interface and the at least one processor are interconnected through a line, and the at least one processor is used to run a computer program or instructions to execute the above method.

[0558] The embodiments of the present application further provide a computer readable storage medium. The computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the method described above. The method described in the above embodiments can be implemented by software, hardware, firmware or any combination thereof, in whole or in part. If implemented by software, the functions can be stored in or transmitted by a computer readable medium as one or more instructions or code. The computer readable medium can include a computer storage medium and a communication medium, and can further include any medium that can carry the computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.

[0559] In a possible implementation, the computer readable medium can include a RAM, a ROM, a compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that is targeted to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is properly referred to as a computer readable medium. For example, if software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave) is included in the definition of medium. As used herein, a disk and a disc include a compact disc, a laser disc, an optical disc, a digital versatile disc (DVD), a floppy disk and a Blu-ray disc, wherein the disk usually magnetically reproduces data, and the disc optically reproduces data with a laser. The above combinations should also be included in the scope of computer readable medium.

[0560] It can be understood that the event subscription method and related apparatus provided by the embodiments of the present application can include an electronic device, a chip, a chip system and / or a computer readable storage medium.

[0561] The embodiments of the present application provide a computer program product, which includes a computer program. When the computer program is executed, the computer program causes a computer to execute the method described above.

[0562] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and a combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device that implements the functions specified in one or more flows in the flowcharts and / or one or more blocks in the block diagrams.

[0563] The above detailed description has further explained the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above is only a specific embodiment of the present application and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical solutions of the present application should be included in the protection scope of the present application.

Claims

1. An event subscription method, characterized by, The method comprises: sending a first subscription request, the first subscription request being used for subscribing to events occurring in a first electronic device in a vehicle, the first subscription request comprising first information, the first information being used for indicating a sending mode of the events; obtaining subscribed events based on the first subscription request, the subscribed events being included in the events occurring in the first electronic device.

2. The method of claim 1, wherein: the first information comprises a sending mode of each event in at least one event, the at least one event being included in the events occurring in the first electronic device; or the first information comprises a sending mode of each event group in at least one event group, the at least one event group being included in the events occurring in the first electronic device, and the event group comprising at least one event.

3. The method of claim 1 or 2, wherein: the first information comprises an identifier of an event and a sending mode corresponding to the event; or the first information comprises indication information of an event group and a sending mode corresponding to the event group, the indication information of the event group being information indicating the event group, and the event group comprising at least one event.

4. The method according to any one of claims 1 to 3, characterized in that, the sending mode comprises any one of a first mode, a second mode or a third mode, the first mode being used for indicating that the event is sent periodically, the second mode being used for indicating that the event is sent when the event reaches a preset threshold, and the third mode being used for indicating that the event is sent when the event changes; the first information comprises at least one of: an event sending period, the event sending period being associated with the first mode; or an identifier of the first mode and an event sending period, the event sending period being associated with the first mode; or an identifier of the second mode and a preset threshold of the second mode; or an identifier of the third mode.

5. The method according to any one of claims 1-4, characterized in that, the first subscription request further comprises second information, the second information being used for indicating part of events in a subscribed event group, the subscribed event group comprising at least one event, and the subscribed event group being included in the events occurring in the first electronic device.

6. The method of claim 5, wherein, the second information comprises an identifier of each event in the part of events.

7. The method of claim 6, wherein, the second information further comprises a first identifier, the first identifier being used for indicating the part of events in the subscribed event group.

8. The method according to any one of claims 1 to 7, characterized in that, the sending mode of the event indicated by the first information is pre-registered on the vehicle before the vehicle is operated, or is registered on the vehicle in a case where the vehicle is operated.

9. The method according to any one of claims 1-7, characterized in that, Before the first subscription request is sent, the method further comprises: receiving a first service publishing packet from the first electronic device, the first service publishing packet being used for indicating a service provided by the first electronic device, the service comprising at least one event group, the event group comprising at least one event, and the at least one event group being included in the events occurring in the first electronic device.

10. The method of claim 9, wherein: The first service publishing message comprises third information, the third information being used to indicate at least one sending mode supported by an event; the sending mode of the event indicated by the first information being selected from the third information.

11. The method according to any one of claims 1-7, characterized in that, The sending mode of the event indicated by the first information is selected from a preset first set, the first set comprising at least one sending mode supported by an event occurred in the first electronic device.

12. The method of claim 11, wherein, The first set comprises any of the following: sending modes supported by each event in at least one event; or, sending modes supported by each event group in at least one event group; or, sending modes supported by each service in at least one service, the service comprising at least one event group; or, sending modes supported by each electronic device in at least one electronic device, the electronic device providing at least one service; or, sending modes supported by each item in at least one item, the item being associated with at least one electronic device. Further comprising:

13. The method according to any one of claims 1-12, characterized in that, sending a first subscription request, the first subscription request being used to subscribe to an event occurred in a second electronic device in the vehicle, the first subscription request comprising fourth information, or, the first subscription request comprising the fourth information and fifth information, the fourth information being used to indicate a sending mode of an event, the fifth information being used to indicate partial events in a subscription event group, the subscription event group comprising at least one event, the subscription event group being contained in the event occurred in the second electronic device; receiving a first response used to indicate a subscription denial; marking an identity of the second electronic device as a second identity; sending a second subscription request, the second subscription request being used to subscribe to an event group of the second electronic device; obtaining all events in an event group associated with the second subscription request. Further comprising:

14. The method of any one of claims 1-13, wherein, sending a first subscription request, the first subscription request being used to subscribe to an event occurred in a third electronic device in the vehicle, the first subscription request comprising sixth information, or, the first subscription request comprising the sixth information and seventh information, the sixth information being used to indicate a sending mode of an event, the seventh information being used to indicate partial events in a subscription event group, the subscription event group comprising at least one event, the subscription event group being contained in the event occurred in the third electronic device; obtaining all events in an event group associated with the first subscription request, the event group associated with the first subscription request being contained in the event occurred in the third electronic device. The method comprises:

15. An event subscription method, characterized by, receiving a first subscription request, the first subscription request being used to subscribe to an event occurred in a first electronic device in a vehicle, the first subscription request comprising first information, or, the first subscription request comprising the first information and second information, the first information being used to indicate a sending mode of an event, the second information being used to indicate partial events in a subscription event group, the subscription event group comprising at least one event, the subscription event group being contained in the event occurred in the first electronic device; distributing the event indicated by the first subscription request based on the first information, or, based on the first information and the second information. ​ 16. The method of claim 15, wherein, The first information includes a sending mode of a target event, the sending mode of the target event including information indicating a first period for periodically sending the target event, and the target event being any of events indicated by the first subscription request to subscribe to; Distributing the events indicated by the first subscription request to subscribe to based on the first information or based on the first information and the second information includes: Setting a first distribution condition of the target event according to the first period of the target event and a preset period of the target event, the preset period of the target event being a preset period for indicating periodic sending of the target event; Transmitting the target event to the electronic device sending the first subscription request based on the first distribution condition of the target event.

17. The method of claim 16, wherein, The first distribution condition of the target event includes a first factor of the target event, the first factor of the target event being positively correlated with the first period of the target event and negatively correlated with the preset period of the target event; The transmitting the target event to the electronic device sending the first subscription request based on the first distribution condition of the target event includes: The first electronic device sends the target event when the number of times of occurrence of the target event reaches the first factor; The number of times of occurrence of the target event of the first electronic device is counted from the first target event after subscribing to the target event or counted from the first target event after sending the target event.

18. The method of claim 17, wherein, The first factor δ of the target event satisfies: δ = max(1,‖T C / T S ‖) wherein max(1,‖T c / T s ‖) represents the maximum value selected from 1 and ‖T C / T s ‖, ‖‖ represents the integer part, T C is the first period, and T S is the preset period.

19. The method of claim 17 or 18, wherein, The first distribution condition of the target event further includes a third identifier and an identifier of an electronic device subscribing to the event, the third identifier being used to indicate that the event has been subscribed to.

20. The method of claim 15, wherein, The first information includes a sending mode of a target event, the sending mode of the target event being a second mode, the target event being any of events indicated by the first subscription request to subscribe to, and the second mode being used to indicate sending of an event when the event reaches a preset threshold; The distributing the events indicated by the first subscription request to subscribe to based on the first information or based on the first information and the second information includes: Setting a second distribution condition of the target event, the second distribution condition of the target event being used to indicate sending of the target event when the target event reaches a preset threshold; Transmitting the target event to the electronic device sending the first subscription request based on the second distribution condition of the target event.

21. The method of claim 20, wherein, The second distribution condition of the target event further includes a third identifier and an identifier of an electronic device subscribing to the event, the third identifier being used to indicate that the event has been subscribed to.

22. The method of claim 15, wherein, The first information includes a sending mode of a target event, the sending mode of the target event being a third mode, the target event being any of events indicated by the first subscription request to subscribe to, and the third mode being used to indicate sending of an event when the event changes; The distributing the events indicated by the first subscription request to subscribe to based on the first information or based on the first information and the second information includes: A third distribution condition of the target event is set, and the third distribution condition of the target event is used to indicate that the target event is sent when the target event changes; Based on the third distribution condition of the target event, the target event is transmitted to the electronic device sending the first subscription request.

23. The method of claim 22, wherein, The second distribution condition of the target event further includes a third identifier and an identifier of the electronic device subscribing to the event, and the third identifier is used to indicate that the event has been subscribed.

24. The method of any one of claims 15-23, wherein, Before the first subscription request is received, the method further includes: A first service publishing message is sent, and the first service publishing message is used to indicate a service provided by the first electronic device, the service includes at least one event group, and the event group associated with the service provided by the first electronic device includes at least one event occurring in the first electronic device.

25. The method of claim 24, wherein, The first service publishing message includes third information, and the third information is used to indicate at least one sending mode supported by the event, the at least one sending mode supported by the event indicated by the third information is selected from a second set registered in advance, the second set includes at least one sending mode supported by the event occurring in the first electronic device; the second set is registered on the vehicle before the vehicle runs, or the second set is registered on the vehicle in the case that the vehicle runs; and the sending mode of the event indicated by the first information in the first subscription request is selected from the third information.

26. An electronic device, comprising: The electronic device includes one or more processors and a memory; the memory is coupled with the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors invoke the computer instructions to enable the electronic device to execute the method in any one of claims 1 to 25.

Citation Information

Patent Citations

  • Communication method and device, and storage medium

    CN114598567A

  • SOA architecture-based vehicle data acquisition system, method and device, and medium

    CN115203078A

  • Service event processing method, computer equipment and storage medium

    CN116743872A

  • Data storage device and operating method thereof

    KR1020260004049A