Service discovery method, vehicle, computer device, and computer program product

By maintaining the service routing table and looking up address files in the first process of the domain controller, the problem of inefficient service registration and discovery is solved, and more efficient service discovery and resource utilization is achieved.

CN119484623APending Publication Date: 2025-02-18SHANGHAI JIDU AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411642555.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In a service-oriented architecture, the registration and discovery of services is less efficient, resulting in waste of computing resources.

Method used

By maintaining the service routing table in the first process of the domain controller, the service address information of the target service is directly found in the process. If it is not found, the address file is found under the target file path of the target service and the service is determined based on the file. Address information.

Benefits of technology

Improve the efficiency of service discovery, reduce dependence on service management modules, and reduce waste of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484623A_ABST
    Figure CN119484623A_ABST
Patent Text Reader

Abstract

The invention provides a service discovery method, a vehicle, computer equipment and a computer program product, and the method can search service address information of a target service from a service routing table corresponding to a first process, search an address file corresponding to the target service from a target file path corresponding to the target service if the service address information of the target service cannot be searched, and search the address file corresponding to the target service. And then the service address information of the target service is determined based on the address file, so that services under the same process or different processes in the current domain controller can be discovered in a more efficient and convenient manner, the frequency of service discovery by using a service management module is reduced, the service discovery efficiency is improved, and the resource waste is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular, to a service discovery method, a vehicle, a computer device, and a computer program product. Background Art

[0002] Service-Oriented Architecture (SOA) is a software architecture model in which different components of an application can provide services to other components through communication protocols on the network. In the automotive field, it can be used to design and develop distributed systems for vehicles. The SOA framework enables the various electronic control units (such as domain controllers) and systems in the vehicle to be written in a more modular and flexible manner by defining services and the interactions between services.

[0003] At present, whether it is a service within the same process, a service in different processes in the same domain controller, or a service in different domain controllers, the registration and discovery of each service needs to be uniformly performed through the service management module. The service management module's service registration and discovery method is inefficient, resulting in a certain degree of waste of computing resources. Summary of the invention

[0004] The embodiments of the present disclosure at least provide a service discovery method, a vehicle, a computer device, and a computer program product.

[0005] In a first aspect, an embodiment of the present disclosure provides a service discovery method, which is applied to a domain controller in a vehicle, and the method includes:

[0006] In response to obtaining a service discovery request sent by a target client of a first process running on the domain controller, searching for service address information of a target service corresponding to the service discovery request from a service routing table corresponding to the first process; the service routing table is used to indicate service address information of each service registered in the first process; the service routing table is shared by each client of the first process;

[0007] If the service address information of the target service is found in the service routing table, the service address information is sent to the target client;

[0008] If the service address information of the target service is not found in the service routing table, the address file corresponding to the target service is searched under the target file path corresponding to the target service; and if the address file is found under the target file path, the service address information of the target service is determined based on the address file, and the service address information is sent to the target client; the address file is shared by each process running by the domain controller.

[0009] In an optional implementation manner, the address file is a soft link file;

[0010] The determining, based on the address file, the service address information of the target service includes:

[0011] Determine the process memory file pointed to by the soft link of the address file; the process memory file is a memory file created by the second process where the target service is located;

[0012] The service address information corresponding to the process memory file is used as the service address information of the target service.

[0013] In an optional implementation manner, the method further includes:

[0014] If the address file is not found under the target file path, monitoring the target file path for file creation events;

[0015] In the case where a file creation event of the address file is detected under the target file path, service address information of the target service is determined based on the address file, and the service address information is sent to the target client.

[0016] In an optional implementation manner, the method further includes:

[0017] In response to obtaining a service registration request sent by a service currently in the first process, writing the service address information indicated by the service registration request into the service routing table; and,

[0018] In response to meeting the service status synchronization condition, the service address information in the service routing table is sent to the service management end; the service management end is used to synchronize the service address information between different domain controllers with the service management ends of other domain controllers.

[0019] In an optional implementation manner, the method further includes:

[0020] If the address file is not found under the target file path, a service discovery request for the target service is sent to the service management end; the service management end is used to search and return the service address information of the target service from the service address information of each process under each domain controller stored.

[0021] In a second aspect, the embodiment of the present disclosure also provides another service discovery method, which is applied to a domain controller in a vehicle, and the method includes:

