Service subscription method and service subscription system
By setting up a service gateway in the vehicle network and dynamically adjusting the service subscription method, the problem of the inability to dynamically adjust the service version management strategy was solved, ensuring service call compatibility and system stability, and improving the user experience.
Patent Information
- Application Number
- CN202511826687.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-02-10
AI Technical Summary
In existing technologies, the service version management strategy in vehicle electronic and electrical systems cannot dynamically adjust service discovery during operation, leading to service version mismatch and compatibility issues.
By setting up a service gateway in the vehicle's in-vehicle network, the system receives service subscription requests from the controller, compares version numbers, and dynamically adjusts the service subscription method based on the comparison results to ensure service call compatibility.
This enables dynamic adjustment of service discovery within the vehicle network, reducing version incompatibility issues, improving service access continuity and system stability, lowering compatibility risks, and enhancing user experience.
Smart Images

Figure CN121509508A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of vehicles, and particularly relate to a service subscription method and a service subscription system. BACKGROUND
[0002] In the intelligent evolution of vehicle electronic and electrical system, EtherNet (ETH) is used as the backbone network of vehicle communication, and bears the increasing service data transmission demand. The wide application of Service-Oriented Architecture (SOA) promotes the micro-service transformation of vehicle software design, and each service may experience multiple iterations, forming a situation of multiple versions coexisting. However, the service version requirements of different vehicle models or different application stages are significantly different, which directly relates to whether the service can be correctly identified and called.
[0003] Currently, when a client tries to access a service, two ways are usually used to determine the service version: one is to explicitly specify the required service version for calling; the other is to set the minor version number to 0xFF to obtain the most extensive service compatibility. However, both methods have limitations, and the configuration file for service discovery needs to be fixed in advance to perform service discovery, which cannot dynamically adjust service discovery during running.
[0004] At present, there is no effective solution to the above problems. SUMMARY
[0005] Embodiments of the present application provide a service subscription method and a service subscription system, aiming to solve the technical problem that the service version management strategy in the related art cannot dynamically adjust service discovery during running.
[0006] According to an aspect of embodiments of the present application, a service subscription method is provided, which is applied to a vehicle, the vehicle comprising: a plurality of controllers, the plurality of controllers comprising: a first controller and a second controller, and a service gateway is arranged in a vehicle network of the vehicle, the service subscription method comprising: receiving a service subscription request from the first controller, wherein information carried in the service subscription request comprises: a first version number of an application service to be subscribed; in response to the service subscription request, comparing the first version number with a second version number of the application service to be subscribed provided by the second controller to obtain a comparison result, wherein the second version number is pre-acquired by the service gateway from the second controller; and determining a service subscription mode of the first controller according to the comparison result.
[0007] It can be seen that the application provides a dynamic and intelligent service subscription mechanism, i.e., a mechanism for dynamically adjusting service discovery during operation, which can effectively deal with the frequent updating and incomplete matching of service versions in the vehicle-mounted network, ensure the continuity and efficient access of services, reduce the compatibility risk in the software development and upgrading process, and improve the overall performance and user experience of the vehicle intelligent system.
[0008] Further, the method further comprises: collecting, by the service discovery function of the service gateway, application service version information from the plurality of controllers, wherein the application service version information comprises version information of all application services provided by the plurality of controllers.
[0009] Further, the first version number comprises a first major version number and a first minor version number, and the second version number comprises a second major version number and a second minor version number, and the comparing the first version number with the second version number provided by the second controller in response to the service subscription request comprises: comparing the first minor version number with the second minor version number provided by the second controller in response to the service subscription request.
[0010] Further, the determining the service subscription mode of the first controller according to the comparison result comprises: in response to determining that the first minor version number is equal to the second minor version number based on the comparison result, determining that the service subscription mode of the first controller remains unchanged; and in response to determining that the first minor version number is not equal to the second minor version number based on the comparison result, notifying the first controller to adjust the service subscription mode.
[0011] Further, the notifying the first controller to adjust the service subscription mode in response to determining that the first minor version number is not equal to the second minor version number based on the comparison result comprises: in response to determining that the first minor version number is less than the second minor version number based on the comparison result, sending a notification message to the first controller, wherein the notification message is used to notify the first controller to adjust the first minor version number specified by the service subscription mode to any minor version number in the memory.
[0012] Further, the notifying the first controller to adjust the service subscription mode in response to determining that the first minor version number is not equal to the second minor version number based on the comparison result comprises: in response to determining that the first minor version number is greater than the second minor version number based on the comparison result, sending an inquiry message to the first controller, wherein the inquiry message is used to inquire about the minimum minor version number of the required application service of the first controller; and in response to the minimum minor version number being less than or equal to the second minor version number, sending a notification message to the first controller, wherein the notification message is used to notify the first controller to adjust the first minor version number specified by the service subscription mode to any minor version number in the memory.
[0013] Further, the method further includes: in response to the minimum minor version number being greater than the second minor version number, determining that the first controller fails to subscribe to the application service to be subscribed to.
[0014] According to another aspect of the embodiments of the present application, a service subscription method is also provided, which is applied to a vehicle including a plurality of controllers including a first controller and a second controller, and a service gateway is arranged in a vehicle network of the vehicle. The service subscription method includes: sending a service subscription request to the service gateway, wherein information carried in the service subscription request includes a first version number of an application service to be subscribed to, the application service to be subscribed to being an application service subscribed to by the first controller to the second controller; receiving a notification message from the service gateway, wherein the notification message is triggered based on a comparison result obtained by the service gateway based on the service subscription request, by comparing the first version number with a second version number of the application service to be subscribed to provided by the second controller; and adjusting a service subscription manner of the first controller according to the notification message.
[0015] It can be seen that, through the version number comparison and notification function of the service gateway, the first controller can know whether the current service call is affected by version mismatch, and adjust the subscription manner accordingly. Moreover, the traditional service subscription manner usually needs to be fixed at an early development stage, and once the version is changed, the code may need to be reconfigured or even rewritten. However, the present application allows the first controller to adjust the subscription strategy in real time according to the notification of the service gateway, without the need to shut down or restart the entire system, which significantly speeds up the response to version changes and enhances the flexibility of the software system. In addition, dynamic version control reduces system failures caused by version incompatibility problems, avoids repeated service call attempts, and reduces network load and computing resource consumption.
[0016] Further, the first version number includes a first major version number and a first minor version number, and adjusting the service subscription manner of the first controller according to the notification message includes adjusting the first minor version number specified by the service subscription manner to any minor version number by modifying configuration data in the memory.
[0017] According to another aspect of the embodiments of this application, a service subscription system is also provided. The service subscription system includes: a service gateway and multiple controllers, the multiple controllers including: a first controller and a second controller; the service gateway is configured to, in response to a service subscription request from the first controller, compare a first version number of an application service to be subscribed with a second version number of an application service to be subscribed provided by the second controller to obtain a comparison result, and determine a service subscription method for the first controller based on the comparison result, wherein the information carried in the service subscription request includes: a first version number; the first controller is configured to send a service subscription request to the service gateway, receive a notification message from the service gateway, and adjust the service subscription method of the first controller based on the notification message; the second controller is configured to provide the second version number to the service gateway.
[0018] According to another aspect of the embodiments of this application, a service subscription device is also provided. This service subscription device is applied to a vehicle, which includes: multiple controllers, including a first controller and a second controller. A service gateway is provided in the vehicle's in-vehicle network. The service subscription device includes: a first receiving module for receiving a service subscription request from the first controller, wherein the service subscription request carries information including: a first version number of the application service to be subscribed; a comparison module for, in response to the service subscription request, comparing the first version number with a second version number of the application service to be subscribed provided by the second controller to obtain a comparison result, wherein the second version number is pre-collected from the second controller by the service gateway; and a notification module for, based on the comparison result, determining the service subscription method of the first controller.
[0019] According to another aspect of the embodiments of this application, a service subscription device is also provided. This service subscription device is applied to a vehicle, which includes: multiple controllers, including a first controller and a second controller. A service gateway is provided in the vehicle's in-vehicle network. The service subscription device includes: a sending module, used to send a service subscription request to the service gateway, wherein the service subscription request carries information including: a first version number of an application service to be subscribed to, the application service to be subscribed to being an application service subscribed to by the first controller from the second controller; a second receiving module, used to receive a notification message from the service gateway, wherein the notification message is triggered based on a comparison result, the comparison result being obtained by the service gateway comparing the first version number with the second version number of the application service to be subscribed to provided by the second controller based on the service subscription request; and an adjustment module, used to adjust the service subscription method of the first controller according to the notification message.
[0020] According to another aspect of the embodiments of this application, a vehicle is also provided, including an on-board controller and a memory, wherein the memory is used to store a computer program, and the on-board controller is used to execute the computer program stored in the memory to implement the methods in the various embodiments of this application.
[0021] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, in which a computer program is stored, which, when executed by a processor, implements the methods in the various embodiments of this application.
[0022] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the methods of various embodiments of this application.
[0023] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to execute the vehicle non-contact accident discrimination method in various embodiments of this application.
[0024] By receiving a service subscription request from the first controller, which carries information including the first version number of the application service to be subscribed to, and then comparing the first version number with the second version number of the application service to be subscribed to provided by the second controller in response to the service subscription request, the service gateway determines the service subscription method of the first controller based on the comparison result. This achieves the goal of dynamically determining service subscriptions to adapt to version differences, thereby improving service access compatibility and system stability, and solving the technical problem in related technologies where service version management strategies cannot dynamically adjust service discovery during operation. Attached Figure Description
[0025] Figure 1 This is a flowchart of a service subscription method provided in an embodiment of this application;
[0026] Figure 2 This is a schematic diagram of service gateway interaction provided in an embodiment of this application;
[0027] Figure 3 This is a flowchart of another service subscription method provided in an embodiment of this application;
[0028] Figure 4 This is a schematic diagram of the structure of a service subscription system provided in an embodiment of this application;
[0029] Figure 5 This is a structural diagram of the service subscription device provided in the embodiments of this application;
[0030] Figure 6 This is a structural diagram of another service subscription device provided in the embodiments of this application;
[0031] Figure 7This is a structural diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0032] To make the technical problems, technical solutions, and beneficial effects solved by this application clearer, the following detailed description is provided in conjunction with embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0033] The application of vehicle Ethernet (EtherNet, ETH) technology is very mature, and the concept of Service-Oriented Architecture (SOA) is very popular in vehicle software design, with more and more signals being transmitted over Ethernet in the form of services.
[0034] As the number of services increases and services are constantly iterated and updated, the number of service versions is also increasing. The same service for different car models may have multiple different versions. During the software development and software upgrade process, various problems caused by version incompatibility are likely to occur.
[0035] Currently, service access is mainly achieved by specifying the service version or by setting the minor version number to 0xFF during access for compatibility. However, both of these methods require the service discovery configuration file to be fixed in advance for service discovery to be performed, and cannot be adjusted during runtime.
[0036] For ease of understanding, some concepts related to the embodiments of this application are illustrated below for reference.
[0037] Service discovery refers to the process of automatically finding and identifying available services and related information on a network. It is a key technology in distributed systems and network applications, especially in microservice architectures, the Internet of Things (IoT), smart homes, and connected vehicles. Service discovery enables devices or applications to dynamically understand what services are available on the network, their locations, their interfaces, and possible metadata, thereby achieving automatic collaboration and interoperability between different components.
[0038] Minor Version: In software version control, the minor version is the part of the software version number used to identify non-major changes or improvements. Software version numbers typically consist of several parts, the most common format being "Major.Minor.Patch". The minor version increments when software undergoes feature additions, performance improvements, or minor bug fixes. This means that compared to the previous version, the new version offers some improvements without breaking existing functionality or compatibility. Developers often release new features by incrementing the minor version number without changing the major version number, allowing users to upgrade with confidence without encountering major incompatibility issues.
[0039] 0xFF: A hexadecimal number, equivalent to 255 in decimal. 0xFF is often used to represent the maximum value of an 8-bit binary number because 8 bits can represent a range from 0 (binary 00000000) to 255 (binary 11111111). Setting the Minor Version to 0xFF for compatibility access refers to using 255 (0xFF) as a special value for the Minor Version in service discovery or version compatibility control, typically representing "any version" or "highest available version." When a system or application attempts to access a service and has no specific requirement for the service's Minor Version, or seeks the highest available version of the service, it may set the Minor Version field to 0xFF. This lets the service provider know that the requester can accept any Minor Version of the service, or that the requester wants the highest Minor Version currently available.
[0040] According to an embodiment of this application, a service subscription method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0041] This application provides a service subscription method applied to a vehicle. The vehicle includes multiple controllers, including a first controller and a second controller. A service gateway is provided in the vehicle's in-vehicle network. Figure 1 This is a flowchart of a service subscription method provided in an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:
[0042] Step S11: Receive a service subscription request from the first controller, wherein the information carried in the service subscription request includes: the first version number of the application service to be subscribed.
[0043] The service subscription method proposed in this application embodiment is applied to vehicles, which can be any means of transportation with an in-vehicle network, including but not limited to cars, trucks, buses, etc.
[0044] The vehicle's in-vehicle network includes a service gateway, which is responsible for managing and coordinating service access between controllers. The service gateway pre-collects service version information for all ECUs and, upon receiving a service subscription request, intelligently notifies the requester to adjust the subscription method based on a comparison of service versions.
[0045] The vehicle includes multiple controllers, namely Electronic Control Units (ECUs). Each ECU is responsible for the control and management of a specific part of the vehicle, such as engine control, braking system, and entertainment system. In the embodiments of this application, the multiple controllers include at least a first controller and a second controller.
[0046] In a vehicle, the first controller refers to the service requester; that is, the ECU that needs to invoke services provided by other ECUs. The first controller sends a service subscription request, hoping to obtain a specific version of the service. For example, the first controller can be any component that needs to invoke services provided by other ECUs on the vehicle network, such as an entertainment system or a driver assistance system.
[0047] In a vehicle, the second controller refers to the service provider, i.e., the ECU that can respond to service subscription requests and provide services. In practice, the second controller may provide multiple versions of services, which may not perfectly match the subscription requirements of the first controller.
[0048] In this embodiment, a service subscription request is first received from the first controller. In a Service-Oriented Architecture (SOA) environment, a service subscription request is a request issued by the controller to obtain the availability and version information of a specific application service. Unlike directly invoking a service, a service subscription request is used to first confirm the existence and version details of the service, preparing for a precise invocation later.
[0049] The service subscription request in this application is a request sent by the first controller to obtain the updated status of a specific application service periodically or on demand. This service subscription request includes the version information of the application service to be subscribed to, namely, the first version number. The first version number is specified by the first controller and indicates the service version that the first controller expects to access. The version number is a label used to identify different iteration states of the application service. Typically, the version number includes a major version number and a minor version number. Changes in the minor version number may involve minor adjustments or improvements to the service interface. For example, the first version number could be x1.y1, where x1 is the major version number and y1 is the minor version number.
[0050] As can be seen, the execution entity in this embodiment is the service gateway. The service gateway receives a service subscription request sent by the first controller, which includes the first version number of the service that the first controller expects to access. Therefore, by carrying the first version number in the service subscription request, the first controller can accurately convey its specific requirements for the service version, enhancing the understanding of intent between the communicating parties and avoiding mis-calling or service incompatibility issues caused by unclear version information.
[0051] Furthermore, after receiving a service subscription request from the first controller, the service gateway can immediately compare the service version information to check for version compatibility issues. This helps to identify problems early and reduce unnecessary service call attempts and potential errors.
[0052] Step S12: In response to the service subscription request, compare the first version number with the second version number of the application service to be subscribed provided by the second controller to obtain the comparison result, wherein the second version number is collected in advance from the second controller by the service gateway.
[0053] In this embodiment, the service gateway responds to a service subscription request by comparing the first version number with the second version number of the application service to be subscribed provided by the second controller, and obtains the comparison result. Here, the second controller refers to the service provider, i.e., another ECU on the vehicle network, capable of providing different versions of the application service to be subscribed. In an Ethernet-communication-based vehicle network environment, any controller may act as either a service provider or a requester.
[0054] The second version number is provided by the second controller and indicates the application service versions that the second controller can currently support. For example, the second version number can be x2.y2, where x2 is the major version number and y2 is the minor version number. The second version number is pre-collected from the second controller by the service gateway. During startup or operation, the service gateway will pre-collect the service version information of all ECUs for subsequent version comparison and compatibility judgment.
[0055] The comparison result is obtained by the service gateway after comparing the first version number and the second version number. By comparing the first version number and the second version number, the service gateway can determine whether the requested service is available or compatible. For example, the comparison result may include states such as complete version match, backward compatibility, and forward incompatibility. Here, the first version number equals the second version number, which indicates a complete version match; the first version number is not equal to the second version number, which indicates a version mismatch. Specifically, the first version number is less than the second version number, which indicates backward compatibility; and the first version number is greater than the second version number, which indicates forward incompatibility.
[0056] As can be seen, since the service gateway of this application pre-collects and stores the service version information of all controllers, upon receiving a subscription request, it immediately compares the pre-stored second controller service version information (i.e., the second version number) with the first version number requested by the first controller. The comparison determines whether the service version requested by the first controller matches or is compatible with the version provided by the second controller, thus obtaining a comparison result. This comparison result guides subsequent service subscription decisions.
[0057] Therefore, the version number comparison function of the service gateway in this application ensures that service calls can be made based on actual network conditions, avoiding the limitations of static configuration and improving the efficiency and flexibility of service calls. Furthermore, the service gateway can quickly determine whether the service version requested by the first controller is compatible with the version provided by the second controller, avoiding service call failures due to version mismatch. By comparing version numbers, the service gateway can also identify potential subscription problems early, thereby taking timely measures to reduce the possibility of service subscription failures. This ensures that even in environments with frequent software updates, the service requester can obtain the latest or most compatible version of the required service, thus improving the stability of services and user experience in the vehicular network.
[0058] Step S13: Based on the comparison results, determine the service subscription method for the first controller.
[0059] In this embodiment, the service gateway determines the service subscription method of the first controller based on the comparison results. The service subscription method of the first controller refers to the mode in which the first controller initiates service requests, and determines how to access the application service to be subscribed based on version number information.
[0060] The service subscription method is determined based on the comparison results and may or may not change. As described above, the comparison results can be categorized into two cases: a complete version match (version 1 equals version 2) and a version mismatch (version 1 does not equal version 2). If the versions match completely, the service gateway will confirm that the first controller's current service subscription method is optimal and allow the first controller to continue accessing services using the current method without adjustment. If the versions mismatch, the first controller's service subscription method needs to be adjusted based on the relationship between the version 1 and version 2. For example, the service gateway may send different instructions or suggestions to the first controller based on the relationship between the version 1 and version 2 to adjust the first controller's service subscription method, ensuring smooth service subscription and subsequent calls.
[0061] For example, adjusting the service subscription method may include subscribing to any version of the service, such as changing the requested version from x1.y1 to x1.any (i.e., not caring about the specific minor version information and being willing to accept any available minor version under the major version x1), or requesting the lowest compatible version of the service, such as changing the requested version from x1.y1 to x1.ymin (i.e., the lowest version among the minor version numbers that match the major version number x1), to ensure normal service invocation and communication, and should be determined according to the actual situation.
[0062] As can be seen, the service gateway in this application determines the service subscription method of the first controller based on the version number comparison result. For example, it determines whether the service subscription method of the first controller remains unchanged, or whether the first controller needs to adjust its service subscription method, and guides the first controller to modify its service subscription configuration to adapt to the service versions available on the current network. Therefore, the first controller can dynamically select the subscription mode and flexibly change the subscription strategy based on the feedback from the service gateway, without being limited to the initial requested version, thus avoiding unnecessary service access interruptions and enhancing system stability. By dynamically adjusting the service subscription method, this application solves the problem of service access failures due to version mismatch, improves the compatibility of service calls between different controllers, and ensures that the vehicle system can seamlessly call the required services during operation, without affecting the normal operation of the system and the user experience even if the version changes.
[0063] In summary, this application provides a dynamic and intelligent service subscription mechanism, namely, a mechanism that dynamically adjusts service discovery during operation. This mechanism can effectively address the issues of frequent service version updates and incomplete matching in vehicular networks, ensuring service continuity and efficient access, reducing compatibility risks during software development and upgrades, and improving the overall performance and user experience of vehicle intelligent systems.
[0064] The above steps of this application involve receiving a service subscription request from a first controller, wherein the service subscription request carries information including the first version number of the application service to be subscribed to. Then, in response to the service subscription request, the first version number is compared with the second version number of the application service to be subscribed to provided by a second controller. The comparison result is obtained, wherein the second version number is pre-collected from the second controller by the service gateway. Finally, based on the comparison result, the service subscription method of the first controller is determined. This achieves the goal of dynamically determining service subscriptions to adapt to version differences, thereby improving service access compatibility and system stability. Furthermore, it solves the technical problem in related technologies where service version management strategies cannot dynamically adjust service discovery during operation.
[0065] Optionally, the method may further include the following execution steps:
[0066] Step S14: Through the service discovery function of the service gateway, application service version information is collected from multiple controllers. The application service version information includes the version information of all application services of the whole vehicle provided by multiple controllers.
[0067] In this embodiment, service discovery is one of the functions of a service gateway, used to detect available services and their version information in the network. Through service discovery, the service gateway can collect service version information published by all controllers in the network. Typically, after startup, the service gateway will collect version information of all application services in the vehicle through service discovery.
[0068] Application service version information includes version information for all application services provided by multiple controllers throughout the vehicle; that is, it refers to the specific version information of the application services provided by each controller in the in-vehicle network. It typically includes a major version number and a minor version number to represent different iteration states of the service. The major version number identifies the major version of the software or service. It increments whenever the software undergoes incompatible Application Programming Interface (API) modifications, significant feature additions, or architectural adjustments. The minor version number identifies smaller-scale updates within the same major version. Incrementing the minor version number indicates backward-compatible improvements, such as adding features, performance optimizations, or bug fixes, without breaking existing APIs. For example, a version number in the format xy, where x is the major version number and y is the minor version number.
[0069] As can be seen, the service gateway in this application collects application service version information from multiple controllers through its service discovery function. For example, the service gateway can actively or passively collect version information of all application services in the vehicle from multiple controllers in the in-vehicle network, either periodically or under specific event triggers. This involves actively probing. Alternatively, the service gateway can be in a listening state, capturing events and recording the new version information when any controller publishes a new service or updates its service version. Finally, the service gateway integrates the collected application service version information into a comprehensive service version database for reference during subsequent service subscriptions and invocations.
[0070] Therefore, ensuring that the service gateway possesses service version information for all controllers in the vehicle is crucial for subsequent version matching and compatibility checks. Furthermore, a service gateway with complete version information can respond more flexibly to service version changes, ensuring that the system maintains high operational efficiency and service quality even in environments with frequent version updates.
[0071] Optionally, the first version number includes: a first major version number and a first required version number; the second version number includes: a second major version number and a second required version number. In step S12, in response to a service subscription request, the first version number is compared with the second version number provided by the second controller. Obtaining the comparison result may include the following execution steps:
[0072] Step S121: In response to the service subscription request, the first version number is compared with the second version number provided by the second controller to obtain the comparison result.
[0073] In this embodiment of the application, the first version number includes a first major version number and a first required version number. Taking x1.y1 as an example, x1 is the first major version number and y1 is the first required version number. The second version number includes a second major version number and a second required version number. Taking x2.y2 as an example, x2 is the second major version number and y2 is the second required version number.
[0074] Since a mismatch in major version numbers indicates a service subscription failure, the service invocation method in this application compares the first version number with the second version number. Specifically, if the major version numbers match, the minor version numbers are compared. In other words, if the first and second major version numbers are the same, the first minor version number is compared with the second minor version number.
[0075] When responding to a service subscription request and comparing the first version number with the second version number provided by the second controller to obtain a comparison result, the first required version number can be compared with the second required version number provided by the second controller to obtain a comparison result. For example, this means comparing the first required version number y1 in the first version number x1.y1 with the second required version number y2 in the second version number x2.y2.
[0076] As can be seen, the service gateway of this application will parse the first required version number y1 from the service subscription request, and parse the second required version number y1 from the version information provided by the second controller. Then, it will compare the size of y1 and y2 to determine the compatibility between the two versions and obtain the comparison result.
[0077] Therefore, by focusing on comparing minor version numbers, service compatibility can be assessed more accurately, avoiding unnecessary service subscription failures or call interruptions. At the same time, it reduces communication barriers caused by version differences and improves the efficiency and success rate of service calls in the vehicle network.
[0078] Optionally, in step S13, determining the service subscription method of the first controller based on the comparison result may include the following execution steps:
[0079] Step S131: Based on the comparison result, the response determines that the first version number is equal to the second version number, and determines that the service subscription method of the first controller remains unchanged.
[0080] Step S132: Based on the comparison result, if it is determined that the version number requested in the first instance is not equal to the version number requested in the second instance, the first controller is notified to adjust the service subscription method.
[0081] In this embodiment, when determining the service subscription method of the first controller based on the comparison results, if the comparison results determine that the first required version number is equal to the second required version number, i.e., y1 = y2, it indicates that the first controller and the second controller are at the same version level, meaning that service subscription and invocation will not be affected by version differences. Therefore, the service gateway will confirm that the existing service subscription method of the first controller is appropriate and no changes are needed, i.e., it will determine that the service subscription method of the first controller remains unchanged.
[0082] If the comparison results determine that the version number requested in the first instance is not equal to the version number requested in the second instance (i.e., y1 ≠ y2), it indicates a difference between the service versions of the first and second controllers. This could be due to the first controller's version being lower or higher than the second controller's version. In this case, because the first controller uses a specified version access method (i.e., specifying the version number as x1.y1), access will fail. The service gateway will then notify the first controller to adjust its service subscription method, for example, by sending instructions or suggestions to the first controller via the vehicle network, thus instructing the first controller on how to adjust its service subscription method to ensure successful service subscription.
[0083] Therefore, this application dynamically adjusts the service subscription method by comparing results, enabling the first controller to adapt to different versions of services and reducing the risk of service call failures due to version incompatibility. Furthermore, this application can handle version inconsistencies, thereby increasing the system's flexibility and robustness in the face of software updates and the coexistence of different versions.
[0084] Optionally, in step S132, the response determines that the first requested version number is not equal to the second requested version number based on the comparison result, and notifies the first controller to adjust the service subscription method, which may include the following execution steps:
[0085] Step S1321: Based on the comparison result, if the first required version number is determined to be less than the second required version number, a notification message is sent to the first controller. The notification message is used to notify the first controller to adjust the first required version number specified by the service subscription method to any minor version number in memory.
[0086] In this embodiment, when the comparison result determines that the first required version number is not equal to the second required version number, and the first controller is notified to adjust the service subscription method, if the comparison result determines that the first required version number is less than the second required version number, a notification message is sent to the first controller. The notification message is information sent by the service gateway to the first controller, instructing the first controller to adjust its service subscription method according to the comparison result.
[0087] When the first required version number (y1) is less than the second required version number (y2), that is, when y1 < y2, this notification message is used to instruct the first controller to adjust the first required version number specified by the service subscription method to any minor version number in memory. That is, to adjust y1 (specific minor version number y1) specified by the service subscription method to any (any minor version number any) in memory, that is, to adjust the service subscription method from x1.y1 to x1.any.
[0088] Any minor version number means that the first controller has no specific requirements for the minor version number of the service and is willing to accept all minor version numbers corresponding to the first major version number. Adjusting to any minor version number can enhance the flexibility and compatibility of service access and avoid communication obstacles caused by version mismatch.
[0089] As can be seen, in this application, if the service gateway determines, based on the comparison result, that the primary minor version number is less than the secondary minor version number, it indicates that the service has backward compatibility on the minor version, and the first controller can adjust its subscription method to accommodate this compatibility. Therefore, the service gateway sends a notification message to the first controller, instructing the first controller to adjust the primary minor version number specified in the service subscription method to any minor version number in memory. Thus, in this case, this application allows the first controller to access any minor version compatible with the primary version number, thereby enhancing the flexibility and compatibility of service access and avoiding service access failures due to version mismatch. Furthermore, by adjusting the subscription method, the first controller can continue to use the existing service, reducing the need to redevelop or modify the application due to version incompatibility.
[0090] Optionally, in step S132, the response, based on the comparison result determining that the first requested version number is not equal to the second requested version number, notifies the first controller to adjust the service subscription method, and may further include the following execution steps:
[0091] Step S1322: Based on the comparison result, if the first minor version number is determined to be greater than the second minor version number, an inquiry message is sent to the first controller. The inquiry message is used to inquire about the minimum minor version number of the application service required by the first controller.
[0092] Step S1323: In response to the minimum minor version number being less than or equal to the second minor version number, a notification message is sent to the first controller, wherein the notification message is used to notify the first controller to adjust the first minor version number specified by the service subscription method to any minor version number in memory.
[0093] In this embodiment of the application, when notifying the first controller to adjust the service subscription method based on the comparison result, if the comparison result determines that the first required version number is greater than the second required version number, an inquiry message is sent to the first controller. The inquiry message is used to query the first controller for the minimum minor version number of the application service required, that is, to query the minimum minor version number ymin that the first controller can accept.
[0094] It can be seen that if the service gateway determines, based on the comparison result, that the first required version number (y1) is greater than the second required version number (y2), i.e., y1 > y2, it means that the service version requested by the first controller is higher than the service version provided by the second controller. Therefore, the service gateway sends an inquiry message to the first controller, asking for the smallest acceptable minor version number ymin. ymin is the smallest version that the first controller can accept under the major version, i.e., the smallest version compatible with the x1.y2 service version.
[0095] Then, in response to the minimum minor version number being less than or equal to the second minor version number, a notification message is sent to the first controller. This notification message instructs the first controller to adjust the first minor version number specified in the service subscription method to any minor version number in memory, that is, to adjust the service subscription method from x1.y1 (a specific minor version number y1) to x1.any (any minor version number any).
[0096] It can be seen that if the smallest minor version number (ymin) returned by the first controller is less than or equal to the second minor version number (y2), i.e., ymin ≤ y2, it means that the first controller can accept a version number lower than its initial request, as long as the version is under the x1 major version, and the version number can be adjusted to ymin. Therefore, the service gateway sends a notification message to the first controller, instructing the first controller to change the service subscription method from the specific x1.y1 to x1.any in memory, indicating that the first controller no longer cares about the minor version number of the service, as long as it is any minor version under the x1 major version.
[0097] Therefore, by querying the least minor version number, this application allows the service gateway to more accurately understand the service requirements of the first controller, avoiding unnecessary service subscription attempts and saving network resources and processing time. When the least minor version number returned by the first controller is less than or equal to the second minor version number, the first controller is notified to adjust the service subscription method to x1.any, improving the flexibility and compatibility of service calls, ensuring service availability, and enabling effective communication even if the versions do not match perfectly. In other words, by dynamically adjusting the service subscription method, this application minimizes the risk of service interruption or inaccessibility due to version differences, ensuring service continuity and reliability, and improving user experience.
[0098] Optionally, the method may further include the following execution steps:
[0099] In step S1324, in response to the smallest minor version number being greater than the second minor version number, it is determined that the first controller has failed to subscribe to the application service to be subscribed.
[0100] In this embodiment of the application, if the service gateway determines that the minimum minor version number is greater than the second minor version number based on the comparison result, i.e., ymin>y2, it means that the requirement of the first controller exceeds the service version that the second controller can provide. Therefore, it is determined that the first controller has failed to subscribe to the application service to be subscribed, i.e., the first controller cannot successfully subscribe to the service provided by the second controller based on its minimum minor version number ymin.
[0101] It can be seen that if the minimum minor version number ymin that the first controller can accept exceeds y2 of the second controller (i.e., ymin > y2), the service gateway recognizes that the minimum service version requirement of the first controller cannot be met in the second controller, thus confirming service version incompatibility. The service gateway can then send a message to the first controller, explicitly informing it that its subscription attempt for the specific application service failed because the version functionality or feature requested by the first controller is not provided in the second controller.
[0102] This ensures that the system can clearly identify the upper limit of service subscriptions, avoids infinite loop subscription attempts, and protects network resources from being consumed by invalid requests. By immediately notifying of subscription failures, the first controller can quickly recognize the obstacle to the service call, facilitating subsequent remedial measures, such as finding alternative services or waiting for the second controller to update to a compatible version.
[0103] In summary, the service subscription method of this application includes the following steps:
[0104] Step 1: After the controller starts up, each application begins to send service messages normally.
[0105] Step 2: The network has a service gateway, which can subscribe to the services of each controller. After starting, the service gateway will collect version information of all services in the vehicle through service discovery.
[0106] Step 3: When a controller in the network initiates a service subscription, the service discovery message should first pass through the service gateway. After the service gateway detects a service subscription request, it will compare the service version information collected in step 2 with the service subscription request.
[0107] Figure 2 This is a schematic diagram of service gateway interaction provided in an embodiment of this application, such as... Figure 2 As shown, the service gateway in the vehicular network will communicate with each controller (as shown in the image). Figure 2Taking EVA, ECB, ENC, and ECD as examples, the service gateway interacts with the controllers. The service gateway pre-collects the specific version information of the application services provided by each controller through its service discovery function. When a controller in the vehicle network initiates a service subscription, the service discovery message should first pass through the service gateway. After detecting a service subscription request, the service gateway will compare the pre-collected service version information with the service subscription request.
[0108] Step 4: When the service version x1.y1 subscribed to by controller A is the same as the version information x2.y2 provided by target controller B, that is, the versions are completely matched, there is no problem with service subscription and invocation, and the service gateway and each controller do not need to do any extra processing.
[0109] Step 5: When the service version x1.y1 subscribed to by controller A differs from the version information x2.y2 provided by target controller B, i.e., when the required y1 ≠ y2, access will fail due to the use of a specified version access method. The handling method of this application is as follows:
[0110] Step 5.1: When the required y1 < y2 for controller A, the service exhibits backward compatibility. Although the service versions do not match, there is no actual access problem. Furthermore, since the service gateway has collected the service version information of the vehicle controller, it can determine that y1 < y2. When the service gateway detects this situation, it will notify controller A, i.e., by informing controller A via Ethernet signal that the service subscription method should be changed.
[0111] Step 5.1.1: When Controller A receives a notification from the service gateway regarding a change in service subscription method, Controller A will modify its service discovery configuration file, switching the subscription method for the service version to x1.any, meaning Controller A does not care about the specific version of y2. For example, the modification is as follows: Since Controller A's service discovery configuration file is typically stored in the controller's flash memory / read-only memory (ROM), the system loads the service discovery configuration file into memory after startup for application use. Upon receiving the notification from the service gateway to switch subscription methods, Controller A will modify the service discovery configuration file in memory, changing the subscription configuration of x1.y1 to x1.any. Afterwards, since Controller A will initiate a resubscription after a subscription failure, the service discovery configuration file in memory will have been modified during the resubscription. Therefore, Controller A will subscribe using the x1.any method to ensure successful subscription.
[0112] Step 5.2: When y1 required by controller A is greater than y2, it means that the service version requested by controller A is higher than the currently available version. Therefore, it is not possible to directly instruct controller A to change the service subscription method. The handling method in this case is as follows:
[0113] Step 5.2.1: When the service gateway detects the situation described in Step 5.2, it will request the minimum required service version from controller A, i.e., request x1.ymin from controller A. Here, service calls often only invoke certain interfaces of the service. However, due to management reasons, engineers may directly use the latest version from the platform library. Since the nodes providing the service may have version update lags, but controller A can still access the existing interfaces of controller B, when ymin ≤ y2 returned by controller A, the process can jump to Step 5.1.1 to ensure service subscription. When ymin > y2, it means that the required latest interface may not yet be integrated, therefore, service subscription fails in this case.
[0114] This application also provides a service subscription method applied to a vehicle. The vehicle includes multiple controllers, including a first controller and a second controller. A service gateway is provided in the vehicle's in-vehicle network. Figure 3 This is a flowchart of another service subscription method provided in an embodiment of this application, such as... Figure 3 As shown, the method includes the following steps:
[0115] Step S31: Send a service subscription request to the service gateway. The information carried in the service subscription request includes: the first version number of the application service to be subscribed to, and the application service to be subscribed to is the application service subscribed by the first controller to the second controller.
[0116] As can be seen, the execution entity in this embodiment is the controller. The first controller sends a service subscription request to the service gateway through the vehicle network (e.g., Ethernet). The service subscription request explicitly identifies the first version number of the application service to be subscribed. For example, the first controller first constructs a service subscription request, which includes the first version number of the application service to be subscribed, thus specifying the specific application service version that the first controller wants to obtain from the second controller. Then, the first controller transmits the constructed service subscription request to the service gateway via Ethernet.
[0117] Therefore, by carrying the first version number in the service subscription request, the service gateway can clearly track the service version information. That is, based on the received first version number, the service gateway can make a decision on whether to make version compatibility adjustments (such as notifying the first controller to adjust the subscription method), which helps to manage multiple versions of services and maintain the stable operation of the system.
[0118] For further details, please refer to the description of the foregoing embodiments, which will not be repeated here.
[0119] Step S32: Receive a notification message from the service gateway. The notification message is triggered based on the comparison result, which is obtained by the service gateway by comparing the first version number with the second version number of the application service to be subscribed provided by the second controller based on the service subscription request.
[0120] As can be seen, after issuing a service subscription request, the first controller enters a waiting state, preparing to receive a notification message from the service gateway. Once the service gateway completes the comparison between the first and second version numbers and generates a corresponding notification message based on the comparison result, the first controller receives this notification message. After receiving the notification message, the first controller parses its content to understand the service gateway's suggestions regarding subscription adjustments. For example, depending on different comparison results, the service gateway's subscription adjustment suggestions might include changing the service subscription method from a specific minor version number to a broader compatibility mode, or other specific version adjustment suggestions.
[0121] Therefore, by receiving notification messages from the service gateway, the first controller can instantly understand the status of the service version and whether the subscription method needs to be adjusted to adapt to version changes, thus ensuring the continuity and efficiency of service calls. Furthermore, based on the service gateway's intelligent version comparison and notification mechanism, the first controller can avoid subscription failures caused by version incompatibility, improving the success rate of service subscriptions.
[0122] For further details, please refer to the description of the foregoing embodiments, which will not be repeated here.
[0123] Step S33: Adjust the service subscription method of the first controller according to the notification message.
[0124] As can be seen, after receiving the notification message from the service gateway, the first controller modifies its service subscription method according to the adjustment suggestions in the message. For example, the service subscription method is typically stored in the first controller's memory. Based on the notification message, the first controller updates the service discovery configuration file in memory to reflect the new subscription strategy. For instance, it might change from a specific version x1.y1 to the more generalized x1.any, or request the minimum compatible version x1.ymin, ensuring that services can still be correctly invoked even in environments with version differences, greatly improving the compatibility of the entire system.
[0125] Therefore, by adjusting the service subscription method, the first controller can invoke services more flexibly, ensuring service availability and continuity even if the versions are not perfectly compatible. Furthermore, this flexibility reduces software compatibility issues caused by version updates, lowering the complexity and cost of upgrading or maintaining the first controller's software. In addition, it avoids repeatedly attempting to subscribe to the same service due to version incompatibility, reducing the burden on network communication and improving the overall efficiency of the in-vehicle network.
[0126] For further details, please refer to the description of the foregoing embodiments, which will not be repeated here.
[0127] In summary, by using the version number comparison and notification functions of the service gateway, the first controller can determine whether the current service call is affected by version mismatch and adjust its subscription method accordingly. Furthermore, traditional service subscription methods typically need to be fixed early in development; once the version changes, reconfiguration or even rewriting of code may be required. This application, however, allows the first controller to adjust the subscription strategy in real time based on notifications from the service gateway, without requiring system downtime or restarts, significantly accelerating the response speed to version changes and enhancing the flexibility of the software system. In addition, dynamic version control reduces system failures caused by version incompatibility issues, avoids repeated service call attempts, and reduces network load and computing resource consumption.
[0128] The above steps in this application involve sending a service subscription request carrying the first version number of the application service to be subscribed to to the service gateway. This application service is one that the first controller subscribes to from the second controller. Then, a notification message is received from the service gateway. This notification message is triggered by a comparison result, obtained by the service gateway comparing the first version number with the second version number of the application service to be subscribed to provided by the second controller based on the service subscription request. Finally, the service subscription method of the first controller is adjusted according to the notification message. This achieves the goal of dynamically adjusting service subscriptions to adapt to version differences, thereby improving service access compatibility and system stability. It also solves the technical problem in related technologies where service version management strategies cannot dynamically adjust service discovery during operation.
[0129] Optionally, the first version number includes: a first major version number and a first minor version number. In step S33, adjusting the service subscription method of the first controller according to the notification message may include the following execution steps:
[0130] Step S331: By modifying the configuration data in memory, the primary version number specified in the service subscription method is adjusted to any secondary version number.
[0131] In this embodiment, the configuration data in memory refers to the service discovery configuration file stored in the runtime memory of the first controller. The configuration data contains detailed information about service subscriptions, such as service name and version number, and is used to guide the first controller on how to search for and invoke services in the network.
[0132] The service subscription method defines how the first controller specifies its service requirements, which includes specifying the major and minor version numbers of the service, such as x1.y1, where x1 is the major version number and y1 is the minor version number.
[0133] As can be seen, after receiving the notification message from the service gateway, the first controller first parses the message to understand the suggested subscription method adjustment. Then, based on the notification content, the first controller locates its service discovery configuration file in memory to find the subscription configuration information related to the specific service. Next, the first controller modifies the configuration data in memory, changing the primary version number specified in the service subscription method to any minor version number. For example, changing the service subscription method from the specified x1.y1 to the more generalized x1.any means that the first controller can now accept all service versions compatible with the primary version number x1, not just the previously specified version y1. Furthermore, after the configuration data is modified, the first controller will initiate a new service subscription request. This new service subscription request will be based on the updated subscription method (i.e., x1.any), thereby improving the success rate of service calls.
[0134] For further details, please refer to the description of the foregoing embodiments, which will not be repeated here.
[0135] Therefore, by adjusting the minor version number to "any," the first controller can access services more flexibly. Even if the service provider (second controller) updates the minor version number, the first controller can still successfully call the service, unaffected by version differences. Furthermore, relaxing version number constraints reduces the service call failure rate caused by version mismatches, ensuring high service availability and system stability. In addition, under the coordination of the service gateway, the first controller's dynamic adjustment capability helps simplify the software upgrade process, reduces the testing and adjustment work related to service version compatibility, and lowers the risks associated with upgrades.
[0136] This application also provides a service subscription system. Figure 4 This is a schematic diagram of the structure of a service subscription system provided in an embodiment of this application, as shown below. Figure 4 As shown, the service subscription system includes a service gateway and multiple controllers, including a first controller and a second controller.
[0137] The service gateway is used to respond to the service subscription request of the first controller, compare the first version number of the application service to be subscribed with the second version number of the application service to be subscribed provided by the second controller to obtain the comparison result, and determine the service subscription method of the first controller based on the comparison result. The information carried in the service subscription request includes: the first version number.
[0138] The first controller is used to send service subscription requests to the service gateway, receive notification messages from the service gateway, and adjust the service subscription method of the first controller according to the notification messages.
[0139] The second controller is used to provide the second version number to the service gateway.
[0140] The service version control system proposed in this application includes a service gateway and multiple controllers, including a first controller and a second controller. For a detailed description, please refer to the description of the foregoing embodiments, which will not be repeated here.
[0141] The system operates as follows:
[0142] When the first controller sends a service subscription request, the service gateway first parses the request and extracts the first version number of the service to be subscribed to. Then, the service gateway compares the first version number with the service version number (second version number) provided by the second controller to determine compatibility. If the versions match perfectly, the service gateway ensures that the service subscription method of the first controller remains unchanged. If there is a version difference, the service gateway decides whether to adjust the subscription method according to preset rules and notifies the first controller via a notification message. The service gateway's comparison and notification functions ensure version compatibility checks before service calls, avoiding service access failures due to version inconsistencies.
[0143] After sending a service subscription request, if the first controller does not receive a notification message from the service gateway, it will maintain its current service subscription method. If it receives a notification message from the service gateway, it will adjust its service subscription method accordingly. If the service gateway suggests relaxing version restrictions, the first controller will modify the service discovery configuration file in its internal storage (usually memory), changing the primary version number to "any minor version number" (i.e., x1.any), indicating that the first controller is willing to accept all service versions with a primary version number of x1. This dynamic adjustment capability allows the first controller to better adapt to changes in service versions within the network, improving the success rate of service calls.
[0144] The second controller provides the service gateway with the latest or historical version information of the service, including the service's second version number. In this way, the second controller indirectly participates in the service version compatibility verification process, ensuring that the services it provides can be correctly subscribed to and invoked by the first controller.
[0145] Therefore, the intervention of the service gateway, through version number comparison and subscription method adjustment, significantly improves the version compatibility of service calls, ensuring stable system operation even when service versions change. Furthermore, each controller in the system can automatically adjust its service subscription strategy based on notifications from the service gateway, greatly simplifying the software upgrade process and reducing system instability caused by version updates. In addition, the dynamic adjustment mechanism reduces unnecessary service call attempts and version verification time, accelerating system response speed and improving overall operational efficiency.
[0146] Therefore, this application maximizes service access compatibility and avoids access failures by using a minimum service version control approach and dynamically adjusting service subscription version access methods, and reduces incompatibility issues during development and software upgrades.
[0147] This application also provides a service subscription device applied to a vehicle. The vehicle includes multiple controllers, including a first controller and a second controller. A service gateway is provided in the vehicle's in-vehicle network. Figure 5 This is a structural diagram of the service subscription device provided in the embodiments of this application, such as... Figure 5 As shown, the service subscription device 500 includes: a first receiving module 501, used to receive a service subscription request from a first controller, wherein the information carried in the service subscription request includes: a first version number of the application service to be subscribed; a comparison module 502, used to compare the first version number with a second version number of the application service to be subscribed provided by a second controller in response to the service subscription request, and obtain a comparison result, wherein the second version number is pre-collected from the second controller by the service gateway; and a determining module 503, used to determine the service subscription method of the first controller based on the comparison result.
[0148] Optionally, the device further includes: a data acquisition module, used to acquire application service version information from multiple controllers through the service discovery function of the service gateway, wherein the application service version information includes: version information of all vehicle application services provided by multiple controllers.
[0149] Optionally, the first version number includes a first major version number and a first required version number, and the second version number includes a second major version number and a second required version number. The comparison module 502 is also used to compare the first required version number with the second required version number provided by the second controller in response to a service subscription request, and obtain a comparison result.
[0150] Optionally, the determining module 503 is further configured to respond to determining that the first required version number is equal to the second required version number based on the comparison result, and to determine that the service subscription method of the first controller remains unchanged; and to respond to determining that the first required version number is not equal to the second required version number based on the comparison result, and to notify the first controller to adjust the service subscription method.
[0151] Optionally, the determining module 503 is further configured to send a notification message to the first controller in response to a determination based on the comparison result that the first required version number is less than the second required version number, wherein the notification message is used to notify the first controller to adjust the first required version number specified by the service subscription method to any second required version number in memory.
[0152] Optionally, the notification module 503 is further configured to, in response to determining, based on the comparison result that the first minor version number is greater than the second minor version number, send an inquiry message to the first controller, wherein the inquiry message is used to inquire about the minimum minor version number of the application service required by the first controller; and in response to the minimum minor version number being less than or equal to the second minor version number, send a notification message to the first controller, wherein the notification message is used to notify the first controller to adjust the first minor version number specified by the service subscription method to any minor version number in memory.
[0153] Optionally, the device further includes: a determination module, configured to determine that the first controller has failed to subscribe to the application service in response to the smallest minor version number being greater than the second minor version number.
[0154] This application also provides a service subscription device applied to a vehicle. The vehicle includes multiple controllers, including a first controller and a second controller. A service gateway is provided in the vehicle's in-vehicle network. Figure 6 This is a structural diagram of another service subscription device provided in the embodiments of this application, such as... Figure 6As shown, the service subscription device 600 includes: a sending module 601, used to send a service subscription request to a service gateway, wherein the service subscription request carries information including: a first version number of the application service to be subscribed, the application service to be subscribed is an application service subscribed by the first controller to the second controller; a second receiving module 602, used to receive a notification message from the service gateway, wherein the notification message is triggered based on a comparison result, the comparison result being obtained by the service gateway comparing the first version number with the second version number of the application service to be subscribed provided by the second controller based on the service subscription request; and an adjustment module 603, used to adjust the service subscription method of the first controller according to the notification message.
[0155] Optionally, the first version number includes: a first major version number and a first minor version number. The adjustment module 603 is also used to adjust the first minor version number specified by the service subscription method to any minor version number by modifying the configuration data in memory.
[0156] Embodiments of this application also provide a vehicle, including an on-board controller and a memory, wherein the memory is used to store a computer program; the on-board controller is used to execute the computer program stored in the memory to implement the methods in various embodiments of this application.
[0157] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods in various embodiments of this application.
[0158] Embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the methods of various embodiments of this application.
[0159] This application also provides an electronic device. Figure 7 This is a structural diagram of the electronic device provided in the embodiments of this application, such as... Figure 7 As shown, the electronic device 700 includes a processor 710 and a memory 720, wherein the memory 710 is used to store computer programs; and the processor 720 is used to execute the programs stored in the memory 710 to implement the methods in the various embodiments of this application.
[0160] In this application, "multiple" refers to two or more.
[0161] In this application, unless otherwise expressly defined, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0162] The terms “first,” “second,” “third,” “fourth,” etc., in this application (if present) are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0163] In this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, in this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0164] Unless otherwise specified, all steps in this application may be performed sequentially or randomly. For example, if the method includes steps A and B, it means that the method may include steps A and B performed sequentially, or it may include steps B and A performed sequentially. For example, if the method may also include step C, it means that step C may be added to the method in any order. For example, the method may include steps A, B, and C, or it may include steps A, C, and B, or it may include steps C, A, and B, etc.
[0165] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A service subscription method, characterized in that, The service subscription method is applied to a vehicle, which includes multiple controllers, including a first controller and a second controller. A service gateway is configured in the vehicle's in-vehicle network. The service subscription method includes: Receive a service subscription request from the first controller, wherein the information carried in the service subscription request includes: the first version number of the application service to be subscribed; In response to the service subscription request, the first version number is compared with the second version number of the application service to be subscribed provided by the second controller to obtain a comparison result, wherein the second version number is collected in advance by the service gateway from the second controller; Based on the comparison results, the service subscription method of the first controller is determined.
2. The service subscription method according to claim 1, characterized in that, The service subscription method also includes: The service gateway collects application service version information from the multiple controllers through its service discovery function. The application service version information includes version information of all application services for the entire vehicle provided by the multiple controllers.
3. The service subscription method according to claim 1, characterized in that, The first version number includes: a first major version number and a first required version number; the second version number includes: a second major version number and a second required version number; in response to the service subscription request, the first version number is compared with the second version number provided by the second controller, and the comparison result includes: In response to the service subscription request, the first required version number is compared with the second required version number provided by the second controller to obtain the comparison result.
4. The service subscription method according to claim 3, characterized in that, Based on the comparison results, the service subscription method of the first controller is determined to include: Based on the comparison result, the response determines that the first required version number is equal to the second required version number, and determines that the service subscription method of the first controller remains unchanged; If the response determines, based on the comparison result, that the first required version number is not equal to the second required version number, the first controller is notified to adjust the service subscription method.
5. The service subscription method according to claim 4, characterized in that, The response, based on the comparison result, determines that the first required version number is not equal to the second required version number, and notifies the first controller to adjust the service subscription method, including: Based on the comparison result, if the first minor version number is determined to be less than the second minor version number, a notification message is sent to the first controller. The notification message is used to notify the first controller to adjust the first minor version number specified by the service subscription method to any minor version number in memory.
6. The service subscription method according to claim 4, characterized in that, The response, based on the comparison result, determines that the first required version number is not equal to the second required version number, and notifies the first controller to adjust the service subscription method, including: Based on the comparison result, if the first minor version number is determined to be greater than the second minor version number, an inquiry message is sent to the first controller, wherein the inquiry message is used to inquire about the minimum minor version number of the application service required by the first controller; In response to the minimum minor version number being less than or equal to the second minor version number, a notification message is sent to the first controller, wherein the notification message is used to notify the first controller to adjust the first minor version number specified by the service subscription method to any minor version number in memory.
7. The service subscription method according to claim 6, characterized in that, The service subscription method also includes: In response to the fact that the minimum minor version number is greater than the second minor version number, it is determined that the first controller has failed to subscribe to the application service to be subscribed.
8. A service subscription method, characterized in that, The service subscription method is applied to a vehicle, which includes multiple controllers, including a first controller and a second controller. A service gateway is configured in the vehicle's in-vehicle network. The service subscription method includes: Send a service subscription request to the service gateway, wherein the information carried in the service subscription request includes: the first version number of the application service to be subscribed, and the application service to be subscribed is the application service subscribed by the first controller to the second controller; Receive a notification message from the service gateway, wherein the notification message is triggered based on a comparison result, which is obtained by the service gateway by comparing the first version number with the second version number of the application service to be subscribed provided by the second controller based on the service subscription request; Adjust the service subscription method of the first controller according to the notification message.
9. The service subscription method according to claim 8, characterized in that, The first version number includes: a first major version number and a first required version number. Adjusting the service subscription method of the first controller according to the notification message includes: By modifying the configuration data in memory, the primary version number specified in the service subscription method can be adjusted to any secondary version number.
10. A service subscription system, characterized in that, The service subscription system includes: a service gateway and multiple controllers, the multiple controllers including: a first controller and a second controller; The service gateway is configured to, in response to a service subscription request from the first controller, compare a first version number of the application service to be subscribed with a second version number of the application service to be subscribed provided by the second controller to obtain a comparison result, and determine a service subscription method for the first controller based on the comparison result, wherein the information carried in the service subscription request includes: the first version number; The first controller is configured to send the service subscription request to the service gateway, receive a notification message from the service gateway, and adjust the service subscription method of the first controller according to the notification message. The second controller is used to provide the second version number to the service gateway.