A permission checking method and system for event subscription
By checking the permissions of event subscriptions in smart vehicles, ensuring that only authorized ECUs can publish or subscribe to events, the problem of unauthorized events occupying bandwidth is solved and the normal operation of communication is achieved.
Patent Information
- Application Number
- CN202210227490.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-08
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2042-03-08
AI Technical Summary
In smart vehicles, unauthorized event publishing and subscriptions lead to on-board Ethernet bandwidth occupies, causing communication blockages.
During the event subscription process, the subscription endpoint information is encrypted, the subscription ciphertext is generated, and the subscription request is filled to the second ECU for permission checking, and the subscription relationship is established only when the subscription permission of the second ECU is passed, so as not to fail to do so. Authorized publishing and subscriptions.
It effectively eliminates unauthorized event publishing and subscription, avoids the use of in-vehicle network bandwidth by invalid messages, and ensures the normal operation of communication.
Smart Images

Figure CN114615049B_ABST
Abstract
Description
Technical Field
[0001] The present specification relates to an in-vehicle device, and more particularly to a method and system for checking permissions for event subscriptions. Background Art
[0002] At present, the communication between ECUs (Electronic Control Units) inside smart vehicles mainly adopts the communication methods of vehicle-mounted Ethernet and service-oriented architecture (SOA), and mainly relies on the SOME / IP (Scalable service-Oriented Middleware over IP) communication protocol.
[0003] However, under this communication protocol, there is no permission control for event publishing and subscription. For example, devices connected to the vehicle Ethernet and the applications running on them can publish or subscribe to events without authorization, which will cause communication to be blocked due to unauthorized invalid events occupying the vehicle Ethernet bandwidth. Summary of the invention
[0004] This specification provides a method and system for checking permissions for event subscriptions to solve or partially solve the technical problem of communication being blocked due to unauthorized invalid events occupying the bandwidth of an in-vehicle Ethernet.
[0005] In order to solve the above technical problems, this specification provides a method for checking permissions for event subscriptions, which is applied to a first ECU and includes:
[0006] During the event subscription process, the first ECU encrypts the subscription endpoint information into a subscription ciphertext, and fills the subscription ciphertext into the subscription request;
[0007] The first ECU sends the subscription request to the second ECU to perform a subscription authority check on the second ECU;
[0008] If the subscription authority check of the second ECU passes, the first ECU and the second ECU establish a subscription relationship.
[0009] Preferably, before event subscription, the method further includes:
[0010] The first ECU and the second ECU discover each other and obtain the publishing endpoint information of the second ECU.
[0011] Preferably, the first ECU encrypts the subscription endpoint information into a subscription ciphertext, specifically including:
[0012] The first ECU encrypts the subscription endpoint information into the subscription ciphertext by using a ciphertext policy attribute-based encryption (CP-ABE) algorithm.
[0013] Preferably, if the subscription authority check of the second ECU passes, the first ECU and the second ECU establish a subscription relationship, which specifically includes:
[0014] If the first ECU and the second ECU are receiving a subscription confirmation message sent by the second ECU, a subscription relationship is established; wherein the subscription confirmation message is sent after the second ECU successfully decrypts the subscription ciphertext.
[0015] Preferably, if the subscription authority check of the second ECU passes, the method further includes:
[0016] The first ECU checks whether the subscription confirmation message has multicast endpoint information;
[0017] If available, the first ECU monitors the multicast IP address and port number in the multicast endpoint information to obtain the multicast event published by the second ECU.
[0018] Preferably, the subscription confirmation message is filled with a publishing ciphertext, and the publishing ciphertext is encrypted by the second ECU and used to check the subscription authority of the first ECU;
[0019] If the subscription authority check of the second ECU passes, the method further includes:
[0020] The first ECU decrypts the release ciphertext;
[0021] If the decryption is successful, it means that the subscription authority check of the first ECU has passed, and the first ECU and the second ECU have established a subscription relationship;
[0022] If the decryption fails, it means that the subscription authority check of the first ECU has not passed, and the first ECU sends a prompt message to the second ECU to prompt the second ECU to terminate the subscription relationship.
[0023] Preferably, the published ciphertext is obtained by the second ECU encrypting the multicast endpoint information or the non-multicast endpoint information in the published endpoint information;
[0024] If the decryption is successful, the method further comprises:
[0025] If the decryption is successful and the subscription confirmation message carries the multicast endpoint information, the first ECU monitors the multicast IP address and port number in the multicast endpoint information to obtain the multicast event published by the second ECU;
[0026] If the decryption is successful and the subscription confirmation message carries non-multicast endpoint information, the first ECU ignores the non-multicast endpoint information and uses the publishing endpoint information of the second ECU to obtain the unicast event published by the second ECU.
[0027] Preferably, the first ECU decrypts the release ciphertext, specifically comprising:
[0028] The first ECU decrypts the release ciphertext using a ciphertext policy attribute-based encryption (CP-ABE) algorithm.
[0029] Another aspect of the present specification provides an electronic controller, comprising:
[0030] The encryption module is used to encrypt the subscription endpoint information into a subscription ciphertext during the event subscription process, and fill the subscription ciphertext into the subscription request;
[0031] A first sending module, used for sending the subscription request to the second ECU, so as to perform a subscription authority check on the second ECU;
[0032] The first subscription establishment module is used to establish a subscription relationship with the second ECU if the subscription authority check of the second ECU passes.
[0033] Another aspect of the present specification provides a method for checking permissions for event subscription, the method being applied to a second ECU, the method comprising:
[0034] During the event subscription process, the second ECU receives a subscription request; the subscription request is filled with a subscription ciphertext, and the subscription ciphertext is obtained by encrypting the subscription endpoint information by the first ECU; the subscription request is used to perform a subscription authority check on the second ECU;
[0035] The second ECU extracts the subscription ciphertext from the subscription request;
[0036] The second ECU decrypts the subscription ciphertext;
[0037] If the decryption is successful, it means that the subscription authority check of the second ECU has passed, and the second ECU and the first ECU have established a subscription relationship.
[0038] Preferably, before event subscription, the method further includes:
[0039] The second ECU and the first ECU discover each other, and send the publishing endpoint information of the second ECU to the first ECU.
[0040] Preferably, the second ECU decrypts the subscription ciphertext, specifically including:
[0041] The second ECU decrypts the subscription ciphertext using a ciphertext policy attribute-based encryption (CP-ABE) algorithm.
[0042] Preferably, if the decryption is successful, the method further comprises:
[0043] The second ECU generates a subscription confirmation message;
[0044] The second ECU sends the subscription confirmation message to the first ECU, so that the first ECU establishes the subscription relationship.
[0045] Preferably, if the decryption is successful, the method further comprises:
[0046] The second ECU encrypts the publishing endpoint information into a publishing ciphertext, and fills the publishing ciphertext into the subscription confirmation message;
[0047] Sending the subscription confirmation message to the first ECU to perform a subscription authority check on the first ECU;
[0048] If the subscription authority check of the first ECU passes, the second ECU establishes a subscription relationship with the first ECU;
[0049] If the subscription authority check of the first ECU fails, the second ECU terminates the subscription relationship.
[0050] Preferably, the second ECU encrypts the publishing endpoint information into a publishing ciphertext, specifically including:
[0051] The second ECU encrypts the publishing endpoint information into the publishing ciphertext by using a ciphertext policy attribute-based encryption (CP-ABE) algorithm.
[0052] Preferably, the second ECU encrypts the publishing endpoint information into a publishing ciphertext, specifically including:
[0053] The second ECU encrypts the multicast endpoint information in the publishing endpoint information into the publishing ciphertext; or
[0054] The second ECU randomly obtains non-multicast endpoint information, and encrypts the non-multicast endpoint information into the publishing ciphertext.
[0055] Another aspect of the present specification provides an electronic controller, comprising:
[0056] A first receiving unit is used to receive a subscription request during an event subscription process; the subscription request is filled with a subscription ciphertext, and the subscription ciphertext is obtained by encrypting the subscription endpoint information by the first ECU; the subscription request is used to perform a subscription authority check on the second ECU;
[0057] An extraction unit, configured to extract the subscription ciphertext from the subscription request;
[0058] A decryption unit, used to decrypt the subscription ciphertext;
[0059] The first establishing unit is used to establish a subscription relationship with the first ECU if the decryption is successful, indicating that the subscription authority check of the second ECU has passed.
[0060] Another aspect of the present specification provides a permission checking system for event subscription, including:
[0061] In the process of event subscription, the first ECU is used to encrypt the subscription endpoint information into a subscription ciphertext, and fill the subscription ciphertext into the subscription request; send the subscription request to the second ECU to perform a subscription authority check on the second ECU;
[0062] The second ECU is used to extract the subscription ciphertext from the subscription request; decrypt the subscription ciphertext; if the decryption is successful, it means that the subscription authority check of the second ECU has passed, and a subscription relationship is established with the first ECU;
[0063] The first ECU is further configured to establish the subscription relationship with the second ECU if the subscription authority check of the second ECU passes.
[0064] In another aspect of the present specification, a method for checking permissions for event subscription is provided, the method being applied to a first ECU, the method comprising:
[0065] During event subscription, the first ECU sends a subscription request to the second ECU;
[0066] The first ECU receives a subscription confirmation message from the second ECU; wherein the subscription confirmation message is used to perform a subscription authority check on the first ECU, and the subscription confirmation message is filled with a publishing ciphertext, and the publishing ciphertext is obtained by encrypting the publishing endpoint information of the event publisher;
[0067] The first ECU decrypts the release ciphertext;
[0068] If the decryption is successful, it means that the subscription authority check of the first ECU has passed, and the first ECU and the second ECU have established a subscription relationship;
[0069] If the decryption fails, it means that the subscription authority check of the first ECU has not passed, and the first ECU sends a prompt message to the second ECU to prompt the second ECU to terminate the subscription relationship.
[0070] Preferably, before event subscription, the method further includes:
[0071] The first ECU and the second ECU discover each other and obtain the publishing endpoint information of the second ECU.
[0072] Preferably, the publishing ciphertext is obtained by the event publisher encrypting the multicast endpoint information or the non-multicast endpoint information in the publishing endpoint information;
[0073] If the decryption is successful, the method further comprises:
[0074] If the decryption is successful and the subscription confirmation message carries the multicast endpoint information, the first ECU monitors the multicast IP address and port number in the multicast endpoint information to obtain the multicast event published by the second ECU;
[0075] If the decryption is successful and the subscription confirmation message carries non-multicast endpoint information, the first ECU ignores the non-multicast endpoint information and uses the publishing endpoint information of the second ECU to obtain the unicast event published by the second ECU.
[0076] Another aspect of the present specification provides an electronic controller, comprising:
[0077] A second sending module, used for sending a subscription request to a second ECU;
[0078] A receiving module, used for receiving a subscription confirmation message from the second ECU; wherein the subscription confirmation message is used to check the subscription authority of the first ECU, and the subscription confirmation message is filled with a publishing ciphertext, and the publishing ciphertext is obtained by encrypting the publishing endpoint information of the event publisher;
[0079] A decryption module, used for decrypting the published ciphertext;
[0080] A second establishing module, configured to establish a subscription relationship with the second ECU if the decryption is successful, indicating that the subscription authority check of the first ECU has passed;
[0081] The third sending module is used to send a prompt message to the second ECU to prompt the second ECU to terminate the subscription relationship if the decryption fails, indicating that the subscription authority check of the first ECU has not passed.
[0082] Another aspect of the present specification provides a method for checking permissions for event subscription, the method being applied to a second ECU, the method comprising:
[0083] During the event subscription process, the second ECU receives a subscription request;
[0084] The second ECU encrypts the publishing endpoint information into a publishing ciphertext, and fills the publishing ciphertext into the subscription confirmation message;
[0085] Sending the subscription confirmation message to the first ECU to perform a subscription authority check on the first ECU;
[0086] If the subscription authority check of the first ECU passes, the second ECU establishes a subscription relationship with the first ECU;
[0087] If the subscription authority check of the first ECU fails, the second ECU terminates the subscription relationship.
[0088] Preferably, before event subscription, the method further includes:
[0089] The second ECU and the first ECU discover each other, and send the publishing endpoint information of the second ECU to the first ECU.
[0090] Preferably, the second ECU encrypts the publishing endpoint information into a publishing ciphertext, specifically including:
[0091] The second ECU encrypts the multicast endpoint information in the publishing endpoint information into the publishing ciphertext; or
[0092] The second ECU randomly obtains non-multicast endpoint information, and encrypts the non-multicast endpoint information into the publishing ciphertext.
[0093] Another aspect of the present specification provides an electronic controller, comprising:
[0094] A second receiving unit is used to receive a subscription request during the event subscription process;
[0095] An encryption unit, used to encrypt the publishing endpoint information into a publishing ciphertext, and fill the publishing ciphertext into a subscription confirmation message;
[0096] A sending unit, used to send the subscription confirmation message to the first ECU, so as to perform a subscription authority check on the first ECU;
[0097] A second establishing unit, configured to establish a subscription relationship with the first ECU if the subscription authority check of the first ECU passes;
[0098] An interruption unit is used to interrupt the subscription relationship if the subscription authority check of the first ECU fails.
[0099] Another aspect of the present specification provides a permission checking system for event subscription, including:
[0100] The first ECU is used to send a subscription request to the second ECU;
[0101] The second ECU is used to receive a subscription request; encrypt the publishing endpoint information into a publishing ciphertext, and fill the publishing ciphertext into a confirmation subscription message; send the confirmation subscription message to the first ECU to perform a subscription authority check on the first ECU; if the subscription authority check of the first ECU passes, establish a subscription relationship with the first ECU; if the subscription authority check of the first ECU fails, send a prompt message to the second ECU to prompt the second ECU to terminate the subscription relationship.
[0102] The first ECU is also used to receive a subscription confirmation message from the second ECU; decrypt the published ciphertext; if the decryption is successful, it means that the subscription authority check of the first ECU has passed, and the subscription relationship is established; if the decryption fails, it means that the subscription authority check of the first ECU has not passed, and the subscription relationship is terminated.
[0103] This specification discloses a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the above method are implemented.
[0104] This specification discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.
[0105] Through one or more embodiments of this specification, this specification has the following beneficial effects or advantages:
[0106] In the process of event subscription, this technical solution encrypts the subscription endpoint information into subscription ciphertext through the first ECU, and fills the subscription ciphertext into the subscription request to check the subscription authority of the second ECU. The subscription relationship between the two parties is established only when the subscription authority check of the second ECU passes, otherwise the two parties do not establish a subscription relationship. It can be seen that this technical solution can ensure that only authorized ECUs can publish or subscribe to events by implementing authority checks in the subscription process, thereby eliminating unauthorized publishing and unauthorized subscription, avoiding a large number of invalid messages from occupying the bandwidth of the in-vehicle network, and ensuring the normal operation of communication.
[0107] The above description is only an overview of the technical solution of this specification. In order to more clearly understand the technical means of this specification, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of this specification more obvious and easy to understand, the specific implementation methods of this specification are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0108] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present specification. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0109] Figure 1 A schematic diagram of the structure of a permission checking system for event subscription according to an embodiment of the present specification is shown;
[0110] Figure 2 A flowchart of a method for checking permissions for event subscription according to an embodiment of the present specification is shown;
[0111] Figure 3 A schematic diagram of a subscription ciphertext according to an embodiment of the present specification is shown;
[0112] Figure 4 A schematic diagram of the structure of an electronic controller according to an embodiment of the present specification is shown;
[0113] Figure 5 Another flow chart of a method for checking permissions for event subscription according to an embodiment of the present specification is shown;
[0114] Figure 6 A schematic diagram of publishing a ciphertext according to an embodiment of the present specification is shown;
[0115] Figure 7 Another structural schematic diagram of an electronic controller according to an embodiment of the present specification is shown;
[0116] Figure 8 Another flow chart of a method for checking permissions for event subscription according to an embodiment of the present specification is shown;
[0117] Fig. 9 Another structural schematic diagram of an electronic controller according to an embodiment of the present specification is shown;
[0118] Fig.10 Another flow chart of a method for checking permissions for event subscription according to an embodiment of the present specification is shown;
[0119] Fig.11 Another structural schematic diagram of an electronic controller according to an embodiment of the present specification is shown;
[0120] Fig.12 A flowchart of Example 1 according to an embodiment of the present specification is shown;
[0121] Fig.13A flowchart of Example 2 according to an embodiment of the present specification is shown;
[0122] Fig.14 A schematic diagram of a computer device according to an embodiment of the present specification is shown. DETAILED DESCRIPTION
[0123] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0124] In order to solve the technical problem that communication is blocked due to unauthorized invalid events occupying the bandwidth of the vehicle Ethernet, the embodiment of the present disclosure discloses a permission checking method and system for event subscription. Figure 1 , is a structural diagram of the permission check system for event subscription. In this system, a first ECU (first electronic controller) and a second ECU (second electronic controller) are included. Among them, the first ECU is the event subscriber and the second ECU is the event publisher. In the process of event subscription, the first ECU and / or the second ECU will each initiate a subscription permission check for the other party, and then complete the subscription permission check of the event subscriber and / or the event publisher in the service discovery phase, ensuring that the subscription process will be completed only when the event subscriber and / or the event publisher pass the subscription permission check; if any of the event subscriber and / or the event publisher fails to pass the subscription permission check, the subscription process will not be established, and communication is naturally impossible, thereby eliminating unauthorized publishing and unauthorized subscription. It can be seen that this solution does not unconditionally establish a subscription relationship and then check after subsequent event transmission, but can perform subscription permission checks in the service discovery phase, so it can avoid a large number of invalid messages from occupying the bandwidth of the in-vehicle network and ensure the normal operation of communication.
[0125] In order to explain the present disclosure in detail, the following embodiments are exemplarily described from the first ECU side and the second ECU side, respectively.
[0126] Please see below Figure 2 The embodiment of this specification discloses a method for checking permissions for event subscription on the first ECU side. The method is used on the first ECU side, and is specifically used for applications on the first ECU side that have event subscription requirements. The method includes the following steps:
[0127] Step 201: During event subscription, the first ECU encrypts subscription endpoint information into subscription ciphertext, and fills the subscription ciphertext into the subscription request.
[0128] Specifically, before event subscription, the first ECU and the second ECU discover each other and obtain the publishing endpoint information of the second ECU. In the process of mutual discovery, the first ECU publishes a search service request in the vehicle Ethernet in a multicast manner. If the second ECU can provide the corresponding service, the second ECU can broadcast a multicast message providing the service in the vehicle Ethernet, or after receiving the search service request sent by the first ECU, respond to the search service request and send the above multicast message to the first ECU. In this way, the two ECUs can discover each other.
[0129] Furthermore, the multicast message carries publishing endpoint information, which is present in the endpoint option field of the multicast message. The publishing endpoint information includes the IP address, transport layer protocol type and port number of the second ECU. Therefore, when the two ECUs discover each other, the first ECU can extract the publishing endpoint information of the second ECU from the multicast message.
[0130] After the two ECUs discover each other, the first ECU will be triggered to subscribe to the event, and then step 201 will be executed.
[0131] In step 201, the subscription endpoint information includes: the IP address, transport layer protocol type and port number of the first ECU. Therefore, the first ECU encrypts the subscription endpoint information into subscription ciphertext using the ciphertext policy attribute-based encryption (CP-ABE) algorithm.
[0132] Since the present embodiment uses the CP-ABE algorithm for security enhancement. Therefore, when the SOME / IP protocol is initialized after each ignition start, a random algorithm is used to generate the public parameters (PK, public parameters) and the master key (MK, master key) required by the CP-ABE encryption algorithm. When the SOME / IP application running on each ECU accesses the SOME / IP protocol, the master key MK and the identity attribute set S of the application itself are used to generate the application's own private key (SK, private key). Furthermore, when registering an event, the event publisher should determine the subscription access control policy for the event, and convert this policy into an access structure tree Tsub that can be used by the CP-ABE algorithm. Similarly, before subscribing to an event, the event subscriber should determine the publishing access control policy for the event, and convert this policy into an access structure tree Tpub that can be used by the CP-ABE algorithm.
[0133] Therefore, when encrypting the subscription endpoint information, the calculation process is expressed as subscription ciphertext Cep=En(PK, Tpub, subscription endpoint information). Further, the subscription ciphertext is filled into the endpoint option field of the subscription request, see Figure 3The slash part is the subscription ciphertext. This subscription request is used to request to subscribe to a specific event group, each of which contains several events.
[0134] Step 202: The first ECU sends a subscription request to the second ECU to perform a subscription authority check on the second ECU.
[0135] Specifically, the first ECU sends the subscription request to the second ECU in a unicast manner. After receiving the subscription request, the second ECU will decrypt the subscription ciphertext to determine whether it has the subscription permission. The specific decryption process is described in the second ECU side in the following embodiment, which will not be repeated here.
[0136] If the subscription permission check of the second ECU passes, step 203 is executed, and the first ECU and the second ECU establish a subscription relationship. If the subscription permission check of the second ECU fails, it means that the attribute set of the second ECU does not meet the access control policy defined by the first ECU. The first ECU believes that the second ECU has no right to send the event, and the two parties will not establish a subscription relationship. Since the second ECU fails to decrypt, the second ECU cannot obtain the subscription endpoint information of the first ECU, so the event sent by the second ECU will not be received by the first ECU, thereby avoiding unauthorized event publishing.
[0137] Specifically, since the subscription confirmation message is sent after the second ECU successfully decrypts the subscription ciphertext, the subscription confirmation message is used to indicate that the subscription permission check of the second ECU has passed, and indicates that the attribute set possessed by the second ECU meets the access control policy defined by the first ECU, and the first ECU believes that the second ECU has the authority to send the event. If the first ECU receives the subscription confirmation message sent by the second ECU, the first ECU and the second ECU establish a subscription relationship.
[0138] In some optional implementations, if the subscription permission check of the second ECU passes and the two parties successfully establish a subscription relationship, the two parties can send and receive events normally. In this case, the first ECU will also check whether the subscription message has multicast endpoint information. The multicast endpoint information carries a multicast IP address and port number for publishing multicast events. If it is confirmed that the subscription message has multicast endpoint information, the first ECU monitors the multicast IP address and port number in the multicast endpoint information to obtain the multicast events published by the second ECU.
[0139] In some optional implementations, both parties need to check each other's subscription permissions to ensure the legitimacy of the subscription. If the subscription permission check of the second ECU passes, it means that the attribute set possessed by the second ECU meets the access control policy defined by the first ECU, that is, the first ECU believes that the second ECU has the authority to send the event. Then the second ECU will also check whether the first ECU has the subscription permission. In the specific implementation process, the confirmation subscription message sent by the second ECU is filled with the release ciphertext, and the release ciphertext is encrypted by the second ECU and used to check the subscription permission of the first ECU. Therefore, after receiving the confirmation subscription message, the first ECU extracts the release ciphertext from the confirmation subscription message and decrypts it. Since both parties use the CP-ABE algorithm for encryption, the first ECU uses the CP-ABE algorithm to decrypt the release ciphertext.
[0140] If the decryption is successful, it means that the attribute set of the first ECU meets the access control policy defined by the second ECU, and the subscription permission check of the first ECU passes, then the two parties establish a subscription relationship. If the decryption fails, it means that the subscription permission check of the first ECU fails, and the two parties terminate the subscription relationship.
[0141] Furthermore, since the publishing ciphertext is obtained by encrypting the multicast endpoint information or non-multicast endpoint information (such as unicast endpoint information) in the publishing endpoint information by the second ECU, when the decryption is successful, if the subscription message is confirmed to carry the multicast endpoint information, the first ECU monitors the multicast IP address and port number in the multicast endpoint information to obtain the multicast event published by the second ECU. If the subscription message is confirmed to carry the non-multicast endpoint information, since the non-multicast endpoint information is only used to determine whether the first ECU has the subscription authority and is not used as an event acquisition address, the first ECU ignores the non-multicast endpoint information and uses the publishing endpoint information of the second ECU to obtain the unicast event published by the second ECU.
[0142] In the above technical solution, by describing the subscription permission check for the second ECU from the perspective of the first ECU, and implementing the subscription permission check required by the second ECU, the subscription permission check is initiated by one party or both parties, and the subscription permission check of the event subscriber and / or event publisher is completed in the service discovery phase, ensuring that the subscription process is completed only when the event subscriber and / or event publisher pass the subscription permission check; if any of the event subscriber and / or event publisher fails to pass the subscription permission check, the subscription process will be interrupted, and communication will naturally be impossible, thereby eliminating unauthorized publishing and unauthorized subscription. This technical solution does not unconditionally establish a subscription relationship and wait for subsequent event transmissions before making a check, but rather performs a subscription permission check in the service discovery phase, thereby avoiding a large number of invalid messages from occupying the bandwidth of the in-vehicle network and ensuring the normal operation of communication.
[0143] In addition, this technical solution uses the CP-ABE algorithm to enhance the security of the event publishing and event subscription process of the SOME / IP SD protocol, and can combine encryption with attribute-based access control to achieve fine-grained access control of the one-to-many communication model in the vehicle network. Compared with the pre-set certificates, keys and other methods, it has sufficient configuration convenience, flexibility and scalability. Furthermore, since the CP-ABE algorithm is only used to encrypt address metadata such as IP addresses, protocol types, ports, etc., rather than encrypting the huge amount of actual transmission content, it reduces the performance consumption of encryption and decryption, and has sufficient security.
[0144] Based on the same inventive concept as the above-mentioned embodiment, the following embodiment discloses an electronic controller from the perspective of a first ECU. Figure 4 ,include:
[0145] The encryption module 401 is used to encrypt the subscription endpoint information into a subscription ciphertext during the event subscription process, and fill the subscription ciphertext into the subscription request;
[0146] A first sending module 402, used to send a subscription request to a second ECU, so as to perform a subscription authority check on the second ECU;
[0147] The first subscription establishing module 403 is used to establish a subscription relationship with the second ECU if the subscription authority check of the second ECU passes.
[0148] Based on the same inventive concept as the above embodiment, the following embodiment discloses a permission checking method for event subscription from the second ECU side. The method is applied to the second ECU, and is specifically used for applications with publishing requirements on the second ECU. Figure 5 , the method comprising:
[0149] Step 501: During the event subscription process, the second ECU receives a subscription request.
[0150] Specifically, before event subscription, the second ECU and the first ECU discover each other, and send the publishing endpoint information of the second ECU to the first ECU. In the process of mutual discovery, the first ECU publishes a search service request in the vehicle Ethernet in a multicast manner. If the second ECU can provide the corresponding service, the second ECU can broadcast a multicast message providing the service in the vehicle Ethernet, or after receiving the search service request sent by the first ECU, respond to the search service request and send a multicast message providing the service to the first ECU. In this way, the two ECUs can discover each other.
[0151] Furthermore, the multicast message carries the publishing endpoint information, which is present in the endpoint option field of the multicast message. The publishing endpoint information includes the IP address, transport layer protocol type and port number of the second ECU. Therefore, when the two ECUs discover each other, the second ECU will fill the publishing endpoint information into the multicast message and send it to the first ECU for the first ECU to extract.
[0152] After the two ECUs discover each other, the first ECU will be triggered to subscribe to the event, thereby generating a subscription request. Specifically, the subscription request is filled with a subscription ciphertext, and the subscription ciphertext is obtained by encrypting the subscription endpoint information of the first ECU. The specific encryption process can be found in the above embodiment and will not be repeated here. Since the subscription request is used to check the subscription authority of the second ECU, the second ECU will perform the following steps after receiving the subscription request.
[0153] Step 502: The second ECU extracts the subscription ciphertext from the subscription request.
[0154] Specifically, since the subscription ciphertext is filled into the endpoint option field of the subscription request, the second ECU can extract the subscription ciphertext from the endpoint option field after receiving the subscription request.
[0155] Step 503: The second ECU decrypts the subscription ciphertext.
[0156] Since the subscription ciphertext is encrypted by the CP-ABE algorithm, the second ECU decrypts the subscription ciphertext by using the CP-ABE algorithm.
[0157] During the decryption process, the second ECU uses its own private key SK and public parameter PK to decrypt the subscription ciphertext to obtain the subscription endpoint information therein. The decryption algorithm is: subscription endpoint information = Dec (SK, PK, Cep).
[0158] If the decryption is successful, the second ECU obtains the subscription endpoint information of the first ECU, and it indicates that the subscription authority check of the second ECU has passed, and step 504 is executed: the second ECU and the first ECU establish a subscription relationship. If the decryption fails, it means that the subscription authority check of the second ECU has not passed, and the attribute set of the second ECU does not meet the access control policy defined by the first ECU. And because the decryption failure causes the second ECU to fail to obtain the subscription endpoint information of the first ECU, the events sent by the second ECU will not be received by the first ECU, thereby avoiding unauthorized event publishing.
[0159] In some optional embodiments, if the second ECU decrypts the subscription endpoint information of the first ECU from the subscription ciphertext, the second ECU decrypts successfully, indicating that the subscription authority check of the second ECU has passed. The second ECU will continue to update the event subscription related information, generate a confirmation subscription message, and send the confirmation subscription message to the first ECU, so that the two parties establish a subscription relationship and subsequently send and receive events normally.
[0160] In some optional embodiments, since both parties need to check each other's subscription permissions to ensure the legitimacy of the subscription, if the subscription permission check of the second ECU passes, it means that the attribute set possessed by the second ECU meets the access control policy defined by the first ECU, that is, the first ECU believes that the second ECU has the permission to send the event. Then the second ECU will also check whether the first ECU has the subscription permission. In the specific implementation process, the second ECU encrypts the publishing endpoint information into a publishing ciphertext. When encrypting, the second ECU uses the CP-ABE algorithm to encrypt the publishing endpoint information into a publishing ciphertext. Specifically, if the second ECU subsequently sends the event in a multicast manner, the second ECU will encrypt the multicast endpoint information (i.e., multicast IP address, protocol, port, etc.) in the publishing endpoint information into a publishing ciphertext, such as the ciphertext Cmp, and the encryption calculation process is expressed as ciphertext Cmp=En(PK, Tsub, multicast endpoint information). If the second ECU subsequently sends the event in a non-multicast manner (e.g., unicast manner), the second ECU randomly obtains the non-multicast endpoint information (e.g., unicast endpoint information), and uses the CP-ABE algorithm to encrypt the non-multicast endpoint information to generate a published ciphertext, such as ciphertext Crep, and the encryption calculation process is expressed as ciphertext Crep = En (PK, Tsub, unicast endpoint information). It is worth noting that the non-multicast endpoint information of this embodiment is only used to check permissions and is not used as an event acquisition address.
[0161] Further, the second ECU fills the published ciphertext into the subscription confirmation message. Continuing with the above example, the second ECU fills the ciphertext Cmp or the ciphertext Crep into the multicast option field in the subscription confirmation message. Figure 6 , the underlined part is the published ciphertext.
[0162] The second ECU sends a subscription confirmation message to the first ECU to check the subscription authority of the first ECU. The subscription confirmation message is decrypted on the first ECU side to determine whether it has the subscription authority. If the decryption is successful, it means that the subscription authority check of the first ECU has passed, and the two parties establish a subscription relationship. If the decryption fails, it means that the subscription authority check of the first ECU has not passed. Even if the second ECU's inspection authority passes, the two will not establish a subscription relationship. Therefore, the first ECU sends a prompt message to the second ECU to prompt the second ECU to interrupt the subscription relationship. Furthermore, the second ECU cleans up the aforementioned updated event subscription related information according to the prompt message to interrupt the subscription relationship.
[0163] The above is a description of the implementation of the subscription permission check required by the first ECU and the implementation of the subscription permission check for the first ECU from the perspective of the second ECU. This technical solution initiates the subscription permission check by one or both parties, and completes the subscription permission check of the event subscriber and / or event publisher in the service discovery phase, ensuring that the subscription process is completed only when the event subscriber and / or event publisher pass the subscription permission check; if any of the event subscriber and / or event publisher fails the subscription permission check, the subscription process will be interrupted, and communication will naturally be impossible, thereby eliminating unauthorized publishing and unauthorized subscription. This technical solution does not unconditionally establish a subscription relationship and wait for subsequent event transmissions before performing a check, but rather performs a subscription permission check in the service discovery phase, thereby avoiding a large number of invalid messages from occupying the in-vehicle network bandwidth and ensuring the normal operation of communications.
[0164] In addition, this technical solution uses the CP-ABE algorithm to enhance the security of the event publishing and event subscription process of the SOME / IP SD protocol, and can combine encryption with attribute-based access control to achieve fine-grained access control of the one-to-many communication model in the vehicle network. Compared with the pre-set certificates, keys and other methods, it has sufficient configuration convenience, flexibility and scalability. Furthermore, since the CP-ABE algorithm is only used to encrypt address metadata such as IP addresses, protocol types, ports, etc., rather than encrypting the huge amount of actual transmission content, it reduces the performance consumption of encryption and decryption, and has sufficient security.
[0165] Based on the same inventive concept as the above-mentioned embodiment, the following embodiment discloses an electronic controller from the perspective of a second ECU. Figure 7 ,include:
[0166] The first receiving unit 701 is used to receive a subscription request during the event subscription process; the subscription request is filled with a subscription ciphertext, and the subscription ciphertext is obtained by encrypting the subscription endpoint information of the first ECU; the subscription request is used to perform a subscription authority check on the second ECU;
[0167] An extraction unit 702, configured to extract a subscription ciphertext from a subscription request;
[0168] A decryption unit 703, used to decrypt the subscription ciphertext;
[0169] The first establishing unit 704 is used to establish a subscription relationship with the first ECU if the decryption is successful, indicating that the subscription authority check of the second ECU has passed.
[0170] Based on the same inventive concept, the following embodiment discloses a permission checking system for event subscription. Figure 1 The structural diagram includes:
[0171] In the event subscription process, the first ECU is used to encrypt the subscription endpoint information into a subscription ciphertext, and fill the subscription ciphertext into the subscription request; send the subscription request to the second ECU to perform a subscription authority check on the second ECU;
[0172] The second ECU is used to extract the subscription ciphertext from the subscription request and decrypt the subscription ciphertext. If the decryption is successful, it means that the subscription authority check of the second ECU has passed and a subscription relationship is established with the first ECU.
[0173] The first ECU is further configured to establish a subscription relationship with the second ECU if the subscription authority check of the second ECU passes.
[0174] The above embodiment is an inventive concept based on the first ECU initiating a subscription permission check for the second ECU. The following embodiment discloses a permission check method for event subscription based on the first ECU implementing the subscription permission check required by the second ECU. The method is applied to the first ECU, specifically used in applications with subscription time requirements. Figure 8 , comprising the following steps:
[0175] Step 801: During event subscription, the first ECU sends a subscription request to the second ECU.
[0176] Specifically, before event subscription, the first ECU and the second ECU discover each other and obtain the publishing endpoint information of the second ECU. In the process of mutual discovery, the first ECU publishes a search service request in the vehicle Ethernet in a multicast manner. If the second ECU can provide the corresponding service, the second ECU can broadcast a multicast message providing the service in the vehicle Ethernet, or after receiving the search service request sent by the first ECU, respond to the search service request and send the above multicast message to the first ECU. In this way, the two ECUs can discover each other.
[0177] Furthermore, the multicast message carries publishing endpoint information, which is present in the endpoint option field of the multicast message. The publishing endpoint information includes the IP address, transport layer protocol type and port number of the second ECU. Therefore, when the two ECUs discover each other, the first ECU can extract the publishing endpoint information of the second ECU from the multicast message.
[0178] After the two ECUs discover each other, the first ECU will be triggered to subscribe to the event, and then execute step 801. Specifically, the first ECU fills the subscription endpoint information (including: the IP address of the first ECU, the transport layer protocol type and the port number) into the subscription request and sends it to the second ECU. The IP address, the transport layer protocol type and the port number of the first ECU are located in the endpoint option field of the subscription request.
[0179] In some optional implementations, the first ECU fills the subscription endpoint information into the subscription request and sends the subscription request to the second ECU. In this solution, the first ECU does not need to initiate a subscription authority check on the second ECU.
[0180] In some optional implementations, the first ECU will initiate a subscription permission check on the second ECU. Specifically, the first ECU encrypts the subscription endpoint information into a subscription ciphertext, fills the subscription ciphertext into a subscription request, and sends the subscription request to the second ECU to initiate a subscription permission check on the second ECU. The specific implementation process can be found in the above embodiment, which will not be described in detail in this implementation.
[0181] Step 802: The first ECU receives a subscription confirmation message from the second ECU.
[0182] When the second ECU receives the subscription request, it will generate a subscription confirmation message, or generate a subscription confirmation message after successfully decrypting the subscription request. The subscription confirmation message is filled with the publishing ciphertext, which is obtained by encrypting the publishing endpoint information of the event publisher. Since the subscription confirmation message is used to check the subscription authority of the first ECU, the first ECU will receive the subscription confirmation request and execute the following steps.
[0183] Step 803: The first ECU decrypts and publishes the ciphertext.
[0184] Specifically, after receiving the subscription confirmation message, the first ECU extracts the published ciphertext from the subscription confirmation message and decrypts it. Since both parties use the CP-ABE algorithm for encryption, the first ECU uses the CP-ABE algorithm to decrypt the published ciphertext.
[0185] Specifically, if the decryption is successful, it means that the attribute set of the first ECU meets the access control policy defined by the second ECU, and the subscription authority check of the first ECU passes, and step 804 is executed: the first ECU and the second ECU establish a subscription relationship. If the decryption fails, it means that the subscription authority check of the first ECU fails, and step 805: a prompt message is sent to the second ECU to prompt the second ECU to terminate the subscription relationship.
[0186] Furthermore, since the published ciphertext is obtained by encrypting the multicast endpoint information or non-multicast endpoint information (such as unicast endpoint information) in the published endpoint information by the event publisher, when the decryption is successful, if it is confirmed that the subscription message carries the multicast endpoint information, the first ECU monitors the multicast IP address and port number in the multicast endpoint information to obtain the multicast event published by the second ECU. If it is confirmed that the subscription message carries the non-multicast endpoint information, since the non-multicast endpoint information is only used to determine whether the first ECU has the subscription authority and is not used as the event acquisition address, the first ECU ignores the non-multicast endpoint information and uses the publishing endpoint information of the second ECU to obtain the unicast event published by the second ECU.
[0187] The above technical solution is implemented on the basis that the first ECU implements the subscription authority check required by the second ECU. Based on the same inventive concept as in the above embodiment, the embodiment of this specification also provides an electronic controller from the perspective of the first ECU, see Fig. 9 ,include:
[0188] The second sending module 901 is used to send a subscription request to the second ECU;
[0189] The receiving module 902 is used to receive a subscription confirmation message from the second ECU; wherein the subscription confirmation message is used to check the subscription authority of the first ECU, and the subscription confirmation message is filled with a publishing ciphertext, which is obtained by encrypting the publishing endpoint information of the event publisher;
[0190] Decryption module 903, used to decrypt and publish ciphertext;
[0191] The second establishing module 904 is used to establish a subscription relationship with the second ECU if the decryption is successful, indicating that the subscription authority check of the first ECU has passed;
[0192] The third sending module 905 is used to send a prompt message to the second ECU to prompt the second ECU to terminate the subscription relationship if the decryption fails, indicating that the subscription authority check of the first ECU has not passed.
[0193] Based on the same inventive concept as in the above-mentioned embodiment, the embodiment of this specification provides a permission checking method for event subscription from the second ECU side. The method is applied to the second ECU, specifically used in an application with publishing requirements. Fig.10 , comprising the following steps:
[0194] Step 1001: During event subscription, the second ECU receives a subscription request.
[0195] Before event subscription, the second ECU and the first ECU discover each other and send the publishing endpoint information of the second ECU to the first ECU. In the process of mutual discovery, the first ECU publishes a search service request in the vehicle Ethernet in a multicast manner. If the second ECU can provide the corresponding service, the second ECU can broadcast a multicast message providing the service in the vehicle Ethernet, or after receiving the search service request sent by the first ECU, respond to the search service request and send a multicast message providing the service to the first ECU. In this way, the two ECUs can discover each other.
[0196] Furthermore, the multicast message carries the publishing endpoint information, which is present in the multicast message in the form of an endpoint option field. The publishing endpoint information includes the IP address, transport layer protocol type and port number of the second ECU. Therefore, when the two ECUs discover each other, the second ECU will fill the publishing endpoint information into the multicast message and send it to the first ECU for the first ECU to extract.
[0197] In some optional implementations, after the two ECUs discover each other, the first ECU will be triggered to subscribe to events, thereby generating a subscription request. Specifically, the subscription request is filled with a subscription ciphertext, and the subscription ciphertext is obtained by encrypting the subscription endpoint information of the first ECU. For the specific encryption process, please refer to the aforementioned embodiment, which will not be repeated here. Since the subscription request is used to check the subscription authority of the second ECU, after the second ECU receives the subscription request, it will extract the subscription ciphertext from the subscription request and decrypt the subscription ciphertext. If the decryption is successful, it means that the subscription authority check of the second ECU has passed, and the second ECU and the first ECU have established a subscription relationship. If the decryption fails, it means that the subscription authority check of the second ECU has not passed, and the second ECU interrupts the subscription relationship. For the specific implementation process, please refer to the aforementioned embodiment, which will not be repeated here.
[0198] In some optional implementations, after the two ECUs discover each other, the first ECU will be triggered to subscribe to events, thereby generating a subscription request. In this embodiment, the first ECU will not initiate a subscription permission check for the second ECU.
[0199] For the second ECU, after receiving the subscription request, if it wants to initiate a subscription authority check for the first ECU, it will execute the following steps.
[0200] Step 1002: The second ECU encrypts the publishing endpoint information into a publishing ciphertext, and fills the publishing ciphertext into the subscription confirmation message.
[0201] Specifically, during encryption, the second ECU uses the CP-ABE algorithm to encrypt the publishing endpoint information into a publishing ciphertext. Specifically, if the second ECU subsequently sends the event in a multicast manner, the second ECU encrypts the multicast endpoint information (i.e., multicast IP address, protocol, port, etc.) in the publishing endpoint information into a publishing ciphertext, such as the ciphertext Cmp, and the encryption calculation process is represented by the ciphertext Cmp=En(PK, Tsub, multicast endpoint information). If the second ECU subsequently sends the event in a non-multicast manner (e.g., unicast manner), the second ECU randomly obtains the non-multicast endpoint information (e.g., unicast endpoint information), and uses the CP-ABE algorithm to encrypt the non-multicast endpoint information to generate a publishing ciphertext, such as the ciphertext Crep, and the encryption calculation process is represented by the ciphertext Crep=En(PK, Tsub, unicast endpoint information). It is worth noting that the non-multicast endpoint information in this embodiment is only used to check permissions and is not used as an event acquisition address.
[0202] Further, the second ECU fills the published ciphertext into the subscription confirmation message. Continuing with the above example, the second ECU fills the ciphertext Cmp or the ciphertext Crep into the multicast option field in the subscription confirmation message. Figure 6 , the underlined part is the published ciphertext.
[0203] Step 1003: Send a subscription confirmation message to the first ECU to perform a subscription authority check on the first ECU.
[0204] Specifically, the first ECU performs an authority check by decrypting the publishing ciphertext in the subscription confirmation message. If the subscription authority check of the first ECU passes, step 1004 is executed: the second ECU establishes a subscription relationship with the first ECU. If the subscription authority check of the first ECU fails, step 1005 is executed: the second ECU terminates the subscription relationship.
[0205] Based on the same inventive concept as in the above-mentioned embodiment, the embodiment of this specification further provides an electronic controller from the second ECU side, see Fig.11 ,include:
[0206] The second receiving unit 1101 is used to receive a subscription request during the event subscription process;
[0207] The encryption unit 1102 is used to encrypt the publishing endpoint information into a publishing ciphertext, and fill the publishing ciphertext into the subscription confirmation message;
[0208] The sending unit 1103 is used to send a subscription confirmation message to the first ECU to perform a subscription authority check on the first ECU;
[0209] The second establishing unit 1104 is used to establish a subscription relationship with the first ECU if the subscription authority check of the first ECU passes;
[0210] The interruption unit 1105 is configured to interrupt the subscription relationship if the subscription authority check of the first ECU fails.
[0211] Based on the same inventive concept as in the above-mentioned embodiment, this embodiment of the specification also provides a permission checking system for event subscription. Figure 1 The structural diagram includes:
[0212] The first ECU is used to send a subscription request to the second ECU;
[0213] The second ECU is used to receive a subscription request; encrypt the publishing endpoint information into a publishing ciphertext, and fill the publishing ciphertext into a confirmation subscription message; send the confirmation subscription message to the first ECU to perform a subscription authority check on the first ECU; if the subscription authority check of the first ECU passes, establish a subscription relationship with the first ECU; if the subscription authority check of the first ECU fails, send a prompt message to the second ECU to prompt the second ECU to interrupt the subscription relationship.
[0214] The first ECU is also used to receive a subscription confirmation message from the second ECU; decrypt and publish the ciphertext; if the decryption is successful, it means that the subscription authority check of the first ECU has passed and a subscription relationship is established; if the decryption fails, it means that the subscription authority check of the first ECU has not passed and the subscription relationship is terminated.
[0215] Based on the same inventive concept as in the aforementioned embodiment, the embodiment of this specification further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of any of the aforementioned methods are implemented.
[0216] In order to further illustrate and explain the present disclosure, the following Example 1 specifically describes the technical solution of this embodiment by taking the process in which the first ECU initiates a subscription authority check for the second ECU. Fig.12 Prior to this, both the first ECU and the second ECU need to be initialized for the CP-ABE algorithm.
[0217] Step 1201: The first ECU sends a search service message. Specifically, the first ECU sends the search service message in a multicast manner in the vehicle Ethernet.
[0218] Step 1202 , the second ECU providing the corresponding service actively sends a multicast message providing the service in the vehicle Ethernet, or passively responds to the multicast message providing the service after receiving the search service message.
[0219] Among them, the endpoint option field of the multicast message carries the publishing endpoint information, including the IP address, transport layer protocol type and port number of the second ECU.
[0220] Step 1203: After obtaining the publishing endpoint information, the first ECU encrypts the subscription endpoint information into a subscription ciphertext and fills it into the subscription request.
[0221] First, the subscription endpoint information of the first ECU (i.e., the IP address, transport layer protocol type, and port number of the first ECU) is encrypted using the CP-ABE algorithm to generate a subscription ciphertext Cep. The calculation process is expressed as subscription ciphertext Cep=En(PK, Tpub, subscription endpoint information).
[0222] Secondly, fill the generated subscription ciphertext Cep into the endpoint option field of the subscription request, see Figure 3 .
[0223] Step 1204: The first ECU sends a subscription request to the second ECU. Specifically, the first ECU sends the subscription request in a unicast manner.
[0224] Step 1205: After receiving the subscription request, the second ECU extracts the subscription ciphertext in the subscription request and decrypts it.
[0225] Specifically, the second ECU uses its own private key SK and public parameter PK to decrypt the subscription ciphertext Cep to obtain the plaintext of the subscription endpoint information. The decryption algorithm is expressed as subscription endpoint information=Dec(SK, PK, Cep).
[0226] If the decryption is successful, it means that the attribute set of the second ECU meets the access control policy defined by the first ECU, that is, the first ECU believes that the second ECU has the authority to send the event, and executes step 1206: the second ECU updates the event subscription related information and replies to confirm the subscription message. Thus, the two parties establish a subscription relationship, and subsequently send and receive events normally.
[0227] If the decryption fails, it means that the attribute set of the second ECU does not meet the access control policy defined by the first ECU, and the first ECU believes that the second ECU has no right to send the event. The two parties will not establish a subscription relationship, and since the second ECU has not obtained the subscription endpoint information of the first ECU, the subsequent events sent by the second ECU will not be received by the first ECU, thereby avoiding unauthorized event publishing.
[0228] Example 2 below specifically illustrates the technical solution of this embodiment by taking the process in which the second ECU initiates a subscription authority check for the first ECU. Fig.13 Prior to this, both the first ECU and the second ECU need to be initialized for the CP-ABE algorithm.
[0229] Step 1301: The first ECU sends a search service message in the vehicle Ethernet in a multicast manner.
[0230] Step 1302 : The second ECU providing the corresponding service actively sends a multicast message providing the service in the vehicle Ethernet, or passively responds to the multicast message providing the service after receiving the service search message.
[0231] Among them, the endpoint option field of the multicast message carries the publishing endpoint information, including the IP address, transport layer protocol type and port number of the second ECU.
[0232] Step 1303: After receiving the publishing endpoint information, the first ECU sends a subscription request to the second ECU in a unicast manner.
[0233] Step 1304: After receiving the subscription request, the second ECU updates event subscription related information, such as the number of subscribers and subscriber endpoint information.
[0234] Step 1305, if the second ECU subsequently sends the event in a multicast manner, the second ECU uses the CP-ABE algorithm to encrypt the multicast endpoint information (i.e., multicast IP address, protocol, port, etc.) to generate a published ciphertext Cmp, and the encryption calculation process is expressed as Cmp=En(PK, Tsub, multicast endpoint information).
[0235] Step 1306, if the second ECU subsequently sends the event in unicast mode, randomly generate a non-multicast endpoint information (such as unicast endpoint information), and use the CP-ABE algorithm to encrypt and generate the published ciphertext Crep. The encryption calculation process is expressed as Crep = En (PK, Tsub, unicast endpoint information).
[0236] Step 1307: The second ECU fills the generated Cmp or Crep into the subscription confirmation message.
[0237] Specifically, fill in the multicast option field in the subscription confirmation message, such as Figure 6 The slashed part is shown.
[0238] Step 1308: The second ECU sends a subscription confirmation message to confirm the subscription request.
[0239] The subscription confirmation message carries the multicast option field generated above, that is, all subscription confirmation messages that need to check the subscriber's authority have the multicast option.
[0240] Step 1309: After receiving the subscription confirmation message, the first ECU extracts the published ciphertext and decrypts it.
[0241] Specifically, the first ECU uses its own private key SK and public parameter PK to try to decrypt to obtain plain text, and the decryption algorithm is expressed as M=Dec(SK, PK, Cmp or Crep).
[0242] Step 1310, if the decryption is successful, a subscription relationship is established. Specifically, if the IP address is a multicast address, the first ECU opens and listens to the multicast address and port; if the IP address is a non-multicast address (such as a unicast address), the first ECU ignores all information in the multicast option. It is worth noting that as long as the decryption is successful, regardless of whether it carries a multicast address, the two parties continue to establish a subscription relationship between the two parties and send and receive events normally.
[0243] Step 1311: If the decryption fails, a prompt message is sent to the second ECU to prompt the second ECU to terminate the subscription relationship. Specifically, if the decryption fails, it means that the attribute set of the first ECU does not meet the access control policy defined by the second ECU, and the second ECU believes that the first ECU has no right to subscribe to and receive the event, and the two parties will not establish a subscription relationship. In addition, step 1312 is executed: the second ECU cleans up the previously updated event subscription related information to terminate the subscription relationship.
[0244] It is worth noting that, since both the first ECU and the second ECU can initiate a subscription authority check on each other, the above example 1 and the above example 2 can be combined to perform mutual authority checks to further ensure the legitimacy of the subscription event.
[0245] Based on the same inventive concept as in the above-mentioned embodiment, the embodiment of this specification also provides a computer device, such as Fig.14 As shown, it includes a memory 1404, a processor 1402, and a computer program stored in the memory 1404 and executable on the processor 1402. When the processor 1402 executes the program, the steps of any of the above methods are implemented.
[0246] Among them, Fig.14 In the embodiment of the present invention, a bus architecture (represented by bus 1400) is shown, and bus 1400 may include any number of interconnected buses and bridges, and bus 1400 links various circuits including one or more processors represented by processor 1402 and memory represented by memory 1404. Bus 1400 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 1405 provides an interface between bus 1400 and receiver 1401 and transmitter 1403. Receiver 1401 and transmitter 1403 may be the same element, namely a transceiver, providing a unit for communicating with various other terminal devices over a transmission medium. Processor 1402 is responsible for managing bus 1400 and general processing, while memory 1404 may be used to store data used by processor 1402 when performing operations.
[0247] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general purpose systems may also be used together with the teachings based thereon. Based on the above description, it is apparent that the structure required to construct such systems is. In addition, this specification is not directed to any particular programming language. It should be understood that the contents of this specification described herein may be implemented using various programming languages, and the description of the specific languages above is intended to disclose the best mode of implementation of this specification.
[0248] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of this description can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0249] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present specification, the various features of the present specification are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: the claimed specification requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, the inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present specification.
[0250] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0251] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of this specification and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0252] The various component embodiments of this specification may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components of a gateway, a proxy server, or a system according to an embodiment of this specification. This specification may also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing this specification may be stored on a computer-readable medium, or may have the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0253] It should be noted that the above embodiments illustrate rather than limit the present specification, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present specification may be implemented with the aid of hardware comprising a number of different elements and with the aid of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
Claims
1. A method for checking permissions for event subscription, the method being applied to a first ECU, the method comprising: During the event subscription process, the first ECU encrypts the subscription endpoint information into a subscription ciphertext, and fills the subscription ciphertext into the subscription request; The first ECU sends the subscription request to the second ECU to perform a subscription authority check on the second ECU; If the subscription authority check of the second ECU passes, the first ECU and the second ECU establish a subscription relationship, specifically including: if a confirmation subscription message sent by the second ECU is received, the first ECU and the second ECU establish a subscription relationship; wherein, the confirmation subscription message is sent after the second ECU successfully decrypts the subscription ciphertext, the confirmation subscription message is filled with the publishing ciphertext, and the publishing ciphertext is encrypted by the second ECU by encrypting the multicast endpoint information or non-multicast endpoint information in the publishing endpoint information and used to check the subscription authority of the first ECU.
2. The method according to claim 1, before event subscription, the method further comprises: The first ECU and the second ECU discover each other and obtain the publishing endpoint information of the second ECU.
3. The method according to claim 1, wherein the first ECU encrypts the subscription endpoint information into a subscription ciphertext, specifically comprising: The first ECU encrypts the subscription endpoint information into the subscription ciphertext by using a ciphertext policy attribute-based encryption (CP-ABE) algorithm.
4. The method according to claim 1, if the subscription authority check of the second ECU passes, the method further comprises: The first ECU checks whether the subscription confirmation message has multicast endpoint information; If available, the first ECU monitors the multicast IP address and port number in the multicast endpoint information to obtain the multicast event published by the second ECU.
5. The method according to claim 1, if the subscription authority check of the second ECU passes, the method further comprises: The first ECU decrypts the release ciphertext; If the decryption is successful, it means that the subscription authority check of the first ECU has passed, and the first ECU and the second ECU have established a subscription relationship; If the decryption fails, it means that the subscription authority check of the first ECU has not passed, and the first ECU sends a prompt message to the second ECU to prompt the second ECU to terminate the subscription relationship.
6. The method according to claim 5, if the decryption is successful, the method further comprises: If the decryption is successful and the subscription confirmation message carries the multicast endpoint information, the first ECU monitors the multicast IP address and port number in the multicast endpoint information to obtain the multicast event published by the second ECU; If the decryption is successful and the subscription confirmation message carries non-multicast endpoint information, the first ECU ignores the non-multicast endpoint information and uses the publishing endpoint information of the second ECU to obtain the unicast event published by the second ECU.
7. The method according to claim 5, wherein the first ECU decrypts the release ciphertext, specifically comprising: The first ECU decrypts the release ciphertext using a ciphertext policy attribute-based encryption (CP-ABE) algorithm.
8. An electronic controller, the electronic controller being a first ECU, the electronic controller comprising: The encryption module is used to encrypt the subscription endpoint information into a subscription ciphertext during the event subscription process, and fill the subscription ciphertext into the subscription request; A first sending module, used for sending the subscription request to the second ECU, so as to perform a subscription authority check on the second ECU; The first subscription establishment module is used to establish a subscription relationship with the second ECU if the subscription authority check of the second ECU is passed, specifically including: if a confirmation subscription message sent by the second ECU is received, the first ECU and the second ECU establish a subscription relationship; wherein the confirmation subscription message is sent by the second ECU after successfully decrypting the subscription ciphertext, the confirmation subscription message is filled with the publishing ciphertext, and the publishing ciphertext is encrypted by the second ECU by encrypting the multicast endpoint information or non-multicast endpoint information in the publishing endpoint information and used to check the subscription authority of the first ECU.
9. A method for checking permissions for event subscription, the method being applied to a second ECU, the method comprising: During the event subscription process, the second ECU receives a subscription request; The subscription request is filled with a subscription ciphertext, and the subscription ciphertext is obtained by encrypting the subscription endpoint information by the first ECU; The subscription request is used to perform a subscription authority check on the second ECU; The second ECU extracts the subscription ciphertext from the subscription request; The second ECU decrypts the subscription ciphertext; If the decryption is successful, it means that the subscription authority check of the second ECU is passed. The second ECU encrypts the multicast endpoint information in the publishing endpoint information into the publishing ciphertext or randomly obtains the non-multicast endpoint information and encrypts it into the publishing ciphertext, and fills the publishing ciphertext into the subscription confirmation message; The subscription confirmation message is sent to the first ECU to perform a subscription authority check on the first ECU; if the subscription authority check of the first ECU passes, the second ECU and the first ECU establish a subscription relationship.
10. The method according to claim 9, before event subscription, the method further comprises: The second ECU and the first ECU discover each other, and send the publishing endpoint information of the second ECU to the first ECU.
11. The method according to claim 9, wherein the second ECU decrypts the subscription ciphertext, specifically comprising: The second ECU decrypts the subscription ciphertext using a ciphertext policy attribute-based encryption (CP-ABE) algorithm.
12. The method according to any one of claims 9 to 11, wherein if the decryption is successful, the method further comprises: The second ECU generates a subscription confirmation message; The second ECU sends the subscription confirmation message to the first ECU, so that the first ECU establishes the subscription relationship.
13. The method according to any one of claims 9 to 11, wherein if the subscription authority check of the first ECU fails, the second ECU terminates the subscription relationship.
14. The method according to claim 13, wherein the second ECU encrypts the publishing endpoint information into a publishing ciphertext, specifically comprising: The second ECU encrypts the publishing endpoint information into the publishing ciphertext by using a ciphertext policy attribute-based encryption (CP-ABE) algorithm.
15. An electronic controller, the electronic controller being a second ECU, the electronic controller comprising: A first receiving unit, used to receive a subscription request during an event subscription process; The subscription request is filled with a subscription ciphertext, and the subscription ciphertext is obtained by encrypting the subscription endpoint information by the first ECU; The subscription request is used to perform a subscription authority check on the second ECU; An extraction unit, configured to extract the subscription ciphertext from the subscription request; A decryption unit, used to decrypt the subscription ciphertext; A first establishing unit is configured to, if the decryption is successful, indicating that the subscription authority check of the second ECU has passed, the second ECU encrypts the multicast endpoint information in the publishing endpoint information into a publishing ciphertext or randomly obtains non-multicast endpoint information and encrypts it into the publishing ciphertext, and fills the publishing ciphertext into the subscription confirmation message; The subscription confirmation message is sent to the first ECU to perform a subscription authority check on the first ECU; if the subscription authority check of the first ECU passes, a subscription relationship is established with the first ECU.
16. A permission checking system for event subscription, comprising: During the event subscription process, the first ECU is used to encrypt the subscription endpoint information into a subscription ciphertext, and fill the subscription ciphertext into the subscription request; Sending the subscription request to the second ECU to perform a subscription authority check on the second ECU; The second ECU is used to extract the subscription ciphertext from the subscription request; Decrypting the subscription ciphertext; If the decryption is successful, it means that the subscription authority check of the second ECU is passed. The second ECU encrypts the multicast endpoint information in the publishing endpoint information into the publishing ciphertext or randomly obtains the non-multicast endpoint information and encrypts it into the publishing ciphertext, and fills the publishing ciphertext into the subscription confirmation message; Sending the subscription confirmation message to the first ECU to perform a subscription authority check on the first ECU; if the subscription authority check of the first ECU passes, the second ECU and the first ECU establish a subscription relationship; The first ECU is also used to establish the subscription relationship with the second ECU if the subscription authority check of the second ECU is passed, specifically including: if a confirmation subscription message sent by the second ECU is received, the first ECU and the second ECU establish a subscription relationship.
17. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
18. An in-vehicle device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the program.