[0022] In response to obtaining a service discovery request sent by a target client of a first process running on the domain controller, determining a service type of a target service corresponding to the service discovery request; the service type includes an intra-process service, an intra-domain controller inter-process service, and an inter-domain controller service;

[0023] Based on the service type, determining a target address acquisition object from a plurality of address acquisition objects;

[0024] Based on the target address acquisition object, the service address information of the target service is searched, and the searched service address information is sent to the target client.

[0025] In an optional implementation manner, determining a target address acquisition object from a plurality of address acquisition objects based on the service type includes:

[0026] When the service type is an in-process service, the target address acquisition object is determined to be a service routing table corresponding to the first process; the service routing table records service address information of each service registered in the first process.

[0027] In an optional implementation manner, determining a target address acquisition object from a plurality of address acquisition objects based on the service type includes:

[0028] In the case where the service type is an inter-process service within a domain controller, determining that the target address acquisition object is a target file path corresponding to the target service;

[0029] The step of searching for service address information of the target service based on the address acquisition object includes:

[0030] Searching for an address file corresponding to the target service under the target file path; the address file is a soft link file;

[0031] Determine the process memory file pointed to by the soft link of the address file; the process memory file is a memory file created by the second process where the target service is located;

[0032] The service address information corresponding to the process memory file is used as the service address information of the target service.

[0033] In an optional implementation manner, the step of searching for service address information of the target service based on the address acquisition object further includes:

[0034] When the address file is not found in the target file path, monitoring the file creation event of the target file path;

[0035] When a file creation event of the address file is detected under the target file path, the process memory file pointed to by the soft link of the address file is determined, and the service address information corresponding to the process memory file is used as the service address information of the target service.

[0036] In an optional implementation manner, determining a target address acquisition object from a plurality of address acquisition objects based on the service type includes:

[0037] When the service type is an inter-domain controller service, the target address acquisition object is determined to be a service management terminal of the domain controller; the service management terminal is used to synchronize service address information between different domain controllers with service management terminals of other domain controllers.

[0038] In a third aspect, an optional implementation of the present disclosure further provides a vehicle, comprising a service discovery device, wherein the service discovery device is used to execute the steps in the above-mentioned first aspect, or any possible implementation of the first aspect, or to execute the above-mentioned second aspect, or any possible implementation of the second aspect.

[0039] In a fourth aspect, an optional implementation of the present disclosure further provides a computer device, comprising: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the machine-readable instructions are executed by the processor to perform the above-mentioned first aspect, or the steps in any possible implementation of the first aspect, or to perform the above-mentioned second aspect, or the steps in any possible implementation of the second aspect.

[0040] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, comprising a computer program, which, when executed, implements the method described in the first aspect or any possible implementation of the first aspect, or executes the steps described in the second aspect or any possible implementation of the second aspect.

[0041] For a description of the effects of the above-mentioned vehicle, computer device, and computer program product, please refer to the description of the above-mentioned service discovery method, which will not be repeated here.

[0042] 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.

[0043] The service discovery method, vehicle, computer device, and computer program product provided by the embodiments of the present disclosure can first search for the service address information of the target service from the service routing table corresponding to the first process. If the information cannot be found, the address file corresponding to the target service is searched from the target file path corresponding to the target service. The service address information of the target service is then determined based on the address file. This allows a more efficient and convenient way to be used to discover services under the same process or different processes in the current domain controller, thereby reducing the frequency of using the service management module for service discovery, thereby improving the efficiency of service discovery and reducing resource waste.

[0044] 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

