A method for dispatching vehicle-mounted services and vehicles
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-22
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]相关技术中,采用SOA架构下的单点优先级仲裁策略,即对每个独立服务单独计算优先级,该方式忽略服务之间的优先级传导关系,导致关键调用链上的下游服务无法获得应有的优先级调整,最终导致无法实现实时精确的车载服务调度
Smart Images

Figure CN122554536A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of vehicle control technology, and in particular to an on-board service scheduling method and a vehicle. Background Technology
[0002] As the electronic and electrical architecture of intelligent vehicles evolves towards a domain-centralized approach, SOA (Service-Oriented Architecture) has become the mainstream architectural pattern for intelligent cockpit software design. Under SOA, in-vehicle services are no longer independent entities, but rather complex call chains composed of numerous atomic services that interact through inter-service calls. For example, a user triggering a "smart parking" function may involve multiple layers of calls, including route planning, environmental perception, vehicle control, and display rendering services.
[0003] In related technologies, a single-point priority arbitration strategy under SOA architecture is adopted, which calculates the priority of each independent service separately. This approach ignores the priority propagation relationship between services, resulting in downstream services on the critical call chain not receiving the necessary priority adjustment, ultimately leading to the inability to achieve real-time and accurate vehicle service scheduling. Summary of the Invention
[0004] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides an in-vehicle service scheduling method and a vehicle.
[0005] This disclosure provides a method for scheduling in-vehicle services. The method includes: when a first service calls a second service, obtaining service call topology information, wherein the service call topology information is used to characterize the call relationship between services, the service call topology information includes at least one service call chain, and the service call chain includes multiple services with call relationships; based on the service call topology information, determining the call hop count of the second service relative to the first service, wherein the call hop count is the call level of the second service relative to the first service in the service call chain; based on the call hop count and the current priority of the first service, determining the inheritance priority of the second service; and based on the inheritance priority, executing the call operation of the second service.
[0006] Therefore, the inheritance priority of the called service is determined by the number of call hops between the calling service and the called service and the current priority of the calling service. This ensures the effectiveness of priority transmission when the upstream service calls the downstream service, thus achieving more refined dynamic scheduling.
[0007] Optionally, determining the number of call hops of the second service relative to the first service based on the service call topology information includes: obtaining the number of call levels of the second service relative to the first service in the service call chain based on the service call topology information, and determining the number of call hops based on the number of call levels.
[0008] Therefore, by determining the number of call hops between the second service and the first service based on the number of call levels of the second service relative to the first service in the service call chain, different call levels correspond to different call hops, thereby achieving different priorities for call transmission at different call levels and ensuring the effectiveness of priority transmission.
[0009] Optionally, the method further includes: determining a key marker of the service call chain to which the second service belongs based on the service call topology information; wherein the key marker is used to identify whether the service call chain belongs to a key call chain; and determining the inheritance priority of the second service based on the call hop count and the current priority of the first service includes: determining the inheritance priority of the second service based on the call hop count, the key marker, and the current priority of the first service.
[0010] Therefore, the inheritance priority of the called service is determined by multiple dimensions such as the number of call hops between the calling service and the called service, the current priority of the calling service, and the key markers of the service call chain to which the called service belongs. By further combining the key markers of the service call chain, the service quality of critical business is guaranteed, and ultimately more refined dynamic scheduling is achieved.
[0011] Optionally, determining the key marker of the service call chain to which the second service belongs based on the service call topology information includes: obtaining a multi-dimensional score of the service call chain to which the second service belongs based on the service call topology information, and performing a weighted calculation based on the multi-dimensional score to obtain a key chain score of the service call chain; when the key chain score is greater than a preset score threshold, identifying the service call chain as a key call chain, and obtaining the key marker.
[0012] Therefore, by determining key markers based on multi-dimensional scoring of service call chains, critical service call chains that are essential to the business can be accurately identified. This allows for prioritization of services on service call chains with key markers, further improving the accuracy of service calls.
[0013] Optionally, obtaining the multi-dimensional score of the service call chain to which the second service belongs based on the service call topology information includes: determining whether the service call chain to which the second service belongs includes a security service based on the service call topology information, and determining the security score of the service call chain; determining the frequency score of the service call chain based on the call frequency of the service call chain; determining the latency score of the service call chain based on the total call duration of the service call chain and a preset duration threshold; and determining the cross-domain score of the service call chain based on whether the service call chain is associated with multiple domain controllers.
[0014] Therefore, security score, frequency score, latency score and cross-domain score are used as multi-dimensional scores for service call chains to identify critical call chains, thereby achieving accurate identification of critical call chains.
[0015] Optionally, determining the inheritance priority of the second service based on the call hop count, the critical marker, and the current priority of the first service includes: determining the transit coefficient of the second service relative to the first service based on the call hop count; determining the transit priority of the second service based on the current priority of the first service and the transit coefficient; and calculating the inheritance priority of the second service based on the base priority of the second service, the transit priority, and the critical marker.
[0016] Therefore, by using different call hop numbers to correspond to different propagation coefficients, different call hop numbers correspond to different propagation priorities, thus achieving precise priority propagation. Furthermore, the inheritance priority of the second service is calculated based on the basic priority, propagation priority, and key markers of the second service, further ensuring the accuracy of the inheritance priority calculation of the second service and achieving precise invocation of the second service.
[0017] Optionally, the step of calculating the inheritance priority of the second service based on the basic priority, the transit priority, and the criticality marker includes: obtaining the basic weight coefficient corresponding to the basic priority; obtaining the transit weight coefficient corresponding to the transit priority; determining the critical chain priority and the corresponding critical chain weight coefficient when the call chain to which the second service belongs is a critical call chain based on the criticality marker; obtaining the preset fairness factor and the corresponding fairness weight coefficient; and performing a weighted summation of the basic priority, the basic weight coefficient, the transit priority, the transit weight coefficient, the critical chain priority, the critical chain weight coefficient, the preset fairness factor, and the fairness weight coefficient to obtain the inheritance priority of the second service.
[0018] Therefore, by assigning different weights to the basic priority, transit priority, criticality marker, and preset fairness factor, the final inheritance priority of the second service is determined through weighted calculation. This further improves the accuracy of the inheritance priority calculation for the second service. In addition, by adding the preset fairness factor, the calculation is made to prevent low-priority services from being too low, thereby further improving the flexibility of service invocation.
[0019] Optionally, the method further includes: traversing the service call topology information, detecting based on a preset depth-first search algorithm, and obtaining a circular service path; wherein, there is a directed path between any two services in the circular service path; and setting the inheritance priority of all services in the circular service path according to a preset priority processing strategy.
[0020] Therefore, by identifying circular service paths in the service call topology information and resolving the loops according to certain strategies, the problem of infinite loops in priority calculation caused by circular dependencies between services can be avoided, thereby further improving the accuracy of service calls.
[0021] Optionally, setting the inheritance priority of all services in the circular service path according to a preset priority processing strategy includes: obtaining the calling order of each service in the first path loop of the circular service path, and calculating the inheritance priority of each service based on the calling order of each service; or, taking any service in the circular service path as an anchor service, and recalculating the inheritance priority of other services in the circular service path based on the current priority of the anchor service and the number of call hops.
[0022] Therefore, the inheritance priority of each service is calculated according to the service call order of the preferred path loop, or a service is used as an anchor service to determine the inheritance priority of other services, thereby quickly and effectively resolving loops and ensuring the effectiveness of service calls.
[0023] Optionally, the method further includes: determining whether the inheritance priority of the second service meets the priority storm suppression condition; wherein the priority storm suppression condition includes the inheritance priority of the second service being greater than a preset upper limit threshold and / or the number of times the inheritance priority of the second service increases and adjusts within a preset time period being greater than a preset number threshold; if the priority storm suppression condition is met, the inheritance priority of the second service is suppressed based on a preset suppression strategy.
[0024] Therefore, by detecting and suppressing priority storms according to corresponding strategies, the technical problem of priority explosion caused by passing priority through multiple layers of calls is avoided, further ensuring the effectiveness of service calls.
[0025] Optionally, before executing the call operation of the second service based on the inheritance priority, the method further includes: determining whether the inheritance priority of the second service satisfies the priority inheritance condition; wherein the priority inheritance condition includes that the inheritance priority of the second service is less than the current priority of the first service, and / or the second service is a service on a critical call chain, and / or the second service is a suppression processing service; and taking the current priority of the first service as the final inheritance priority of the second service.
[0026] Therefore, before executing the call operation of the second service according to the inheritance priority of the second service, it is further determined whether the second service meets the inheritance conditions, thereby further improving the accuracy of service calls.
[0027] Optionally, the method further includes: detecting whether the service call topology information meets preset service update conditions; wherein the preset service update conditions include one or more of service registration or deregistration, service call relationship changes, and timed global recalculation, and each service update condition has a corresponding response time; if the preset service update conditions are met, updating the service call topology information and updating the inheritance priority of one or more services in the updated service call topology information according to the response time.
[0028] Therefore, it can detect whether the service call topology information is updated in real time, and quickly redetermine the inheritance priority of each service when the service call topology information is updated, thereby ensuring the real-time performance and effectiveness of service calls.
[0029] This disclosure also provides an in-vehicle service scheduling device, comprising: an acquisition module, configured to acquire service call topology information when a first service calls a second service, the service call topology information being used to characterize the call relationship between services, the service call topology information including at least one service call chain, the service call chain including multiple services with call relationships; a determination module, configured to determine the call hop count of the second service relative to the first service based on the service call topology information, the call hop count being the call level of the second service relative to the first service in the service call chain; a calculation module, configured to determine the inheritance priority of the second service based on the call hop count and the current priority of the first service; and an execution module, configured to execute the call operation of the second service based on the inheritance priority.
[0030] This disclosure also provides a vehicle, the vehicle including: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the in-vehicle service scheduling method provided in this disclosure.
[0031] This disclosure also provides a computer-readable storage medium storing a computer program for executing the vehicle service scheduling method provided in this disclosure.
[0032] This disclosure also provides a computer program product, including a computer program, wherein the computer program is executed by a processor as described in the vehicle service scheduling method of this disclosure.
[0033] Compared with the prior art, the technical solution provided in this disclosure has the following advantages: The vehicle service scheduling scheme provided in this disclosure, when a first service calls a second service, obtains service call topology information. This service call topology information characterizes the call relationship between services and includes at least one service call chain, which includes multiple services with call relationships. Based on the service call topology information, the number of call hops of the second service relative to the first service is determined. The number of call hops is the number of call levels of the second service relative to the first service in the service call chain. Based on the number of call hops and the current priority of the first service, the inheritance priority of the second service is determined. Based on the inheritance priority, the call operation of the second service is executed. This method determines the inheritance priority of the called service by using the number of call hops between the calling service and the called service and the current priority of the calling service. This ensures the effectiveness of priority transmission when an upstream service calls a downstream service, achieving more refined dynamic scheduling.
[0034] The above description is merely an overview of the technical solution disclosed herein. In order to better understand the technical means of this disclosure and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this disclosure more apparent and understandable, specific embodiments of this disclosure are described below. Attached Figure Description
[0035] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0036] Figure 1 A flowchart illustrating an in-vehicle service scheduling method provided in an embodiment of this disclosure; Figure 2 A flowchart illustrating another vehicle service scheduling method provided in this embodiment of the present disclosure; Figure 3 Example diagram of the service call chain provided in the embodiments of this disclosure; Figure 4This is a schematic diagram of the structure of an in-vehicle service dispatching device provided in an embodiment of the present disclosure; Figure 5 This is a schematic diagram of the structure of a vehicle provided in an embodiment of the present disclosure. Detailed Implementation
[0037] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0038] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0039] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0040] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0041] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0042] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0043] In actual vehicle service scenarios, a single-point priority arbitration strategy under SOA architecture is adopted, that is, priority is calculated separately for each independent service. However, in SOA architecture, there are complex call chain relationships between services. When the first service calls the second service, the priority of the first service should have a propagating effect on the second service. The existing method completely ignores this priority propagation relationship on the call chain, resulting in downstream services on the critical call chain not being able to obtain the priority boost they should have.
[0044] To address the aforementioned technical issues, this disclosure proposes an in-vehicle service scheduling scheme. The inherited priority of the called service is determined by the number of call hops between the calling service and the called service and the current priority of the calling service. This ensures the effectiveness of priority transmission when the upstream service calls the downstream service.
[0045] Figure 1 This is a flowchart illustrating an embodiment of an in-vehicle service scheduling method provided in this disclosure. This in-vehicle service scheduling method can be executed by an in-vehicle service scheduling device, which can be implemented using software and / or hardware, and is generally integrated into a vehicle. Figure 1 As shown, the vehicle service scheduling method includes: Step 101: In the case of the first service calling the second service, obtain the service call topology information. The service call topology information is used to characterize the call relationship between services. The service call topology information includes at least one service call chain, and the service call chain includes multiple services that have a call relationship.
[0046] The service call topology information refers to the topological structure formed by the call relationships between services, which is usually represented by a directed acyclic graph or a graph with cycles. In the embodiments of this disclosure, the service call topology information includes at least one service call chain, and each service call chain includes multiple services that have call relationships, that is, a service call chain formed between multiple services.
[0047] For example, a service call chain includes four services: service A, service B, service C, and service D. The call relationship between the four services is that service A calls service B, service B calls service C, and service C calls service D.
[0048] In this embodiment of the disclosure, the first service refers to the calling service, which can be service A, service B, and service C in the above examples; the second service refers to the called service, which can be service B, service C, and service D in the above examples.
[0049] Step 102: Based on the service call topology information, determine the number of call hops of the second service relative to the first service. The number of call hops is the number of call levels of the second service relative to the first service in the service call chain.
[0050] In this embodiment of the disclosure, the call hop count of the second service relative to the first service refers to the call level of the second service relative to the first service in the service call chain. Specifically, if the first service can directly call the second service, then the call level of the second service relative to the first service in the service call chain is 1, and the corresponding call hop count is 1. If the second service can also indirectly call the second service, then the call level of the second service relative to the first service in the service call chain is a positive integer greater than 1, and the corresponding call hop count is a positive integer greater than 1.
[0051] Continuing with the example above, if the first service is service A and the second service is service B, then it is determined that the first service directly calls the second service, and the hop count of the second service relative to the first service is 1. If the first service is service A and the second service is service C, then it is determined that the first service indirectly calls the second service, and the hop count of the second service relative to the first service is 2.
[0052] Step 103: Determine the inheritance priority of the second service based on the number of call hops and the current priority of the first service.
[0053] Step 104: Based on inheritance priority, execute the call operation of the second service.
[0054] The current priority of the first service refers to the real-time priority of the first service at the current moment. For example, the inherited priority calculated in real time when the first service is called by the third service, or the real-time priority determined in real time based on key markers when the first service is not called by any service.
[0055] In this embodiment, the inheritance priority of the second service refers to the priority that the second service inherits when it is called by the first service. Instead of directly assigning the current priority of the first service to the second service when the second service is called by the first service, the inheritance priority of the second service is determined based on the number of call hops, key markers and the current priority of the first service. This ensures the effectiveness of priority transmission based on the priority propagation when the upstream service calls the downstream service. The key markers of the service call chain are combined to ensure the service quality of critical businesses, and ultimately achieve more refined dynamic scheduling.
[0056] In this embodiment, there are many ways to determine the inheritance priority of the second service based on the number of call hops and the current priority of the first service. As one example, a propagation priority is determined based on the number of call hops and the current priority of the first service, and the inheritance priority of the second service is calculated based on the base priority and propagation priority of the second service. As another example, a propagation priority is determined based on the number of call hops and the current priority of the first service, and the inheritance priority of the second service is obtained by weighted summation based on the base priority, propagation priority, and a preset fairness factor according to corresponding weight coefficients. These two examples are merely illustrations, and this embodiment does not limit the specific implementation method of determining the inheritance priority of the second service based on the number of call hops and the current priority of the first service.
[0057] Furthermore, after determining the inheritance priority of the second service, the invocation operation of the second service is executed according to the inheritance priority of the second service.
[0058] The vehicle service scheduling scheme provided in this disclosure, when a first service calls a second service, obtains service call topology information. This service call topology information characterizes the call relationship between services and includes at least one service call chain, comprising multiple services with call relationships. Based on the service call topology information, it determines the call hop count of the second service relative to the first service and the key marker of the service call chain to which the second service belongs. The call hop count is the call level of the second service relative to the first service in the service call chain, and the key marker identifies whether the service call chain is a critical call chain. Based on the call hop count, the key marker, and the current priority of the first service, it determines the inherited priority of the second service. Based on the inherited priority, it executes the call operation of the second service. This method determines the inherited priority of the called service by using the call hop count between the calling service and the called service and the current priority of the calling service, thereby ensuring the effectiveness of priority transmission when an upstream service calls a downstream service.
[0059] In some embodiments, determining the number of call hops of the second service relative to the first service based on service call topology information includes: obtaining the number of call levels of the second service relative to the first service in the service call chain based on the service call topology information, and determining the number of call hops based on the number of call levels.
[0060] In this embodiment, the service node corresponding to the second service is first located based on the service call topology information. Then, the service call chain to which the service node belongs is searched, thereby obtaining all services corresponding to the service call chain and the call relationship between each service. Finally, the number of call layers of the second service relative to the first service in the service call chain is obtained. The number of call layers refers to the number of call layers between the second service and the first service in the service call chain. Direct calls between two services in the service call chain constitute one call layer. Indirect calls between two services in the service call chain through one service constitute two call layers. And so on, the number of call layers between the first service and the second service can be obtained. Finally, the number of call hops is determined based on the number of call layers.
[0061] Therefore, by determining the number of call hops between the second service and the first service based on the number of call levels of the second service relative to the first service in the service call chain, different call levels correspond to different call hops, thereby achieving different priorities for call transmission at different call levels and ensuring the effectiveness of priority transmission.
[0062] In some embodiments, a critical marker of the service call chain to which the second service belongs is determined based on service call topology information; wherein, the critical marker is used to identify whether the service call chain belongs to a critical call chain; the inheritance priority of the second service is determined based on the call hop count and the current priority of the first service, including: determining the inheritance priority of the second service based on the call hop count, the critical marker and the current priority of the first service.
[0063] In this embodiment of the disclosure, the critical marker of the service call chain to which the second service belongs is used to identify whether the service call chain belongs to a critical call chain. That is, a service call chain with a corresponding critical marker indicates that the service call chain is a critical call chain, that is, a service call path that is critical to user experience or security.
[0064] In this disclosure, there are many ways to determine the key markers of the service call chain to which the second service belongs based on service call topology information. As one example, by obtaining information such as security services corresponding to the service call chain to which the second service belongs based on service call topology information, the service call chain can be directly determined to be a key call chain, and the service call chain has a corresponding key marker. As another example, by obtaining multiple dimensions of the service call chain to which the second service belongs based on service call topology information, such as service type, call frequency, call latency, and associated controller registration, and scoring them, the service call chain is determined to be a key call chain based on the multi-dimensional scoring and a preset scoring threshold. When the service call chain is determined to be a key call chain, it indicates that the service call chain has a corresponding key marker. The above two are merely examples, and this disclosure does not limit the specific implementation method of determining the key markers of the service call chain to which the second service belongs based on service call topology information.
[0065] In this embodiment, there are many ways to determine the inheritance priority of the second service based on the number of call hops, a critical flag, and the current priority of the first service. As one example, a transit priority is determined based on the number of call hops and the current priority of the first service, and the inheritance priority of the second service is calculated based on its base priority, transit priority, and critical flag. As another example, a transit priority is determined based on the number of call hops and the current priority of the first service, and the inheritance priority of the second service is obtained by weighted summation based on its base priority, transit priority, critical flag, and a preset fairness factor according to corresponding weight coefficients. These two examples are merely illustrations, and this embodiment does not limit the specific implementation method of determining the inheritance priority of the second service based on the number of call hops, a critical flag, and the current priority of the first service.
[0066] This solves the technical problem that treating all call chains equally makes it impossible to identify and prioritize critical call chains, leading to a lack of service quality assurance for critical business operations. By determining the inheritance priority of the called service through multiple dimensions such as the number of call hops between the calling service and the called service, the current priority of the calling service, and the key markers of the call chain to which the called service belongs, the service call chain further combines the key markers of the service call chain to ensure the service quality of critical business operations, ultimately achieving more refined dynamic scheduling.
[0067] In some embodiments, determining the criticality marker of the service call chain to which the second service belongs based on service call topology information includes: obtaining a multi-dimensional score of the service call chain to which the second service belongs based on service call topology information, and performing a weighted calculation based on the multi-dimensional score to obtain a critical chain score of the service call chain; when the critical chain score is greater than a preset score threshold, the service call chain is identified as a critical call chain, and a criticality marker is obtained.
[0068] Based on the service call topology information, the multi-dimensional scores of the service call chain to which the second service belongs are obtained and weighted to calculate the critical chain score of the service call chain. In other words, the service call chain can be scored from different dimensions, including service type, call frequency, total call time, and domain controllers associated with each service in the service call chain. The critical chain score of the service call chain is obtained by weighting the multi-dimensional scores.
[0069] In some embodiments, obtaining a multi-dimensional score for the service call chain to which the second service belongs based on service call topology information includes: determining whether the service call chain to which the second service belongs includes a security service based on the service call topology information, and determining the security score of the service call chain; determining the frequency score of the service call chain based on the call frequency of the service call chain; determining the latency score of the service call chain based on the total call duration of the service call chain and a preset duration threshold; and determining the cross-domain score of the service call chain based on whether the service call chain is associated with multiple domain controllers.
[0070] Specifically, critical call chains are usually service call chains that are crucial to the business. First, it is determined whether the service call chain to which the second service belongs includes safety services, and the safety score of the service call chain is determined. For example, does the service call chain include safety services such as airbag control and brake control? When the service call chain includes safety services, it has a corresponding safety score, and the more safety services included, the higher the corresponding safety score, which further ensures the priority of calling safety services and further improves vehicle control safety.
[0071] Furthermore, based on the call frequency of the service call chain, a frequency score is determined for the service call chain. That is, within a pre-set time period, the number of calls to the service call chain is counted to obtain the call frequency of the service call chain, such as the number of calls per second or per minute. Finally, a frequency score is determined based on the call frequency. It can be understood that the higher the call frequency, the higher the frequency score. A certain frequency threshold can be set, and only service call chains with a frequency value greater than a certain threshold will have a corresponding frequency score. It is also possible to sort the call frequencies of all service call chains in the service call topology information and assign corresponding frequency scores based on the sorting results, further improving the flexibility of key call chain identification.
[0072] Furthermore, based on the total call duration of the service call chain and the preset duration threshold, the latency score of the service call chain is determined. Specifically, the total call duration of all services in the service call chain is obtained as the total call duration, and the latency score of the service call chain is determined according to the total call duration and the preset duration threshold. For example, if the total call duration of the service call chain is greater than the preset duration threshold, the corresponding latency score is assigned.
[0073] Furthermore, based on whether a service call chain is associated with multiple domain controllers, the cross-domain score of the service call chain is determined. Specifically, a service in a service call chain can be associated with only one domain controller or with multiple domain controllers. If each service in a service call chain is associated with multiple domain controllers, it indicates that the service calls in that service call chain are more important. Therefore, a corresponding cross-domain score is assigned depending on whether the service call chain is associated with multiple domain controllers. The more domain controllers a service call chain is associated with, the higher the corresponding cross-domain score, ensuring priority in the invocation of cross-domain control services and further improving the stability of vehicle control.
[0074] Therefore, security score, frequency score, latency score and cross-domain score are used as multi-dimensional scores for service call chains to identify critical call chains, thereby achieving accurate identification of critical call chains.
[0075] In this embodiment of the disclosure, after obtaining the multi-dimensional scores of the service call chain, a weighted calculation is performed based on the multi-dimensional scores to obtain the critical chain score of the service call chain. If the critical chain score is greater than a preset score threshold, the service call chain is identified as a critical call chain and a critical mark is obtained. Thus, if the service call chain to which the second service belongs is a critical call chain, it will obtain additional critical priority for calculating the inheritance priority of the second service. The preset score threshold can be selected and set according to the actual application needs.
[0076] For example, the critical chain score is obtained by multiplying the security score by the corresponding security weight, adding the frequency score by the corresponding frequency weight, adding the latency score by the latency weight, and adding the cross-domain score by the cross-domain weight. The sum of the security weight, frequency weight, latency weight, and cross-domain weight is 1, and the specific values can be selected and set according to the actual application scenario.
[0077] For example, a service call chain might include calls from emergency braking detection service to braking command issuance service to vehicle stability control service to anti-lock braking service. Since this call chain includes multiple safety services, it can be identified as a critical call chain, for example, marked as a safety critical chain, and a corresponding priority coefficient, such as 1.5, can be set. Another service call chain might include calls from speech recognition service to semantic understanding service to intent classification service to service scheduling service to execution feedback service. Since this call chain has a high call frequency, it can be identified as a critical call chain, for example, marked as a high-frequency interaction critical chain, and a corresponding priority coefficient, such as 1.3, can be set. A third service call chain might include calls from navigation path planning service (entertainment domain) to power demand calculation service (power domain) to torque distribution service (power domain). Since this call chain is associated with multiple domain controllers, it can be identified as a critical call chain, for example, marked as a cross-domain collaboration critical chain, and a corresponding priority coefficient, such as 1.4, can be set. When calculating service inheritance priorities based on these critical markers, the priority coefficients can be further combined to improve the accuracy of priority calculation and ultimately enhance the effectiveness of service calls.
[0078] It should be noted that when the critical chain score is less than or equal to the preset score threshold, the service call chain will not be marked as a critical call chain. That is, the service call chain does not have a criticality mark, so when calculating the inheritance priority of the second service, the critical chain priority corresponding to the criticality mark will be 0.
[0079] Therefore, by determining key markers based on multi-dimensional scoring of service call chains, critical service call chains that are essential to the business can be accurately identified. This allows for prioritization of services on service call chains with key markers, further improving the accuracy of service calls.
[0080] In some embodiments, determining the inheritance priority of a second service based on the number of call hops, a critical flag, and the current priority of the first service includes: determining the transit coefficient of the second service relative to the first service based on the number of call hops; determining the transit priority of the second service based on the current priority and the transit coefficient of the first service; and calculating the inheritance priority of the second service based on the base priority, transit priority, and critical flag of the second service.
[0081] Specifically, the transit coefficient of the second service relative to the first service is determined based on the number of call hops. More specifically, different numbers of call hops correspond to different transit coefficients. For example, a direct call (1 hop) corresponds to a transit coefficient of 0.9, an indirect call (2 hops) corresponds to a transit coefficient of 0.8, and a multi-hop call (3 hops or more) corresponds to a transit coefficient of 0.7 × 0.9^(n-3); where n is a positive integer greater than 3.
[0082] Furthermore, after determining the transmission coefficient of the second service relative to the first service, the current priority of the first service is multiplied by the transmission coefficient to obtain the transmission priority of the second service. It should be noted that after calculating the transmission priority of the second service, the basic priority and the transmission priority of the second service are compared, and the larger value is taken as the final transmission priority of the second service.
[0083] For example, a service call chain includes four services: service A, service B, service C, and service D. The call relationship between the four services is: service A calls service B, service B calls service C, and service C calls service D. Service A's current priority is 100. The transit coefficient of service A when calling service B is 0.9. The transit priority of service B is calculated as 100 multiplied by 0.9, resulting in 90. This is then compared with service B's base priority, for example, 40, and its transit priority of 90. Finally, the transit priority of 90 is taken as the final transit priority of service B. Similarly, when calling service C... The transmission coefficient is 0.8. The transmission priority of service C is calculated as 90 multiplied by 0.8, which equals 72. The basic priority of service C, such as 30, is compared with the transmission priority of service C, which is 72. Finally, the transmission priority of service C is 72. Similarly, when calling service D, the transmission coefficient is 0.7. The transmission priority of service D is calculated as 72 multiplied by 0.7, which equals 50.4. The basic priority of service D, such as 20, is compared with the transmission priority of service D, which is 50.4. Finally, the transmission priority of service D is 50.4.
[0084] Furthermore, the inheritance priority of the second service is calculated based on its basic priority, transmission priority, and key marker. Specifically, the inheritance priority of the second service can be obtained by weighting and summing the basic priority, transmission priority, and key marker according to certain weight coefficients. Alternatively, the inheritance priority of the second service can be obtained by weighting and summing the basic priority, transmission priority, key marker, and preset fairness factor according to corresponding weight coefficients.
[0085] In some embodiments, the basic weight coefficient corresponding to the basic priority is obtained, the transit weight coefficient corresponding to the transit priority is obtained, and when the call chain to which the second service belongs is a critical call chain based on the criticality marker, the critical chain priority and the corresponding critical chain weight coefficient are determined, the preset fairness factor and the corresponding fairness weight coefficient are obtained, and the basic priority, basic weight coefficient, transit priority, transit weight coefficient, critical chain priority, critical chain weight coefficient, preset fairness factor and fairness weight coefficient are weighted and summed to obtain the inheritance priority of the second service.
[0086] Specifically, weight coefficients are determined for the basic priority, transitive priority, and criticality marker, and a weighted sum is calculated by adding a preset fairness factor and its corresponding weight coefficients to obtain the inheritance priority of the second service. The sum of the basic weight coefficient, transitive weight coefficient, critical chain weight coefficient, and fairness weight coefficient is 1, and their specific values can be selected and set according to the actual application scenario.
[0087] For example, the basic priority corresponds to a basic weight coefficient of 0.4 to ensure the inherent importance of the service, the transit priority corresponds to a transit weight coefficient of 0.35 to ensure the priority passed by the upstream caller, the critical chain priority corresponds to a critical chain weight coefficient of 0.15 to ensure the additional bonus on the critical call chain, and the preset fairness factor corresponds to a fairness weight coefficient of 0.1 to prevent low-priority services from being called.
[0088] For example, if a navigation service is called by a voice service, and the basic priority of the navigation service is 50, the transmission priority of the upstream voice service is 45 × 0.9 = 40.5. The navigation service belongs to a high-frequency interaction critical chain in the service call chain, that is, the navigation service belongs to a critical call chain in the service call chain. The critical chain priority is 10, the preset fairness factor is 5, and the inheritance priority of the navigation service is calculated as 50 × 0.4 + 40.5 × 0.3 + 10 × 0.15 + 5 × 0.1 = 36.65.
[0089] For example, the navigation service calls the route planning service. The route planning service has a base priority of 40. When called by the navigation service, the priority is passed on as 50 × 0.9 = 45. The route planning service belongs to the high-frequency interaction critical chain of the service call chain, which means that the navigation service belongs to the critical call chain. The critical chain priority is 10, and the preset fairness factor is 5. The inheritance priority of the route planning service is calculated as 40 × 0.4 + 45 × 0.3 + 10 × 0.15 + 5 × 0.1 = 38.5.
[0090] Therefore, by assigning different weights to the basic priority, transit priority, criticality marker, and preset fairness factor, the final inheritance priority of the second service is determined through weighted calculation. This further improves the accuracy of the inheritance priority calculation for the second service. In addition, by adding the preset fairness factor, the calculation is made to prevent low-priority services from being too low, thereby further improving the flexibility of service invocation.
[0091] Specifically, a multi-dimensional priority calculation method based on basic priority, transit priority, critical chain priority, and preset fairness factors comprehensively considers the inherent importance of the service, the call chain context, business importance, and service fairness to achieve more refined dynamic scheduling.
[0092] Therefore, by using different call hop numbers to correspond to different propagation coefficients, different call hop numbers correspond to different propagation priorities, thus achieving precise priority propagation. Furthermore, the inheritance priority of the second service is calculated based on the basic priority, propagation priority, and key markers of the second service, further ensuring the accuracy of the inheritance priority calculation of the second service and achieving precise invocation of the second service.
[0093] In some embodiments, the vehicle service scheduling method further includes: traversing service call topology information, detecting based on a preset depth-first search algorithm, and obtaining a circular service path; wherein, there is a directed path between any two services in the circular service path; and setting the inheritance priority of all services in the circular service path according to a preset priority processing strategy.
[0094] Specifically, in complex SOA service networks, there may be circular dependencies between services (e.g., service X calls service Y, service Y calls service Z, and service Z calls service X). When circular dependencies occur, priority propagation may form a closed loop, causing priority calculation to get stuck in an infinite loop or produce unreasonable priority values, i.e., there is a priority deadlock problem caused by circular dependencies.
[0095] In this embodiment of the disclosure, circular dependencies in the service call chain are detected and priority deadlocks are resolved. Specifically, the service call topology information is traversed, and a preset depth-first search algorithm, such as depth-first search (DFS), is used to detect loops. Strongly connected components (SCCs) are identified as circular service paths, and services within the circular service paths are marked as circular dependencies. An example of a circular dependency is that service X calls service Y, service Y calls service Z, and service Z calls service X (forming a loop). That is, there is a directed path between any two services in the circular service path, thereby marking the circular service paths corresponding to services X, service Y, and service Z as a circular dependency group.
[0096] Furthermore, after obtaining the circular service path, the inheritance priority of all services in the circular service path is set according to the preset priority processing strategy, that is, the circular call of services in the circular service path is resolved. The circular service path can be processed according to strategies such as priority freezing and loop breaking.
[0097] In some embodiments, the inheritance priority of all services in the circular service path is set according to a preset priority processing strategy, including: obtaining the calling order of each service in the first path loop of the circular service path, and calculating the inheritance priority of each service based on the calling order of each service; or, taking any service in the circular service path as an anchor service, and recalculating the inheritance priority of other services in the circular service path based on the current priority of the anchor service and the number of call hops.
[0098] Specifically, for all services within the circular service path, the inheritance priority calculated at the beginning of the loop is used as the final inheritance priority, thereby preventing the infinite propagation of priority within the loop; any service in the circular service path is selected as the anchor service, and the priority of the anchor service does not propagate with the loop, while the inheritance priority of other services is calculated based on the anchor service.
[0099] It should be noted that time-slice round-robin scheduling can also be used for service groups in the circular service path, and the inheritance priority of all services in the circular service path can be calculated according to the time interval to avoid deadlock caused by priority conflicts.
[0100] Therefore, the inheritance priority of each service is calculated according to the service call order of the preferred path loop, or a service is used as an anchor service to determine the inheritance priority of other services, thereby quickly and effectively resolving loops and ensuring the effectiveness of service calls.
[0101] Specifically, in the field of vehicle service scheduling, the automatic detection and resolution of circular dependencies can be achieved. Different strategies can be used to resolve deadlocks and further ensure the effectiveness of service calls.
[0102] Therefore, by identifying circular service paths in the service call topology information and resolving the loops according to certain strategies, the problem of infinite loops in priority calculation caused by circular dependencies between services can be avoided, thereby further improving the accuracy of service calls.
[0103] In some embodiments, the vehicle service scheduling method further includes: determining whether the inheritance priority of the second service meets the priority storm suppression condition; wherein the priority storm suppression condition includes the inheritance priority of the second service being greater than a preset upper limit threshold and / or the number of times the inheritance priority of the second service is adjusted upward within a preset time period being greater than a preset number threshold; if the priority storm suppression condition is met, the inheritance priority of the second service is suppressed based on a preset suppression strategy.
[0104] It is understandable that if upstream priority is simply passed to downstream services, in the case of multi-level service call relationships, the priority will be amplified at each level, causing low-priority underlying services to be unreasonably promoted to the highest priority, thus causing a priority storm; a priority storm refers to the phenomenon that the priority value expands infinitely due to multi-level priority passing.
[0105] In this embodiment of the disclosure, priority storm suppression conditions are preset, including the second service's inherited priority being greater than a preset upper limit threshold and the second service's inherited priority being adjusted more than a preset number of times within a preset time period; wherein, the preset upper limit threshold, preset time period, and preset number of times threshold can be set according to the actual application scenario.
[0106] Specifically, if the inheritance priority of the second service exceeds the preset upper limit threshold, or if the inheritance priority of the service rises more than the preset number of times within a preset time period (e.g., 1 second), such as 3 times, then it is determined that the inheritance priority of the second service needs to be suppressed.
[0107] In this embodiment, the inheritance priority of the second service can be suppressed according to a preset suppression strategy. Specifically, when the inheritance priority of the second service reaches a certain value, such as 95, it will no longer be increased, and the second service will be marked as having a priority saturation state. Alternatively, when a storm trend is detected and the priority storm suppression condition is met, the inheritance priority of the second service will directly inherit the current priority of the first service, and the inheritance priority of the second service will not be re-determined based on the number of call hops, critical flags, and the current priority of the first service. Or, suppression measures such as requiring the inheritance priority of the second service to be increased for a certain period of time, such as 100ms, before it can be increased again can be implemented.
[0108] Therefore, by detecting and suppressing priority storms according to corresponding strategies, the technical problem of priority explosion caused by passing priority through multiple layers of calls is avoided, further ensuring the effectiveness of service calls.
[0109] Optionally, before executing the call operation of the second service based on the inheritance priority, the method further includes: determining whether the inheritance priority of the second service meets the priority inheritance conditions; wherein, the priority inheritance conditions include the inheritance priority of the second service being less than the current priority of the first service, and / or the second service being a service on the critical call chain, and / or the second service being a suppression processing service, and the current priority of the first service being taken as the final inheritance priority of the second service.
[0110] Specifically, before executing the call operation of the second service according to the inheritance priority of the second service, priority inheritance processing can be selected for flexible scenarios. In scenarios such as the inheritance priority of the second service being lower than the current priority of the first service (that is, when a high-priority service calls a low-priority service, the priority of the called service can be temporarily raised to the priority of the caller), or the second service being a service on a critical call chain, or the second service being a suppression processing service, the current priority of the first service can be used as the final inheritance priority of the second service, further improving the flexibility of service priority determination and meeting the call requirements of different scenarios.
[0111] It should be noted that, in order to further ensure the accuracy of service calls, a certain inheritance validity period can be set, such as call completion or timeout (e.g., 5 seconds), and the call level between services during inheritance can be limited to a maximum of 3 levels to avoid deep inheritance and other strategies to ensure the accuracy of service calls.
[0112] Therefore, before executing the call operation of the second service according to the inheritance priority of the second service, it is further determined whether the second service meets the inheritance conditions. If the inheritance conditions are met, the current priority of the first service can be selected as the final inheritance priority of the second service, which further improves the flexibility of service calls and meets the calling needs of different scenarios.
[0113] Optionally, the vehicle-mounted service scheduling method further includes: detecting whether the service call topology information meets the preset service update conditions; wherein, the preset service update conditions include one or more of the following: service registration or deregistration, changes in service call relationships, and timed global recalculation, and each service update condition has a corresponding response time; if the preset service update conditions are met, updating the service call topology information and updating the inheritance priority of one or more services in the updated service call topology information according to the response time.
[0114] Specifically, service call topology information is built and maintained in real time through runtime technology. More specifically, service description files are obtained and interface dependencies are parsed to obtain multiple services with call relationships and construct service call chains. At least one service call chain constitutes the service call topology information. Service call relationships can also be recorded by embedding points at the service call entry and exit points to update the service call topology information. Service call relationships can also be inferred from the inter-service communication records of the message bus (soft bus) to update the service call topology information. The final constructed service call topology information includes at least one service call chain, and the service call chain includes multiple services with call relationships.
[0115] Therefore, in the in-vehicle SOA architecture, real-time construction of runtime service call topology information is achieved. Through the fusion of static analysis, dynamic tracing, and runtime inference, accurate service call topology information is constructed, providing a foundation for subsequent service priority calculation.
[0116] In this embodiment of the disclosure, when a service is registered or deregistered, the service call relationship changes (such as calling a new service or canceling a call), or a full scan is performed periodically (such as every 60 seconds), the preset service update conditions are determined, the service call topology information is updated, and the inheritance priority of one or more services in the updated service call topology information is updated according to the response time corresponding to each service update condition; wherein, the incremental service update can only update the changed part of the service, thereby reducing the computational overhead.
[0117] Different service update conditions correspond to different response times. For example, service registration immediately triggers an update of the service's inheritance priority; changes in service call relationships trigger an update of the service's inheritance priority within a response time of, for example, 100ms; call chain topology updates trigger an update of the service's inheritance priority within a response time of, for example, 500ms; and periodic global recalculation triggers an update of the service's inheritance priority every 10 seconds based on the response time, allowing only the inheritance priority of the affected services to be recalculated.
[0118] It should be noted that during the update process, if the inheritance priority changes by more than a certain value, such as 20, a transition period of 500ms is adopted. The history of service inheritance priority adjustment can also be recorded for subsequent algorithm optimization and other operations, thereby further improving the effectiveness of subsequent service calls.
[0119] Therefore, it can detect whether the service call topology information is updated in real time, and quickly redetermine the inheritance priority of each service when the service call topology information is updated, thereby ensuring the real-time performance and effectiveness of service calls.
[0120] Based on the foregoing embodiments, this disclosure determines the inherited priority of the called service through multiple dimensions, such as the number of call hops between the calling service and the called service, the current priority of the calling service, and key markers in the call chain of the called service. This ensures the effectiveness of priority transmission when an upstream service calls a downstream service, achieving more refined dynamic scheduling. The following section will further elaborate on this. Figure 2 Provide a detailed description.
[0121] Figure 2 This is a flowchart illustrating another vehicle service scheduling method provided in this embodiment of the present disclosure. This embodiment further optimizes the above-described vehicle service scheduling method based on the previous embodiment. Figure 2 As shown, the method includes: Step 201: In the case of the first service calling the second service, obtain the service call topology information. The service call topology information is used to characterize the call relationship between services. The service call topology information includes at least one service call chain, and the service call chain includes multiple services that have a call relationship.
[0122] Step 202: Obtain the number of call levels of the second service relative to the first service in the service call chain based on the service call topology information, and determine the number of call hops based on the number of call levels.
[0123] Step 203: Obtain the multi-dimensional score of the service call chain to which the second service belongs based on the service call topology information, and perform weighted calculation based on the multi-dimensional score to obtain the critical chain score of the service call chain. When the critical chain score is greater than the preset score threshold, the service call chain is marked as a critical call chain and a criticality mark is obtained.
[0124] Step 204: Determine the transit coefficient of the second service relative to the first service based on the number of call hops. Determine the transit priority of the second service based on the current priority and transit coefficient of the first service. Calculate the inheritance priority of the second service based on the basic priority, transit priority and key marker of the second service.
[0125] Step 205: Traverse the service call topology information, detect based on the preset depth-first search algorithm, and obtain the circular service path; wherein, there is a directed path between any two services in the circular service path, and set the inheritance priority of all services in the circular service path according to the preset priority processing strategy.
[0126] Step 206: Determine whether the inheritance priority of the second service meets the priority storm suppression conditions; wherein, the priority storm suppression conditions include the inheritance priority of the second service being greater than a preset upper limit threshold and / or the number of times the inheritance priority of the second service increases and adjusts within a preset time period being greater than a preset number threshold. If the priority storm suppression conditions are met, the inheritance priority of the second service is suppressed based on the preset suppression strategy.
[0127] Step 207: Determine whether the inheritance priority of the second service meets the priority inheritance conditions; wherein, the priority inheritance conditions include that the inheritance priority of the second service is less than the current priority of the first service, and / or the second service is a service on the critical call chain, and / or the second service is a suppression processing service, and the current priority of the first service is taken as the final inheritance priority of the second service.
[0128] Step 208: Based on the final inheritance priority of the second service, execute the call operation of the second service.
[0129] It should be noted that after step 204, steps 205 and / or 206 and / or 207 can be executed. Figure 2 This is just an example; you can choose the settings according to your actual application scenario.
[0130] Specifically, the service call topology information includes at least one service call chain. Each service call chain includes multiple services with call relationships. The call relationship between services can be a call relationship or a called relationship. In the case where any service calls another service, i.e., the first service calls the second service, the service call topology information is used to determine the number of call levels of the second service relative to the first service in the service call chain to determine the number of hops, and to determine whether the service call chain to which the second service belongs is a critical call chain, so as to determine whether the service call chain has a critical marker.
[0131] Specifically, the multi-dimensional scores of the service call chain to which the second service belongs are obtained based on the service call topology information and weighted to obtain the critical chain score of the service call chain. If the critical chain score is greater than the preset score threshold, the service call chain is marked as a critical call chain and a critical mark is obtained.
[0132] Specifically, the security score of the service call chain is determined by determining whether the service call chain to which the second service belongs includes a security service based on the service call topology information; the frequency score of the service call chain is determined based on the call frequency of the service call chain; the latency score of the service call chain is determined based on the total call duration of the service call chain and the preset duration threshold; and the cross-domain score of the service call chain is determined based on whether the service call chain is associated with multiple domain controllers. Finally, the security score is multiplied by the corresponding security weight, the frequency score is multiplied by the corresponding frequency weight, the latency score is multiplied by the latency weight, and the cross-domain score is multiplied by the cross-domain weight to obtain the critical chain score.
[0133] Furthermore, the transit coefficient of the second service relative to the first service is determined based on the number of call hops. The current priority of the first service is multiplied by the transit coefficient to obtain the transit priority of the second service. The inheritance priority of the second service is calculated based on the basic priority, transit priority and critical flag of the second service.
[0134] The inheritance priority of the second service is calculated based on its basic priority, transit priority, and criticality marker. This includes: obtaining the basic weight coefficient corresponding to the basic priority; obtaining the transit weight coefficient corresponding to the transit priority; determining the critical chain priority and its corresponding critical chain weight coefficient when the call chain to which the second service belongs is a critical call chain based on the criticality marker; obtaining the preset fairness factor and its corresponding fairness weight coefficient; and performing a weighted summation of the basic priority, basic weight coefficient, transit priority, transit weight coefficient, critical chain priority, critical chain weight coefficient, preset fairness factor, and fairness weight coefficient to obtain the inheritance priority of the second service.
[0135] Understandably, circular dependencies between services can lead to an infinite loop in priority calculation. To resolve this, we can traverse the service call topology information, use a preset depth-first search algorithm such as depth-first search to detect and obtain the circular service path, and set the inheritance priority of all services in the circular service path according to the preset priority processing strategy.
[0136] The inheritance priority of all services in the circular service path is set according to the preset priority processing strategy, including: obtaining the calling order of each service during the first path loop of the circular service path, and calculating the inheritance priority of each service based on the calling order of each service; or, taking any service in the circular service path as an anchor service, and recalculating the inheritance priority of other services in the circular service path based on the current priority of the anchor service and the number of call hops.
[0137] In some embodiments, priority storm suppression conditions are preset, including the second service's inherited priority being greater than a preset upper limit threshold, the second service's inherited priority increasing and adjusting more times within a preset time period than a preset number threshold, etc. If the second service's inherited priority exceeds the preset upper limit threshold or the service's inherited priority continuously increases more than a preset number threshold within a preset time period, it is determined that the second service's inherited priority needs to be suppressed according to the preset suppression strategy.
[0138] Specifically, the second service may be marked as having a priority saturation state; or the second service may inherit the current priority of the first service directly, without re-determining the second service's inheritance priority based on the number of call hops, critical flags, and the current priority of the first service; or the second service may be subject to suppression measures such as maintaining its inheritance priority for a certain period of time after it has been increased before it can be increased again.
[0139] In some embodiments, before executing the call operation of the second service according to the inheritance priority of the second service, priority inheritance processing can be selected for flexible scenarios. In scenarios such as the inheritance priority of the second service being lower than the current priority of the first service, or the second service being a service on a critical call chain, or the second service being a suppression processing service, the current priority of the first service can be used as the final inheritance priority of the second service.
[0140] In some embodiments, the service call topology information is detected to meet the preset service update conditions. The preset service update conditions include one or more of the following: service registration or deregistration, changes in service call relationships, and periodic global recalculation. Each service update condition has a corresponding response time. If the preset service update conditions are met, the service call topology information is updated and the inheritance priority of one or more services in the updated service call topology information is updated according to the response time.
[0141] As an example scenario, when a user triggers a smart parking function, it may involve service call relationships, such as... Figure 3 The example shown includes the path planning service calling the environment perception service, the vehicle control service, and the display rendering service. Taking the path planning service as the first service calling the environment perception service as the second service as the example.
[0142] Specifically, the current priority of the path planning service is 50. The transmission coefficient of the path planning service in the environmental perception service is 0.9. The transmission priority of the environmental perception service is calculated as 50 multiplied by 0.9 to get 45. The basic priority of the environmental perception service, such as 40, is compared with the transmission priority of the environmental perception service, 45. Finally, the transmission priority of 45 is taken as the final transmission priority of the environmental perception service.
[0143] Specifically, the environment awareness service belongs to the service call chain as a cross-domain collaboration critical chain, that is, the environment awareness service belongs to the service call chain as a critical call chain, the critical chain priority is 10, the preset fairness factor is 5, the basic priority corresponds to the basic weight coefficient of 0.4, the transit priority corresponds to the transit weight coefficient of 0.35, the critical chain priority corresponds to the critical chain weight coefficient of 0.15, and the preset fairness factor corresponds to the fairness weight coefficient of 0.1. The inheritance priority of the environment awareness service is calculated as 40×0.4+45×0.3+10×0.15+5×0.1=38.5.
[0144] Therefore, by constructing runtime service call topology information, identifying critical call chains, realizing intelligent propagation and decay of priorities along the call chain, and resolving circular dependency deadlocks, fine-grained dynamic scheduling of service priorities under the SOA architecture is achieved. Furthermore, a critical call chain identification method based on security weight, frequency weight, latency weight, and cross-domain weight is proposed. Through multi-dimensional scoring of the call chain, critical paths crucial to the business are accurately identified, and services on these paths are given priority. By setting a decreasing propagation coefficient based on the number of call hops, the effectiveness of priority propagation is ensured while preventing priority storms. In the field of vehicle service scheduling, automatic detection and resolution of circular dependencies are achieved, identifying circular service paths and using strategies such as priority freezing, loop-breaking selection, and time-slice isolation to resolve deadlocks. Finally, a multi-dimensional priority calculation method based on basic priority, propagation priority determined by the number of call hops, criticality marking, and preset fairness factors comprehensively considers the inherent importance of services, call chain context, business importance, and service fairness, achieving more refined dynamic scheduling.
[0145] Figure 4 This is a schematic diagram of the structure of an in-vehicle service dispatching device provided in an embodiment of this disclosure. The device can be implemented by software and / or hardware and is generally integrated into a vehicle. Figure 4 As shown, the device includes: The acquisition module 410 is used to acquire service call topology information when the first service calls the second service. The service call topology information is used to characterize the call relationship between services. The service call topology information includes at least one service call chain, and the service call chain includes multiple services that have a call relationship.
[0146] The determining module 420 is used to determine the number of call hops of the second service relative to the first service based on the service call topology information, wherein the number of call hops is the number of call levels of the second service relative to the first service in the service call chain.
[0147] The calculation module 430 is used to determine the inheritance priority of the second service based on the number of call hops and the current priority of the first service.
[0148] Execution module 440 is used to execute the invocation operation of the second service based on the inheritance priority.
[0149] Therefore, the inheritance priority of the called service is determined by the number of call hops between the calling service and the called service and the current priority of the calling service. This ensures the effectiveness of priority transmission when the upstream service calls the downstream service, thus achieving more refined dynamic scheduling.
[0150] Optionally, the determining module 420 includes: an acquisition determining unit, configured to acquire the number of call levels of the second service relative to the first service in the service call chain based on the service call topology information, and determine the number of call hops based on the number of call levels.
[0151] Therefore, by determining the number of call hops between the second service and the first service based on the number of call levels of the second service relative to the first service in the service call chain, different call levels correspond to different call hops, thereby achieving different priorities for call transmission at different call levels and ensuring the effectiveness of priority transmission.
[0152] Optionally, the determining module 420 further includes: a determining unit, configured to determine a key marker of the service call chain to which the second service belongs based on the service call topology information; wherein the key marker is used to identify whether the service call chain belongs to a key call chain; the calculation module 430 is further configured to: determine the inheritance priority of the second service based on the call hop count, the key marker and the current priority of the first service.
[0153] Therefore, the inheritance priority of the called service is determined by multiple dimensions such as the number of call hops between the calling service and the called service, the current priority of the calling service, and the key markers of the service call chain to which the called service belongs. By further combining the key markers of the service call chain, the service quality of critical business is guaranteed, and ultimately more refined dynamic scheduling is achieved.
[0154] Optionally, the determining unit includes: a determining subunit, configured to obtain a multi-dimensional score of the service call chain to which the second service belongs based on the service call topology information, and perform a weighted calculation based on the multi-dimensional score to obtain a critical chain score of the service call chain; and an identifying subunit, configured to identify the service call chain as a critical call chain when the critical chain score is greater than a preset score threshold, thereby obtaining the criticality marker.
[0155] Therefore, by determining key markers based on multi-dimensional scoring of service call chains, critical service call chains that are essential to the business can be accurately identified. This allows for prioritization of services on service call chains with key markers, further improving the accuracy of service calls.
[0156] Optionally, the determining subunit is specifically configured to: determine whether the service call chain to which the second service belongs includes a security service based on the service call topology information, and determine the security score of the service call chain; determine the frequency score of the service call chain based on the call frequency of the service call chain; determine the latency score of the service call chain based on the total call duration of the service call chain and a preset duration threshold; determine the cross-domain score of the service call chain based on whether the service call chain is associated with multiple domain controllers, and perform a weighted calculation based on the multi-dimensional scores to obtain the critical chain score of the service call chain.
[0157] Therefore, security score, frequency score, latency score and cross-domain score are used as multi-dimensional scores for service call chains to identify critical call chains, thereby achieving accurate identification of critical call chains.
[0158] Optionally, the calculation module 430 includes: a first determining unit, configured to determine the transit coefficient of the second service relative to the first service based on the call hop count; a second determining unit, configured to determine the transit priority of the second service based on the current priority of the first service and the transit coefficient; and a calculation unit, configured to calculate the inheritance priority of the second service based on the base priority of the second service, the transit priority, and the key marker.
[0159] Therefore, by using different call hop numbers to correspond to different propagation coefficients, different call hop numbers correspond to different propagation priorities, thus achieving precise priority propagation. Furthermore, the inheritance priority of the second service is calculated based on the basic priority, propagation priority, and key markers of the second service, further ensuring the accuracy of the inheritance priority calculation of the second service and achieving precise invocation of the second service.
[0160] Optionally, the calculation unit is specifically used for: obtaining the basic weight coefficient corresponding to the basic priority; obtaining the transit weight coefficient corresponding to the transit priority; determining the critical chain priority and the corresponding critical chain weight coefficient when the call chain to which the second service belongs is a critical call chain based on the criticality marker; obtaining the preset fairness factor and the corresponding fairness weight coefficient; and performing a weighted summation calculation on the basic priority, the basic weight coefficient, the transit priority, the transit weight coefficient, the critical chain priority, the critical chain weight coefficient, the preset fairness factor, and the fairness weight coefficient to obtain the inheritance priority of the second service.
[0161] Therefore, by assigning different weights to the basic priority, transit priority, criticality marker, and preset fairness factor, the final inheritance priority of the second service is determined through weighted calculation. This further improves the accuracy of the inheritance priority calculation for the second service. In addition, by adding the preset fairness factor, the calculation is made to prevent low-priority services from being too low, thereby further improving the flexibility of service invocation.
[0162] Optionally, the device further includes: a traversal module, used to traverse the service call topology information, detect based on a preset depth-first search algorithm, and obtain a circular service path; wherein, there is a directed path between any two services in the circular service path; and a processing module, used to set the inheritance priority of all services in the circular service path according to a preset priority processing strategy.
[0163] Therefore, by identifying circular service paths in the service call topology information and resolving the loops according to certain strategies, the problem of infinite loops in priority calculation caused by circular dependencies between services can be avoided, thereby further improving the accuracy of service calls.
[0164] Optionally, the processing module is specifically used to: obtain the calling order of each service during the first path loop of the circular service path, and calculate the inheritance priority of each service based on the calling order of each service; or, take any service in the circular service path as an anchor service, and recalculate the inheritance priority of other services in the circular service path based on the current priority of the anchor service and the number of call hops.
[0165] Therefore, the inheritance priority of each service is calculated according to the service call order of the preferred path loop, or a service is used as an anchor service to determine the inheritance priority of other services, thereby quickly and effectively resolving loops and ensuring the effectiveness of service calls.
[0166] Optionally, the device further includes: a judgment module, used to judge whether the inheritance priority of the second service meets the priority storm suppression condition; wherein the priority storm suppression condition includes the inheritance priority of the second service being greater than a preset upper limit threshold and / or the number of times the inheritance priority of the second service increases and adjusts within a preset time period being greater than a preset number threshold; and a suppression module, used to suppress the inheritance priority of the second service based on a preset suppression strategy when the priority storm suppression condition is met.
[0167] Therefore, by detecting and suppressing priority storms according to corresponding strategies, the technical problem of priority explosion caused by passing priority through multiple layers of calls is avoided, further ensuring the effectiveness of service calls.
[0168] Optionally, before executing the call operation of the second service based on the inheritance priority, the device further includes: an inheritance determination module, used to determine whether the inheritance priority of the second service meets the priority inheritance conditions; wherein, the priority inheritance conditions include the inheritance priority of the second service being less than the current priority of the first service, and / or the second service being a service on a critical call chain, and / or the second service being a suppression processing service, and the current priority of the first service being used as the final inheritance priority of the second service.
[0169] Therefore, before executing the call operation of the second service according to the inheritance priority of the second service, it is further determined whether the second service meets the inheritance conditions, thereby further improving the accuracy of service calls.
[0170] Optionally, the apparatus further includes: an update processing module, configured to detect whether the service call topology information meets preset service update conditions; wherein the preset service update conditions include one or more of service registration or deregistration, service call relationship changes, and timed global recalculation, each service update condition having a corresponding response time, and when the preset service update conditions are met, updating the service call topology information and updating the inheritance priority of one or more services in the updated service call topology information according to the response time.
[0171] Therefore, it can detect whether the service call topology information is updated in real time, and quickly redetermine the inheritance priority of each service when the service call topology information is updated, thereby ensuring the real-time performance and effectiveness of service calls.
[0172] The vehicle service scheduling device provided in this disclosure can execute the vehicle service scheduling method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.
[0173] This disclosure also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the vehicle service scheduling method provided in any embodiment of this disclosure.
[0174] Figure 5 This is a schematic diagram of the structure of a vehicle provided in an embodiment of this disclosure.
[0175] For example, such as Figure 5 As shown, the vehicle includes a memory 501 and a processor 502. The memory 501 stores executable program code 5011, and the processor 502 is used to call and execute the executable program code 5011 to perform the vehicle service scheduling method.
[0176] This embodiment can divide the vehicle into functional modules according to the above method example. For example, each function can be assigned to a separate module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0177] When each functional module is divided according to its corresponding function, the vehicle may include: a receiving and acquisition module, a calculation module, and a warning module, etc. It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0178] The vehicle provided in this embodiment is used to execute the above-described vehicle service scheduling method, and therefore can achieve the same effect as the above implementation method.
[0179] When using integrated units, the vehicle may include a processing module and a storage module. The processing module is used to control and manage the vehicle's actions. The storage module supports the vehicle in executing program code and data.
[0180] The processing module may be a processor or a controller that can implement or execute various exemplary logic blocks, modules, and circuits as described herein. The processor may also be a combination of functions that implement computing capabilities, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and microprocessors, etc., and the storage module may be a memory.
[0181] This embodiment also provides a computer-readable storage medium (including but not limited to disk storage, CD-ROM, optical storage, etc.) storing computer program code. When the computer program code is run on a computer, the computer executes the above-mentioned related method steps to implement the vehicle service scheduling method provided in the above embodiment.
[0182] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned related steps to implement the vehicle service scheduling method provided in the above embodiment.
[0183] The beneficial effects of the above embodiments can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.
[0184] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0185] In the embodiments provided in this disclosure, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms. In the description of this disclosure, it should be understood that if the terms "upper", "lower", "front", "rear", "left" and "right" are used to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the position or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure.
[0186] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element. The above are merely embodiments of this disclosure and are not intended to limit the scope of this disclosure. Various modifications and variations can be made to this disclosure by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of the claims of this disclosure.
Claims
1. A method for scheduling vehicle-mounted services, characterized in that, The method includes: In the case where the first service calls the second service, service call topology information is obtained. The service call topology information is used to characterize the call relationship between services. The service call topology information includes at least one service call chain, and the service call chain includes multiple services that have a call relationship. Based on the service call topology information, the call hop count of the second service relative to the first service is determined, where the call hop count is the call level of the second service relative to the first service in the service call chain; Based on the number of call hops and the current priority of the first service, the inheritance priority of the second service is determined; Based on the inheritance priority, the call operation of the second service is executed.
2. The method according to claim 1, characterized in that, Determining the number of call hops of the second service relative to the first service based on the service call topology information includes: Based on the service call topology information, the call level number of the second service relative to the first service in the service call chain is obtained, and the call hop number is determined based on the call level number.
3. The method according to claim 1, characterized in that, The method further includes: Based on the service call topology information, a key marker of the service call chain to which the second service belongs is determined; wherein, the key marker is used to identify whether the service call chain belongs to a key call chain; Determining the inheritance priority of the second service based on the call hop count and the current priority of the first service includes: The inheritance priority of the second service is determined based on the number of call hops, the key marker, and the current priority of the first service.
4. The method according to claim 3, characterized in that, The key markers for determining the service call chain to which the second service belongs based on the service call topology information include: Based on the service call topology information, a multi-dimensional score of the service call chain to which the second service belongs is obtained, and a weighted calculation is performed based on the multi-dimensional score to obtain the critical chain score of the service call chain. When the critical chain score is greater than a preset score threshold, the service call chain is identified as a critical call chain, and the criticality marker is obtained.
5. The method according to claim 4, characterized in that, The process of obtaining a multi-dimensional score for the service call chain to which the second service belongs based on the service call topology information includes: Based on the service call topology information, determine whether the service call chain to which the second service belongs includes a security service, and determine the security score of the service call chain. Based on the call frequency of the service call chain, a frequency score for the service call chain is determined; Based on the total call duration of the service call chain and a preset duration threshold, the latency score of the service call chain is determined; The cross-domain score of the service call chain is determined based on whether the service call chain is associated with multiple domain controllers.
6. The method according to claim 3, characterized in that, The step of determining the inheritance priority of the second service based on the call hop count, the critical marker, and the current priority of the first service includes: The transit coefficient of the second service relative to the first service is determined based on the number of call hops. The transmission priority of the second service is determined based on the current priority of the first service and the transmission coefficient. The inheritance priority of the second service is calculated based on the basic priority of the second service, the transmission priority, and the key marker.
7. The method according to claim 6, characterized in that, The calculation of the inheritance priority of the second service based on the basic priority of the second service, the transmission priority, and the key marker includes: Obtain the basic weight coefficient corresponding to the basic priority; Obtain the transmission weight coefficient corresponding to the transmission priority; If the call chain to which the second service belongs is determined to be a critical call chain based on the critical marker, then the critical chain priority and the corresponding critical chain weight coefficient are determined. Obtain the preset fairness factor and the corresponding fairness weight coefficient; The inheritance priority of the second service is obtained by weighted summation of the basic priority, the basic weight coefficient, the transit priority, the transit weight coefficient, the critical chain priority, the critical chain weight coefficient, the preset fairness factor, and the fairness weight coefficient.
8. The method according to claim 1, characterized in that, The method further includes: The service call topology information is traversed, and a circular service path is obtained based on a preset depth-first search algorithm; wherein, there is a directed path between any two services in the circular service path; The inheritance priority of all services in the circular service path is set according to the preset priority processing strategy.
9. The method according to claim 8, characterized in that, The step of setting the inheritance priority of all services in the loop service path according to the preset priority processing strategy includes: Obtain the invocation order of each service in the first path loop of the loop service path, and calculate the inheritance priority of each service based on the invocation order of each service; or, Take any service in the circular service path as an anchor service, and recalculate the inheritance priority of other services in the circular service path based on the current priority of the anchor service and the number of call hops.
10. The method according to claim 1, characterized in that, The method further includes: Determine whether the inheritance priority of the second service meets the priority storm suppression condition; wherein, the priority storm suppression condition includes the inheritance priority of the second service being greater than a preset upper limit threshold and / or the number of times the inheritance priority of the second service is adjusted upward within a preset time period being greater than a preset number threshold; If the priority storm suppression condition is met, the inheritance priority of the second service is suppressed based on a preset suppression strategy.
11. The method according to claim 1, characterized in that, Before executing the call operation of the second service based on the inheritance priority, the method further includes: Determine whether the inheritance priority of the second service meets the priority inheritance conditions; wherein, the priority inheritance conditions include the inheritance priority of the second service being lower than the current priority of the first service, and / or the second service being a service on a critical call chain, and / or the second service being a suppression processing service; The current priority of the first service is used as the final inherited priority of the second service.
12. The method according to claim 1, characterized in that, The method further includes: The system detects whether the service call topology information meets the preset service update conditions. The preset service update conditions include one or more of the following: service registration or deregistration, changes in service call relationships, and timed global recalculation. Each service update condition has a corresponding response time. If the preset service update conditions are met, the service call topology information is updated, and the inheritance priority of one or more services in the updated service call topology information is updated according to the response time.
13. A vehicle, characterized in that, The vehicles include: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1-12.