Event subscription method and related device
By including information about the event transmission method in the subscription request, the problem of frequent transmission of invalid events in the domain controller is solved, thereby achieving accurate event transmission and efficient utilization of bus bandwidth, and reducing the probability of target function failures.
Patent Information
- Application Number
- CN202411127185.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2026-03-03
AI Technical Summary
When a domain controller calls a service through the service publish/subscribe function, the target function may fail, resulting in frequent transmission of invalid events that consume bus bandwidth and increase the probability of failure.
By including information indicating the event sending method in the subscription request, the frequency of invalid event sending is reduced, the scope of application is expanded by adopting a flexible information representation method, the required events are sent accurately, and the bus bandwidth usage is reduced.
This reduces the probability of invalid events, decreases the occurrence of target function failures, and improves the accuracy of event transmission and the utilization efficiency of bus bandwidth.
Smart Images

Figure CN121603558A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle management technology, and in particular to an event subscription method and related apparatus. Background Technology
[0002] Some automotive electrical and electronic architectures may include domain controllers (DCs) for each of the vehicle's multiple functional domains. These functional domains may include powertrain, chassis, body, cockpit, and autonomous driving domains, among others. Domain controllers are used to manage and control the functions associated with their respective functional domains.
[0003] In some implementations, the electrical and electronic architecture (EEA) adopts a service-oriented architecture (SOA). SOA encapsulates the functionality of each domain controller within the EEA as services, assigning each service a specific Internet Protocol (IP) address and standardized interface. This allows domain controllers to invoke the encapsulated services at any time, achieving the desired functionality through the combination of various services. For example, the communication protocol of an SOA architecture may include a scalable service-oriented middleware over IP (SOME / IP) protocol. The SOME / IP protocol features service publish / subscribe functionality. Domain controllers in the EEA can use this service publish / subscribe functionality to invoke the encapsulated services, thereby achieving the desired functionality through the combination of various services.
[0004] However, in scenarios where a domain controller calls services through the service publish / subscribe function to achieve a target function, the target function may fail. Summary of the Invention
[0005] This application provides an event subscription method and related apparatus, which are applied in the field of vehicle management technology and can reduce the probability of target function failures of domain controllers.
[0006] Firstly, an event subscription method is provided, comprising: sending a first subscription request, the first subscription request being used to subscribe to events occurring on a first electronic device in a vehicle, the first subscription request including first information indicating the method of event transmission; and obtaining the subscribed events based on the first subscription request, the subscribed events being included in the events occurring on the first electronic device.
[0007] According to the above scheme, by carrying first information indicating the event transmission method in the first subscription request, the first electronic device can send the event associated with the first information to the electronic device that sent the first subscription request (or the electronic device subscribing to the event) according to the event transmission method indicated by the first information. This reduces the probability that the frequency of events sent by the first electronic device exceeds the frequency of events required by the electronic device subscribing to the event, thereby reducing the probability of invalid events occurring. It also reduces the probability that invalid event transmission occupies bus bandwidth, causing target function failures in the electronic device subscribing to the event.
[0008] In conjunction with the first aspect, in some implementations of the first aspect, the first information includes: the transmission method of each event in at least one event, and the at least one event includes events occurring in the first electronic device. Alternatively, the first information includes: the transmission method of each event group in at least one event group, and the at least one event group includes events occurring in the first electronic device, and the event group includes at least one event.
[0009] According to the above scheme, the flexibility of the first information representation or expression method can be achieved, and the applicability of the event subscription method provided in the embodiments of this application can be expanded.
[0010] In conjunction with the first aspect, in some implementations of the first aspect, the first information includes an identifier of the event and a corresponding method of sending the event. Alternatively, the first information includes indication information for an event group and a corresponding method of sending the event group, wherein the indication information for the event group is information indicating the event group, and the event group includes at least one event.
[0011] According to the above scheme, the flexibility of the first information representation or expression method can also be achieved, and the applicability of the event subscription method provided in the embodiments of this application can be expanded.
[0012] In conjunction with the first aspect, in some implementations of the first aspect, the first information can be represented as follows: <key, value>, where key includes the identifier of the event and value includes the method of sending the event. Alternatively, key includes indication information of the event group, and value includes the method of sending the event group.
[0013] According to the above scheme, the flexibility of the first information representation or expression method can also be achieved, and the applicability of the event subscription method provided in the embodiments of this application can be expanded.
[0014] In conjunction with the first aspect, in some implementations of the first aspect, the event sending method includes an identifier of the event sending method, and the event group sending method includes an identifier of the event group sending method.
[0015] According to the above scheme, compared to the first information containing the specific content of the event sending method or the specific content of the event group sending method, the first information uses the event sending method identifier to represent the event sending method, and the event group sending method uses the event group sending method identifier to represent the event group sending method. This can reduce the amount of data in the first information, thereby reducing the bus bandwidth occupied by the transmission of the first subscription request.
[0016] In conjunction with the first aspect, in certain implementations of the first aspect, the transmission method includes any one of the first method, the second method, or the third method. The first method is used to indicate periodically transmitting events, the second method is used to indicate transmitting events when an event reaches a preset threshold, and the third method is used to indicate transmitting events when an event changes. The first information includes at least one of the following: an event transmission period, which is associated with the first method. Alternatively, an identifier of the first method and an event transmission period, which is associated with the first method. Alternatively, an identifier of the second method and a preset threshold of the second method. Alternatively, a third-party identifier.
[0017] According to the above scheme, the method of sending the event indicated in the first information can be any one of the first method, the second method, or the third method.
[0018] In conjunction with the first aspect, in some implementations of the first aspect, the first subscription request further includes second information, which indicates a subset of events in the subscription event group. The subscription event group includes at least one event, and the subscription event group contains events occurring on the first electronic device.
[0019] According to the above scheme, the first subscription request also includes second information, which enables the first electronic device to send the events associated with the second information to the electronic device subscribing to the event. The events associated with the second information are some 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 the electronic device subscribing to the event does not need to the electronic device subscribing to the event can be reduced, thereby reducing the bus bandwidth occupation by invalid events.
[0020] In conjunction with the first aspect, in some implementations of the first aspect, the second information includes the identifiers of each event in a subset of events.
[0021] According to the above scheme, the accuracy of sending the events required by the first electronic device to the electronic device subscribing to the events can be achieved. The second information includes the identifiers of each event in a subset of the events, as shown in S802.
[0022] In conjunction with the first aspect, in some implementations of the first aspect, the second information also includes a first identifier, which is used to indicate a subset of events in the subscribed event group.
[0023] According to the above scheme, the accuracy of sending the events required by the first electronic device to the electronic device that subscribes to the event can be achieved.
[0024] In conjunction with the first aspect, in some implementations of the first aspect, the second information is represented as follows: <key, value>, where key includes the first identifier and value includes the identifiers of each event in the partial events.
[0025] According to the above scheme, the accuracy of sending the events required by the first electronic device to the electronic device subscribing to the event can be achieved. The representation of the second information can be found in S802.
[0026] In conjunction with the first aspect, in some implementations of the first aspect, the event indicated by the first information is sent either by pre-registering on the vehicle before the vehicle is in operation, or by registering on the vehicle while the vehicle is in operation.
[0027] According to the above scheme, it is possible to carry accurate first information or first information that meets the needs of electronic devices for subscription events in the first subscription request.
[0028] In conjunction with the first aspect, in some implementations of the first aspect, before sending the first subscription request, the method further includes: receiving a first service publication message from a first electronic device, the first service publication message 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 all included in events occurring in the first electronic device.
[0029] According to the above scheme, the first service publishing message is used to indicate the services provided by the first electronic device. The service includes at least one event group, and each event group includes at least one event. All at least one event group contains events occurring on the first electronic device. The first service publishing message sent by the first electronic device can be used to notify electronic devices subscribing to events to subscribe to the events, and to inform the subscribing electronic devices of the events that the first electronic device can provide, so that the subscribing electronic devices can subscribe.
[0030] In conjunction with the first aspect, in certain implementations of the first aspect, the first service publishes a message including third information, which indicates at least one transmission method supported by the event. The transmission method of the event indicated by the first information is selected from the third information.
[0031] According to the above scheme, the first service publishing message includes third information indicating at least one transmission method supported by the event, so that the electronic device subscribing to the event can select a suitable transmission method from the transmission methods provided in 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 transmission method in the first subscription request sent to the first electronic device, thereby reducing the data volume of the first subscription request and thus reducing the bus bandwidth usage of the first subscription request transmission. Furthermore, the transmission methods in the third information are all transmission methods supported by the first electronic device for the event, and the transmission method indicated by the first information is selected from the third information, which can reduce the probability of the first electronic device not supporting the transmission method indicated by the first information.
[0032] In conjunction with the first aspect, in some implementations of the first aspect, the transmission method of the event indicated by the first information is selected from a preset first set, the first set including at least one transmission method supported by the event occurring in the first electronic device.
[0033] According to the above scheme, the sending method of the event indicated by the first information is selected from a preset first set. The service publishing message sent by the first electronic device may not carry the sending method of the event, which can reduce the data volume of the service publishing message.
[0034] In conjunction with the first aspect, in certain implementations of the first aspect, the first set includes any of the following: a transmission method supported by each event in at least one event; or a transmission method supported by each event group in at least one event group; or a transmission method supported by each service in at least one service, wherein the service includes at least one event group; or a transmission method supported by each electronic device in at least one electronic device, wherein the electronic device provides at least one service; or a transmission method supported by each item in at least one project, wherein the project is associated with at least one electronic device.
[0035] According to the above scheme, the first set includes at least one event's supported transmission method, which can realize the representation of the transmission method of events in the first set at the event granularity. The first set includes at least one event group's supported transmission method, which can realize the representation of the transmission method of all events in the event group in the first set at the event group granularity. The first set includes at least one service's supported transmission method, which can realize the representation of the transmission method of all events contained in the service in the first set at the service granularity. The first set includes at least one electronic device's supported transmission method, which can realize the representation of the transmission method of all events occurring at the communication node in the first set at the communication node granularity. The first set includes at least one project's supported transmission method, which can realize the representation of the transmission method of all events occurring at the communication nodes associated with the project in the first set at the project granularity.
[0036] In conjunction with the first aspect, some implementations of the first aspect further include: sending a first subscription request, the first subscription request being used to subscribe to events occurring on the second electronic device in the vehicle, the first subscription request including fourth information, or the first subscription request including both fourth and fifth information, the fourth information being used to indicate the method of sending the events, the fifth information being used to indicate subscribing to a subset of events in an event group, the event group including at least one event, and the event group being included in the events occurring on the second electronic device. Receiving a first response indicating subscription denial. Marking the identifier of the second electronic device as a second identifier. Sending a second subscription request, the second subscription request being used to subscribe to the event group of the second electronic device. Obtaining all events in the event group associated with the second subscription request.
[0037] According to the above scheme, when the preset parsing rules of the second electronic device are not applicable to parsing the first subscription request, the electronic device subscribing to the event can subscribe to all events in the target event group from the second electronic device. This reduces the probability of the electronic device failing to subscribe to events when the preset parsing rules of the second electronic device are not applicable to parsing the first subscription request. It also improves the compatibility of event subscriptions on the second electronic device.
[0038] In conjunction with the first aspect, some implementations of the first aspect further include: sending a first subscription request, the first subscription request being used to subscribe to events occurring on a third electronic device in the vehicle, the first subscription request including sixth information, or the first subscription request including both sixth and seventh information, the sixth information being used to indicate the method of sending the events, the seventh information being used to indicate a subset of events in a subscription event group, the subscription event group including at least one event, and the subscription event group encompassing events occurring on the third electronic device. Then, all events in the event group associated with the first subscription request are obtained, the first subscription request associated event group encompassing events occurring on the third electronic device.
[0039] According to the above scheme, when the preset parsing rules of the third electronic device are not applicable to parsing the first subscription request, the electronic device subscribing to the event can subscribe to all events in the target event group from the third electronic device. This reduces the probability of the electronic device failing to subscribe to events when the preset parsing rules of the third electronic device are not applicable to parsing the first subscription request. It also improves the compatibility of event subscriptions by the third electronic device.
[0040] Secondly, an event subscription method is provided, comprising: receiving a first subscription request, the first subscription request being used to subscribe to events occurring on a first electronic device in a vehicle, the first subscription request including first information, or the first subscription request including first information and second information, the first information being used to indicate the sending method of the event, the second information being used to indicate subscribing to a subset of events in an event group, the event group including at least one event, the event group being included in the events occurring on the first electronic device; and distributing the events subscribed to by the first subscription request based on the first information, or based on the first information and the second information.
[0041] According to the above scheme, by carrying first information indicating the event transmission method in the first subscription request, the first electronic device can send the event associated with the first information to the electronic device that sent the first subscription request (or the electronic device subscribing to the event) according to the event transmission method indicated by the first information. This reduces the probability that the frequency of events sent by the first electronic device exceeds the frequency of events required by the electronic device subscribing to the event, thereby reducing the probability of invalid events occurring. It also reduces the probability that invalid event transmission occupies bus bandwidth, causing target function failures in the electronic device subscribing to the event.
[0042] In conjunction with the second aspect, in some implementations of the second aspect, the first information includes a method for sending the target event, and the method for sending the target event includes information for indicating a first period for periodically sending the target event. The target event is any event among the events subscribed to by the first subscription request. Distributing the events subscribed to by the first subscription request based on the first information, or based on the first information and the second information, includes: setting a first distribution condition for the target event according to the first period of the target event and a preset period of the target event, wherein the preset period of the target event is a preset period for indicating periodically sending the target event. Based on the first distribution condition of the target event, transmitting the target event to the electronic device that sent the first subscription request.
[0043] According to the above scheme, since the target event is any of the events subscribed to by the first subscription request, it is possible to transmit the subscribed events to the electronic device that subscribes to the event based on the first information, or based on the first and second information, thereby reducing the probability of invalid events occurring.
[0044] In conjunction with the second aspect, in some implementations of the second aspect, 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. Based on the first distribution condition of the target event, transmitting the target event to the electronic device that sent the first subscription request includes: sending the target event when the number of times the target event occurs on the first electronic device reaches the first factor. The number of times the target event occurs on the first electronic device starts counting from the first target event after subscribing to the target event, or starts counting from the first target event after sending the target event.
[0045] According to the above scheme, it is possible to transmit the events subscribed to by the electronic device to the subscribed event based on the first information, or based on the first information and the second information, so as to reduce the probability of invalid events occurring.
[0046] In conjunction with the second aspect, in some implementations of the second aspect, the first factor δ of the target event satisfies:
[0047] δ=max(1,‖T C / T S ‖)
[0048] Where max(1,‖T) C / T S ‖) represents from 1 and ‖T C / T S The maximum value in T is taken from the integer part. C For the first period, T S This is the preset cycle.
[0049] According to the above scheme, it is possible to transmit subscribed events to electronic devices based on first information, or based on both first and second information, thereby reducing the probability of invalid events occurring. Furthermore, when the first period T of the target event... C Less than the preset period T of the target event S At that time, T C / T S If the value is less than 1, then δ = 1. δ = 1 indicates that the first electronic device can send the target event to the electronic device subscribed to the target event according to the preset period of the target event. It should be understood that the electronic device subscribed to the target event is the electronic device that indicates the first period of the target event. The first period T of the target event... C Less than the preset period T of the target event S This can be understood as follows: the preset method of sending the target event by the first electronic device cannot meet the frequency of the target event required by the electronic device subscribing to the target event.
[0050] In conjunction with the second aspect, in some implementations of the second aspect, the first distribution condition of the target event further includes: a third identifier and an identifier of the electronic device subscribing to the event, wherein the third identifier is used to indicate that the event has been subscribed to.
[0051] According to the above scheme, since the event associated with the second information is an event needed by the electronic device subscribing to the event, when the first subscription request includes both the first and second information, if the distribution conditions of the target event include a third identifier, then the first electronic device can transmit the target event to the electronic device subscribing to the event when the target event meets the distribution conditions. If the distribution conditions of the target event do not include the third identifier, it indicates that the target event is not needed by the electronic device subscribing to the event, and the first electronic device may not transmit the target event to the electronic device subscribing to the event when the target event meets the distribution conditions. This reduces the probability of the first electronic device transmitting events that the client does not need to the electronic device subscribing to the event, thereby reducing the probability of invalid events occurring.
[0052] In conjunction with the second aspect, in some implementations of the second aspect, the first information includes a method for sending the target event, which is a second method. The target event is any event among those subscribed to by the first subscription request, and the second method is used to indicate that the event is sent when it reaches a preset threshold. Distributing the event subscribed to by the first subscription request based on the first information, or based on the first and second information, includes: setting a second distribution condition for the target event, which indicates that the target event is sent when it reaches a preset threshold. Based on the second distribution condition, the target event is transmitted to the electronic device that sent the first subscription request.
[0053] According to the above scheme, the first electronic device can transmit the target event to the electronic device that subscribes to the event according to the second distribution condition of the target event, so as to reduce the probability of invalid events occurring.
[0054] In conjunction 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, wherein the third identifier is used to indicate that the event has been subscribed to.
[0055] According to the above scheme, since the event associated with the second information is an event needed by the electronic device subscribing to the event, when the first subscription request includes both the first and second information, if the distribution conditions of the target event include a third identifier, then the first electronic device can transmit the target event to the electronic device subscribing to the event when the target event meets the distribution conditions. If the distribution conditions of the target event do not include the third identifier, it indicates that the target event is not needed by the electronic device subscribing to the event, and the first electronic device may not transmit the target event to the electronic device subscribing to the event when the target event meets the distribution conditions. This reduces the probability of the first electronic device transmitting events that the client does not need to the electronic device subscribing to the event, thereby reducing the probability of invalid events occurring.
[0056] In conjunction with the second aspect, in some implementations of the second aspect, the first information includes a method for sending the target event, which is a third method. The target event is any event among those subscribed to by the first subscription request, and the third method is used to indicate that the event should be sent when the event changes. Based on the first information, or based on the first and second information, distributing the event subscribed to by the first subscription request includes: setting a third distribution condition for the target event, which is used to indicate that the target event should be sent when the target event changes. Based on the third distribution condition of the target event, transmitting the target event to the electronic device that sent the first subscription request.
[0057] According to the above scheme, the first electronic device can transmit the target event to the electronic device that subscribes to the event according to the third distribution condition of the target event, so as to reduce the probability of invalid events occurring.
[0058] In conjunction 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, wherein the third identifier is used to indicate that the event has been subscribed to.
[0059] According to the above scheme, since the event associated with the second information is an event needed by the electronic device subscribing to the event, when the first subscription request includes both the first and second information, if the distribution conditions of the target event include a third identifier, then the first electronic device can transmit the target event to the electronic device subscribing to the event when the target event meets the distribution conditions. If the distribution conditions of the target event do not include the third identifier, it indicates that the target event is not needed by the electronic device subscribing to the event, and the first electronic device may not transmit the target event to the electronic device subscribing to the event when the target event meets the distribution conditions. This reduces the probability of the first electronic device transmitting events that the client does not need to the electronic device subscribing to the event, thereby reducing the probability of invalid events occurring.
[0060] In conjunction with the second aspect, in some implementations of the second aspect, before receiving the first subscription request, the method further includes: sending a first service publication message. The first service publication 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 on the first electronic device.
[0061] According to the above scheme, the first service publishing message is used to indicate the services provided by the first electronic device. The service includes at least one event group, and each event group includes at least one event. All at least one event group contains events occurring on the first electronic device. The first service publishing message sent by the first electronic device can be used to notify electronic devices subscribing to events to subscribe to the events, and to inform the subscribing electronic devices of the events that the first electronic device can provide, so that the subscribing electronic devices can subscribe.
[0062] In conjunction with the second aspect, in some implementations of the second aspect, the first service publishing message includes third information indicating at least one transmission method supported by the event. The at least one transmission method supported by the event indicated by the third information is selected from a pre-registered second set, which includes at least one transmission method supported by events occurring on the first electronic device. The second set is pre-registered on the vehicle before the vehicle is operational, or the second set is registered on the vehicle while it is operational. The transmission method 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 indicating at least one transmission method supported by the event, so that the electronic device subscribing to the event can select a suitable transmission method from the transmission methods provided in 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 transmission method in the first subscription request sent to the first electronic device, so as to reduce the data volume of the first subscription request, and thus reduce the bus bandwidth occupation of the transmission of the first subscription request.
[0064] Thirdly, an electronic device is provided, comprising: one or more processors and a memory. The memory is coupled to the one or more processors and is used to store computer program code, the computer program code including computer instructions, wherein the one or more processors invoke the computer instructions to cause the electronic device to perform the methods of the first aspect, any possible implementation of the first aspect, the second aspect, and any possible implementation of the second aspect.
[0065] Fourthly, a chip system is provided, which is applied to an electronic device. The chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device to perform the methods described in the first aspect, any possible implementation of the first aspect, the second aspect, and any possible implementation of the second aspect.
[0066] Fifthly, a computer-readable storage medium is provided, comprising computer instructions that, when executed on an electronic device, cause the electronic device to perform the methods described in 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, comprising computer program code, which, when executed on an electronic device, causes the electronic device to perform the methods described in 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 to sixth aspects of this application correspond to the technical solutions of the first or second aspects of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description
[0069] Figure 1 A schematic diagram illustrating an event subscription and distribution process provided for an embodiment of this application;
[0070] Figure 2 A schematic diagram of an electronic and electrical architecture of a car provided in an embodiment of this application;
[0071] Figure 3 A software-related architecture diagram of a communication node provided in an embodiment of this application;
[0072] Figure 4 A schematic diagram of another software-related architecture for a communication node provided in an embodiment of this application;
[0073] Figure 5 A schematic diagram illustrating a static registration mechanism provided in an embodiment of this application;
[0074] Figure 6 A schematic diagram illustrating another static registration mechanism provided in an embodiment of this application;
[0075] Figure 7 A schematic diagram illustrating a dynamic registration mechanism provided in an embodiment of this application;
[0076] Figure 8A schematic diagram of an event subscription process provided in an embodiment of this application;
[0077] Figure 9 A schematic diagram illustrating yet another event subscription and distribution process provided in an embodiment of this application;
[0078] Figure 10 This is a schematic diagram illustrating the effect of event distribution as provided in an embodiment of this application.
[0079] Figure 11 This is a schematic diagram of another event subscription process provided in an embodiment of this application;
[0080] Figure 12 This is a schematic diagram of another event subscription process provided in an embodiment of this application;
[0081] Figure 13 This is a schematic diagram of another event subscription process provided in an embodiment of this application;
[0082] Figure 14 This is a schematic diagram of another event subscription process provided in an embodiment of this application. Detailed Implementation
[0083] To facilitate a clear description of the technical solutions in the embodiments of this application, some terms and technologies involved in the embodiments of this application will be briefly introduced below:
[0084] 1. Service-oriented architecture (SOA)
[0085] SOA can be understood as a method for designing, developing, deploying, and managing discrete models in a computer environment. In an 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] A protocol stack can be understood as a hierarchical combination of a series of protocols used to implement network communication. Each layer of the protocol stack is responsible for different functions, and through the layered combination and collaborative work of the protocol stack, the reliability, efficiency, and security of network communication are achieved.
[0088] A protocol stack can be divided into multiple layers according to different functions, with each layer responsible for a specific function. These multiple layers of a protocol stack include, for example, the physical layer, data link layer, network layer, transport layer, and application layer.
[0089] The protocol stack can perform data encapsulation, data transmission, and data processing.
[0090] For example, in network communication, data needs to undergo multiple layers of processing and encapsulation. Each layer's protocol can add corresponding header information to the data so that the receiving end can correctly parse and process the data. The protocol stack can transmit and forward data between different layers, ensuring that the data can correctly reach its destination in the network. Each layer of the protocol stack can process and transform data, such as data segmentation, reassembly, error detection, and correction, to achieve data processing.
[0091] Some protocol layers in the protocol stack can also perform network security functions such as data encryption, authentication, and access control 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 used for in-vehicle SOA architecture.
[0094] SOME / IP provides communication mechanisms such as methods, events, and data fields.
[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] Events use a publish-subscribe communication mechanism. For example, a client can subscribe to events from a server, and the server can send the subscribed events to the client.
[0097] A field defines the structure and content of the data associated with a service method and event, enabling the client and server to process the data exchanged between them. A field can include getters, setters, and notifiers. The communication mechanism for getters and setters is method invocation. The communication mechanism for notifiers is a publish / subscribe mechanism.
[0098] Regarding the service publish / subscribe functionality of the SOME / IP protocol, for example, when a server publishes a service, a client subscribes to an event group for that service based on its needs, thereby obtaining events from the subscribed event group. An event group contains one or more events. In this embodiment, the event can be either the aforementioned event or the notifier in the aforementioned field.
[0099] The process by which a client subscribes to an event group published by a server and obtains events from the subscribed event group may include an event subscription and distribution process. In some embodiments of this application, SOME / IP may also be referred to as SOMEIP.
[0100] 4. Client and Server
[0101] In this embodiment, the client can be understood as the end that subscribes to events, the end that invokes services, or the end that sends requests. The server can be understood as the end that provides events, the end that provides services, or the end that executes requests.
[0102] For example, in the electronic and electrical architecture of a vehicle, domain controller A can subscribe to events from domain controller B, and domain controller B can send the subscribed events to domain controller A. In this scenario, domain controller A is the client, and domain controller B is the server.
[0103] Alternatively, in a scenario where domain controller A calls a service from domain controller B, domain controller A acts as the client and domain controller B acts as the server.
[0104] For example, domain controller B can subscribe to events from domain controller A, and domain controller A can send the subscribed events to domain controller B. In this scenario, domain controller B is the client, and domain controller A is the server.
[0105] Alternatively, in a scenario where domain controller B calls a service from domain controller A, domain controller B acts as the client and domain controller A acts as the server.
[0106] As can be seen, domain controller A can be either a client or a server. Domain controller B can be either a server or a client.
[0107] 5. Other terms
[0108] In the embodiments of this application, terms such as "first" and "second" are used to distinguish identical or similar items with substantially the same function and purpose. For example, "first chip" and "second chip" are used only to distinguish different chips and do not limit their order of execution. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply that they are different.
[0109] It should be noted that, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0110] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, and c can be single or multiple.
[0111] 6. Electronic equipment
[0112] The electronic devices in this application embodiment may include handheld devices with communication functions, vehicle-mounted devices, etc. The electronic devices may be modules or assemblies in a vehicle, or they may be components of the vehicle.
[0113] By way of example and not limitation, in the embodiments of this application, the electronic device may also be a domain controller, gateway, sensor, actuator or electronic control unit (ECU) in a vehicle.
[0114] Furthermore, in this embodiment of the application, the electronic device can also be a terminal device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network of human-machine interconnection and object-to-object interconnection.
[0115] The electronic devices in the embodiments of this application may also be referred to as: terminal devices or user devices, etc.
[0116] In this embodiment, the electronic device includes a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on top of 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 memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux, Unix, Android, iOS, or Windows.
[0117] Figure 1 This illustration shows a flowchart of an event subscription and distribution process provided in an embodiment of this application.
[0118] like Figure 1 As shown, taking server, client 1, and client 2 as examples, in some possible implementations, the event subscription and distribution process may include:
[0119] S100. The server can multicast a second service offer message. Correspondingly, client 1 and client 2 can each receive the second service offer message from the server.
[0120] In this context, the server, client 1, and client 2 can all be domain controllers within the vehicle's electrical and electronic architecture. For example, the server could be the vehicle domain controller (VDC). Client 1 could be the integrated cockpit controller (ICC). Client 2 could be the mobile data center (MDC). The vehicle's electrical and electronic architecture will be discussed later. Figure 2 The architecture shown is for ease of understanding. Figure 2 This will be described later.
[0121] The second service publication message may include: service identification information. The service identification information may include the service's identifier (ID) and the service's version. The service may include at least one event group. An event group may include at least one event, for example, an event group may include at least one event occurring within a functional domain managed by the server. Exemplarily, a service can be understood as one of at least one services provided by the server.
[0122] It should be understood that at least one event occurring within the functional domain managed by the server can be referred to as at least one event occurring on the server side. An event can be a notification of a status value. Status values can include any of the following: multimedia volume, vehicle speed, or air conditioning temperature. Status values can be obtained by the server at any time. An event can also be an abnormal event. Abnormal events include, for example, a collision or a malfunction.
[0123] by Figure 1 The service in the second service publication message of the server multicast shown is service 1. Service 1 includes event group 1, which can include event A and event B, with event A being a vehicle speed event or taking vehicle speed as an example. If both client 1 and client 2 need to obtain event A from 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. Client 1 can send a second subscription request to the server. This second subscription request may include: the ID of service 1 and the ID of event group 1. Correspondingly, the server can receive the second subscription request from client 1.
[0125] S102. The server can send a subscription ACK to client 1. The subscription ACK may include the ID of service 1 and the ID of event group 1.
[0126] Thus, through S100-S102, client 1 subscribes to all events in event group 1 of service 1 from the server. The server can then send each event in event group 1 to client 1 according to the preset sending method for each event in event group 1.
[0127] S103. Client 2 can send a second subscription request to the server. This second subscription request may include: the ID of service 1 and the ID of event group 1. Correspondingly, the server can receive the second subscription request from client 2.
[0128] S104. The server can send a subscription ACK to client 2. The subscription ACK may include the ID of service 1 and the ID of event group 1.
[0129] Thus, through S100, S103-S104, client 2 subscribes to all events in event group 1 of service 1 from the server. It is understandable that the execution times of S101 and S103 can be the same or different. The server can send each event in event group 1 to client 2 according to the preset sending method for each event in event group 1.
[0130] In event group 1, the preset sending mode for each event can be the first mode. The first mode is used to indicate periodically sent events. The first mode can be called periodic sending.
[0131] For example, taking the server-preset event A sending method as the first method with a sending period of 10 milliseconds (ms), and event B sending method as the first method with a sending period of 40 ms as an example, when the server sends a subscription confirmation to client 1, the server can send event A to client 1 with a sending period of 10 ms and event B to client 1 with a sending period of 40 ms. When the server sends a subscription confirmation to client 2, the server can send event A to client 2 with a sending period of 10 ms and event B to client 2 with a sending period of 40 ms.
[0132] Client 1 acquires event A (such as vehicle speed) for display on a large screen (i.e., the car's display), for example, displaying the vehicle speed on the large screen. In other words, client 1 acquires event A from the server to achieve the target function of displaying on the large screen. The large screen's refresh rate can be once every few hundred milliseconds. Client 1 only needs to acquire event A once every few hundred milliseconds to meet the large screen display requirements.
[0133] Here, obtaining event A every few hundred milliseconds can be understood as the frequency of client 1's demand for event A.
[0134] Client 2 acquires event A to implement intelligent driving functions. Specifically, client 2 acquires event A from the server to achieve intelligent driving functionality. The implementation of intelligent driving functions requires high sensitivity to vehicle speed. For example, client 2 needs to acquire event A every tens of milliseconds for intelligent driving adjustments. In other words, client 2 only needs to acquire event A once every tens of milliseconds to meet the requirements of intelligent driving.
[0135] The fact that event A is retrieved every tens of milliseconds can be understood as the frequency at which client 2 requests event A.
[0136] like Figure 1 As shown, in a possible implementation, both client 1 and client 2 obtain event A by subscribing to event group 1 on the server. Subscribing to event group 1 means subscribing to all events in event group 1. When both client 1 and client 2 subscribe to event group 1 associated with service 1, the server sends event A to both client 1 and client 2 according to the server's preset event A sending method (e.g., a sending period of 10ms), and sends event B to both client 1 and client 2 according to the server's preset event B sending method (e.g., a sending period of 40ms).
[0137] Because the frequency of event A's transmission is higher than the frequency at which client 1 requires event A, and the frequency of event A's transmission is higher than the frequency at which client 2 requires event A. For example, for client 1, client 1 only needs to use the latest received event A for large-screen display when the large screen refreshes. Event A received by client 1 between two consecutive large-screen refreshes is invalid, meaning it is not the event client 1 needs. For client 2, client 2 only needs to use the latest received event A for intelligent driving adjustment. Event A received by client 2 between two consecutive intelligent driving adjustment sessions is invalid, meaning it is not the event client 2 needs.
[0138] In addition, such as Figure 1 As shown, both client 1 and client 2 obtain event A to achieve their respective target functions, without needing event B. That is, event B is neither needed by client 1 nor by client 2. Therefore, event B is an invalid event for both client 1 and client 2.
[0139] like Figure 1 As shown, in possible implementations, the server sends the target event (e.g., event A) more frequently than the client (e.g., client 1 or client 2) needs the target event (e.g., event A). This causes the server to send events that the client does not need, resulting in a large number of invalid events and their transmission. Since the client obtains the target events from the subscribed event groups by subscribing to them from the server, the server sends all events in the event group to the client, leading to the server sending events that the client does not need, resulting in a large number of invalid events and their transmission.
[0140] The transmission of invalid events may consume excessive bus bandwidth used for event transmission, potentially affecting the transmission of target events and leading to target event transmission failures. For example, the client may not receive the target event sent by the server. This could result in the client's target function failing to function (or malfunctioning). The bus can be an Ethernet (Eth) bus, a Controller Area Network (CAN) bus, and / or a Local Interconnect Network (LIN) bus.
[0141] Furthermore, each event received by the client from the server needs to be processed. For example, the client parses or stores the events sent by the server. A large number of invalid events results in significant overhead for the client's event processing, which may affect the client's operating efficiency.
[0142] In view of this, embodiments of this application provide an event subscription method, in which a client sends a first subscription request to a server. The client obtains the events to be subscribed to based on the first subscription request. The first subscription request is used to subscribe to events occurring on the server. The first subscription request includes first information indicating the event transmission method. The subscribed events are included in the events occurring on the server. Both the server and the client can be electronic devices in a vehicle. Since the first subscription request includes first information indicating the event transmission method, the server can send the client-subscribed events to the client according to the event transmission method indicated by the client, reducing the probability that the frequency of the server sending client-subscribed events exceeds the frequency of the client's demand for subscribed events, thereby reducing the probability of invalid events occurring. By reducing the probability of invalid events, the probability of invalid event transmission consuming bus bandwidth and causing client-side target function failures can also be reduced, and the impact on client operating efficiency can also be reduced.
[0143] Figure 2 A schematic diagram of an electronic and electrical architecture of a car provided in an embodiment of this application is shown.
[0144] like Figure 2 As shown, the automotive electronic and electrical architecture may include at least one domain controller 201, at least one gateway 202, at least one sensor 203, and at least one actuator 204. Domain controller 201 and gateway 202 can communicate via an Ethernet (Eth) bus. Gateways 202 can also communicate with each other via an Eth bus. Gateway 202 and sensor 203 can communicate via any of the following buses: Eth bus, Controller Area Network (CAN) bus, or Local Interconnect Network (LIN) bus. Gateway 202 and actuator 204 can also communicate via any of the following buses: Eth bus, CAN bus, or LIN bus.
[0145] Sensor 203 can transmit data received by sensor 203 to gateway 202 via the bus between sensor 203 and gateway 202. Gateway 202 can encapsulate the data transmitted by sensor 203 to obtain encapsulated data. Gateway 202 can transmit the encapsulated data to domain controller 201 via the bus between gateway 202 and domain controller 201. Domain controller 201 can perform calculations on the encapsulated data to obtain calculation results. Domain controller 201 can encapsulate the calculation results into encapsulated calculation results and transmit the encapsulated calculation results to gateway 202 via the bus between domain controller 201 and gateway 202. Gateway 202 can transmit the encapsulated calculation results to actuator 204 via the bus between gateway 202 and actuator 204. Actuator 204 can execute the function corresponding to the encapsulated calculation results.
[0146] The communication nodes in the Eth network use the SOME / IP protocol. The encapsulated data can be SOME / IP messages. The results of encapsulated operations can also be SOME / IP messages.
[0147] When the bus between gateway 202 and sensor 203 is a CAN bus or LIN bus, and the bus between gateway 202 and actuator 204 is a CAN bus or LIN bus, the communication nodes of the Eth network (i.e. Eth bus) in the vehicle's electronic and electrical architecture may include domain controller 201 and gateway 202.
[0148] Optionally, in one embodiment of this application, the bus between gateway 202 and sensor 203 is an Eth bus, and the bus between gateway 202 and actuator 204 is also an Eth bus. In the automotive's electronic and electrical architecture, the communication nodes of the Eth network may include domain controller 201, gateway 202, sensor 203, and actuator 204.
[0149] It is understood that, in one embodiment of this application, the electronic and electrical architecture of the vehicle may 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 may not include a gateway 202. Domain controllers 201 can communicate with each other via an Ethernet (Eth) bus. Domain controller 201 and sensor 203 can communicate via any of the Eth bus, CAN bus, or LIN bus. Domain controller 201 and actuator 204 can also communicate via any of the Eth bus, CAN bus, or LIN bus. Sensor 203 can transmit data received by sensor 203 to domain controller 201 via the bus between sensor 203 and domain controller 201. Domain controller 201 can process the data transmitted by sensor 203 to obtain a calculation result. Domain controller 201 can transmit the calculation result to actuator 204 via the bus between domain controller 201 and actuator 204. Actuator 204 can execute the function corresponding to the calculation result. Domain controller 201 can encapsulate the data transmitted by sensor 203 into encapsulated data. Domain controller 201 can transmit encapsulated data to another domain controller 201 via the bus between domain controllers 201, so that the other domain controller 201 can use the encapsulated data for calculation and processing to achieve the target function of the other domain controller 201.
[0150] In automotive electrical and electronic architectures employing SOA (Service-Oriented Architecture), the functions of each communication node in the Ethernet network can be encapsulated as services, with each service assigned a specific IP address and standardized interface. The communication protocol in an SOA architecture can include the SOME / IP protocol. SOME / IP is an Ethernet-based application-layer communication protocol that provides communication mechanisms such as event subscription and event publishing. Therefore, a communication node on the Ethernet network can subscribe to events from another communication node to invoke its services. Correspondingly, the other communication node can distribute events to the subscribed node through event publishing. This allows communication nodes on the Ethernet network within the electrical and electronic architecture to invoke encapsulated services at any time, thereby achieving the target function through the combination of various services. It should be understood that events occurring at a communication node can be data received by sensors within the functional domain managed by the communication node. For example, events occurring at a communication node can be the aforementioned status values or abnormal events.
[0151] It is understood that the server in the embodiments of this application can be as follows: Figure 2 This refers to any communication node in the Eth network within the vehicle's electrical and electronic architecture. The client can also be, for example,... Figure 2 Any communication node in the Eth network of the vehicle's electronic and electrical architecture shown.
[0152] Figure 3 This paper illustrates a software-related architecture diagram of a communication node provided in an embodiment of this application.
[0153] like Figure 3 As shown, a communication node may include an application software layer, an operating system, and hardware.
[0154] The application software layer may include at least one application (APP). For example, at least one APP: Figure 3 The examples shown are APP1, APP2, and APP3. Applications can be simply referred to as apps.
[0155] The application program may include at least one software component (SWC). A software component can be understood as a basic unit that constitutes the application. Software components are used to implement specific functionalities. For example, ... Figure 3 As shown, APP1 may include SWC1, SWC2, and SWC3. APP2 may include SWC4 and SWC5. APP3 may include SWC6 and SWC7.
[0156] An operating system can include a runtime environment (RTE) and a basic software layer (BSW).
[0157] The RTE provides the runtime environment for the operation of SWCs. The RTE can be used to enable communication between SWCs, and also to enable communication between SWCs and BSWs.
[0158] BSW can include a protocol stack. The protocol stack in BSW can include the SOME / IP protocol stack. BSW can be used to provide various basic capabilities for SWC in the application software layer, such as communication capabilities, memory management capabilities, hardware abstraction capabilities, or drivers.
[0159] For example, taking the Ethernet communication between the BSW and SWC as an example, the SWC can transmit signals to the BSW via the RTE. The BSW converts and encapsulates the signals from the SWC before sending them out through the SOME / IP protocol stack. The signal reception process is the reverse of the signal transmission process.
[0160] Events occurring on a communication node can be events occurring within the communication node's application. For example, an event occurring on a communication node can be an event occurring within the SWC (Software-Defined Control) function of the communication node's application.
[0161] like Figure 3As shown, the SOME / IP protocol stack of the communication nodes can realize the transmission of events between communication nodes. For details on implementing event transmission between communication nodes using the SOME / IP protocol stack, please refer to [link to relevant documentation]. Figure 4 .
[0162] Figure 4 This illustration shows another software-related architecture diagram of the communication node provided in an embodiment of this application.
[0163] Understandable, Figure 4 Both the server and client shown can be communication nodes in the Eth network of the vehicle's electronic and electrical architecture.
[0164] like Figure 4 As shown, the SOME / IP protocol stack can include the SOME / IP layer, transport layer, IP layer, media access control (MAC) layer, and physical layer.
[0165] The SOME / IP layer belongs to the application layer of the protocol stack. The SOME / IP layer may include a service discovery module and a message sending / receiving module.
[0166] The service discovery module can be used to transmit service publication messages and / or receive subscription requests. The service publication message includes either a first service publication message or a second service publication message. The subscription request can include either a first subscription request or a second subscription request. The first service publication message and the first subscription request will be described later.
[0167] The service discovery module can also register event sending methods and / or subscription requests. Subscription requests can include the events to be subscribed to, the event sending methods to be subscribed to, or the required frequency of the events to be subscribed to.
[0168] The method of sending the event can include any one of the first method, the second method, or the third method.
[0169] The first mode is used to indicate periodically transmitted events. The first mode can be called periodic transmission.
[0170] The second method is used to indicate that an event will be sent when it reaches a preset threshold. This second method can be called epsilon on change (EOC). For example, assuming that server-side events include temperature events, and the preset threshold for these temperature events is 40°C, the server can obtain the temperature of its associated functional areas in real time. If the server's preset temperature event sending method is the second method, then the server can send the temperature event to clients subscribed to the temperature event when the temperature reaches or exceeds 40°C. The temperature event can include a specific temperature value.
[0171] The third method is used to indicate that an event is sent when the event changes. This third method can be called User-Occurred (UOC). For example, taking server-side events including door status events as an example, if the server's default sending method for door status events is the third method, then the server can send door status events to clients subscribed to door status events when the door status changes. Door status changes include, for example, a door changing from closed to open, or a door changing from open to closed. Door status events can include information indicating the door status. It should be understood that door status includes both open and closed states.
[0172] The message sending and receiving module can be used to receive event distribution conditions transmitted by the service discovery module. It can also be used to receive events transmitted by the application and distribute them according to the event distribution conditions. Furthermore, it can receive events.
[0173] The IP layer is the network layer of the protocol stack. The IP layer can be used for the transmission and routing of data packets in the network.
[0174] The transport layer can be used to provide data transmission services. The transport layer may include the User Datagram Protocol (UDP) and / or the 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] like Figure 4 As shown, before or while the server is running, the communication node designer's equipment or the server's application software layer can register the events provided by the server and the sending methods of each event with the server's service discovery module, so that the server can send service publication messages to the client. Before or while the client is running, the communication node designer's equipment or the client's application software layer can register subscription requests with the client's service discovery module, so that the client can send its first subscription request to the client.
[0177] For details on the specific implementation principles of registering server-provided events with the server-side service discovery module and the sending methods of each event within those events, please refer to [link to relevant documentation]. Figures 5-7 The illustrated embodiment. For a detailed explanation of the implementation principle of registering subscription requests with the client's service discovery module, please refer to [link to relevant documentation]. Figures 5-7 The illustrated embodiment is provided for ease of understanding. Figures 5-7 The illustrated embodiments will be described later.
[0178] It is understood that the second service publication message may include identification information for each service in at least one of the services. The identification information may include the service ID and the service version. At least one of the services is a service provided by the server.
[0179] For example, a second service publishing message may include identification information of the target service. This identification information includes, for example, the target service's ID and version. The target service can be any of at least one service provided by the server.
[0180] For example, let's continue with the example where the second service publication message may include the identification information of the target service. If the service discovery module on the server side has completed the registration of the event sending method, the server-side service discovery module can send the second service publication message to the client's physical layer through the server's transport layer, IP layer, MAC layer, and physical layer. Correspondingly, the client's physical layer receives the second service publication message from the server.
[0181] The client's physical layer transmits the second service publication message to the client's service discovery module through the client's MAC layer, client's IP layer, and client's transport layer.
[0182] It should be understood that in this embodiment, both the client and the server can maintain a third set. The third set may include the identification information of the services provided by each of the multiple servers associated with the vehicle's electronic and electrical architecture, the event groups contained in the corresponding services, and all events contained in the event groups. In this way, when the client receives a service publication message sent by the server, it can determine the event group or events of the event group to subscribe to based on the service publication message and the third set.
[0183] Once the client's service discovery module completes the registration of its subscription request and receives the second service publication message from the server, the client's service discovery module can send a first subscription request to the server's physical layer through the client's transport layer, IP layer, MAC layer, and physical layer. Correspondingly, the server's physical layer receives the first subscription request from the client.
[0184] The first subscription request may include: the ID of the target service, the ID of the target event group, and first information. The first information may be related to all or some of the events in the target event group. For example, the first information may be used to indicate the sending method of each event in all the events of the target event group, or the first information may be used to indicate the sending method of each event in some of the events of the target event group.
[0185] The server's physical layer transmits the first subscription request to the server's service discovery module through the server's MAC layer, server's IP layer, and server's transport layer.
[0186] The server-side service discovery module parses the first subscription request to obtain the target service ID, the target event group ID, and the first piece of information. The server-side service discovery module then converts the first piece of information into distribution conditions for each event associated with that first piece of information.
[0187] The service discovery module on the server side transmits the distribution conditions of each event associated with the first information to the message sending and receiving module on the server side.
[0188] The server-side message sending and receiving module sets the distribution conditions for each event associated with the first piece of information.
[0189] The server-side message sending and receiving module receives the target event sent by the server-side APP. The target event can be any of the events associated with the first piece of information.
[0190] When the target event meets the distribution conditions, the server's message sending and receiving module sends the target event to the client's physical layer through the server's transport layer, IP layer, MAC layer, and physical layer. Correspondingly, the client's physical layer receives the target event from the server.
[0191] The client's physical layer transmits the target event to the client's message sending and receiving module through the client's MAC layer, client's IP layer, and client's transport layer.
[0192] The client's message sending and receiving module transmits the target event to the client's APP, so that the client's APP can use the target event to implement the target function.
[0193] like Figure 4 As shown, the client can include first information in the first subscription request sent to the server to indicate how the client wants the events to be sent. The server can convert the first information sent by the client into the event distribution conditions associated with the first information. When the events subscribed to by the client meet the distribution conditions, the server can distribute the subscribed events to the client. In this way, the server sends the events subscribed to by the client to the client according to the event sending method indicated by the client, reducing the probability of the server sending client-subscribed events more frequently than the client needs them, thereby reducing the probability of invalid events. This also reduces the probability of invalid event transmission consuming bus bandwidth and causing client-side function failures, and also reduces the impact on client operating efficiency.
[0194] Figure 5A schematic diagram of a static registration mechanism provided in an embodiment of this application is shown.
[0195] like Figure 5 As shown, before the communication node's application is designed and the communication node is run (or started), the SWC design tool used for application design can transfer a general configuration file or database file of the automotive open system architecture (AUTOSAR) to the underlying software configuration tool. The SWC design tool can be a framework modeling tool or a behavioral modeling tool, etc. The framework modeling tool can be called an SWC framework modeling tool.
[0196] The general configuration file or database file for AUTOSAR can be an AUTOSAR Extensible Markup Language (AUTOSAR XML, ARXML) file. The ARXML file may include: the methods for sending various events provided by the communication nodes, and / or, the subscription requirements of the communication nodes. The ARXML file may also include information such as software components, interfaces, data types, and configuration parameters.
[0197] The methods for sending events provided by the communication node, and / or the representation of the communication node's subscription requests, can be found in [reference needed]. Figure 5 The signal shown is represented by any one of the following: Signal 1: 100ms, Signal 2: 500ms, or Signal 3: UOC. Each of Signal 1, Signal 2, and Signal 3 corresponds to a different event. Signal 1: 100ms indicates that the event corresponding to Signal 1 is transmitted periodically with a period of 100ms. Signal 2: 500ms indicates that the event corresponding to Signal 2 is transmitted periodically with a period of 500ms. Signal 3: UOC indicates that the event corresponding to Signal 3 is transmitted under the UOC (Usage-Oriented) condition.
[0198] The underlying configuration tool can generate SOME / IP protocol stack configuration code based on ARXML files and transmit the SOME / IP protocol stack configuration code to the operating system of the communication node. The service discovery module in the operating system of the communication node uses the SOME / IP protocol stack configuration code to register the sending methods of various events provided by the communication node, and / or, the registration of the communication node's subscription requirements.
[0199] This achieves static registration of the event transmission methods provided by communication nodes, and / or static registration of communication node subscription requests. The statically registered event transmission methods and / or subscription requests of communication nodes will not be cleared when a communication node is powered off. This allows communication nodes to send the first service publication message based on the registered event transmission methods provided by the communication nodes. It also allows communication nodes to send the first subscription request based on the registered subscription requests of the communication nodes. Furthermore, in the AUTOSAR CP architecture, the following is adopted... Figure 5 The static registration mechanism shown can facilitate the registration of the sending methods of various events provided by the communication nodes and / or the subscription requirements of the communication nodes.
[0200] Figure 6 A schematic diagram of another static registration mechanism provided in an embodiment of this application is shown.
[0201] like Figure 6 As shown, before the communication node's design personnel complete the design of the communication node's application and before the communication node runs (or starts), the design device used for application design can transmit a configuration file to the communication node's operating system. This configuration file may include: the sending methods for each event provided by the communication node, and / or, the communication node's subscription requirements. The representation of the sending methods for each event provided by the communication node, and / or, the communication node's subscription requirements, can be found in [reference needed]. Figure 6 The signal shown is represented as either signal 1: 100ms, signal 2: 500ms, or signal 3: UOC. This configuration file can be readable by the SOME / IP protocol stack. It can also be a lightweight data exchange format (JavaScript Object Notation, JSON) file.
[0202] The service discovery module in the operating system of the communication node can read the contents of the configuration file to register the sending methods of various events provided by the communication node, and / or register the subscription requirements of the communication node.
[0203] This achieves static registration of the event transmission methods provided by the communication nodes, and / or static registration of the communication nodes' subscription requests. The statically registered event transmission methods and / or subscription requests of the communication nodes will not be cleared when the communication nodes are powered off. This allows communication nodes to send the first service publication message based on the registered event transmission methods provided by the communication nodes. It also allows communication nodes to send the first subscription request based on the registered subscription requests of the communication nodes. Furthermore, in the AUTOSAR AP architecture, the following is adopted... Figure 6The static registration mechanism shown can facilitate the registration of the sending methods of various events provided by the communication nodes and / or the subscription requirements of the communication nodes.
[0204] Figure 7 A schematic diagram of a dynamic registration mechanism provided in an embodiment of this application is shown.
[0205] like Figure 7 As shown, when the communication node is running (or started), the application software layer can register with the service discovery module in the operating system the sending methods of various events provided by the communication node, and / or the subscription requirements of the communication node.
[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 may be, for example, the way events are sent or the frequency of event requests.
[0207] For example, when the SWC in the application software layer is running, it can call the application programming interface (API) provided by the SOME / IP protocol stack to dynamically set the event sending method associated with the SWC or the subscription requirements associated with the SWC.
[0208] This enables dynamic registration of the event transmission methods provided by communication nodes, and / or dynamic registration of the subscription requirements of communication nodes. In AUTOSAR CP or AUTOSAR AP architectures, this is achieved... Figure 7 The dynamic registration mechanism shown can realize real-time registration and / or flexible registration of the sending methods of various events provided by the communication nodes and / or the subscription requirements of the communication nodes.
[0209] The event subscription method provided in this application will be further described below with reference to some embodiments.
[0210] Figure 8 A schematic diagram of an event subscription process provided in an embodiment of this application is shown.
[0211] For example, the second service publishing message may include the identification information of the target service. Figure 8 As shown, the event subscription method provided in this application embodiment may include:
[0212] S801. The server can multicast or unicast second service publication messages. Correspondingly, the client can receive second service publication messages from the server.
[0213] S802. The client can send the 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 may include the target service ID, the target event group ID, and the subscription policy. The target event group is any one of at least one event group within the target service.
[0215] For example, a subscription strategy may include first information and / or, second information.
[0216] The first piece of information indicates how the event was sent.
[0217] The second piece of information is used to indicate a subset of events within a subscribed event group. Each subscribed event group includes at least one event. All events in a subscribed event group can occur on the server side; that is, the subscribed event group contains events that occur on the server side. A subscribed event group can be a target event group.
[0218] First information:
[0219] The first information indicates the method of sending the event, which can be a method of sending events one by one in the form of event granularity.
[0220] For example, the first information may include: the sending method of each event in at least one event. Wherein, each event in at least one event can be an event occurring on the server side, that is, at least one event is included in events occurring on the server side.
[0221] The first information may include an event identifier and the event sending method corresponding to the event identifier. For example, the first information may include key-value pairs with the event identifier as the key and the event sending method corresponding to the event identifier as the value.
[0222] The first information indicates the way the event is sent, or it can represent the way all events in the event group are sent in a granular form at the event group level.
[0223] For example, the first information may include: the sending method of each event group in at least one event group. Wherein, the events contained in each event group in at least one event group are all events occurring on the server side, that is, each event group in at least one event group contains events occurring on the server side. It should be understood that an event group may include at least one event.
[0224] The first information may include indication information for the event group and the corresponding sending method for the event group. The indication information for the event group is information that indicates the event group. For example, the first information may include key-value pairs where the indication information is the key and the sending method of the event group indicated by the indication information is the value. The indication information for the event group may be an identifier.
[0225] Since the event can be sent in any of the first, second, or third methods, the first information may include at least one of the following:
[0226] Event sending period, which is associated with the first method;
[0227] Alternatively, the identifier and event sending period of the first method, with the event sending period associated with the first method;
[0228] Alternatively, the identifier for the second method and the preset threshold for the second method;
[0229] Alternatively, a third-party identifier.
[0230] The event sending period can also be expressed as the frequency of event transmission. The event sending period can be simply referred to as the sending period. The sending period is used in the first mode.
[0231] The subscription strategy includes first information indicating how events are sent. This allows the server to send events associated with the first information to the client according to the sending method indicated by the first information. This reduces the probability of the server sending events more frequently than the client needs, thereby reducing the bandwidth usage of invalid events.
[0232] Second information:
[0233] The second information may include the identifiers of each event within this subset of events. The second information may also include a first identifier. The first identifier indicates a subset of events within the subscribed event group. The subscribed event group may be the target event group corresponding to the ID of the target event group in the first subscription request. The first identifier may 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 simply one string representing the first identifier. The first identifier may be any other string.
[0234] For example, the second information may include key-value pairs with the first identifier as the key and the identifiers of each event in the subset of events as the values. Taking an subset of events including events a, b, and c, where event a has the identifier 8001, event b has the identifier 8002, and event c has the identifier 8003, and the first identifier is an event filter, the second information can be represented as follows:<event filter,800180028003> Alternatively, event filter = 800180028003.
[0235] The subscription strategy includes a second piece of information indicating a subset of events in the subscribed event group, enabling the server to send events associated with this second piece of information to the client. The events associated with this second piece of information are a subset of the events in the subscribed event group, rather than all of them. This reduces the probability of the server sending unwanted events to the client, thereby reducing the bandwidth consumption of invalid events.
[0236] Optionally, a subscription request can be a subscription message. The first subscription request can be the first subscription message. For ease of understanding, the format of a subscription message will be described later.
[0237] S803, the server can parse the first subscription request and obtain the subscription strategy in the first subscription request.
[0238] For example, the server can use the server's preset parsing rules or parsing methods to parse the first subscription request and obtain the first information and / or the second information in the first subscription request.
[0239] S804. The server can set the distribution conditions of events associated with the subscription strategy according to the subscription strategy.
[0240] Subscription strategies can include the following three scenarios:
[0241] Scenario 1: The subscription strategy includes the first message.
[0242] Scenario 2: The subscription strategy includes first information and second information.
[0243] Scenario 3: The subscription strategy includes a second message.
[0244] In scenario one, where the subscription strategy includes the first information, the server can set the distribution conditions for events associated with the first information based on the first information.
[0245] For example, the first information may include the method of sending the target event. The method of sending the target event may include information indicating a first period for periodically sending the target event. The target event is any event among the events indicated for subscription 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 that the client needs to subscribe to.
[0246] The server can set the first distribution conditions for the target event based on the first period and the preset period of the target event. The preset period of the target event is a period pre-defined 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 may include the first factor of the target event. The first factor can be called the frequency division factor. The first factor of the target event is positively correlated with the first period of the target event and negatively correlated with the preset period of the target event. For example, the first factor δ of the target event can satisfy:
[0249] δ=max(1,‖T C / T S ‖)
[0250] Where max(1,‖T) C / T S ‖) represents from 1 and ‖T C / T S The maximum value in T is taken from the integer part. C For the first period of the target event, T S The preset period for the target event.
[0251] 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 the target event occurs on the server reaches the first factor, the server sends the target event to the client.
[0252] The number of times the target event occurs on the server can be counted starting from the first target event after the client subscribes to the target event, or it can be counted starting from the first target event after the target event is sent.
[0253] When the first period T of the target event C Less than the preset period T of the target event S At that time, T C / T SIf the value is less than 1, then δ = 1. δ = 1 indicates that the server can send the target event to the client according to the preset period of the target event. The first period T of the target event. C Less than the preset period T of the target event S This can be understood as follows: the server's preset method for sending target events cannot meet the client's required frequency of target events.
[0254] That is, when the server's preset method for sending target events cannot meet the client's required frequency of target events, the server can send target events to the client according to the preset period of the target events.
[0255] Optionally, the method of sending the target event included in the first information can be a second method. The second method is used to indicate that the event is sent when it reaches a preset threshold.
[0256] The server can set a second dispatch condition for the target event. The second dispatch condition for the target event is used to indicate when the target event is sent when it reaches a preset threshold;
[0257] In this way, the server can transmit the target event to the client according to the second distribution condition of the target event.
[0258] Optionally, the method of sending the target event included in the first information can be a third method. The third method is used to indicate that the event is sent when the event changes.
[0259] The server can set a third dispatch condition for the target event. The third dispatch condition for the target event is used to indicate when the target event is sent if the target event changes.
[0260] In this way, the server can transmit the target event to the client according to the third dispatch condition of the target event.
[0261] For scenario two, where the subscription strategy includes both the first and second information, the server can set the event distribution conditions associated with the subscription strategy based on both information. Specifically, the distribution conditions for events associated with the second information can include a third identifier and the client's identifier. These distribution conditions can be based on the first information.
[0262] It should be understood that the number of events associated with the first piece of information can be greater than the number of events associated with the second piece of information. When the subscription strategy includes the second piece of information, the events associated with the second piece of information can be understood as the events required by the client.
[0263] Taking an event that is 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 may further include: a third identifier and the client's identifier. The third identifier is used to indicate that the event has been subscribed to.
[0264] Based on the first information, if the distribution condition of the target event is the second distribution condition, then the second distribution condition of the target event may also include: the third identifier and the client's identifier.
[0265] Based on the first information, if the distribution condition of the target event is the third distribution condition, then the third distribution condition of the target event may also include: the third identifier and the client identifier.
[0266] Thus, if the subscription strategy includes the first information and the second information, and the distribution condition of the target event includes the third identifier, then when the target event meets the distribution condition, the server transmits the target event to the client.
[0267] Since the event associated with the second piece of information is an event needed by the client, if the distribution conditions of the target event do not include the third identifier, it indicates that the target event is not an event needed by the client. Therefore, if the target event meets the distribution conditions, the server may not transmit the target event to the client. This reduces the probability of the server transmitting events that the client does not need.
[0268] Optionally, for scenario two, where the subscription strategy includes not only the first information but also the second information, the server can set a first distribution condition, a second distribution condition, or a third distribution condition for events associated with the second information. Events unrelated to the second information will not have distribution conditions set.
[0269] Taking event i as an example, which is one of at least one events associated with the second information, a first distribution condition, a second distribution condition, or a third distribution condition can be set for event i associated with the second information, for example:
[0270] If the sending method of event i in the first message is the first method, then set the first dispatch condition of event i.
[0271] If the sending method of event i in the first message is the second method, then set the second dispatch condition for event i.
[0272] If the sending method of event i in the first message is the third method, then set the third dispatch condition for event i.
[0273] The specific implementation principle of setting the first, second, or third distribution condition of event i can be found in the specific implementation principle of setting the first, second, or third distribution condition of the target event for case one, which will not be repeated here.
[0274] For scenario three, where the subscription strategy includes the second information but excludes the first information, the server can set a fourth distribution condition for events associated with the second information based on the second information. The fourth distribution condition may include: a third identifier and the client's identifier.
[0275] Taking an event that belongs to the second type of information association as an example, the server can send the target event to the client when the target event meets the fourth distribution condition. Meeting the fourth distribution condition can be understood as: the target event meets the server's preset sending method for the target event, and the target event is an event subscribed to by the client.
[0276] S805. The server can send a second response to the client to indicate subscription confirmation. Correspondingly, the client can receive the second response from the server. The second response may include: the ID of the target service and the ID of the target event group.
[0277] Optionally, the steps for setting distribution conditions on the server side in S805 and S804 can be executed concurrently.
[0278] By executing S805 to notify the client of a successful event subscription, the server can reduce the probability of the client repeatedly sending the first subscription request to the server, thus reducing the interaction between the client and the server.
[0279] In this way, the client subscribes to events from the server, and the server can transmit the events associated with the subscription strategy of the first subscription request to the client according to the event distribution conditions. Enabling the server to send events according to the event sending method indicated by the client reduces the probability of the server sending events more frequently than the client needs, and reduces the bus bandwidth consumption of invalid events. It also ensures that only the events requested by the client are sent, reducing the probability of sending unwanted events, further reducing the bus bandwidth consumption of invalid events. Finally, it minimizes the impact on client operating efficiency.
[0280] like Figure 8As shown in the embodiment of this application, the event subscription method involves sending a first subscription request to the server. The first subscription request carries first information to instruct the server on how the client intends to subscribe to events, and / or carries second information to instruct the server to send a subset of events from the subscribed event group. This subset of events represents the events requested by the client.
[0281] If the first subscription request includes first information, the server sets the distribution conditions for the events associated with the first information based on the first information. When the events subscribed to by the client meet the distribution conditions, the server distributes the subscribed events to the client. This ensures that the server sends the client-subscribed events to the client according to the event sending method indicated by the client, reducing the probability of the server sending client-subscribed events more frequently than the client demands them. This reduces the probability of invalid events, thereby reducing the probability of invalid event transmission consuming bus bandwidth and causing client-side functional failures, and also reducing the impact on client operating efficiency.
[0282] If the first subscription request also includes second information, the distribution conditions associated with the first information may further include a third identifier. The server can then distribute the event to the client according to the distribution conditions that include the third identifier. If the first subscription request also includes second information, and the event's distribution conditions do not include a third identifier, the server will not transmit the event to the client even if the event meets the distribution conditions. This allows the server to send only the events the client needs, reducing the probability of the server transmitting events the client does not need, thereby reducing the probability of invalid events occurring.
[0283] If the first subscription request includes the second information but excludes the first information, the server can set a fourth distribution condition for the target event associated with the second information based on the second information. The server can then transmit the target event to the client according to the fourth distribution condition of the target event. This also allows the server to send only the events the client needs, reducing the probability of the server transmitting events the client doesn't need, thereby reducing the probability of invalid events occurring.
[0284] Figure 9 This illustration shows another event subscription and distribution process provided in an embodiment of this application.
[0285] like Figure 9 As shown, the event subscription method provided in this application embodiment may include:
[0286] S901, The service discovery module on the server side can receive the first subscription request from the client.
[0287] S902. The server-side service discovery module can generate event distribution conditions associated with the subscription policy in the first subscription request based on the first subscription request. The server-side service discovery module can transmit the event distribution conditions associated with the subscription policy to the server-side message sending and receiving module. The server-side message sending and receiving module can set the event distribution conditions associated with the subscription policy within the message sending and receiving module.
[0288] For example, a first subscription request may include first information, and the first information may include the method of sending the target event.
[0289] If the transmission method of the target event includes information indicating the first period of periodic transmission of the target event, the server-side service discovery module can calculate the first period and the preset period of the target event to obtain the first factor of the target event. The server-side service discovery module can then transmit the first factor of the target event and the identifier of the client subscribing to the target event to the server-side message sending and receiving module.
[0290] The server-side message sending and receiving module can set the first distribution condition for the target event based on the first factor of the target event and the identifier of the client subscribing to the target event. The first distribution condition can include the first factor of the target event and the identifier of the client subscribing to the target event.
[0291] If the target event can be sent using the second method, the server's service discovery module can transmit the target event identifier, the second method identifier, and the identifier of the client subscribing to the target event to the server's message sending and receiving module.
[0292] The server-side message sending and receiving module can set a second distribution condition for the target event based on the target event identifier, the second method identifier, and the identifier of the client subscribing to the target event. The second method identifier may include a preset threshold corresponding to the target event. The second method identifier may also include the EOC identifier. The second distribution condition may include the target event identifier, the second method identifier, and the identifier of the client subscribing to the target event.
[0293] If the target event can be sent via a third-party method, the server's service discovery module can transmit the target event's identifier, the third-party identifier, and the identifier of the client subscribing to the target event to the server's message sending and receiving module.
[0294] The server-side message sending and receiving module can set third-party distribution conditions for the target event based on the target event's identifier, a third-party identifier, and the identifier of the client subscribing to the target event. The third-party identifier can be the identifier UOC. The third-party distribution conditions can include the target event's identifier, the third-party identifier, and the identifier of the client subscribing to the target event.
[0295] Optionally, if the first subscription request also includes second information, and the event associated with the second information includes the target event, then the server's service discovery module can also transmit a third identifier to the server's message sending and receiving module. The distribution conditions for the target event set by the server's message sending and receiving module in the message sending and receiving module can also include the third identifier. The distribution conditions for the target event can be any one of the first distribution conditions, the second distribution conditions, or the third distribution conditions.
[0296] Optionally, if the first subscription request includes the second information but 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 identifier of the target event, the third identifier, and the identifier of the client subscribing to the target event to the message sending and receiving module of the server.
[0297] The server-side message sending and receiving module can set a fourth distribution condition for the target event based on the target event's identifier, a third identifier, and the identifier of the client subscribing to the target event. The fourth distribution condition can include the target event's identifier, the third identifier, and the identifier of the client subscribing to the target event.
[0298] It should be understood that the message sending and receiving module on the server side can parse the first subscription request using the server's preset parsing rules to obtain the content in the first subscription request.
[0299] S903. The service discovery module of the server can send a second response to the service discovery module of the client that sent the first subscription request, indicating subscription confirmation.
[0300] S904. The server-side SWC can transmit target events to the server-side message transceiver module. When the target event meets the distribution conditions set by the server-side message transceiver module, the server-side message transceiver module can send the target event to clients subscribed to the target event. Clients subscribed to the target event include, for example: Figure 9 The client shown is either client 1, client 2, or client 3.
[0301] The specific implementation principles of S901-S903 can be found in [link to documentation]. Figure 8 The specific implementation principles of S802-S805 in the embodiment will not be elaborated here.
[0302] In S904, the distribution condition for this event can be any one of the first distribution condition, the second distribution condition, the third distribution condition, or the fourth distribution condition.
[0303] like Figure 9As shown in the embodiment of this application, the event subscription method allows the server-side service discovery module to receive a first subscription request from a client and, based on the first subscription request, generate distribution conditions for the event associated with the subscription policy in the first subscription request. The server-side service discovery module can transmit the distribution conditions for the event associated with the subscription policy to the server-side message transceiver module. The server-side message transceiver module can set the distribution conditions for the event associated with the subscription policy within its message transceiver module. The server-side SWC can transmit a target event to the server-side message transceiver module. When the target event satisfies the distribution conditions set by the server-side message transceiver module, the server-side message transceiver module can send the target event to the client subscribing to the target event. In this way, by enabling the server-side message sending and receiving module to send the events subscribed to by the client according to the instructions of the first and / or second information, the probability of the server-side message sending and receiving module sending events to the client at a frequency higher than the frequency required by the client can be reduced. This reduces the probability of sending invalid events or the probability of the server sending events (or event messages) that the client does not need, thereby reducing the bus bandwidth occupation by invalid events.
[0304] Figure 10 This illustration shows the effect of an event distribution method provided by an embodiment of this application.
[0305] Figure 10 The server, client 1, and client 2 shown can interact with... Figure 1 The server, client 1, and client 2 shown are identical. For example, Figure 10 The server shown is Figure 1 The server shown is the same. Figure 10 Client 1 shown Figure 1 The client shown is the same as client 1. Figure 10 Client 2 shown Figure 1 The client shown is the same as client 2.
[0306] like Figure 10 As shown, taking the service provided by the server as service 1, which includes event group 1, event group 1 includes event A and event B. The server presets the sending method of event A as the first method and the sending period as 10 milliseconds (ms). The server presets the sending method of event B as the first method and the sending period as 40ms. Client 1 obtains event A for large screen display. Client 1 requires event A once every 200ms. Client 2 obtains event A to implement intelligent driving function. Client 2 requires event A once every 40ms.
[0307] Both client 1 and client 2 can use the event subscription method provided in this application embodiment to subscribe to event A in event group 1 from the server. This allows the server to send event A to client 1 every 200ms and to client 2 every 40ms. The server will not send event B to either client 1 or client 2. This satisfies the respective needs of clients 1 and 2 for event A while reducing the probability of the server sending invalid events to clients 1 and 2, thereby reducing the bandwidth consumption of invalid events.
[0308] Figure 11 This illustration shows another event subscription process provided by an embodiment of this application.
[0309] Taking the subscription strategy of the first subscription request, which includes the first information, as an example, such as Figure 11 As shown, the event subscription method provided in this application embodiment may include:
[0310] S1101. The server can multicast or unicast the first service publication message. Correspondingly, the client can receive the first service publication message from the server.
[0311] The first service publication message can be used to indicate the services provided by the server. The service includes at least one event group. Each event group includes at least one event. Each event group contains events occurring on the server. The first service publication message may include identification information of the target service and third information. The third information indicates at least one transmission method supported by the event.
[0312] For example, the third piece of information could be a first subscription policy list. The first subscription policy list could include at least one sending method supported by each event in at least one event associated with the target service.
[0313] This makes it easier for the client to select the sending method for the events to be subscribed to from third-party information.
[0314] For example, the third information may be selected by the server from a second set preset by the server. The second set may include at least one sending method supported by each event in at least one event occurring on the server. The second set may be selected before the server runs (or starts) by means of, etc. Figure 5 or Figure 6 The static registration method shown is pre-registered on the server's service discovery module. Alternatively, the second set can be registered while the server is running (or started) via, for example... Figure 7 The dynamic registration method shown is registered on the service discovery module on the server side.
[0315] S1102. The client parses the first service publication message, obtains the third information, and selects the sending method of the event to be subscribed from the third information.
[0316] For example, the client parses the first service publication message to obtain a first subscription policy list. The client can then select the event sending method that matches its subscription requirements from the first subscription policy list.
[0317] For example, consider a client's subscription requirement that includes the method of sending the target event.
[0318] If the target event is sent using the first method and the target event is sent within the first period in the client's subscription request, the client can select, from at least one of the target event's supported sending methods in the first subscription strategy list, a sending method that is the first method and has a sending period less than or equal to the first period, as the sending method for the target event indicated by the client to the server.
[0319] If, in the client's subscription request, the target event is sent using the second method and the preset threshold corresponding to the target event is the first threshold, then the client can select, from at least one sending method supported by the target event in the first subscription strategy list, a sending method that is the second method and whose preset threshold corresponding to the target event is less than or equal to the first threshold, as the sending method for the target event indicated by the client to the server.
[0320] If the target event is sent in a third-party manner in the client's subscription request, the client can select the third-party sending method from at least one of the target event's supported sending methods in the first subscription strategy list as the sending method for the target event indicated by the client to the server.
[0321] The target event is any one of at least one events that the client wants to subscribe to from the server. In other words, the target event can be any event that the client needs to subscribe to. The target event is an event associated with the target service.
[0322] S1103. The client can send the first subscription request to the server. Correspondingly, the server can receive the first subscription request from the client.
[0323] The subscription policy in the first subscription request includes first information, which may include an identifier of the event sending method selected by the client in S1102 that matches the client's subscription request. That is, the event sending method indicated by the first information is selected from third information. The identifier of the event sending method that matches the client's subscription request belongs to the subscription policy identifier.
[0324] For example, the first information may include an identifier of the sending method selected by the client from at least one sending method supported by the target event in the first subscription policy list.
[0325] Compared to the first information including the event transmission method, the first information in this embodiment may include an identifier of the event transmission method, but not the specific content of the event transmission method. This reduces the data volume of the first subscription request, thereby reducing the bus bandwidth usage of the first subscription request.
[0326] S1104. The server can parse the first subscription request and obtain the subscription strategy in the first subscription request.
[0327] For example, the server can use the server's preset parsing rules to parse the first subscription request and obtain the first information in the first subscription request.
[0328] The server obtains the event sending method indicated by the first information based on the identifier of the event sending method in the first information.
[0329] S1105. The server can set the distribution conditions of events associated with the subscription strategy according to the subscription strategy.
[0330] For example, the server can set the distribution conditions of the event associated with the first information based on the first information.
[0331] For the specific implementation principle and technical effect of this step, please refer to the specific implementation principle and technical effect of the server setting the event distribution conditions associated with the first information according to the first information in S804, which will not be repeated here.
[0332] S1106. The server may send a second response to the client to indicate subscription confirmation. Correspondingly, the client may receive a second response from the server. This second response may include the ID of the target service and the ID of the target event group.
[0333] Optionally, S1106 and S1105 can be executed concurrently.
[0334] The specific implementation principle and technical effect of this step are similar to those of S805, and will not be repeated here.
[0335] like Figure 11As shown, the event subscription method provided in this application embodiment involves sending a first subscription request to the server. The first subscription request carries first information, which includes an identifier of the event sending method but does not contain the content of the event sending method itself. This reduces the data volume of the first subscription request while instructing the server to subscribe to the event sending method. Based on the first information, the server obtains the event sending method indicated by the client and sets the event distribution conditions associated with the first information. When the event subscribed by the client meets the distribution conditions, the server distributes the subscribed event to the client. This enables the server to send the client-subscribed events according to the event sending method indicated by the client, reducing the probability of the server sending client-subscribed events at a frequency higher than the client's demand frequency for subscribed events, thereby reducing the probability of sending invalid events. This can reduce the probability of invalid event transmission consuming bus bandwidth and causing client-side target function failures.
[0336] Figure 12 This illustration shows another event subscription process provided in an embodiment of this application.
[0337] Taking the subscription strategy of the first subscription request, which includes the first information, as an example, such as Figure 12 As shown, the event subscription method provided in this application embodiment may include: S801, S1201, S1103-S1106.
[0338] Figure 12 The illustrated embodiments and Figure 11 The difference in the illustrated embodiment is that: Figure 12 In the illustrated embodiment, the server multicasts or unicasts a second service publication message. Correspondingly, the client can receive the second service publication message from the server. The server and the client jointly maintain a first set. The first set may include at least one transmission method supported by each event in at least one event occurring on at least one server of a vehicle (e.g., a car). The first set may be referred to as a second subscription policy list. The client can select the transmission method of the event to be subscribed to from the second subscription policy list. See S801 and S1201 for details.
[0339] S801. The server can multicast or unicast second service publication messages. Correspondingly, the client can receive second service publication messages from the server. The second service publication message includes the identification information of the target service.
[0340] S1201. The client parses the second service publication message, obtains the identification information of the target service, and selects the sending method of the event to be subscribed from the preset second subscription strategy list.
[0341] It is understandable that the events that the client wants to subscribe to include the events associated with the target service.
[0342] The specific implementation principle of the client selecting the sending method 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 method of the event matching the client's subscription requirements from the first subscription strategy list in S1102, and will not be repeated here.
[0343] As described above, the first set may include at least one transmission method supported by each event occurring in at least one event of at least one server in the vehicle (e.g., automobile). Wherein, the at least one transmission method supported by the events in the first set may be:
[0344] The method of sending events by representing each event individually at the event granularity;
[0345] Alternatively, the sending method of all events in an event group can be represented as a whole at the event group granularity.
[0346] Alternatively, the way all events within a service are sent can be represented holistically at the service granularity level;
[0347] Alternatively, the method of sending all events occurring at a communication node can be represented holistically at the communication node granularity.
[0348] Alternatively, it can be represented holistically at the project level, showing how all events occurring at the communication nodes associated with the project are sent.
[0349] For example, the first set (or the second list of subscription strategies) may include at least one of the following:
[0350] The transmission methods supported by each event in at least one event of the vehicle;
[0351] Alternatively, the transmission methods supported by each event group in at least one event group of the vehicle;
[0352] Alternatively, the sending methods supported by each service in at least one service of the vehicle, whereby a service may include at least one event group;
[0353] Alternatively, each of the at least one server in the vehicle supports a sending method, and the server can provide at least one service.
[0354] Alternatively, the sending methods supported by each item in at least one of the vehicle's items, and the items are associated with at least one server.
[0355] This allows for convenient and flexible maintenance of the first set.
[0356] like Figure 12As shown in the embodiment of this application, the event subscription method allows the server to send a second service publication message to the client. The second service publication message does not contain a subscription strategy list, thus reducing the data volume of the message. The client can select an identifier of the event's delivery method from a preset second strategy list. The client can send a first subscription request to the server. This first subscription request carries first information, which includes the identifier of the event's delivery method selected by the client from the second subscription strategy list, but does not contain the content of the event's delivery method. This reduces the data volume of the first subscription request while instructing the server on the client's desired event delivery method. Based on the first information, the server obtains the event delivery method indicated by the client and sets the event distribution conditions associated with the first information. When the event subscribed to by the client meets the event distribution conditions, the server distributes the subscribed event to the client. This allows the server to send events subscribed to by the client according to the event sending method indicated by the client. This reduces the probability of the server sending client-subscribed events more frequently than the client needs them, thereby reducing the probability of sending invalid events. This can also reduce the probability of invalid event transmission consuming bus bandwidth and causing client-side target function failures.
[0357] In one possible implementation, there might be a situation where the server-side pre-defined parsing rules (or parsing methods) are not applicable to parsing the first subscription request. Parsing rules can be understood as the rules or methods used to parse subscription requests (or subscription messages) sent by the client.
[0358] In order to achieve compatibility of communication node subscription events in the automotive electronic and electrical architecture, Figure 9 and Figure 10 The interactive flow related to the event subscription method provided in the embodiments of this application is illustrated.
[0359] Figure 13 This illustration shows another event subscription process provided in an embodiment of this application.
[0360] like Figure 13 As shown, the event subscription method provided in this application embodiment may include:
[0361] S801. The server can multicast or unicast second service publication messages. Correspondingly, the client can receive second service publication messages from the server.
[0362] S802. The client can send the first subscription request to the server. Correspondingly, the server can receive the first subscription request from the client.
[0363] The specific implementation principles of S801 and S802 are as follows: Figure 8The specific implementation principles of S801 and S802 in the illustrated embodiments are similar, and will not be repeated here.
[0364] S1301. The server can parse the first subscription request, ignore the unknown fields 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.
[0365] For example, if the server's preset parsing rules are not applicable to the parsing of the first subscription request, the server can use the preset parsing rules to parse the ID of the target service and the ID of the target event group in the first subscription request, but it cannot parse the subscription policy in the first subscription request. That is, the subscription policy in the first subscription request is an unknown field.
[0366] When the server-side parsing rules use a weak validation strategy, the server can ignore fields that cannot be parsed (i.e., unknown fields).
[0367] The server can use the parsed content, such as the ID of the target service and the ID of the target event group, to subscribe to events.
[0368] For example, the server can send each event in the target event group to the client according to the preset sending method of each event in the target event group.
[0369] S805. The server can send a second response to the client to indicate subscription confirmation. Correspondingly, the client can receive the second response from the server. The second response may include: the ID of the target service and the ID of the target event group.
[0370] For example, the server can execute S805 after parsing 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, so as to notify the client that the event subscription is successful. This 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.
[0371] like Figure 13 As shown in the event subscription method provided in this application embodiment, if the server can parse the target service ID and target event group ID in the first subscription request using preset parsing rules, but cannot parse the subscription strategy in the first subscription request, the server can subscribe to events using the target service ID and target event group ID, and send each event in the target event group to the client according to the preset sending method of each event in the target event group. The server sends all events in the target event group to the client, reducing the probability of client event subscription failure when the server's preset parsing rules are not applicable to the parsing of the first subscription request.
[0372] Figure 14 This illustration shows another event subscription process provided in an embodiment of this application.
[0373] like Figure 14 As shown, the event subscription method provided in this application embodiment may include:
[0374] S801. The server can multicast or unicast second service publication messages. Correspondingly, the client can receive second service publication messages from the server.
[0375] S802. The client can send the first subscription request to the server. Correspondingly, the server can receive the first subscription request from the client.
[0376] The specific implementation principles of S801 and S802 are as follows: Figure 8 The specific implementation principles of S801 and S802 in the illustrated embodiments are similar, and will not be repeated here.
[0377] S1401. The server can parse the first subscription request, and if an unknown field is detected, the server can trigger exception handling.
[0378] For example, if the server's preset parsing rules are not applicable to the parsing of the first subscription request, and the server uses the preset parsing rules to parse the first subscription request and identifies an unknown field, the server can trigger exception handling to interrupt the client's event subscription. An unknown field could be, for example, the subscription strategy in the first subscription request.
[0379] For example, if the server uses a strong validation strategy in the default parsing rules, and the server uses the default parsing rules to parse the first subscription request and parses out 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 strategy in the first subscription request, the server can execute S1402 to achieve exception handling.
[0380] S1402. The server may send a first response to the client to indicate subscription denial. Correspondingly, the client may receive a first response from the server. The first response may include: the ID of the target service and the ID of the target event group.
[0381] S1403. The client may mark the server's identifier as a second identifier. This second identifier may be used to indicate that the subscription strategy is not supported, or to indicate that the first subscription request cannot be resolved.
[0382] 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 may include: the ID of the target service and the ID of the target event group.
[0383] S1405. The server may send a second response to the client to indicate subscription confirmation. Correspondingly, the client may receive a second response from the server. This second response may include the ID of the target service and the ID of the target event group.
[0384] For example, since the second subscription request does not include a subscription strategy, when the server receives the second subscription request from the client, the server can parse the entire content of the second subscription request using preset parsing rules without triggering exception handling, thus enabling the client to successfully subscribe.
[0385] The server can send each event in the target event group to the client according to the preset sending method of each event in the target event group.
[0386] This allows the client to subscribe to all events in the target event group from the server. The server can then send each event in the target event group to the client according to the preset sending method for each event in the target event group.
[0387] like Figure 14 As shown in the event subscription method provided in this application embodiment, if the server can parse the ID of the target service and the ID of the target event group in the first subscription request using preset parsing rules, but cannot parse the subscription policy in the first subscription request, the server can interrupt the client's event subscription and send a first response to the client to indicate subscription denial. The client can mark the server's identifier as a second identifier based on the first response. Thus, when the client subscribes to events from the server marked with the second identifier, it can subscribe to all events in the target event group by sending a second subscription request to the server. Since the second subscription request does not include the subscription policy, when the server receives the second subscription request from the client, it can parse all the content in the second subscription request using preset parsing rules without triggering exception handling, allowing the client to successfully subscribe to the event. The server can send each event in the target event group to the client according to the preset sending method for each event in the target event group, enabling the server to send all events in the target event group to the client, reducing the probability of client event subscription failure when the server's preset parsing rules are not applicable to the parsing of the first subscription request.
[0388] Optionally, before executing S802 on the client, the client can determine whether the server's identifier contains a second identifier. If it does, it indicates that the server's parsing rules do not support parsing the first subscription request, and the client can send a second subscription request to the server to subscribe to the event. If it does not, it indicates that the server's parsing rules support parsing the first subscription request, and the client can execute S802 to subscribe to the event.
[0389] In this embodiment, the subscription request, service publication message, first response, and second response can each take the form of a message. For example, a subscription request may be a first subscription request or a second subscription request. For example, a service publication message may be a first service publication message or a second service publication message.
[0390] It should be understood that the embodiments of this application do not limit the specific form of the subscription request, service publication message, first response, or second response.
[0391] For example, the subscription request, service publication message, first response, and second response can each take the form of a SOME / IP service discovery (SD) message. A SOME / IP service discovery message can be referred to as a SOME / IP-SD message.
[0392] SOME / IP-SD messages may include the SOMEIP header, SOMEIP SD header, entries, and options.
[0393] An entry can represent a specific service discovery action. Examples of service discovery actions include service offer, subscription, or subscription ack. The entry section can include fields such as the service ID and service version. An entry section can be associated with one or more options.
[0394] Options can be used to specify additional content for an entry. Examples of additional content for an entry include IPv4 or IPv6 addresses.
[0395] For example, the message format of a SOME / IP-SD message can be as shown in Table 1.
[0396] Table 1. SOME / IP-SD Message Format Diagram
[0397]
[0398] In Table 1, the first row represents bits. The length of the entry array in bytes and the entry array itself belong to the entry section. The length of the option array in bytes and the option array itself belong to the option section.
[0399] In this embodiment of the application, when the first subscription request is in the form of a SOME / IP-SD message, the subscription policy in the first subscription request can be laid out in the option part of the SOME / IP-SD message.
[0400] For example, the first information in the subscription strategy can be represented in the SOME / IP-SD message as shown in Table 2.
[0401] Table 2 illustrates a type of first information in a first subscription request in the form of a SOME / IP-SD message.
[0402]
[0403] Table 2 shows how the subscription policy is carried in the custom options of SOME / IP-SD messages. In Table 2, the first row represents bits. `length` indicates the length, which can represent the length of an option with type 0x01. `type` (=0x01) indicates that the option type is a custom option (configurationoption). `[len]id=value` indicates the length of the entry `id=value`. The entry `id=value` can be used to indicate the sending method of an event or the sending method of an event group. `[0]` can be used to indicate the termination position of a custom option. `reserved` is a reserved field. `reserved` (=0x00) indicates that the reserved field of the custom option is 0x00. `zero-terminated configuration string` is a zero-terminated custom string.
[0404] For example, let's take the entry id=value as an example to represent the sending method of an event. In the entry id=value, id can be the identifier of the event, and value can be the sending method of the event corresponding to id. The specific style of using the entry id=value to represent the sending method of an event can be found in Table 3 below.
[0405] Taking the entry id=value as an example to represent the sending method of an event group, in the entry id=value, id can be the indication information of the event group, and value can be the sending method of the event group indicated by id. The specific style of representing the sending method of an event group using the entry id=value can be found in Table 4 below.
[0406] It is understandable that an entry id=value can be a key-value pair.
[0407] For example, taking the first information in the first subscription request indicating the method of sending an event as an example, the first information in the first subscription request in the form of a SOME / IP-SD message as shown in Table 2 can be seen in Table 3.
[0408] Table 3. Another illustration of the first information in the first subscription request in the SOME / IP-SD message format.
[0409]
[0410] In Table 3, the first row represents bits. The meanings of length, type (=0x 01) and reserved (=0x 00) can be found in Table 2, and will not be repeated here. event 8001 is the identifier of event 8001, cyclic indicates that the transmission mode is the first mode, and 100 is the transmission period.
[20] is the length of the entry event 8001=cyclic:100. [0] can be used to indicate the end position of the custom options shown in Table 3.
[0411] Table 3 shows that event 8001 is sent in the first mode and the sending period is 100 (ms).
[0412] For example, taking the first information in the first subscription request indicating the sending method of an event group as an example, the first information in the first subscription request in the form of a SOME / IP-SD message as shown in Table 2 can be seen in Table 4.
[0413] Table 4 illustrates another example of the first message in the first subscription request in the SOME / IP-SD message format.
[0414]
[0415] In Table 4, the first row represents bits. The meanings of length, type (=0x 01) and reserved (=0x 00) can be found in Table 2, and will not be repeated here. time filter is a string. time filter can represent the indication information of event groups. time filter can be used to indicate the target event group ID corresponding to the target event group ID in the first subscription request. The layout of the target event group ID in the first subscription request in SOME / IP-SD message form is not shown in Tables 1-4. cyclic indicates that the sending mode is the first mode, and 100 is the sending cycle.
[22] is the length of the entry time filter=cyclic:100. [0] can be used to indicate the end position of the custom options shown in Table 4. It should be understood that the indication information of event groups can also be represented by other strings.
[0416] Table 4 indicates that the target event group in the first subscription request is sent using the first method with a sending period of 100 ms. This means that all events in the target event group in the first subscription request are sent using the first method with a sending period of 100 ms.
[0417] As shown in Tables 2-4, the subscription policy content can be carried in the custom options of the SOME / IP-SD message.
[0418] Optionally, the option types and fields of the SOME / IP-SD message can be redefined, and the redefined option types and fields can be used to carry the subscription policy content, as shown in Table 5.
[0419] Table 5 illustrates another example of the first message in the first subscription request in the SOME / IP-SD message format.
[0420]
[0421] In Table 5, the first row represents bits. `length` indicates the length, which can represent the length of an option with type 0x0F. `type` (=0x0F) can indicate that the option type is a redefined 0x0F type. Options of type 0x0F can be called subscription policy options (subpolicy options). `event ID` is the event identifier. `time filter` represents the subscription policy content; the time filter can be a variable value. The time filter uses 2 bytes. The high 2 bits of the time filter can represent the transmission method type, and the remaining 14 bits can represent the transmission method-related period or preset threshold, etc. The time filter in the same row as the event ID can represent the transmission method of the event corresponding to the event ID. It should be understood that the subscription policy content can also be represented by other strings.
[0422] The high 2 bits in the time filter can be understood as the first two bits in the bit set of the time filter.
[0423] For example, the high 2 bits of the time filter can be any of 00, 01, or 10. 00 can indicate the transmission mode type as mode 1 (or cyclic). 01 can indicate the transmission mode type as mode 3 (or UOC). 10 can indicate the transmission mode type as mode 2 (or EOC).
[0424] If the high 2 bits of the time filter are 00, then the remaining 14 bits of the time filter can represent the period related to the transmission method.
[0425] If the high 2 bits of the time filter are 10, then the remaining 14 bits of the time filter can represent the preset threshold related to the transmission method, that is, the preset threshold of the event corresponding to the time filter.
[0426] Understandably, the event ID in Table 5 can also be replaced with the event group ID. The time filter in the same row as the event group ID can indicate the sending method of the event group corresponding to the event group ID.
[0427] Optionally, the event ID in Table 5 can be an identifier for an event group. When the event ID in Table 5 is an identifier for an event group, the event ID may contain information indicating that the event ID is an identifier for an event group.
[0428] It should be understood that Table 1 is merely an illustration of the SOME / IP-SD message format in the embodiments of this application, and is not intended to limit the SOME / IP-SD message format in the embodiments of this application. Tables 2-5 are merely illustrations of the first information in the embodiments of this application, and are not intended to limit the first information in the embodiments of this application.
[0429] In this application embodiment, subscription confirmation can be understood as subscription success, and subscription denial can be understood as subscription failure.
[0430] This application also provides an event subscription method, the method comprising:
[0431] Send a first subscription request, which is used to subscribe to an event occurring in a first electronic device in the vehicle. The first subscription request includes first information, which is used to indicate the method of sending the event.
[0432] The events subscribed to are obtained based on the first subscription request, and the subscribed events are included in the events occurring on the first electronic device.
[0433] For example, the execution entity of this application embodiment may be Figures 1-14 The client is shown in any of the embodiments depicted in the accompanying drawings. The vehicle in the embodiments of this application may be... Figure 1 The vehicle shown in the illustrated embodiment, and the first electronic device in this application embodiment, can also be... Figures 1-14 The server in any of the embodiments shown in the accompanying drawings. The execution entity and the first electronic device in the embodiments of this application can both be... Figure 1 Communication nodes in the system.
[0434] With the first electronic device as Figure 8 Taking the server-side example in the illustrated embodiment, the first subscription request in this application embodiment can be... Figure 8 The first subscription request in the illustrated embodiment. The event occurring in the first electronic device in this application embodiment can be... Figure 8 The events occurring on the server side in the illustrated embodiment. At least one event occurring on the server side can be understood as at least one event or at least one event instance occurring within the functional domain managed by the server. The first information in this embodiment may be... Figure 8 The first information in the illustrated embodiment.
[0435] For the specific implementation principles of the embodiments in this application, please refer to [link / reference]. Figure 8 The illustrated embodiment Figure 9The illustrated embodiment Figure 11 The illustrated embodiment or Figure 12 The specific implementation principle of the illustrated embodiment.
[0436] By including first information indicating the event transmission method in the first subscription request, the first electronic device can send the event associated with the first information to the electronic device that sent the first subscription request (or the electronic device subscribing to the event) according to the event transmission method indicated by the first information. This reduces the probability that the frequency of events sent by the first electronic device exceeds the frequency of events required by the electronic device subscribing to the event, thereby reducing the probability of invalid events occurring. It also reduces the probability that invalid event transmissions will occupy bus bandwidth, causing target function failures in the electronic device subscribing to the event.
[0437] Optionally, the first information includes: the transmission method of each event in at least one event, and at least one event includes events occurring in the first electronic device.
[0438] Alternatively, the first information includes: the transmission method of each event group in at least one event group, each event group in at least one event group contains events occurring in the first electronic device, and the event group includes at least one event.
[0439] For example, the first information includes the transmission method of each event in at least one event, which can indicate that the transmission method of the event indicated by the first information is the transmission method of the event represented by each event in the form of event granularity.
[0440] The first information includes the transmission method of each event group in at least one event group, which can represent the transmission method of the event indicated by the first information. It represents the transmission method of all events in the event group in the form of event group granularity.
[0441] This allows for greater flexibility in the representation or expression of the first information, and expands the applicability of the event subscription method provided in the embodiments of this application.
[0442] Optionally, the first information includes the identifier of the event and the method of sending the corresponding event.
[0443] Alternatively, the first information includes indication information for the event group and the corresponding event group's transmission method, wherein the indication information for the event group is information indicating the event group, and the event group includes at least one event.
[0444] For example, as shown in Tables 2, 3, or 5, the first information may include an event identifier and the event transmission method corresponding to the event identifier. Alternatively, as shown in Table 4, the first information includes event group indication information and the transmission method of the event group corresponding to (or indicating) the event group. The event group indication information may be the timefilter shown in Table 4.
[0445] This also allows for greater flexibility in the representation or expression of the first information, and expands the applicability of the event subscription method provided in the embodiments of this application.
[0446] Optionally, the first information can be represented as: <key, value>, where key includes the identifier of the event and value includes the method of sending the event. Alternatively, key includes indication information for the event group, and value includes the method of sending the event group.
[0447] This also allows for greater flexibility in the representation or expression of the first information, and expands the applicability of the event subscription method provided in the embodiments of this application.
[0448] Optionally, the event sending method includes an identifier for the event sending method, and the event group sending method includes an identifier for the event group sending method.
[0449] In this way, compared to the first information containing the specific content of the event transmission method or the specific content of the event group transmission method, the first information uses the event transmission method identifier to represent the event transmission method, and the event group transmission method uses the event group transmission method identifier. This can reduce the amount of data in the first information, thereby reducing the bus bandwidth occupied by the transmission of the first subscription request.
[0450] Optionally, the transmission method includes any one of the first, second, or third methods. The first method is used to indicate periodic transmission of events, the second method is used to indicate transmission of events when an event reaches a preset threshold, and the third method is used to indicate transmission of events when an event changes.
[0451] The first information includes at least one of the following:
[0452] The event sending period is associated with the first method. Alternatively,
[0453] The first method's identifier and event sending period are associated with the first method. Alternatively,
[0454] The identifier for the second method and the preset threshold for the second method. Or,
[0455] The identifier for the third method.
[0456] Exemplarily, the first approach in the embodiments of this application may be Figure 1 The first embodiment shown is a first approach (or cyclic). The second approach in the embodiments of this application can be... Figure 4 The second method (or EOC) in the illustrated embodiment. The third method in the embodiments of this application may be... Figure 4The third method (or UOC) in the illustrated embodiment. The preset threshold in the embodiments of this application can be... Figure 4 The preset threshold in the illustrated embodiment. The event sending period is associated with the first method, for example... Figure 1 In the illustrated embodiment, when event A is transmitted using the first method and the transmission period is 10 milliseconds (ms), the first method of event A is associated with the transmission period of 10 milliseconds (ms). The identifier for the first method can be cyclic. The identifier for the second method can be EOC. The identifier for the third method can be UOC.
[0457] Optionally, the identifier for the first method can be the high 2 bits (00) of the time filter in the embodiment shown in Table 5. The identifier for the second method can be the high 2 bits (10) of the time filter in the embodiment shown in Table 5. The identifier for the third method can be the high 2 bits (01) of the time filter in the embodiment shown in Table 5.
[0458] The first information includes the event sending cycle, or the identifier of the first method and the style of the event sending cycle can be found in the embodiments shown in Table 3 or Table 4.
[0459] Thus, the method of sending the event indicated in the first message can be any one of the first, second, or third methods.
[0460] Optionally, the first subscription request may further include second information indicating a subset of events in the subscription event group. The subscription event group includes at least one event, and the subscription event group contains events occurring on the first electronic device.
[0461] For example, the second information in the embodiments of this application may be Figure 8 The second information in the illustrated embodiment. The subscription event group in this application embodiment can be... Figure 8 The subscription event group in the illustrated embodiment. The subscription event group in the embodiments of this application may also be Figure 8 The target event group in the illustrated embodiment.
[0462] The first subscription request also includes second information, which enables the first electronic device to send events associated with the second information to the electronic device subscribing to the events. The events associated with the second information are a subset of the events in the subscription event group, rather than all the events in the subscription event group. This reduces the probability of the first electronic device sending events that the subscribing electronic device does not need, thereby reducing the bus bandwidth usage of invalid events.
[0463] Optionally, the second information includes the identifiers of each event in the partial event.
[0464] The second information includes the identifiers of each event in a subset of events, as shown in S802.
[0465] In this way, the accuracy of sending the events required by the first electronic device to the electronic device that subscribes to the event can be ensured.
[0466] Optionally, the second information may also include a first identifier, which is used to indicate a subset of events in the subscribed event group.
[0467] For example, the first identifier in this application embodiment may be the string "eventfilter" shown in S802. The representation of the second information can be found in S802.
[0468] In this way, the accuracy of sending the events required by the first electronic device to the electronic device that subscribes to the event can be ensured.
[0469] Optionally, the second information is represented as follows: <key, value>, where key includes a first identifier and value includes the identifiers of each event in the partial events.
[0470] In this way, the accuracy of the first electronic device sending the events required by the subscribed electronic device to the subscribed electronic device can be ensured. The representation of the second information can be found in S802.
[0471] Optionally, the event indicated by the first information is sent either by pre-registering on the vehicle before the vehicle is in operation, or by registering on the vehicle while it is in operation.
[0472] For example, Figure 5 The illustrated embodiment Figure 6 The illustrated embodiment or Figure 7 The subscription requirements of the client in the illustrated embodiment may include the method of sending events indicated by the first information.
[0473] The specific implementation principle of pre-registering the method of sending the first information indication event on the vehicle before it starts running can be found in [reference needed]. Figure 5 The specific implementation principle of the illustrated embodiment or Figure 6 The specific implementation principle of the illustrated embodiment.
[0474] For the specific implementation principle of registering the method of sending the first information indication event on the vehicle while the vehicle is running, please refer to [link to relevant documentation]. Figure 7 The specific implementation principle of the illustrated embodiment.
[0475] In this way, it is possible to carry accurate first information or first information that meets the needs of electronic devices for subscription events in the first subscription request.
[0476] Optionally, before sending the first subscription request, the method further includes:
[0477] The device receives a first service publication message from a first electronic device. The first service publication message is used to indicate the service provided by the first electronic device. The service includes at least one event group, and the event group includes at least one event. The at least one event group contains events that occur in the first electronic device.
[0478] For example, the first service publishing message in this application embodiment can be the second service publishing message in S801 or the first service publishing message in S1101.
[0479] Thus, the first service publication message is used to indicate the services provided by the first electronic device. The service includes at least one event group, and each event group includes at least one event. All at least one event group contains events occurring on the first electronic device. The first service publication message sent by the first electronic device can be used to notify electronic devices subscribing to events to subscribe to the events, and to inform subscribing electronic devices of the events that the first electronic device can provide, so that the subscribing electronic devices can subscribe.
[0480] Optionally, the first service publication message includes third information, which indicates at least one transmission method supported by the event. The transmission method of the event indicated by the first information is selected from the third information.
[0481] For example, the first service publishing message in this application embodiment may be the first service publishing message in S1101. The third information may be... Figure 11 The third information or first subscription strategy list in the illustrated embodiment.
[0482] Thus, the first service publishing message includes third information indicating at least one supported transmission method for the event, enabling the electronic device subscribing to the event to select a suitable transmission method from the transmission methods provided in the first service publishing message. On the other hand, the electronic device subscribing to the event can carry an identifier of the selected transmission method in its first subscription request, reducing the data volume of the first subscription request and consequently reducing the bus bandwidth usage of the first subscription request transmission. Furthermore, since the transmission methods in the third information are all supported by the server, and the transmission method indicated by the first information is selected from the third information, the probability of the server not supporting the transmission method indicated by the first information can be reduced.
[0483] Optionally, the transmission method of the event indicated by the first information is selected from a preset first set, which includes at least one transmission method supported by events occurring in the first electronic device.
[0484] For example, the first set in the embodiments of this application may be Figure 12 The first set in the illustrated embodiment.
[0485] In this way, the event transmission method indicated by the first information is selected from a preset first set, and the service publication message sent by the first electronic device may not carry the event transmission method, which can reduce the data volume of the service publication message.
[0486] Optionally, the first set includes any of the following:
[0487] At least one of the events in an event specifies the supported sending methods. Alternatively,
[0488] At least one event group's supported sending methods. Or,
[0489] At least one service supports various sending methods, and each service includes at least one event group. Alternatively,
[0490] At least one electronic device supports various transmission methods, and each electronic device provides at least one service. Alternatively,
[0491] At least one project supports a sending method, and each project is associated with at least one electronic device.
[0492] In this way, the first set includes at least one event's supported sending method, which can realize the sending method of the event in the first set in the form of event granularity.
[0493] The first set includes at least one event group and the sending methods supported by each event group, which can realize the sending methods of all events in the event group in the first set in the form of event group granularity.
[0494] The first set includes at least one service that supports sending methods, which can represent the sending methods of all events contained in the services in the first set in terms of service granularity.
[0495] The first set includes the transmission methods supported by each electronic device in at least one electronic device, which can realize the transmission methods of all events occurring in the communication nodes in the first set in the form of communication node granularity.
[0496] The first set includes at least one project's supported sending methods, which can realize the sending methods of all events occurring in the communication nodes associated with the projects in the first set in the form of project granularity.
[0497] Optionally, the method further includes:
[0498] Send a first subscription request, which is used to subscribe to events occurring on the second electronic device in the vehicle. The first subscription request includes a fourth message, or the first subscription request includes a fourth message and a fifth message. The fourth message is used to indicate the method of sending the event, and the fifth message is used to indicate a subset of events in the subscription event group. The subscription event group includes at least one event and is contained in the events occurring on the second electronic device.
[0499] Receive the first response indicating subscription denial.
[0500] The identifier marking the second electronic device is the second identifier.
[0501] Send a second subscription request, which is used to subscribe to the event group of the second electronic device.
[0502] Get all events in the event group associated with the second subscription request.
[0503] For example, the second electronic device in the embodiments of this application may be Figure 14 The server in the illustrated embodiment. The first subscription request in this embodiment may be... Figure 14 The first subscription request in the illustrated embodiment. The fourth information in this embodiment may be... Figure 14 The subscription strategy in the illustrated embodiment includes the first information. The fifth information in the embodiments of this application may be... Figure 14 The subscription policy in the illustrated embodiment includes second information. The first response in this embodiment can be the first response in S1402. The second subscription request in this embodiment can be... Figure 14 The second subscription request in the illustrated embodiment. For the specific implementation principles and technical effects of the embodiments of this application, please refer to... Figure 14 The specific implementation principle and technical effects of the illustrated embodiment.
[0504] In this way, even if the preset parsing rules of the second electronic device are not applicable to parsing the first subscription request, the electronic device subscribing to the event can subscribe to all events in the target event group from the second electronic device. This reduces the probability of the electronic device failing to subscribe to events when the preset parsing rules of the second electronic device are not applicable to parsing the first subscription request. It also improves the compatibility of event subscriptions on the second electronic device.
[0505] Optionally, the method further includes:
[0506] Send a first subscription request, which is used to subscribe to events occurring on a third electronic device in the vehicle. The first subscription request includes a sixth message, or the first subscription request includes a sixth message and a seventh message. The sixth message is used to indicate the method of sending the event, and the seventh message is used to indicate a subset of events in the subscription event group. The subscription event group includes at least one event and is contained in the events occurring on the third electronic device.
[0507] Obtain all events in the first subscription request associated event group, which contains events occurring on the third electronic device.
[0508] For example, the third electronic device in the embodiments of this application may be Figure 13 The server in the illustrated embodiment. The first subscription request in this embodiment may be... Figure 13 The first subscription request in the illustrated embodiment. The sixth information in this embodiment may be... Figure 13 The subscription strategy in the illustrated embodiment includes the first information. The seventh information in the embodiments of this application may be... Figure 13 The subscription strategy in the illustrated embodiment includes second information. For the specific implementation principles and technical effects of the embodiments of this application, please refer to... Figure 13 The specific implementation principle and technical effects of the illustrated embodiment.
[0509] In this way, even if the third electronic device's preset parsing rules are not applicable to parsing the first subscription request, the electronic device subscribing to the event can subscribe to all events in the target event group from the third electronic device. This reduces the probability of the subscribing electronic device failing to subscribe to events when the third electronic device's preset parsing rules are not applicable to parsing the first subscription request. It also improves the compatibility of event subscriptions on the third electronic device.
[0510] This application also provides an event subscription method, the method comprising:
[0511] A first subscription request is received, the first subscription request being used to subscribe to events occurring in a first electronic device in the vehicle. The first subscription request includes first information, or the first subscription request includes first information and second information. The first information is used to indicate the method of sending the event, and the second information is used to indicate a subset of events in the subscription event group. The subscription event group includes at least one event and is contained in the events occurring in the first electronic device.
[0512] Based on the first information, or based on the first and second information, the first subscription request indicates the event to be subscribed.
[0513] For example, the execution subject of this application embodiment may be a first electronic device. The first electronic device may be... Figures 1-14The server in any of the embodiments shown in the accompanying drawings. The first electronic device may be... Figure 2 The communication node in the application. The vehicle in this embodiment can be a communication node in the application. Figure 2 The car in the illustrated embodiment,
[0514] With the first electronic device as Figure 8 Taking the server-side example in the illustrated embodiment, the first subscription request in this application embodiment can be... Figure 8 The first subscription request in the illustrated embodiment. The event occurring in the first electronic device in this application embodiment can be... Figure 8 The events occurring on the server side in the illustrated embodiment. At least one event occurring on the server side can be understood as at least one event or at least one event instance occurring within the functional domain managed by the server. The first information in this embodiment may be... Figure 8 The first information in the illustrated embodiment. The second information in the embodiments of this application may be... Figure 8 The second information in the illustrated embodiment. The subscription event group in this application embodiment can be... Figure 8 The subscription event group in the illustrated embodiment. The subscription event group in the embodiments of this application may also be Figure 8 The target event group in the illustrated embodiment.
[0515] For the specific implementation principles of the embodiments in this application, please refer to [link / reference]. Figure 8 The illustrated embodiment Figure 9 The illustrated embodiment Figure 11 The illustrated embodiment or Figure 12 The specific implementation principle of the illustrated embodiment.
[0516] By including first information indicating the event transmission method in the first subscription request, the first electronic device can send the event associated with the first information to the electronic device that sent the first subscription request (or the electronic device subscribing to the event) according to the event transmission method indicated by the first information. This reduces the probability that the frequency of events sent by the first electronic device exceeds the frequency of events required by the electronic device subscribing to the event, thereby reducing the probability of invalid events occurring. It also reduces the probability that invalid event transmissions will occupy bus bandwidth, causing target function failures in the electronic device subscribing to the event.
[0517] Optionally, the first information includes the method of sending the target event, which includes information indicating a first period for periodically sending the target event. The target event is any of the events subscribed to by the first subscription request.
[0518] Based on the first information, or based on both the first and second information, the event indicating the subscription for the first subscription request is distributed, including:
[0519] Based on the first period and the preset period of the target event, the first distribution condition of the target event is set. The preset period of the target event is a preset period used to indicate the periodic sending of the target event.
[0520] Based on the first distribution condition of the target event, the target event is transmitted to the electronic device that sent the first subscription request.
[0521] For example, the target event in this application embodiment can be the target event in S804. The first period of the target event in this application embodiment can be the first period of the target event in S804. For the specific implementation principle of this application embodiment, please refer to the specific implementation principle of S804.
[0522] Thus, since the target event is any of the events subscribed to by the first subscription request, it is possible to transmit the subscribed events to the electronic device based on the first information, or based on both the first and second information, thereby reducing the probability of invalid events occurring.
[0523] Optionally, the first distribution condition for the target event includes the 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 the preset period of the target event.
[0524] Based on the first distribution conditions of the target event, the target event is transmitted to the electronic device that sent the first subscription request, including:
[0525] The first electronic device sends the target event when the number of times the target event occurs reaches the first factor. The number of times the target event occurs is counted from the first target event after subscribing to the target event, or from the first target event after sending the target event.
[0526] For example, the first factor of the target event in this application embodiment can be the first factor of the target event in S804. The preset period of the target event in this application embodiment can be the preset period of the target event in S804. For the specific implementation principle of this application embodiment, please refer to the specific implementation principle of S804.
[0527] In this way, it is possible to transmit the events subscribed to by electronic devices based on the first information, or based on the first and second information, thereby reducing the probability of invalid events occurring.
[0528] Optionally, the first factor δ of the target event satisfies:
[0529] δ=max(1,‖T C / T S ‖)
[0530] Where max(1,‖T) C / T S ‖) represents from 1 and ‖T C / T S The maximum value in T is taken from the integer part. C For the first period, T S This is the preset cycle.
[0531] This allows for the transmission of subscribed events to electronic devices based on either the first or second information, thereby reducing the probability of invalid events occurring. Furthermore, when the first period T of the target event... C Less than the preset period T of the target event S At that time, T C / T S If the value is less than 1, then δ = 1. δ = 1 indicates that the first electronic device can send the target event to the electronic device subscribed to the target event according to the preset period of the target event. It should be understood that the electronic device subscribed to the target event is the electronic device that indicates the first period of the target event. The first period T of the target event... C Less than the preset period T of the target event S This can be understood as follows: the preset method of sending the target event by the first electronic device cannot meet the frequency of the target event required by the electronic device subscribing to the target event.
[0532] Optionally, the first distribution condition for the target event may further include: a third identifier and an identifier of the electronic device subscribing to the event, wherein the third identifier is used to indicate that the event has been subscribed to.
[0533] For example, the third identifier in this application embodiment can be the third identifier in S804. The electronic device subscribing to the event in this application embodiment can be the client in S804. For the specific implementation principle of this application embodiment, please refer to the specific implementation principle of S804.
[0534] Thus, since the event associated with the second information is an event needed by the electronic device subscribing to the event, when the first subscription request includes both the first and second information, if the distribution conditions of the target event include a third identifier, then the first electronic device can transmit the target event to the electronic device subscribing to the event when the target event meets the distribution conditions. If the distribution conditions of the target event do not include the third identifier, it indicates that the target event is not needed by the electronic device subscribing to the event, and the first electronic device may not transmit the target event to the electronic device subscribing to the event when the target event meets the distribution conditions. This reduces the probability of the first electronic device transmitting events that the client does not need to the electronic device subscribing to the event, thereby reducing the probability of invalid events occurring.
[0535] Optionally, the first information includes the sending method of the target event, the sending method of the target event is a second method, the target event is any event among the events subscribed to by the first subscription request, and the second method is used to indicate that the event is sent when the event reaches a preset threshold.
[0536] Based on the first information, or based on both the first and second information, the event indicating the subscription for the first subscription request is distributed, including:
[0537] Set a second dispatch condition for the target event, which is used to indicate when the target event is sent when it reaches a preset threshold.
[0538] Based on the second distribution condition of the target event, the target event is transmitted to the electronic device that sent the first subscription request.
[0539] For example, the second method in this application embodiment can be the second method in S804. The preset threshold in this application embodiment can be the preset threshold in S804. The specific implementation principle of this application embodiment can be found in the specific implementation principle of S804. The second distribution condition in this application embodiment can be the second distribution condition in S804.
[0540] In this way, the first electronic device can transmit the target event to the electronic device that subscribes to the event according to the second distribution condition of the target event, thereby reducing the probability of invalid events occurring.
[0541] Optionally, the second distribution condition for the target event also includes: a third identifier and an identifier of the electronic device subscribing to the event, wherein the third identifier is used to indicate that the event has been subscribed to.
[0542] Thus, since the event associated with the second information is an event needed by the electronic device subscribing to the event, when the first subscription request includes both the first and second information, if the distribution conditions of the target event include a third identifier, then the first electronic device can transmit the target event to the electronic device subscribing to the event when the target event meets the distribution conditions. If the distribution conditions of the target event do not include the third identifier, it indicates that the target event is not needed by the electronic device subscribing to the event, and the first electronic device may not transmit the target event to the electronic device subscribing to the event when the target event meets the distribution conditions. This reduces the probability of the first electronic device transmitting events that the client does not need to the electronic device subscribing to the event, thereby reducing the probability of invalid events occurring.
[0543] Optionally, the first information includes the method of sending the target event, wherein the method of sending the target event is a third method, the target event is any event among the events subscribed to by the first subscription request, and the third method is used to indicate that the event is sent when the event changes.
[0544] Based on the first information, or based on both the first and second information, the event indicating the subscription for the first subscription request is distributed, including:
[0545] Set the third dispatch condition for the target event, which is used to indicate when the target event changes.
[0546] Based on the third distribution condition of the target event, the target event is transmitted to the electronic device that sent the first subscription request.
[0547] For example, the third method in the embodiments of this application can be the third method in S804. The preset threshold in the embodiments of this application can be the preset threshold in S804. The specific implementation principle of the embodiments of this application can be found in the specific implementation principle of S804. The third distribution condition in the embodiments of this application can be the third distribution condition in S804.
[0548] In this way, the first electronic device can transmit the target event to the electronic device that subscribes to the event according to the third distribution condition of the target event, thereby reducing the probability of invalid events occurring.
[0549] Optionally, the second distribution condition for the target event also includes: a third identifier and an identifier of the electronic device subscribing to the event, wherein the third identifier is used to indicate that the event has been subscribed to.
[0550] Thus, since the event associated with the second information is an event needed by the electronic device subscribing to the event, when the first subscription request includes both the first and second information, if the distribution conditions of the target event include a third identifier, then the first electronic device can transmit the target event to the electronic device subscribing to the event when the target event meets the distribution conditions. If the distribution conditions of the target event do not include the third identifier, it indicates that the target event is not needed by the electronic device subscribing to the event, and the first electronic device may not transmit the target event to the electronic device subscribing to the event when the target event meets the distribution conditions. This reduces the probability of the first electronic device transmitting events that the client does not need to the electronic device subscribing to the event, thereby reducing the probability of invalid events occurring.
[0551] Optionally, before receiving the first subscription request, the method further includes:
[0552] Send a first service publication message. The first service publication message is used to indicate the 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 that has occurred in the first electronic device.
[0553] For example, the first service publishing message in this application embodiment can be the second service publishing message in S801 or the first service publishing message in S1101.
[0554] Thus, the first service publication message is used to indicate the services provided by the first electronic device. The service includes at least one event group, and each event group includes at least one event. All at least one event group contains events occurring on the first electronic device. The first service publication message sent by the first electronic device can be used to notify electronic devices subscribing to events to subscribe to the events, and to inform subscribing electronic devices of the events that the first electronic device can provide, so that the subscribing electronic devices can subscribe.
[0555] Optionally, the first service publication message includes third information indicating at least one transmission method supported by the event. This third information is selected from a pre-registered second set of information, which includes at least one transmission method supported by events occurring on the first electronic device. The second set is either pre-registered on the vehicle before it is operational, or it is registered on the vehicle while it is in operation. The transmission method of the event indicated by the first information in the first subscription request is selected from the third information.
[0556] For example, the first service publishing message in this application embodiment may be the first service publishing message in S1101. The third information in this application embodiment may be... Figure 11 The third information or first subscription policy list in the illustrated embodiment. The second set in the embodiments of this application may be... Figure 11 The second set in the illustrated embodiment. For the specific implementation principle of pre-registering the second set on the vehicle before it runs, please refer to [link to relevant documentation]. Figure 5 The specific implementation principle of the illustrated embodiment or Figure 6 The specific implementation principle of the illustrated embodiment. For the specific implementation principle of registering the second set on the vehicle while the vehicle is running, please refer to [link to relevant documentation]. Figure 7 The specific implementation principle of the illustrated embodiment.
[0557] Thus, the first service publishing message includes third information indicating at least one transmission method supported by the event, so that the electronic device subscribing to the event can select a suitable transmission method from the transmission methods provided in 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 transmission method in the first subscription request sent to the first electronic device, thereby reducing the data volume of the first subscription request and thus reducing the bus bandwidth usage of the first subscription request transmission.
[0558] It should be noted that the module names involved in the embodiments of this application can all be defined as other names, as long as they can achieve the function of each module, and no specific restrictions are placed on the module names.
[0559] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0560] The event subscription method of the present application embodiments has been described above. The apparatus for executing the above method provided in the present application embodiments is described below. Those skilled in the art will understand that the methods and apparatus can be combined and referenced with each other, and the related apparatus provided in the present application embodiments can execute the steps in the above event subscription method.
[0561] The event subscription method provided in this application can be applied to electronic devices with communication functions. The electronic device may include a terminal device; the specific device form of the terminal device can be referred to the above-described related features, and will not be repeated here.
[0562] This application provides an electronic device comprising: one or more processors and a memory. The memory is coupled to the one or more processors and is used to store computer program code, which includes computer instructions. The one or more processors invoke the computer instructions to cause the electronic device to perform the described method.
[0563] This application provides a chip. The chip includes a processor, which is used to call a computer program in memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those in the related embodiments described above, and will not be repeated here.
[0564] This application provides a chip system. The chip system includes at least one processor and a communication interface, the communication interface and the at least one processor being interconnected via a circuit, and the at least one processor being used to run computer programs or instructions to perform the above-described method.
[0565] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, it implements the methods described above. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium accessible by a computer.
[0566] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage or other magnetic storage devices, or any other medium targeted to carry or to store the required program code in the form of instructions or data structures, and accessible by a computer. Furthermore, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, disks and optical discs include optical discs, laser discs, optical discs, Digital Versatile Discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0567] It is understood that in the event subscription method and related apparatus provided in the embodiments of this application, the related apparatus may include electronic devices, chips, chip systems and / or computer-readable storage media.
[0568] This application provides a computer program product, which includes a computer program that, when run, causes a computer to perform the above-described method.
[0569] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0570] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.
Claims
1. An event subscription method, characterized in that, include: Send a first subscription request, the first subscription request being used to subscribe to an event occurring in a first electronic device in the vehicle, the first subscription request including first information, the first information being used to indicate the method of sending the event; The events subscribed to are obtained based on the first subscription request, and the subscribed events include events occurring on the first electronic device.
2. The method according to claim 1, characterized in that, The first information includes: the transmission method of each event in at least one event, wherein the at least one event is an event occurring in the first electronic device; or, The first information includes: the transmission method of each event group in at least one event group, wherein each event group in at least one event group contains events that occur in the first electronic device, and the event group includes at least one event.
3. The method according to claim 1 or 2, characterized in that, The first information includes the identifier of the event and the corresponding sending method for the event; or, The first information includes indication information for an event group and a transmission method corresponding to the event group, wherein the indication information for the event group is information indicating the event group, and the event group includes at least one event.
4. The method according to any one of claims 1-3, characterized in that, The sending method includes any one of the first method, the second method, or the third method; the first method is used to indicate the periodic sending of events, the second method is used to indicate the sending of events when an event reaches a preset threshold, and the third method is used to indicate the sending of events when an event changes. The first information includes at least one of the following: Event sending period, which is associated with the first method; or... The identifier and event transmission period of the first method, wherein the event transmission period is associated with the first method; or, The identifier of the second method and the preset threshold of the second method; or, The third-party identifier.
5. The method according to any one of claims 1-4, characterized in that, The first subscription request further includes second information, which indicates a subset of events in the subscription event group; the subscription event group includes at least one event, and the subscription event group contains events that occur on the first electronic device.
6. The method according to claim 5, characterized in that, The second information includes the identifiers of each event in the aforementioned partial events.
7. The method according to claim 6, characterized in that, The second information also includes a first identifier, which is used to indicate a subset of events in the subscribed event group.
8. The method according to any one of claims 1-7, characterized in that, The event indicated by the first information is sent either by pre-registration on the vehicle before the vehicle is in operation, or by registration on the vehicle while the vehicle is in operation.
9. The method according to any one of claims 1-7, characterized in that, Before sending the first subscription request, the method further includes: The device receives a first service publication message from the first electronic device. The first service publication 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 includes at least one event. The at least one event group contains events that occur in the first electronic device.
10. The method according to claim 9, characterized in that, The first service publishing message includes third information, which indicates at least one transmission method supported by the event; the transmission method of the event indicated by the first information is selected from the third information.
11. The method according to any one of claims 1-7, characterized in that, The method of sending the event indicated by the first information is selected from a preset first set, which includes at least one method of sending events that are supported by the events occurring on the first electronic device.
12. The method according to claim 11, characterized in that, The first set includes any one of the following: At least one of the events in an event supports a specific sending method; or, At least one event group supports the sending methods of each event group; or, At least one service supports a sending method, wherein the service includes at least one event group; or, At least one electronic device supports a transmission method, and the electronic device provides at least one service; or, At least one project includes the sending methods supported by each item, and the project is associated with at least one electronic device.
13. The method according to any one of claims 1-12, characterized in that, Also includes: Send a first subscription request, the first subscription request being used to subscribe to events occurring in the 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 method of the event, the fifth information being used to indicate a subset of events in the subscription event group, the subscription event group including at least one event, the subscription event group being included in the events occurring in the second electronic device; Receive the first response indicating subscription denial; The identifier marking the second electronic device is designated as the second identifier; Send a second subscription request, which is used to subscribe to the event group of the second electronic device; Get all events in the event group associated with the second subscription request.
14. The method according to any one of claims 1-13, characterized in that, Also includes: Send 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 a sixth piece of information, or the first subscription request including the sixth piece of information and a seventh piece of information, the sixth piece of information being used to indicate the sending method of the event, the seventh piece of information being used to indicate a subset of events in a subscription event group, the subscription event group including at least one event, the subscription event group being included in events occurring in the third electronic device; Obtain all events in the first subscription request associated event group, which includes events occurring on the third electronic device.
15. An event subscription method, characterized in that, The method includes: A first subscription request is received, the first subscription request being used to subscribe to events occurring in a first electronic device in the vehicle, the first subscription request including first information, or the first subscription request including the first information and second information, the first information being used to indicate the sending method of the event, the second information being used to indicate a subset of events in a subscription event group, the subscription event group including at least one event, the subscription event group being included in the events 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.
16. The method according to claim 15, characterized in that, The first information includes the method of sending the target event, which includes information for indicating a first period of periodic sending of the target event; the target event is any of the events subscribed to by the first subscription request. Based on the first information, or based on the first information and the second information, distributing the event indicating subscription in the first subscription request includes: Based on the first period of the target event and the preset period of the target event, the first distribution condition of the target event is set, wherein the preset period of the target event is a preset period used to indicate the periodic sending of the target event; Based on the first distribution conditions of the target event, the target event is transmitted to the electronic device that sent the first subscription request.
17. The method according to claim 16, characterized in that, 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 a first period of the target event and negatively correlated with a preset period of the target event. The step of transmitting the target event to the electronic device that sent the first subscription request based on the first distribution condition of the target event includes: When the number of times the first electronic device generates the target event reaches the first factor, the target event is sent. The number of times the first electronic device generates the target event is counted starting from the first target event after subscribing to the target event, or starting from the first target event after sending the target event.
18. The method according to claim 17, characterized in that, The first factor δ of the target event satisfies: δ=max(1,‖T C / T S ‖) Where max(1,‖T) C / T S ‖) represents from 1 and ‖T C / T S The maximum value in T is taken from the integer part. C For the first period, T S The preset period is defined as such.
19. The method according to claim 17 or 18, characterized in that, The first distribution condition for the target event also includes: a third identifier and an identifier of the electronic device subscribing to the event, wherein the third identifier is used to indicate that the event has been subscribed to.
20. The method according to claim 15, characterized in that, The first information includes the sending method of the target event, the sending method of the target event is a second method, the target event is any event among the events subscribed to by the first subscription request, and the second method is used to indicate that the event is sent when the event reaches a preset threshold; The event of distributing the first subscription request indicating subscription based on the first information, or based on the first information and the second information, includes: A second distribution condition for the target event is set, which is used to indicate that the target event is sent when the target event reaches a preset threshold. Based on the second distribution conditions of the target event, the target event is transmitted to the electronic device that sent the first subscription request.
21. The method according to claim 20, characterized in that, The second distribution condition for the target event further includes: a third identifier and an identifier of the electronic device subscribing to the event, wherein the third identifier is used to indicate that the event has been subscribed to.
22. The method according to claim 15, characterized in that, The first information includes the sending method of the target event, the sending method of the target event is a third method, the target event is any event among the events subscribed to by the first subscription request, and the third method is used to indicate that the event is sent when the event changes; The event of distributing the first subscription request indicating subscription based on the first information, or based on the first information and the second information, includes: A third distribution condition is set for the target event, which is used to indicate when the target event changes; Based on the third distribution condition of the target event, the target event is transmitted to the electronic device that sent the first subscription request.
23. The method according to claim 22, characterized in that, The second distribution condition for the target event further includes: a third identifier and an identifier of the electronic device subscribing to the event, wherein the third identifier is used to indicate that the event has been subscribed to.
24. The method according to any one of claims 15-23, characterized in that, Prior to receiving the first subscription request, the method further includes: Send a first service publication message; the first service publication message is used to indicate the 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 includes at least one event that occurred on the first electronic device.
25. The method according to claim 24, characterized in that, The first service publishing message includes third information, which indicates at least one transmission method supported by the event. The at least one transmission method supported by the event indicated by the third information is selected from a pre-registered second set, which includes at least one transmission method supported by events occurring on 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 while the vehicle is running. The transmission method of the event indicated by the first information in the first subscription request is selected from the third information.
26. An electronic device, characterized in that, The electronic device includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, and the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 25.