[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.

[0046] Figure 1 A flow chart of a service discovery method provided by some embodiments of the present disclosure is shown;

[0047] Figure 2 A schematic diagram showing in-process service registration and service discovery provided by some embodiments of the present disclosure is shown;

[0048] Figure 3 A schematic diagram showing service discovery and registration between different processes in the same domain controller provided by some embodiments of the present disclosure is shown;

[0049] Figure 4 A schematic diagram of a service discovery system provided by some embodiments of the present disclosure is shown;

[0050] Figure 5 A flowchart showing another service discovery method provided by some embodiments of the present disclosure is shown;

[0051] Figure 6 A schematic diagram of a computer device provided by some embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme 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. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the present disclosure claimed for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.

[0053] Research has found that in vehicles using SOA architecture, whether it is services within the same process, services in different processes in the same domain controller, or services in different domain controllers, the registration and discovery of each service needs to be uniformly performed through the service management module. The service management module's service registration and discovery method is inefficient, resulting in a certain degree of waste of computing resources.

[0054] Based on the above research, the present disclosure provides a service discovery method, a vehicle, a computer device and a computer program product, which can first search for the service address information of the target service from the service routing table corresponding to the first process. If the service address information cannot be found, the address file corresponding to the target service is searched from the target file path corresponding to the target service, and then the service address information of the target service is determined based on the address file. In this way, a more efficient and convenient method can be used to discover services under the same process or different processes in the current domain controller, reduce the frequency of using the service management module for service discovery, thereby improving the efficiency of service discovery and reducing resource waste.

[0055] The defects existing in the above solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.

[0056] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0057] To facilitate understanding of this embodiment, a service discovery method disclosed in the embodiment of the present disclosure is first introduced in detail.

[0058] See also Figure 1 FIG. 1 is a flowchart of a service discovery method provided by an embodiment of the present disclosure, wherein the method is applied to a domain controller in a vehicle, and includes:

[0059] S101. In response to obtaining a service discovery request sent by a target client of a first process running on the domain controller, searching for service address information of a target service corresponding to the service discovery request from a service routing table corresponding to the first process; the service routing table is used to indicate service address information of each service registered in the first process; and the service routing table is shared by each client of the first process.

[0060] In a vehicle, a domain controller (DCU) is a centralized electronic control unit (ECU) that manages multiple subsystems and functions in a specific domain (such as driver assistance, infotainment, body control, etc.). The domain controller can use a service-oriented architecture (SOA) to service multiple functions and manage multiple services through the SOA architecture, thereby providing a modular and scalable functional integration platform. For example, the controller in the body domain can use the SOA framework to manage multiple independent services such as smart driving, windows, doors, and air conditioning.

[0061] Functions in vehicles often span multiple domains. For example, autonomous driving requires the coordinated work of sensor data processing (perception domain), driving decision-making (autonomous driving domain), and vehicle control (power domain). The SOA framework implements communication between services through standardized communication protocols (such as REST, SOAP, AUTOSAR, etc.), and these communications can be carried out within the domain controller or across domains. For example, services in the infotainment system can call services in the autonomous driving domain to provide voice-controlled navigation functions.

[0062] In the disclosed embodiment, the vehicle can use a service discovery mechanism to find the service to be used and communicate through a standardized interface. In the disclosed embodiment, the service provider can be called a service, and the service user can be called a client.

[0063] Typically, in a complex distributed system (such as a domain controller system in a vehicle), service discovery requires the help of a service management module, which can collect information about each registered service. The client can request service discovery from the service management module, and the service management module can return the information required for service discovery to the client.

[0064] However, the service management module usually needs to run in an independent process. In some cases, the service management module may also run in another domain controller. In this way, the service registration and discovery process is more complicated, less efficient, and requires more computing resources.

[0065] To this end, when the embodiment of the present disclosure obtains the service discovery request sent by the target client of the first process running by the domain controller, it can directly search the service address information of the target service in the service routing table, thereby completing the service discovery directly in the process.

[0066] The target service may be any service in the vehicle. For example, the service may be a service running in a first process, or a service running in another process under the current domain controller, or a service under another domain controller.

[0067] In the disclosed embodiment, the target client may be any client running in the first process, and the first process may be any process under the current domain controller. The first process may maintain a service routing table, and the service routing table may indicate the service address information of each service registered in the first process; the service routing table may be shared by each client of the first process (that is, the client under the first process may obtain the information in the service routing table).

[0068] Exemplarily, each service-providing process of the domain controller can maintain a service routing table. Services in the same process can register in the process. Clients under the process can obtain the service address information in the service routing table, thereby realizing discovery of services under the same process (the service and the client run in the same process).

[0069] In this way, when the client in the first process needs to perform service discovery, it can directly search for the service address information of the target service from the service routing table, instead of requesting service discovery from a cross-process or even cross-domain service management module, which can effectively improve the efficiency of service discovery within the same process.

