Service online notification system, method and device, computer equipment and storage medium
Through the service online notification system, the service module collects and manage service online information, solves the problem of the influence of the service on the online service online notification speed, and realizes the reduction of the amount of information and resource occupation.
Patent Information
- Application Number
- CN202310929620.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-26
- Publication Date
- 2025-01-28
AI Technical Summary
Under the service-oriented architecture (SOA) framework, the speed of service online notification in vehicles affects vehicle performance, and the existing technology has problems of large amount of information and high resource utilization.
Provide a service online notification system, find the service online information of the service providing modules through the service to discover the module, and determine whether the service module has changed according to the historical online information. Send the necessary service information to the service to use the module to reduce information transmission information transmission Quantity and resource occupation.
The unified collection of services in the service in the vehicle is realized, reducing the number of information transmission and the occupation of computer resources, and improving the performance of the vehicle.
Smart Images

Figure CN119383219A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a service online notification system, method, device, computer equipment and storage medium. Background Art
[0002] Multiple domain controllers are usually deployed on a vehicle, each of which can run multiple applications, and each application can provide multiple services to other applications. The vehicle can perform software definition at the hardware level to form a service-oriented architecture (SOA), providing a software abstraction layer with the same functions for different hardware, making it easier to develop software on the vehicle.
[0003] Under the SOA framework, the services of each application need to be registered to inform other applications that the service is online so that other applications can use the service. Therefore, the notification speed of the service online greatly affects the performance of the vehicle. Summary of the invention
[0004] The embodiments of the present disclosure at least provide a service online notification system, method, apparatus, computer equipment and storage medium.
[0005] In a first aspect, an embodiment of the present disclosure provides a service online notification system, which is deployed in any domain controller among multiple domain controllers of a vehicle, and includes: a service discovery module and at least one service provision module, wherein the service provision module establishes a communication connection with the service discovery module;
[0006] The service providing module is used to send service online information to the service discovery module; the service online information carries service information of the service providing module; the service information is used to indicate the service in the service providing module that is in an online state;
[0007] The service discovery module is used to query the historical online information matching the service providing module when receiving the service online information; determine the first service based on the service online information and the historical online information, the first service being the service whose status changes in the service providing module; send the service information corresponding to the service online information to the service using module; the service using module is a module in the multiple domain controllers that subscribes to the first service.
[0008] The service online notification system provided by the above aspects collects the service online information of each service providing module through the service discovery module, and realizes the unified collection and statistics of the services that are online in the current domain controller; and it can also judge whether there are services with status changes in the service providing module based on historical online information. After determining that there are services with status changes, it sends service information to the service usage module, thereby reducing the amount of information transmitted within the vehicle and reducing the computer resources occupied by transmitting information.
[0009] In an optional implementation manner, when the service discovery module determines the first service based on the service online information and the historical online information, it is used to:
[0010] If the historical online information is not found, determining that the service indicated in the service information is the first service;
[0011] If the historical online information is found, the service information of the historical online information is compared with the service information of the service online information, and the first service is determined based on the comparison result.
[0012] In an optional implementation manner, the service online information further includes a session identifier; the session identifier is identification information of a communication connection established between the service discovery module and the service provision module; the service discovery module is further used to:
[0013] In the case where it is determined that the first service does not exist, determining whether the session identifier of the service online information is consistent with the session identifier of the historical online information;
[0014] In the case where the session identifiers are inconsistent, service restart information is sent to the service usage module; the service restart information is used to indicate the second service that has returned to the online state after being offline in the service providing module; the service usage module is used to re-establish a connection with the second service that has returned to the online state after being offline in the service providing module based on the service restart information.
[0015] The above implementation mode can allocate an exclusive session identifier for the communication connection established between the service discovery module and the service provision module, and carry the session identifier in the service online information. By comparing the service online information with the session identifier in the historical online information, it can determine whether a new communication connection has been re-established between the service discovery module and the service provision module, thereby determining whether the service provision module has experienced a network disconnection. When it is determined that a network disconnection has occurred (that is, the session identifier is inconsistent), a service restart information is sent to the service usage module, so that the service usage module can quickly sense that the service is offline, and quickly re-establish a connection with the service that has returned to the online state.
[0016] In an optional implementation manner, the service providing module is used to:
[0017] When there is a newly launched service in the service providing module and the service discovery module is in an idle state, service launch information is sent to the service discovery module; wherein the service discovery module being in an idle state includes that there is no service launch information to be processed in the service discovery module.
[0018] In the above implementation mode, the service provision module can quickly send service online information to the service discovery module when a new service is online, thereby improving the efficiency of service online notification. In addition, by sending service online information when the service discovery module is in an idle state, the frequency of sending messages can be reduced, thereby improving resource utilization efficiency.
[0019] In an optional implementation manner, the service discovery module is further used to:
[0020] After sending the service information corresponding to the service online information to the service usage module, after the service discovery module is in an idle state for a continuous period greater than or equal to a first period, sending the service information corresponding to the most recently received service online information to the service usage module.
[0021] In the above implementation, after the service discovery module has been idle for a long enough time (the service launch phase is over), the latest service information can be sent to the service usage module to prevent the service usage module from not being able to work properly due to the loss of previously sent service information.
[0022] In an optional implementation manner, the service providing module is used to:
[0023] Generate service online information carrying a timing identifier, and send the service online information to the service discovery module;
[0024] When the timing identifier indicates that the sending order of the service online information is before the sending order of the historical online information, the service online information is discarded.
[0025] The above implementation method can use the timing identifier to determine the sending order between the service online information and the historical online information, so as to discard the expired message and prevent the transmission of expired erroneous information.
[0026] In an optional implementation, the service discovery module is used to:
[0027] The service information is sent to a first service usage module in a target domain controller corresponding to the service discovery module; and the service information is sent to service discovery modules of other domain controllers among the multiple domain controllers except the target domain controller, and the service discovery modules of the other domain controllers are used to send the service information to a second service usage module in their own domain controller.
[0028] The above implementation can directly send service information to the first service usage module in the current target domain controller, which is highly efficient. In addition, the service information is forwarded through the service discovery module of other domain controllers, which facilitates the management of the sending of service information and is highly efficient.
[0029] In an optional implementation manner, the service provision module and the service discovery module use a pre-agreed target communication protocol for data transmission; the target communication protocol is used to generate and parse the service online information;
[0030] The target communication protocol indicates a target data structure, and the target data structure includes at least one of a service information field, a session identification field, and a timing identification field.
[0031] In the above implementation mode, the service providing module and the service discovery module use the same target communication protocol for data transmission, which makes data transmission more efficient. In addition, the target data structure indicated by the target communication protocol can make the service online information carry multiple fields, thereby realizing various functions.
[0032] In a second aspect, an embodiment of the present disclosure further provides a service online notification method, comprising the steps executed by the service discovery module in the above-mentioned first aspect or any one of the implementations of the first aspect.
[0033] In a third aspect, an embodiment of the present disclosure further provides a service online notification device for executing the steps in the above second aspect.
[0034] In a fourth aspect, an optional implementation of the present disclosure further provides a computer device, which may be a domain controller, or may be deployed in a domain controller, or may be connected to a domain controller and controlled by the domain controller, and includes: a processor, a memory, the memory storing machine-readable instructions executable by the processor, the processor being used to execute the machine-readable instructions stored in the memory, and when the machine-readable instructions are executed by the processor, the steps in the above-mentioned second aspect are performed.
[0035] In a fifth aspect, an optional implementation of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the steps in the above-mentioned second aspect are executed.
[0036] For a description of the effects of the above-mentioned service online notification method, device, computer equipment, and computer-readable storage medium, please refer to the description of the above-mentioned service online notification system, which will not be repeated here.
[0037] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present disclosure.
[0038] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of a vehicle provided by some embodiments of the present disclosure is shown;
[0040] Figure 2 A schematic diagram of a service online notification system provided by some embodiments of the present disclosure is shown;
[0041] Figure 3 A flow chart of a service online notification method provided by some embodiments of the present disclosure is shown;
[0042] Figure 4 A flowchart showing another service online notification method provided by some embodiments of the present disclosure is shown;
[0043] Figure 5 A flowchart of another service online notification method provided by some embodiments of the present disclosure is shown;
[0044] Figure 6 A schematic diagram showing a service online notification device provided by some embodiments of the present disclosure is shown;
[0045] Figure 7 A schematic diagram of a computer device provided by some embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure more clear, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure.
[0047] Each application in the vehicle will send service online information to other applications at preset time intervals to notify other applications that their own services are online. This results in a waiting period after a service goes online before the online information can be sent to other applications, which is inefficient. In addition, since the application will send service online information multiple times, the amount of information within the entire system is large, wasting vehicle resources.
[0048] Based on the above research, the present disclosure provides a service online notification system, see Figure 1 As shown, it is an example diagram of a vehicle provided by an embodiment of the present disclosure. The vehicle provided by an embodiment of the present disclosure may be deployed with multiple domain controllers (such as domain controller 1, domain controller 2), and a service online notification system may be deployed on any of the multiple domain controllers. The domain controllers may be communicated with each other, and the service online notification systems corresponding to different domain controllers may also be communicated with each other; the service online notification system can collect the online information of each service in the current domain controller and inform it of the service usage modules in the multiple domain controllers. The above-mentioned domain controllers may include a cockpit domain controller, an intelligent driving domain controller, a power domain controller, a body domain controller, a chassis domain controller, and the like.
[0049] The following is a detailed description of a service online notification system disclosed in an embodiment of the present disclosure. Figure 2 As shown, a service online notification system provided by an embodiment of the present disclosure is deployed in any domain controller among multiple domain controllers of a vehicle, including a service discovery module 21 and at least one service providing module 22 (such as a service providing module 22-1 and a service providing module 22-2 in the figure), wherein:
[0050] The service providing module 22 is used to send service online information to the service discovery module 21; the service online information carries service information of the service providing module 22; the service information is used to indicate the service in the service providing module 22 that is in an online state;
[0051] The service discovery module 21 is used to query the historical online information matching the service providing module 22 when receiving the service online information; determine the first service based on the service online information and the historical online information, the first service being the service whose status changes in the service providing module 22; send the service information corresponding to the service online information to the service using module; the service using module is a module in the multiple domain controllers that subscribes to the first service.
[0052] The above-mentioned service providing module 22-1 and service providing module 22-2 can establish a communication connection with the service discovery module. The service discovery module 21 can also establish a communication connection with the service usage modules in multiple domain controllers and send online information to the service usage module. The service online information can include service information. The service information can indicate that there are services in the service providing module 22 that are online. The service usage module can use the service information to establish a communication connection with the service providing module 22 and use the services corresponding to the service providing module.
[0053] The above-mentioned service provision module can run applications, and the applications can provide multiple services. During the startup of the vehicle's domain controller, each application also starts to start, and its corresponding service also starts to go online. The online service can be called by other applications to realize the corresponding functions of the service; the service discovery module can run a service discovery application, and the service discovery application can execute various service discovery related logics.
[0054] If other applications in the vehicle want to use a service, the service needs to be online. When the application knows that the service is online, it can call it. Usually, after a service in the vehicle is online, the application can send a broadcast to notify other applications in each domain controller. Since services are online one by one, multiple broadcasts need to be sent, and each application will receive multiple broadcasts, which takes up more computer resources.
[0055] To this end, the embodiment of the present disclosure introduces a service discovery module, which is used to manage the service online information issued by the service providing module, and then the service discovery module notifies each service using module, thereby reducing the computer resource occupation of the service online notification.
[0056] During the startup phase, if the service providing module finds that the service discovery module has also been started, it can establish a communication connection with the service discovery module. Afterwards, the service providing module can send service online information to the service discovery module, and the service online information can carry service information of the service providing module.
[0057] When the service discovery module and the service provision module communicate, they may use a pre-agreed target communication protocol for data transmission, and the target communication protocol may be used to generate and parse service online information.
[0058] The target communication protocol may indicate a target data structure, and the target data structure may include at least one of a service information field, a session identification field, and a timing identification field.
[0059] Exemplarily, the data recorded in the above-mentioned service information field may be the above-mentioned service information. In addition to recording the identification information of the service in the online state in the service providing module, the service information field may also record the access address, port number and other information corresponding to the service, so that the service using module can use the above-mentioned information to use the service.
[0060] In this way, the service provision module and the service discovery module use the same target communication protocol for data transmission, making data transmission more efficient. In addition, the target data structure indicated by the target communication protocol can make the service online information carry multiple fields, thereby realizing various functions.
[0061] Before sending the service online information, the service providing module can first determine whether there is a newly launched service in itself and whether the service discovery module is in an idle state. If both of the above conditions are met, the service online information is sent to the service discovery module.
[0062] Among them, whether the service discovery module is in an idle state can be determined according to whether there is service online information to be processed in the service discovery module. Exemplarily, if there is no service online information to be processed in the service discovery module, it can be determined that the service discovery module is in an idle state; otherwise, it is determined that the service discovery module is not in an idle state.
[0063] When receiving the service online information, the service discovery module may search for historical online information matching the service providing module from the stored multiple historical online information, wherein the historical online information may be the service online information received by the service discovery module in the past.
[0064] Exemplarily, the service online information may indicate an identity of a corresponding service providing module, and the service discovery module may be able to use the identity to search for corresponding historical online information.
[0065] The above-mentioned historical online information can be the previous service online information closest to the current time. The service online information can carry a timing identifier. The timing identifier can be a serial number generated by the service online information, or it can be a timestamp when it is generated. The service discovery module can search for the stored service online information with the largest timing identifier as the historical online information.
[0066] In the above implementation mode, the service provision module can quickly send service online information to the service discovery module when a new service is online, thereby improving the efficiency of service online notification. In addition, by sending service online information when the service discovery module is in an idle state, the frequency of sending messages can be reduced, thereby improving resource utilization efficiency.
[0067] Furthermore, after finding the historical online information, the service discovery module can also compare the service online information with the timing identifier of the historical online information. If the timing identifier of the historical online information is greater than the timing identifier of the service online information, it can be considered that the issuance order of the service online information is before the issuance order of the historical online information, indicating that the service online information has timed out. At this time, the service online information can be directly discarded to avoid using outdated information.
[0068] After the service discovery module finds the historical online information, it can determine whether the service provider module has a service with a state change based on the service online information and the historical online information, and determine the determined service with a state change as the first service. The service with a state change can refer to a service that changes from an offline state to an online state, or from an online state to an offline state.
[0069] Specifically, the service discovery module can compare the historical online information with the service information in the service online information, and determine whether the service provider module has a service whose status has changed based on the comparison result. Exemplarily, if the service information in the service online information contains identification information of a service that does not exist in the service information in the historical online information, or lacks the identification information of a service that appears in the service information in the historical online information, it can be determined that the service provider module has a service whose status has changed.
[0070] If the historical online information corresponding to the service providing module cannot be queried, it can be considered that the service providing module is in an online state for the first time. It can be directly determined that there are services with status changes in the service providing module, and each service indicated in the service information of the service online information can be taken as the first service.
[0071] After determining that there is a service with a status change in the service providing module, the service information can be sent to the service using modules in the multiple domain controllers of the vehicle.
[0072] Specifically, for the first service usage module in the target domain controller corresponding to the service discovery module, the service discovery module can directly send service information to it; for the second service usage module in multiple domain controllers, the service information can be first sent to the service discovery modules of other domain controllers, and then the service discovery modules of other domain controllers send the service information to the second service usage module in its own domain controller.
[0073] When the service discovery module of each domain controller sends service information to the service use module, it can first filter the services in the service information and only feed back the information required by the service use module, thereby reducing the amount of information transmission.
[0074] In the disclosed embodiment, the service discovery module sends service information to the service usage module only when it determines that there is a service with a status change in the service provision module (that is, a new service appears in the service information, or a service is missing in the service information). If the service information is lost for some reason during the sending process, the service usage module will receive the new service information only the next time a new service appears. If the services have been online at this time, the service usage module cannot obtain the service information again.
[0075] In order to solve the above problem, service information corresponding to the most recently received service online information may be periodically sent to the service usage module, so that the service usage module can have multiple opportunities to obtain service information, thereby reducing the probability of failure in obtaining service information.
[0076] Since the service discovery program frequently obtains service online information during the service launch phase, the frequency of sending service information to the service usage module is relatively high. Therefore, the service discovery module can be sent to the service usage module after the continuous time length that the service discovery module has been in an idle state is greater than or equal to the first preset time length. At this time, if the service discovery module has not received new service online information for a sufficiently long time, it means that the service of the service providing module has been launched. Generally, new service online information will not be generated, and the most recently received service information can be used as the latest service information.
[0077] In one possible implementation, when the service discovery module has been idle for long enough, it can periodically send service information to the service usage module. This can not only ensure that the service usage module obtains service information and prevent the service usage module from being unable to work properly due to the loss of previously sent service information, but also reduce the sending frequency of the service discovery module and reduce the amount of data transmission.
[0078] It is worth noting that in some cases (such as application crash, application restart, etc.), the above-mentioned service provider module may experience network disconnection, which will cause the communication connection between the service provider module and other modules or applications to be interrupted. After the network disconnection, the service provider module can be restarted or reconnected to the network. However, the service usage module does not know that the service it is using can no longer be used due to network disconnection, and is still waiting for the service response, resulting in the service being unable to be used normally.
[0079] In this regard, the service discovery module in the embodiment of the present disclosure can allocate a session identifier for the communication connection established with the service provision module, and send the session representation to the service provision module. The session identifier can be used as identification information of the communication connection established this time. If the service provision module is disconnected from the network, the communication connection between it and the service provision module will be disconnected. When it re-establishes a communication connection with the service discovery module, it will be allocated a new session identifier. On this basis, when generating service online information, the service providing module can generate service online information carrying the session identifier, and then send it to the service discovery module. If the service discovery module finds that there is no service with a status change in the service providing module based on the service online information and the historical online information, the service online information can be compared with the session identifier in the historical online information. If the session identifiers are consistent, it can be said that the service providing module has not been disconnected from the network and there is no need to process the service online information. If they are inconsistent, it can be said that the service providing module has been disconnected from the network and service restart information can be sent to the service usage module. The service restart information is used to indicate the service that has returned to the online state after being offline in the service providing module. The service usage module is used to re-establish a connection with the service that has returned to the online state after being offline in the service providing module based on the service restart information.
[0080] In this way, an exclusive session identifier can be assigned to the communication connection established between the service discovery module and the service provision module, and the session identifier can be carried in the service online information. By comparing the service online information with the session identifier in the historical online information, it can be determined whether a new communication connection has been re-established between the service discovery module and the service provision module, thereby determining whether the service provision module has experienced a network disconnection. When it is determined that a network disconnection has occurred (that is, the session identifier is inconsistent), a service restart information is sent to the service usage module, so that the service usage module can quickly sense that the service is offline, and quickly re-establish a connection with the service that has returned to the online state.
[0081] The service online notification system provided by the embodiment of the present disclosure collects the service online information of each service providing module through the service discovery module, so as to realize the unified collection and statistics of the services that are currently online in the domain controller; moreover, it can also judge whether there are services with status changes in the service providing module based on the historical online information, and after determining that there are services with status changes, send the service information to the service using module, thereby reducing the amount of information transmitted inside the vehicle and reducing the computer resources occupied by the information transmission.
[0082] See also Figure 3As shown, it is a flow chart of a service online notification method provided by an embodiment of the present disclosure, the method includes steps S301 to S304, the execution subject of the method may be a service discovery module in a service online notification system, and the service online notification system is deployed in any domain controller of multiple domain controllers of the vehicle, wherein:
[0083] S301. When receiving service online information sent by a service providing module, query historical online information matching the service providing module.
[0084] S302: Determine a first service based on the service online information and the historical online information, where the first service is a service whose status changes in the service providing module.
[0085] S303: Send service information corresponding to the service online information to a service use module; the service use module is a module in the multiple domain controllers that subscribes to the first service.
[0086] In a possible implementation manner, determining the first service based on the service online information and the historical online information includes:
[0087] If the historical online information is not found, determining that the service indicated in the service information is the first service;
[0088] If the historical online information is found, the service information of the historical online information is compared with the service information of the service online information, and the first service is determined based on the comparison result.
[0089] In a possible implementation manner, the service online information further includes a session identifier; the session identifier is identification information of a communication connection established between the service discovery module and the service provision module;
[0090] The method further comprises:
[0091] In the case where it is determined that the first service does not exist, determining whether the session identifier of the service online information is consistent with the session identifier of the historical online information;
[0092] In the case where the session identifiers are inconsistent, service restart information is sent to the service usage module; the service restart information is used to indicate the second service that has returned to the online state after being offline in the service providing module; the service usage module is used to re-establish a connection with the second service that has returned to the online state after being offline in the service providing module based on the service restart information.
[0093] In a possible implementation, the service providing module is used to:
[0094] When there is a newly launched service in the service providing module and the service discovery module is in an idle state, service launch information is sent to the service discovery module; wherein the service discovery module being in an idle state includes that there is no service launch information to be processed in the service discovery module.
[0095] In a possible implementation, the method further includes:
[0096] Generate service online information carrying a timing identifier, and send the service online information to the service discovery module;
[0097] When the timing identifier indicates that the sending order of the service online information is before the sending order of the historical online information, the service online information is discarded.
[0098] In a possible implementation, the method further includes:
[0099] The service information is sent to a first service usage module in a target domain controller corresponding to the service discovery module; and the service information is sent to service discovery modules of other domain controllers among the multiple domain controllers except the target domain controller, and the service discovery modules of the other domain controllers are used to send the service information to a second service usage module in their own domain controller.
[0100] In a possible implementation, the service provision module and the service discovery module use a pre-agreed target communication protocol for data transmission; the target communication protocol is used to generate and parse the service online information;
[0101] The target communication protocol indicates a target data structure, and the target data structure includes at least one of a service information field, a session identification field, and a timing identification field.
[0102] See also Figure 4 FIG. 1 is a flowchart of another service online notification method provided by some embodiments of the present disclosure. The method can be executed by a service providing module, and includes:
[0103] When the service provider module is initialized or after the network is disconnected, it initiates a connection to the service discovery module;
[0104] Get the session identifier assigned by the service discovery module;
[0105] Assemble service launch information using the target communication protocol;
[0106] Determine whether the service discovery module is idle;
[0107] When the service discovery module is idle, all services currently online are written into the service online information, and a service online message is sent to the service usage module; when the service discovery module is busy, jump back to the step of assembling the service online information.
[0108] See also Figure 5 FIG. 1 is a flowchart of another service online notification method provided by some embodiments of the present disclosure. The method can be executed by a service discovery module and includes:
[0109] The service discovery module establishes a communication connection with the service provision module;
[0110] Get the service online information sent by the service provider module;
[0111] Determine whether the service online information is consistent with the service information in the historical online information;
[0112] If they are consistent, the service information in the service launch information is used as the latest service information and the new service is launched;
[0113] If they are inconsistent, determine whether the session characters in the service online information are the same as those in the historical online information;
[0114] If they are the same, no action will be taken; if they are different, the service provider module will be offline.
[0115] Process the launch of new services corresponding to the service launch information.
[0116] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0117] Based on the same inventive concept, a service online notification device corresponding to the service online notification method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned service online notification method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0118] Reference Figure 6 FIG. 1 is a schematic diagram of a service online notification device provided by an embodiment of the present disclosure, wherein the device includes:
[0119] The query unit 610 is used to query the historical online information matching the service providing module when receiving the service online information sent by the service providing module.
[0120] The determining unit 620 is configured to determine a first service based on the service online information and the historical online information, where the first service is a service whose state changes in the service providing module.
[0121] The sending unit 630 is used to send the service information corresponding to the service online information to a service use module; the service use module is a module in the multiple domain controllers that subscribes to the first service.
[0122] In a possible implementation manner, the determining unit 620 is specifically configured to:
[0123] If the historical online information is not found, determining that the service indicated in the service information is the first service;
[0124] If the historical online information is found, the service information of the historical online information is compared with the service information of the service online information, and the first service is determined based on the comparison result.
[0125] In a possible implementation manner, the service online information further includes a session identifier; the session identifier is identification information of a communication connection established between the service discovery module and the service provision module;
[0126] The sending unit 630 is also used for:
[0127] In the case where it is determined that the first service does not exist, determining whether the session identifier of the service online information is consistent with the session identifier of the historical online information;
[0128] In the case where the session identifiers are inconsistent, service restart information is sent to the service usage module; the service restart information is used to indicate the second service that has returned to the online state after being offline in the service providing module; the service usage module is used to re-establish a connection with the second service that has returned to the online state after being offline in the service providing module based on the service restart information.
[0129] In a possible implementation manner, the sending unit 630 is further configured to:
[0130] Generate service online information carrying a timing identifier, and send the service online information to the service discovery module;
[0131] When the timing identifier indicates that the sending order of the service online information is before the sending order of the historical online information, the service online information is discarded.
[0132] In a possible implementation manner, the sending unit 630 is further configured to:
[0133] The service information is sent to a first service usage module in a target domain controller corresponding to the service discovery module; and the service information is sent to service discovery modules of other domain controllers among the multiple domain controllers except the target domain controller, and the service discovery modules of the other domain controllers are used to send the service information to a second service usage module in their own domain controller.
[0134] In a possible implementation, the service provision module and the service discovery module use a pre-agreed target communication protocol for data transmission; the target communication protocol is used to generate and parse the service online information;
[0135] The target communication protocol indicates a target data structure, and the target data structure includes at least one of a service information field, a session identification field, and a timing identification field.
[0136] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0137] The embodiment of the present disclosure also provides a computer device, which may be a domain controller, or may be deployed in a domain controller, or may be connected to a domain controller and controlled by the domain controller, such as Figure 7 FIG. 1 is a schematic diagram of a computer device structure provided in an embodiment of the present disclosure, including:
[0138] A processor 71 and a memory 72; the memory 72 stores machine-readable instructions executable by the processor 71, and the processor 71 is used to execute the machine-readable instructions stored in the memory 72. When the machine-readable instructions are executed by the processor 71, the processor 71 performs the following steps:
[0139] When the service online information sent by the service providing module is received, the historical online information matching the service providing module is queried.
[0140] Based on the service online information and the historical online information, a first service is determined, where the first service is a service whose state changes in the service providing module.
[0141] Sending service information corresponding to the service online information to a service use module; the service use module is a module in the multiple domain controllers that subscribes to the first service.
[0142] In a possible implementation manner, in the instruction executed by the processor 71, determining the first service based on the service online information and the historical online information includes:
[0143] If the historical online information is not found, determining that the service indicated in the service information is the first service;
[0144] If the historical online information is found, the service information of the historical online information is compared with the service information of the service online information, and the first service is determined based on the comparison result.
[0145] In a possible implementation, in the instruction executed by the processor 71, the service online information further includes a session identifier; the session identifier is identification information of a communication connection established between the service discovery module and the service provision module;
[0146] The instructions executed by the processor 71 also include:
[0147] In the case where it is determined that the first service does not exist, determining whether the session identifier of the service online information is consistent with the session identifier of the historical online information;
[0148] In the case where the session identifiers are inconsistent, service restart information is sent to the service usage module; the service restart information is used to indicate the second service that has returned to the online state after being offline in the service providing module; the service usage module is used to re-establish a connection with the second service that has returned to the online state after being offline in the service providing module based on the service restart information.
[0149] In a possible implementation manner, the instructions executed by the processor 71 further include:
[0150] Generate service online information carrying a timing identifier, and send the service online information to the service discovery module;
[0151] When the timing identifier indicates that the sending order of the service online information is before the sending order of the historical online information, the service online information is discarded.
[0152] In a possible implementation manner, the instructions executed by the processor 71 further include:
[0153] The service information is sent to a first service usage module in a target domain controller corresponding to the service discovery module; and the service information is sent to service discovery modules of other domain controllers among the multiple domain controllers except the target domain controller, and the service discovery modules of the other domain controllers are used to send the service information to a second service usage module in their own domain controller.
[0154] In a possible implementation, in the instructions executed by the processor 71, the service provision module and the service discovery module use a pre-agreed target communication protocol for data transmission; the target communication protocol is used to generate and parse the service online information;
[0155] The target communication protocol indicates a target data structure, and the target data structure includes at least one of a service information field, a session identification field, and a timing identification field.
[0156] The above-mentioned memory 72 includes internal memory 721 and external memory 722; the memory 721 here is also called internal memory, which is used to temporarily store the calculation data in the processor 71, as well as the data exchanged with the external memory 722 such as the hard disk. The processor 71 exchanges data with the external memory 722 through the internal memory 721.
[0157] The specific execution process of the above instructions can refer to the steps of the service online notification method described in the embodiment of the present disclosure, which will not be repeated here.
[0158] The embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the service online notification method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0159] The present disclosure also provides a computer program product that carries a program code. The program code includes instructions that can be used to execute the steps of the service online notification method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0160] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0161] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0162] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0163] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0164] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0165] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A service online notification system, characterized in that: Any domain controller among a plurality of domain controllers deployed in a vehicle comprises: a service discovery module and at least one service provision module, wherein the service provision module establishes a communication connection with the service discovery module; The service providing module is used to send service online information to the service discovery module; the service online information carries service information of the service providing module; the service information is used to indicate the service in the service providing module that is in an online state; The service discovery module is used to query the historical online information matching the service providing module when receiving the service online information; determine the first service based on the service online information and the historical online information, the first service being the service whose status changes in the service providing module; send the service information corresponding to the service online information to the service using module; the service using module is a module in the multiple domain controllers that subscribes to the first service.
2. The system according to claim 1, characterized in that When the service discovery module determines the first service based on the service online information and the historical online information, it is used to: If the historical online information is not found, determining that the service indicated in the service information is the first service; If the historical online information is found, the service information of the historical online information is compared with the service information of the service online information, and the first service is determined based on the comparison result.
3. The system according to any one of claims 1 to 2, characterized in that: The service online information also includes a session identifier; the session identifier is identification information of a communication connection established between the service discovery module and the service providing module; the service discovery module is further used to: In the case where it is determined that the first service does not exist, determining whether the session identifier of the service online information is consistent with the session identifier of the historical online information; In the case where the session identifiers are inconsistent, sending service restart information to the service use module; The service restart information is used to indicate the second service that has returned to the online state after being offline in the service providing module; the service using module is used to re-establish a connection with the second service that has returned to the online state after being offline in the service providing module based on the service restart information.
4. The system according to any one of claims 1 to 3, characterized in that: The service providing module is used for: When there is a newly launched service in the service providing module and the service discovery module is in an idle state, service launch information is sent to the service discovery module; wherein the service discovery module being in an idle state includes that there is no service launch information to be processed in the service discovery module.
5. The system according to claim 4, characterized in that The service discovery module is also used to: After sending the service information corresponding to the service online information to the service usage module, after the service discovery module is in an idle state for a continuous period greater than or equal to a first period, sending the service information corresponding to the most recently received service online information to the service usage module.
6. The system according to any one of claims 1 to 5, characterized in that: The service providing module is used for: Generate service online information carrying a timing identifier, and send the service online information to the service discovery module; When the timing identifier indicates that the sending order of the service online information is before the sending order of the historical online information, the service online information is discarded.
7. The system according to any one of claims 1 to 6, characterized in that: The service discovery module is used to: The service information is sent to a first service usage module in a target domain controller corresponding to the service discovery module; and the service information is sent to service discovery modules of other domain controllers among the multiple domain controllers except the target domain controller, and the service discovery modules of the other domain controllers are used to send the service information to a second service usage module in their own domain controller.
8. The system according to any one of claims 1 to 7, characterized in that: The service provision module and the service discovery module use a pre-agreed target communication protocol for data transmission; the target communication protocol is used to generate and parse the service online information; The target communication protocol indicates a target data structure, and the target data structure includes at least one of a service information field, a session identification field, and a timing identification field.
9. A service online notification method, characterized in that: The method comprises steps performed by the service discovery module as claimed in any one of claims 1 to 8.
10. A service online notification device, characterized in that: Used to execute the service online notification method as described in claim 9.
11. A computer device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the processor executes the steps of the service online notification method as described in claim 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program. When the computer program is executed by a computer device, the computer device executes the steps of the service online notification method according to claim 9.