[0070] See also Figure 2 , which is a schematic diagram of in-process service registration and service discovery provided by some embodiments of the present disclosure. Figure 2 In the example, service 201, client 202 and client 203 are running in process 20. Service 201 can register in process 20. After completing the service registration, the service address information of service 201 can be recorded in the service routing table. When the client requests to discover service 201, the service address information of service 201 can be found in the service routing table, and the service address information is sent to the client (such as client 202 and / or client 203) to notify service 201 to go online, thereby realizing the discovery of service 201.

[0071] S102: If the service address information of the target service is found in the service routing table, the service address information is sent to the target client.

[0072] In this step, if the service address information of the target service is found in the service routing table, it means that the target service is also running in the first process, and the service address information of the target service can be directly sent to the target client, so that the target client can communicate with the target service.

[0073] If the target service and the target client run in different processes of the same domain controller, or run in different domain controllers, the target service will not register the service with the first process, and the service routing table maintained by the first process will not include the service address information of the target service. At this time, service discovery can be continued through the following step S103.

[0074] In some possible implementations, when the target client requests to discover the target service, even if the target service is also running in the first process, the target service may not have completed service registration, and the service routing table of the first process also does not contain the service address information of the target service.

[0075] At this time, the following step S103 can be continued. At the same time, if the service routing table is updated before the service discovery for the target service is completed, the service address information of the target service can be searched in the updated service routing table. If found, the found service address information can be directly returned to the target client.

[0076] Alternatively, a monitoring item for the service address information of the target service may be registered, and when the service address information of the target service is detected to be written into the service routing table, it is directly sent to the target client.

[0077] S103. If the service address information of the target service is not found in the service routing table, search for the address file corresponding to the target service under the target file path corresponding to the target service; and if the address file is found under the target file path, determine the service address information of the target service based on the address file, and send the service address information to the target client; the address file is shared by each process running on the domain controller.

[0078] In this step, cross-process service discovery under the same domain controller can be achieved by searching for specific files. When a process starts, a process memory file is usually created for the process to use, and the services under the process also use the process memory file. Process memory files refer to virtual files related to the memory space of the process. These files can access the memory content of the process through specific interfaces.

[0079] Specifically, the process memory file pointed to by the soft link of the address file can be determined; the process memory file is a memory file created by the second process where the target service is located; the service address information corresponding to the process memory file is used as the service address information of the target service. Among them, the second process can be a process running under the current domain controller, which is different from the first process.

[0080] When a service is registered, an address file will be created under the specified file path corresponding to the service. The address file is usually soft-linked to the process memory file, so that the service can read and write memory. When the service exits, the created address file will be deleted. A soft link (Symbolic Link, also known as a symbolic link) is a special type of file in the file system that points to another file or directory. A soft link usually points to the path of the target file or directory, but does not contain actual data. Therefore, when determining the address file corresponding to a service, the process memory file of its soft link can be determined based on the address file, thereby determining the service address information of the service.

[0081] The address file of the service is usually created under a fixed file path. The target file path corresponding to the target service can be determined based on the relevant information of the target service (such as identification information, service name, etc.), and then the address file of the target service can be found under the target file path.

[0082] When the address file is found, it means that the target service has completed the service registration. The process memory file of the soft link of the address file can be found by parsing or directly reading the path pointed to by the address file.

[0083] After determining the process memory file corresponding to the address file, the memory address corresponding to the process memory file can be determined to obtain the service address information of the target service.

[0084] In this way, even if the target service and the target client are running in different processes under the same domain controller, they can bypass the service management module and achieve fast service discovery. In addition, the method of searching the service routing table for service discovery is simple to calculate, requires less computing resources, and has a faster computing time. Even if the service routing table is searched first, it is more efficient than service discovery through the service management module.

[0085] In a possible implementation, when the target client requests to discover the target service, the target service may not have completed service registration and the address file may not have been created. Therefore, the online monitoring of the target service can be achieved by monitoring the creation of the address file.

[0086] Specifically, if the address file is not found under the target file path, the target file path can be monitored for file creation events; when a file creation event of the address file is detected under the target file path, the service address information of the target service can be determined based on the address file, and the service address information can be sent to the target client to complete service discovery for the target service.

[0087] Exemplarily, the inotify mechanism can be used to monitor the file creation event of the target file path. The above inotify mechanism can be used to monitor event changes in the file system. It allows an application to monitor the status changes of files or directories, such as the creation, deletion, modification and access of files.

[0088] See also Figure 3 , which is a schematic diagram of service discovery and registration between different processes in the same domain controller provided by some embodiments of the present disclosure. Figure 3 In system 30 (or domain controller), when process 303 is initialized, a process memory file (file name process3011) can be created in directory 301. The content of this file may include service address information (that is, the memory address corresponding to the process, such as / tmp / BGM_server3021-zmq). When service 3031 of process 303 goes online, an address file (that is, soft link file service3021) can be created in directory 302 and softly linked to process memory file process3011. When the client 3041 in the process 304 needs to discover the service 3031, the process 304 can check whether the address file service3021 exists under the directory 302, and if it exists, determine the process memory file process3011 under the directory 301 based on the address file service3021, thereby determining the service address information of the service 3031; if it does not exist, then establish a file creation event monitoring for the directory 302, and when the creation of the address file service3021 is detected, determine the service address information corresponding to the service 3031, and return the determined service address information to the client 3041.

[0089] In one possible implementation, the target service and the target client may run in different domain controllers. If the address file of the target service cannot be found, or the target file path corresponding to the target service cannot be found, a service discovery request for the target service can be sent to the service management end (ie, the service management module).

[0090] The service management terminal can be used to search and return the service address information of the target service from the service address information of each process under each domain controller stored.

[0091] The above-mentioned service management terminal can adopt a centralized management mode or a distributed management mode. In the centralized management mode, a service management terminal can be deployed in the vehicle to collect the service address information in the service routing table of each process under each domain controller in the vehicle; in the distributed management mode, a service management terminal can be deployed under each domain controller of the vehicle to collect the service address information in the service routing table of each process under the corresponding domain controller. Each service management terminal can communicate with each other and synchronize the service address information corresponding to its own domain controller to the service management terminals of other domain controllers to realize the collection of the service address information of the entire vehicle.

[0092] In some possible implementations, in response to obtaining a service registration request sent by a service in the current first process, the service address indicated by the service registration request can be written into the service routing table, and in response to satisfying the service status synchronization condition, the service address information in the service routing table is sent to the service management end. The service management end is used to synchronize the service address information between different domain controllers with the service management ends of other domain controllers.

[0093] See also Figure 4 , which is a schematic diagram of a service discovery system provided by some embodiments of the present disclosure. Figure 4 The service discovery system in may include system 41 (domain controller) and system 42 (domain controller). System 41 may run processes 412 and 413, as well as a registration center 411 (that is, the above-mentioned service management terminal). System 42 may run processes 422 and a registration center 421.

[0094] Service 4121, client 4122 and client 4123 may run in process 412, and service routing table 4124 is also maintained in process 412. Process 412 may respond to service registration requests from service 4121, and service discovery requests from clients 4122 and 4123. Process 412 may use service routing table 4124 to implement service discovery within the process, implement service discovery between processes in the same system based on file monitoring, and synchronize service status with registration center 411 in system 41 (i.e., synchronization of service address information).

[0095] The process 413 may run a service 4131 and a client 4132, and maintain a service routing table 4133. The process 413 may implement a service discovery function similar to that of the process 412.

[0096] Process 422 in system 42 may maintain a routing table 4224 , and service 4221 , client 4222 , and client 4223 may run under process 422 .

[0097] The registration center 411 and the registration center 421 may synchronize service information and status (ie, synchronize service address information) to achieve cross-domain service discovery.

[0098] Based on the same inventive concept, another service discovery method is also provided in the embodiments of the present disclosure. In this embodiment, the same system architecture as the embodiment corresponding to the above steps S101 to S103 can be adopted, and the description of similar features can refer to the corresponding content in the above embodiments. The main difference between this embodiment and the above embodiments is that the above embodiments sequentially execute the service discovery steps corresponding to different scenarios (i.e., service discovery within a process, service discovery between processes under the same domain controller, and service discovery of different domain controllers) according to preset priorities, while this embodiment first performs scenario judgment and then adopts the service discovery steps that match the scenario. For the description of specific service discovery steps in different scenarios, this embodiment and the above embodiments can communicate with each other.

[0099] The service discovery method provided by the embodiment of the present disclosure can first search for the service address information of the target service from the service routing table corresponding to the first process. If the information cannot be found, the address file corresponding to the target service is searched from the target file path corresponding to the target service. The service address information of the target service is then determined based on the address file. This enables a more efficient and convenient method to be used to discover services under the same process or different processes in the current domain controller, thereby reducing the frequency of using the service management module for service discovery, thereby improving the efficiency of service discovery and reducing resource waste.

[0100] See also Figure 5 FIG. 1 is a flowchart of another service discovery method provided by some embodiments of the present disclosure. The method can be applied to a domain controller in a vehicle, and the method includes:

[0101] S501. In response to obtaining a service discovery request sent by a target client of a first process running on the domain controller, determine a service type of a target service corresponding to the service discovery request; the service types include intra-process services, intra-domain controller inter-process services, and inter-domain controller services.

[0102] When a service discovery request sent by a target client is obtained, the service type of the target service (i.e., the service discovery scenario) can be determined first. The service type may include an in-process service (the target client and the target service both run in the first process), an intra-domain controller inter-process service (the target service runs in another process under the current domain controller), and an inter-domain controller service (the target service runs under another domain controller).

[0103] S502: Determine a target address acquisition object from multiple address acquisition objects based on the service type.

[0104] In this step, a corresponding target address acquisition object can be determined from a plurality of address acquisition objects according to different service types. The target address acquisition object can be a source for acquiring service address information. Exemplarily, the address acquisition object can include at least one of a service routing table, a target file path, and a service management terminal.

[0105] S503: Acquire an object based on the target address, search for service address information of the target service, and send the found service address information to the target client.

[0106] Exemplarily, when the service type is an in-process service, the target address acquisition object is determined to be a service routing table corresponding to the first process; the service routing table records the service address information of each service registered in the first process.

[0107] In the case where the service type is an inter-process service within a domain controller, the target address acquisition object is determined to be a target file path corresponding to the target service.

[0108] At this time, the address file corresponding to the target service can be searched under the target file path; the address file is a soft link file; the process memory file pointed to by the soft link of the address file is determined; the process memory file is a memory file created by the second process where the target service is located; the service address information corresponding to the process memory file is used as the service address information of the target service.

[0109] If the address file is not found under the target file path, the target file path is monitored for file creation events; when a file creation event of the address file is detected under the target file path, the service address information of the target service is determined based on the address file, and the service address information is sent to the target client.

[0110] When the service type is an inter-domain controller service, the target address acquisition object is determined to be a service management terminal of the domain controller; the service management terminal is used to synchronize service address information between different domain controllers with service management terminals of other domain controllers.

[0111] In the embodiment of the present disclosure, the description of the target service, the target client, the first process, the second process, the service routing table, the target file path, the address file, the process memory file, the service management end and the steps related to the above contents can be found in the relevant descriptions in steps S101 to S103, which will not be repeated here.

[0112] 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.

[0113] Based on the same inventive concept, the embodiment of the present disclosure also provides a vehicle, which includes a service discovery device, and the service discovery device is used to execute any of the service discovery methods in the above embodiments. Since the principle of solving the problem by the vehicle in the embodiment of the present disclosure is similar to the above service discovery 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.

[0114] Based on the same inventive concept, a service discovery device corresponding to the service discovery 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 discovery 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.

[0115] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Figure 6 As shown, it is a schematic diagram of the structure of a computer device 600 provided in an embodiment of the present disclosure, including a processor 601, a memory 602, and a bus 603. Among them, the memory 302 is used to store execution instructions, including a memory 6021 and an external memory 6022; the memory 6021 here is also called an internal memory, which is used to temporarily store the operation data in the processor 601, and the data exchanged with the external memory 6022 such as a hard disk. The processor 601 exchanges data with the external memory 6022 through the memory 6021. When the computer device 600 is running, the processor 601 communicates with the memory 602 through the bus 603, so that the processor 601 executes the following instructions:

[0116] In response to obtaining a service discovery request sent by a target client of a first process running on the domain controller, searching for service address information of a target service corresponding to the service discovery request from a service routing table corresponding to the first process; the service routing table is used to indicate service address information of each service registered in the first process; the service routing table is shared by each client of the first process;

[0117] If the service address information of the target service is found in the service routing table, the service address information is sent to the target client;

[0118] If the service address information of the target service is not found in the service routing table, the address file corresponding to the target service is searched under the target file path corresponding to the target service; and if the address file is found under the target file path, the service address information of the target service is determined based on the address file, and the service address information is sent to the target client; the address file is shared by each process running by the domain controller.

[0119] In an optional implementation manner, in the instruction executed by the processor 601, the address file is a soft link file;

[0120] The determining, based on the address file, the service address information of the target service includes:

[0121] Determine the process memory file pointed to by the soft link of the address file; the process memory file is a memory file created by the second process where the target service is located;

[0122] The service address information corresponding to the process memory file is used as the service address information of the target service.

[0123] In an optional implementation manner, the instructions executed by the processor 601 further include:

[0124] If the address file is not found under the target file path, monitoring the target file path for file creation events;

[0125] In the case where a file creation event of the address file is detected under the target file path, service address information of the target service is determined based on the address file, and the service address information is sent to the target client.

[0126] In an optional implementation manner, the instructions executed by the processor 601 further include:

[0127] In response to obtaining a service registration request sent by a service currently in the first process, writing the service address information indicated by the service registration request into the service routing table; and,

[0128] In response to meeting the service status synchronization condition, the service address information in the service routing table is sent to the service management end; the service management end is used to synchronize the service address information between different domain controllers with the service management ends of other domain controllers.

[0129] In an optional implementation manner, the instructions executed by the processor 601 further include:

[0130] If the address file is not found under the target file path, a service discovery request for the target service is sent to the service management end; the service management end is used to search and return the service address information of the target service from the service address information of each process under each domain controller stored.

[0131] Alternatively, the processor 601 executes the following instructions:

[0132] In response to obtaining a service discovery request sent by a target client of a first process running on the domain controller, determining a service type of a target service corresponding to the service discovery request; the service type includes an intra-process service, an intra-domain controller inter-process service, and an inter-domain controller service;

[0133] Based on the service type, determining a target address acquisition object from a plurality of address acquisition objects;

[0134] Based on the target address acquisition object, the service address information of the target service is searched, and the searched service address information is sent to the target client.

[0135] In an optional implementation manner, in the instruction executed by the processor 601, determining the target address acquisition object from multiple address acquisition objects based on the service type includes:

[0136] When the service type is an in-process service, the target address acquisition object is determined to be a service routing table corresponding to the first process; the service routing table records service address information of each service registered in the first process.

[0137] In an optional implementation manner, in the instruction executed by the processor 601, determining the target address acquisition object from multiple address acquisition objects based on the service type includes:

[0138] In the case where the service type is an inter-process service within a domain controller, determining that the target address acquisition object is a target file path corresponding to the target service;

[0139] The step of searching for service address information of the target service based on the address acquisition object includes:

[0140] Searching for an address file corresponding to the target service under the target file path; the address file is a soft link file;

[0141] Determine the process memory file pointed to by the soft link of the address file; the process memory file is a memory file created by the second process where the target service is located;

[0142] The service address information corresponding to the process memory file is used as the service address information of the target service.

[0143] In an optional implementation manner, in the instruction executed by the processor 601, the acquiring object based on the address and searching for the service address information of the target service further includes:

[0144] When the address file is not found in the target file path, monitoring the file creation event of the target file path;

[0145] When a file creation event of the address file is detected under the target file path, the process memory file pointed to by the soft link of the address file is determined, and the service address information corresponding to the process memory file is used as the service address information of the target service.

[0146] In an optional implementation manner, in the instruction executed by the processor 601, determining the target address acquisition object from multiple address acquisition objects based on the service type includes:

[0147] When the service type is an inter-domain controller service, the target address acquisition object is determined to be a service management terminal of the domain controller; the service management terminal is used to synchronize service address information between different domain controllers with service management terminals of other domain controllers.

[0148] 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 discovery method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0149] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the service discovery method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0150] 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).

[0151] 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.

[0152] 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.

[0153] 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.

[0154] 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.

[0155] 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 aforementioned 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 aforementioned 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 shall be based on the protection scope of the claims.

Claims

1. A service discovery method, characterized in that: Applied to a domain controller in a vehicle, the method comprises: In response to obtaining a service discovery request sent by a target client of a first process running on the domain controller, searching for service address information of a target service corresponding to the service discovery request from a service routing table corresponding to the first process; the service routing table is used to indicate service address information of each service registered in the first process; the service routing table is shared by each client of the first process; If the service address information of the target service is found in the service routing table, the service address information is sent to the target client; If the service address information of the target service is not found in the service routing table, the address file corresponding to the target service is searched under the target file path corresponding to the target service; and if the address file is found under the target file path, the service address information of the target service is determined based on the address file, and the service address information is sent to the target client; the address file is shared by each process running by the domain controller.

2. The method according to claim 1, characterized in that The address file is a soft link file; The determining, based on the address file, the service address information of the target service includes: Determine the process memory file pointed to by the soft link of the address file; the process memory file is a memory file created by the second process where the target service is located; The service address information corresponding to the process memory file is used as the service address information of the target service.

3. The method according to claim 1, characterized in that The method further comprises: If the address file is not found under the target file path, monitoring the target file path for file creation events; In the case where a file creation event of the address file is detected under the target file path, service address information of the target service is determined based on the address file, and the service address information is sent to the target client.

4. The method according to claim 1, characterized in that: The method further comprises: In response to obtaining a service registration request sent by a service currently in the first process, writing the service address information indicated by the service registration request into the service routing table; and, In response to meeting the service status synchronization condition, the service address information in the service routing table is sent to the service management end; the service management end is used to synchronize the service address information between different domain controllers with the service management ends of other domain controllers.

5. The method according to claim 4, characterized in that The method further comprises: If the address file is not found under the target file path, a service discovery request for the target service is sent to the service management end; the service management end is used to search and return the service address information of the target service from the service address information of each process under each domain controller stored.

6. A service discovery method, characterized in that: Applied to a domain controller in a vehicle, the method comprises: In response to obtaining a service discovery request sent by a target client of a first process running on the domain controller, determining a service type of a target service corresponding to the service discovery request; the service type includes an intra-process service, an intra-domain controller inter-process service, and an inter-domain controller service; Based on the service type, determining a target address acquisition object from a plurality of address acquisition objects; Based on the target address acquisition object, the service address information of the target service is searched, and the searched service address information is sent to the target client.

7. The method according to claim 6, characterized in that The step of determining a target address acquisition object from a plurality of address acquisition objects based on the service type includes: When the service type is an in-process service, the target address acquisition object is determined to be a service routing table corresponding to the first process; the service routing table records service address information of each service registered in the first process.

8. The method according to claim 6, characterized in that The step of determining a target address acquisition object from a plurality of address acquisition objects based on the service type includes: In the case where the service type is an inter-process service within a domain controller, determining that the target address acquisition object is a target file path corresponding to the target service; The step of searching for service address information of the target service based on the address acquisition object includes: Searching for an address file corresponding to the target service under the target file path; the address file is a soft link file; Determine the process memory file pointed to by the soft link of the address file; the process memory file is a memory file created by the second process where the target service is located; The service address information corresponding to the process memory file is used as the service address information of the target service.

9. The method according to claim 8, characterized in that The step of obtaining the service address information of the target service based on the address acquisition object further includes: If the address file is not found under the target file path, monitoring the target file path for file creation events; When a file creation event of the address file is detected under the target file path, the process memory file pointed to by the soft link of the address file is determined, and the service address information corresponding to the process memory file is used as the service address information of the target service.

10. The method according to claim 6, characterized in that The step of determining a target address acquisition object from a plurality of address acquisition objects based on the service type includes: When the service type is an inter-domain controller service, the target address acquisition object is determined to be a service management terminal of the domain controller; the service management terminal is used to synchronize service address information between different domain controllers with service management terminals of other domain controllers.

11. A vehicle, characterized in that: It comprises a service discovery device, and the service discovery device is used to execute the service discovery method as claimed in any one of claims 1 to 5, or claims 6 to 10.

12. A computer device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the machine-readable instructions are executed by the processor to perform the service discovery method according to any one of claims 1 to 5, or claims 6 to 10.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed, the service discovery method according to any one of claims 1 to 5 or claims 6 to 10 is implemented.