Communication method, device, equipment and storage medium
Through the client-server message exchange between the publishing process of application services and the subscription process in the smart car software products, the network bandwidth occupation problem caused by topological message sending under the topic-based publishing and subscription model in the smart car software is solved, and the network bandwidth occupation problem is improved. Response speed and performance.
Patent Information
- Application Number
- CN202211684644.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2042-12-27
AI Technical Summary
In the software products of smart cars, the topic-based publishing subscription model faces a large number of topics, topological messages between information publishers and subscribers are sent to each other, resulting in serious network bandwidth usage and reducing application response time and performance .
When opening the application service, the publishing process of the application service sends client topology messages and server topology messages to the subscription process, and receives client topology messages and server topology messages from the subscription process, and notifies them from the client server dimension, reducing the Network bandwidth occupies, improving response speed and performance.
It realizes fast and efficient topological message notification, reduces network bandwidth usage, and greatly improves the response speed and performance of applications.
Smart Images

Figure CN115988055B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of autonomous driving technology, and specifically to a communication method, apparatus, device and storage medium. Background Art
[0002] With the gradual development of artificial intelligence technology, current smart car software products are becoming more and more abundant. Generally, in smart car software products, if a service event or service message needs to be sent to multiple message recipients, a topic-based publish-subscribe model is usually used. Summary of the invention
[0003] The present disclosure provides a communication method, apparatus, device and storage medium.
[0004] According to one aspect of the present disclosure, a communication method is provided, which is applied to an information publisher of an application service based on a publish-subscribe model, and the method includes:
[0005] In response to starting the application service, determining a publishing process and a subscription process of the application service, the publishing process being a process of an information publisher of the application service, and the subscription process being a process of an information subscriber of the application service;
[0006] Controlling the publishing process to send a first topology message to the subscribing process and to receive a second topology message from the subscribing process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message;
[0007] The first topology message includes the client topology message and the server topology message of the publishing process, and the second topology message includes the client topology message and the server topology message of the subscribing process.
[0008] According to another aspect of the present disclosure, a communication method is provided, which is applied to an information subscriber of an application service based on a publish-subscribe model, and the method comprises:
[0009] In response to a subscription operation to the application service, determining a publishing process and a subscription process of the application service, wherein the publishing process is a process of an information publisher of the application service, and the subscription process is a process of an information subscriber of the application service;
[0010] Receiving a first topology message from the publishing process and controlling the subscribing process to send a second topology message to the publishing process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message;
[0011] The first topology message includes the client topology message and the server topology message of the publishing process, and the second topology message includes the client topology message and the server topology message of the subscribing process.
[0012] According to another aspect of the present disclosure, a communication device is provided, which is applied to an information publisher of an application service based on a publish-subscribe model, and the device includes:
[0013] A determination module, configured to determine, in response to starting the application service, a publishing process and a subscription process of the application service, wherein the publishing process is a process of an information publisher of the application service, and the subscription process is a process of an information subscriber of the application service;
[0014] A first control module, used to control the publishing process to send a first topology message to the subscribing process and receive a second topology message from the subscribing process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message;
[0015] The first topology message includes the client topology message and the server topology message of the publishing process, and the second topology message includes the client topology message and the server topology message of the subscribing process.
[0016] According to another aspect of the present disclosure, a communication device is provided, which is applied to an information subscriber of an application service based on a publish-subscribe model, and the device includes:
[0017] A determination module, configured to determine, in response to a subscription operation to the application service, a publishing process and a subscription process of the application service, wherein the publishing process is a process of an information publisher of the application service, and the subscription process is a process of an information subscriber of the application service;
[0018] A communication module, used for receiving a first topology message from the publishing process and controlling the subscribing process to send a second topology message to the publishing process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message;
[0019] The first topology message includes the client topology message and the server topology message of the publishing process, and the second topology message includes the client topology message and the server topology message of the subscribing process.
[0020] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0021] at least one processor; and
[0022] a memory communicatively connected to the at least one processor; wherein,
[0023] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the communication method provided by the present disclosure.
[0024] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the communication method provided by the present disclosure.
[0025] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the communication method provided by the present disclosure when the computer program is executed by a processor.
[0026] The technical solution provided by the present invention, under the premise of starting the application service, sends the client topology message and server topology message of the publishing process to the subscription process of the application service through the publishing process of the application service, and simultaneously receives the client topology message and server topology message from the subscription process, so as to subsequently use the client topology message and server topology message of both to communicate, and provides a method for notifying topology messages from the client and server dimensions, which can quickly and efficiently notify topology messages, reduce the occupancy of network bandwidth, can greatly improve the response speed of the application, and improve the performance of the application.
[0027] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0029] Figure 1 It is a schematic diagram of an implementation environment of a communication method shown in an embodiment of the present disclosure;
[0030] Figure 2 It is a flow chart of a communication method shown in an embodiment of the present disclosure;
[0031] Figure 3 It is a flow chart of a communication method shown in an embodiment of the present disclosure;
[0032] Figure 4 It is a flow chart of a communication method shown in an embodiment of the present disclosure;
[0033] Figure 5 This is a processing flow of an application service shown in an embodiment of the present disclosure;
[0034] Figure 6is a schematic diagram of an architecture of a communication method shown in an embodiment of the present disclosure;
[0035] Figure 7 is a comparative schematic diagram of a notification topology message shown in an embodiment of the present disclosure;
[0036] Figure 8 is a structural block diagram of a communication device shown in an embodiment of the present disclosure;
[0037] Fig. 9 is a structural block diagram of a communication device shown in an embodiment of the present disclosure;
[0038] Fig.10 The block diagram is a block diagram of an electronic device for implementing the communication method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0039] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0040] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0041] First, the application scenarios involved in the embodiments of the present disclosure are described. The communication method provided by the embodiments of the present disclosure can be applied to software products of smart cars, such as smart seats, autonomous driving or other products. Specifically, the communication method provided by the embodiments of the present disclosure can be applied to application services based on the publish-subscribe model.
[0042] Among them, the software products of smart cars are usually built based on SOA architecture (Service Oriented Architecture). SOA architecture is a service architecture with strong scalability, high availability, loose coupling, standardized interfaces and support for heterogeneous system integration. In some embodiments, SOA architecture is used to split different functional units of an application (which can be called services) and connect them through well-defined interfaces and protocols between these services.
[0043] In the process of implementing SOA architecture, if a service event or service message needs to be sent to multiple message recipients, a topic-based publish-subscribe model is usually used. The topic-based publish-subscribe model is to publish service events or service messages to a virtual channel called a topic.
[0044] When communicating based on the topic-based publish-subscribe model, it is necessary to ensure that the topology messages of the topic's publishers and subscribers are known in advance. In related technologies, usually for each topic, the publishers and subscribers of the topic are notified of their respective topology messages from the dimensions of the publishers and subscribers of the topic, that is, each publisher and the corresponding subscriber need to send their own topology messages once. However, in the case of a large number of topics, if each publisher and the corresponding subscriber send topology messages to each other, the number of messages will increase exponentially, seriously occupying the network bandwidth, reducing the application response time, and greatly affecting the application performance.
[0045] Based on this, the embodiments of the present disclosure provide a communication method. On the premise of starting the application service, the publishing process of the application service sends the client topology message and the server topology message of the publishing process to the subscription process of the application service, and at the same time receives the client topology message and the server topology message from the subscription process, so as to subsequently use the client topology messages and the server topology messages of the two to communicate. A method for notifying topology messages from the client and server dimensions is provided, which can quickly and efficiently notify topology messages, reduces the occupancy of network bandwidth, can greatly improve the response speed of the application, and improves the performance of the application.
[0046] Figure 1 is a schematic diagram of an implementation environment of a communication method shown in an embodiment of the present disclosure, see Figure 1 , the implementation environment includes an electronic device 101 and a server 102.
[0047] The electronic device 101 may be at least one of a vehicle-mounted device, a smart phone, a smart watch, a desktop computer, a laptop computer, a virtual reality terminal, an augmented reality terminal, a wireless terminal, and a laptop computer.
[0048] In some embodiments, the electronic device 101 has a communication function and can access a wired network or a wireless network. The electronic device 101 may generally refer to one of a plurality of devices, and the embodiment of the present disclosure is only illustrated by the electronic device 101. Those skilled in the art may know that the number of the electronic devices may be more or less.
[0049] In some embodiments, an application client is running on the electronic device 101, and the application client is used to provide vehicle-related application services. For example, the application client can be a client that provides an automatic driving function, or the application client can be a client that provides a vehicle control function, such as controlling windows, controlling seats, controlling air conditioning, etc. The disclosed embodiments do not limit the type of application client.
[0050] In the disclosed embodiment, the electronic device 101 includes a first electronic device and a second electronic device. The first electronic device is used to refer to the electronic device corresponding to the information publisher of the application service. In some embodiments, the first electronic device is used to determine the publishing process and subscription process of the application service in response to the opening of the application service; control the publishing process to send a first topology message to the subscription process and receive a second topology message from the subscription process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message. The second electronic device is used to refer to the electronic device corresponding to the information subscriber of the application service. In some embodiments, the second electronic device is used to determine the publishing process and subscription process of the application service in response to the subscription operation of the application service; receive a first topology message from the publishing process and control the subscription process to send a second topology message to the publishing process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message.
[0051] In some embodiments, the server 102 is an independent physical server, or a server cluster or distributed file system composed of multiple physical servers, or at least one of the cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks, and big data or artificial intelligence platforms, etc., which is not limited in the embodiments of the present disclosure. In some embodiments, the number of the above-mentioned servers 102 can be more or less, which is not limited in the embodiments of the present disclosure. Of course, the server 102 can also include other functions to provide more comprehensive and diversified services.
[0052] In the embodiment of the present disclosure, the server 102 is used to receive a first topology message from the publishing process, send the first topology message to the subscribing process, and receive a second topology message from the subscribing process, send the second topology message to the publishing process, and then establish a communication connection between the information publisher and the information subscriber based on the first topology message and the second topology message.
[0053] The following is based on Figure 1 The implementation environment shown is used to introduce the method provided by the embodiment of the present disclosure.
[0054] Figure 2 is a flow chart of a communication method shown in an embodiment of the present disclosure, and the communication method is applied to an information publisher of an application service based on a publish-subscribe model. In some embodiments, the communication method is executed by an electronic device. In a possible implementation, the electronic device may be the above-mentioned Figure 1 The first electronic device shown. Figure 2 As shown, the method includes the following steps.
[0055] S201. In response to starting an application service, determining a publishing process and a subscription process of the application service, wherein the publishing process is a process of an information publisher of the application service, and the subscription process is a process of an information subscriber of the application service.
[0056] In the embodiments of the present disclosure, an application service refers to a service function provided by an application client running on an electronic device, such as an autonomous driving function or a vehicle control function, etc. The publishing process of the application service is also the process of the current electronic device. The subscription process of the application service is also other processes that subscribe to the application service. In some embodiments, the number of subscription processes for the application service can be multiple.
[0057] S202: Control the publishing process to send a first topology message to the subscribing process and receive a second topology message from the subscribing process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message.
[0058] The first topology message includes the client topology message and the server topology message of the publishing process, and the second topology message includes the client topology message and the server topology message of the subscribing process. Specifically, the client topology message may include the communication identifier of the client, the IP address (Internet Protocol Address) of the host machine, or the communication interface of the process. The server topology message may include the communication identifier of the server, the IP address of the host machine, or the communication interface of the process.
[0059] The technical solution provided by the embodiment of the present disclosure, under the premise of starting the application service, sends the client topology message and server topology message of the publishing process to the subscription process of the application service through the publishing process of the application service, and simultaneously receives the client topology message and server topology message from the subscription process, so as to subsequently use the client topology message and server topology message of both to communicate, and provides a method for notifying topology messages from the client-server dimension, which can quickly and efficiently notify topology messages, reduces the occupancy of network bandwidth, can greatly improve the response speed of the application, and improves the performance of the application.
[0060] Figure 3 is a flow chart of a communication method shown in an embodiment of the present disclosure, and the communication method is applied to information subscribers of application services based on a publish-subscribe model. In some embodiments, the communication method is executed by an electronic device. In a possible implementation, the electronic device may be the above-mentioned Figure 1 The second electronic device shown. Figure 3 As shown, the method includes the following steps.
[0061] S301. In response to a subscription operation to the application service, determine a publishing process and a subscription process of the application service, where the publishing process is a process of an information publisher of the application service, and the subscription process is a process of an information subscriber of the application service.
[0062] S302, receiving a first topology message from the publishing process and controlling the subscribing process to send a second topology message to the publishing process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message.
[0063] The first topology message includes the client topology message and the server topology message of the publishing process, and the second topology message includes the client topology message and the server topology message of the subscribing process.
[0064] The technical solution provided by the embodiment of the present disclosure, under the premise of having subscribed to an application service, sends the client topology message and the server topology message of the subscription process to the publishing process of the application service through the subscription process of the application service, and simultaneously receives the client topology message and the server topology message from the publishing process, so as to subsequently communicate by using the client topology messages and the server topology messages of the two. A method for notifying topology messages from the client-server dimension is provided, which can quickly and efficiently notify topology messages, reduces the occupancy of network bandwidth, can greatly improve the response speed of the application, and improves the performance of the application.
[0065] Above Figures 2 to 3 This is a simple embodiment of the present disclosure. The communication method provided by the present disclosure is described below based on a specific embodiment. Figure 4 FIG. 1 is a flow chart of a communication method shown in an embodiment of the present disclosure, and the communication method is executed by an electronic device. Figure 4 As shown, with the first electronic device and the second electronic device as execution entities, the method includes the following steps.
[0066] S401. In response to starting an application service, the first electronic device determines a publishing process and a subscription process of the application service, where the publishing process is a process of an information publisher of the application service, and the subscription process is a process of an information subscriber of the application service.
[0067] The first electronic device is used to refer to the electronic device corresponding to the information publisher of the application service. The application service refers to the service function provided by the application client running on the electronic device, such as the automatic driving function or the vehicle control function, etc. The present disclosure embodiment does not limit the application service.
[0068] It should be noted that the application services mentioned in the embodiments of the present disclosure communicate based on a topic-based publish-subscribe model. For example, taking the application service that provides the autonomous driving function as an example, it requires the mutual cooperation between the perception module, positioning module, decision module, planning module and control module in the autonomous driving system. At this time, the topic-based publish-subscribe model can be used for communication.
[0069] The publishing process of the application service is also the process in the current first electronic device for publishing the topology message of the application service. The subscription process of the application service is also other processes that subscribe to the application service, and specifically can be a process that subscribes to the topology message of the application service. In some embodiments, the number of subscription processes for the application service can be multiple.
[0070] In some embodiments, the process of the first electronic device determining the publishing process of the application service may be: determining a process for publishing the topology message of the application service from among multiple processes included in the first electronic device, and using the determined process as the publishing process. For example, the publishing process of the application service may be a pre-set process for publishing the topology message of the application service, or the publishing process of the application service may be a newly added process for publishing the topology message of the application service.
[0071] In some embodiments, the first electronic device maintains themes of various application services and information subscribers of various application services. Among them, the theme is used to uniquely identify the application service. In some embodiments, the theme can be the name, number, ID (Identity document identification number) of the application service, etc. The present disclosure embodiment does not limit the theme. It should be understood that one theme corresponds to one information publisher and at least one information subscriber. Accordingly, the process of the first electronic device determining the subscription process of the application service can be: the first electronic device determines the information subscriber corresponding to the theme of the application service based on the theme of the application service, obtains the process information of the information subscriber, and then uses the process information of the information subscriber to determine the subscription process of the application service. By way of example, the process information may include a process number or a process IP address, etc.
[0072] In the above embodiment, by maintaining the subject of each application service and the information subscriber of each application service in the first electronic device, the subscription progress of each application service can be determined in time, thereby improving the communication efficiency.
[0073] S402: The first electronic device determines whether the publishing process has sent a first topology message to the subscribing process, where the first topology message includes a client topology message and a server topology message of the publishing process.
[0074] The client topology message may include the client's communication identifier, the host's IP address, or the process's communication interface, etc. The server topology message may include the server's communication identifier, the host's IP address, or the process's communication interface, etc.
[0075] In some embodiments, the first electronic device maintains a topology sending record of the publishing process, and the topology sending record is used to record multiple subscription processes that have received the first topology message of the publishing process. Accordingly, the first electronic device queries the topology sending record of the publishing process to determine whether there is a subscription process for the application service in the topology sending record of the publishing process.
[0076] Furthermore, if the subscription process of the application service does not exist in the topology sending record of the publishing process, S403 is executed; if the subscription process of the application service exists in the topology sending record of the publishing process, S403 does not need to be executed. In this way, repeated sending of the topology message of the publishing process can be effectively avoided, and the occupation of network bandwidth can be avoided.
[0077] In the above embodiment, by maintaining the topology sending record of the publishing process in the first electronic device, the subscription process that has received the first topology message of the publishing process can be determined in time, thereby improving the communication efficiency.
[0078] S403: When the publishing process has not sent the first topology message to the subscribing process, the first electronic device controls the publishing process to send the first topology message to the second electronic device where the subscribing process is located.
[0079] The second electronic device is used to refer to the electronic device corresponding to the information subscriber of the application service. In some embodiments, the number of the second electronic device is one or more.
[0080] In some embodiments, the process of controlling the publishing process to send the first topology message to the subscribing process in the above S403 can be performed by the first electronic device and the server in cooperation, and the corresponding process is: the first electronic device controls the publishing process to send the first topology message to the server, the server receives the first topology message from the publishing process, and sends the first topology message to the second electronic device.
[0081] In the above embodiment, for the publishing process of the application service, the topology message is notified based on the client-server dimension, which can quickly and efficiently notify the topology message. Moreover, by judging whether the topology message of the publishing process has been sent in the past, it can be ensured that each publishing topic only sends the topology information once based on the client-server.
[0082] For example, Figure 5 This is a processing flow of an application service shown in an embodiment of the present disclosure. Figure 5 After the application service is started, the client topic of the application service will be registered, and then it will be determined in turn whether the server and client that have subscribed to the application service are online. If the server and client that have subscribed to the application service are online, the topic subscription relationship will be automatically bound. Among them, the topic subscription relationship is used to indicate at least one information subscriber associated with the topic. In the case that the server or client that has subscribed to the application service is not online, the topic subscription relationship is first cached until the server and client are online. Then, based on the topic subscription relationship, it is determined whether the publishing process of the application service has sent the topology message of the publishing process to the corresponding subscription process. If not, the publishing process is controlled to send the topology message of the publishing process to the corresponding subscription process. If it has been sent, there is no need to perform the above-mentioned control sending process.
[0083] S404: The second electronic device receives a first topology message from the publishing process.
[0084] In some embodiments, the second electronic device receives the first topology message from the publishing process when the first topology message of the publishing process is not stored locally. It should be understood that through the judgment process of the first electronic device in S402 to S403 above, it is ensured that when the publishing process has not sent the first topology message to the subscription process, that is, it can be ensured that when the first topology message of the publishing process is not stored locally in the second electronic device, the publishing process of the first electronic device is controlled to send the first topology message to the subscription process of the second electronic device, ensuring that the first topology message is sent only once, which can effectively avoid repeated sending of the topology message of the publishing process and avoid occupying the network bandwidth.
[0085] In some embodiments, before executing S404, the second electronic device also determines the publishing process and subscription process of the application service in response to the subscription operation of the application service. It should be noted that the timing of triggering the subscription operation on the second electronic device may be after the timing of the first electronic device starting the application service in S401.
[0086] In some embodiments, the process of the second electronic device determining the subscription process of the application service may be: determining a process for subscribing to the topology message of the application service from among multiple processes included in the second electronic device, and using the determined process as the subscription process. For example, the subscription process of the application service may be a pre-set process for subscribing to the topology message of the application service, or the subscription process of the application service may be a newly added process for subscribing to the topology message of the application service.
[0087] In some embodiments, the second electronic device maintains the subject of the subscribed application service and the information publisher of the application service. Accordingly, the process of the second electronic device determining the publishing process of the application service may be: the first electronic device determines the information publisher corresponding to the subject according to the subject of the application service, obtains the process information of the information publisher, and then uses the process information of the information publisher to determine the publishing process of the application service.
[0088] S405: The second electronic device determines whether the subscription process has sent a second topology message to the publishing process, where the second topology message includes a client topology message and a server topology message of the subscription process.
[0089] In some embodiments, the second electronic device maintains a topology sending record of the subscription process, and the topology sending record is used to record the publishing process of multiple second topology messages that have received the subscription process. Accordingly, the second electronic device queries the topology sending record of the subscription process to determine whether there is a publishing process of the application service in the topology sending record of the subscription process.
[0090] Furthermore, if the publishing process of the application service does not exist in the topology sending record of the subscription process, S406 is executed; if the publishing process of the application service exists in the topology sending record of the subscription process, S406 does not need to be executed. In this way, repeated sending of the topology message of the subscription process can be effectively avoided, and the occupation of network bandwidth can be avoided.
[0091] In the above embodiment, by maintaining the topology sending record of the subscription process in the second electronic device, the publishing process of the second topology message of the subscription process can be determined in time, thereby improving the communication efficiency.
[0092] S406: When the subscription process has not sent the second topology message to the publishing process, the second electronic device controls the subscription process to send the second topology message to the first electronic device where the publishing process is located.
[0093] In some embodiments, the process of controlling the subscription process to send the second topology message to the publishing process in the above S406 can be executed by the second electronic device and the server in cooperation, and the corresponding process is: the second electronic device controls the subscription process to send the second topology message to the server, the server receives the second topology message from the subscription process, and sends the second topology message to the first electronic device.
[0094] S407: The first electronic device receives a second topology message from the subscription process.
[0095] In some embodiments, the first electronic device receives the second topology message from the subscription process when the second topology message of the subscription process is not stored locally. It should be understood that through the judgment process of the second electronic device in the above S405 to S406, it is ensured that when the subscription process has not sent the second topology message to the publishing process, that is, it can be ensured that when the second topology message of the subscription process is not stored locally in the first electronic device, the subscription process of the second electronic device is controlled to send the second topology message to the publishing process of the first electronic device, ensuring that the second topology message is sent only once, which can effectively avoid repeated sending of the topology message of the subscription process and avoid occupying the network bandwidth.
[0096] Through the above embodiment, the first electronic device is used to control the publishing process to send the first topology message to the subscription process, and at the same time, the second electronic device is used to control the subscription process to send the second topology message to the publishing process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message. And, it is ensured that when the second topology message of the subscription process is not stored locally on the first electronic device, the second topology message from the subscription process is received, and when the first topology message of the publishing process is not stored locally on the second electronic device, the first topology message from the publishing process is received. In this way, it can be ensured that each time a topic is published, the topology information is only sent once based on the client server, which can effectively avoid the occupation of network bandwidth.
[0097] For example, Figure 6 Schematic diagram of a communication method shown in an embodiment of the present disclosure. Figure 6 , provides a topology optimization solution based on client-server structure, Figure 6 Taking process 1 and process 2 as examples, process 1 can be used to refer to the publishing process, and process 2 can be used to refer to the subscribing process. The topology message of client 1 and the topology message of server 1 are sent to process 2 through process 1, and the topology message of client 2 and the topology message of server 2 are sent to process 1 through process 2.
[0098] For example, Figure 7FIG. 1 is a schematic diagram showing a comparison of a notification topology message in an embodiment of the present disclosure. Figure 7 , taking 10 topics as an example, Figure 7 (a) is a schematic diagram of notifying topology messages in the related art, in which each client and server needs to notify 10 topic messages before their respective communications can be established. It can be seen that a total of 40 topology messages need to be notified in the related art. Figure 7 (b) is a schematic diagram of notifying topology messages in the embodiment of the present disclosure, wherein each client and server only needs to notify one topology message to establish their respective communications. It can be seen that in the embodiment of the present disclosure, only four topology messages need to be notified in total, which can notify topology information more quickly, greatly reduce network bandwidth, greatly improve application response speed, and improve communication efficiency.
[0099] The following describes the communication process between the information publisher and the information subscriber based on the publishing process of the associated information of the application service. For the corresponding process, see S408 to S410.
[0100] S408: The first electronic device determines whether the second topology information of the subscription process is stored locally.
[0101] In some embodiments, the electronic device maintains topology information of each subscription process in the local communication record. Accordingly, the electronic device performs a query in the local communication record to determine whether the second topology information of the subscription process exists in the local communication record.
[0102] The local communication record is used to record the topology information of multiple subscription processes. Furthermore, when the second topology information of the subscription process exists in the local communication record, the step of controlling the publishing process to send the association information of the application service to the subscription process in S409 is executed.
[0103] In the above embodiment, by maintaining the local communication record in the first electronic device, the second topology message of other subscription processes can be determined in time by using the local communication record, so that the second topology message can be used for subsequent communication, thereby ensuring communication efficiency.
[0104] S409: When the first electronic device locally stores the second topology information of the subscription process, the first electronic device controls the publishing process to publish the associated information of the application service to the subscription process.
[0105] The associated information of the application service may be any information required to implement the application service. For example, taking an application service that provides an autonomous driving function as an example, the associated information of the application service may be the vehicle's positioning information, the vehicle's perception data, or the vehicle's control signal, etc.
[0106] In the above embodiment, when ensuring that the second topology message of the subscription process is stored locally, the second topology message of the subscription process is used to publish the associated information of the application service to the subscription process to ensure the reliability and security of communication.
[0107] In some embodiments, when the electronic device locally stores the second topology message of the subscription process, it also determines whether the server corresponding to the subscription process is online. When the server corresponding to the subscription process is online, it determines whether the client corresponding to the subscription process is online. When the client corresponding to the subscription process is online, it controls the publishing process to publish the associated information of the application service to the subscription process.
[0108] In other embodiments, when the server corresponding to the subscription process is not online, the electronic device caches the associated information of the application service until it receives a message that the server of the subscription process is online, and then performs a subsequent publishing operation. Similarly, in other embodiments, when the client corresponding to the subscription process is not online, the electronic device caches the associated information of the application service until it receives a message that the client of the subscription process is online, and then controls the publishing process to publish the associated information of the application service to the subscription process.
[0109] In the above embodiment, by judging whether the server corresponding to the subscription process is online and judging whether the client corresponding to the subscription process is online, it is ensured that when the server corresponding to the subscription process is online and the client corresponding to the subscription process is online, the associated information of the application service is published to the subscription process, thereby improving the reliability and security of communication.
[0110] S410: The second electronic device receives the associated information of the application service from the publishing process.
[0111] The embodiments shown in S408 to S410 above take the second topology message of the subscription process stored locally in the first electronic device as an example to illustrate the process of publishing the associated information of the application service. In other embodiments, when the second topology message of the subscription process is not stored locally, the electronic device caches the associated information of the application service, and after receiving the second topology message of the subscription process, controls the publishing process to publish the associated information of the application service to the subscription process.
[0112] In the above embodiment, when the second topology message of the subscription process is not stored locally, the association information of the application service is first cached and the second topology message of the subscription process is waited for. After receiving the second topology message of the subscription process, the above process of publishing the association information is executed, thereby improving the reliability and security of communication.
[0113] The technical solution provided by the embodiment of the present disclosure, under the premise of starting the application service, sends the client topology message and server topology message of the publishing process to the subscription process of the application service through the publishing process of the application service, and simultaneously receives the client topology message and server topology message from the subscription process, so as to subsequently use the client topology message and server topology message of both to communicate, and provides a method for notifying topology messages from the client-server dimension, which can quickly and efficiently notify topology messages, reduces the occupancy of network bandwidth, can greatly improve the response speed of the application, and improves the performance of the application.
[0114] Figure 8 is a structural block diagram of a communication device shown in an embodiment of the present disclosure, and the device is applied to an information publisher of an application service based on a publish-subscribe model, see Figure 8 , the device includes a determination module 801 and a first control module 802. Wherein:
[0115] The determination module 801 is used to determine the publishing process and the subscription process of the application service in response to starting the application service, wherein the publishing process is the process of the information publisher of the application service, and the subscription process is the process of the information subscriber of the application service;
[0116] A first control module 802, used to control the publishing process to send a first topology message to the subscribing process and receive a second topology message from the subscribing process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message;
[0117] The first topology message includes the client topology message and the server topology message of the publishing process, and the second topology message includes the client topology message and the server topology message of the subscribing process.
[0118] The technical solution provided by the embodiment of the present disclosure, under the premise of starting the application service, sends the client topology message and server topology message of the publishing process to the subscription process of the application service through the publishing process of the application service, and simultaneously receives the client topology message and server topology message from the subscription process, so as to subsequently use the client topology message and server topology message of both to communicate, and provides a method for notifying topology messages from the client-server dimension, which can quickly and efficiently notify topology messages, reduces the occupancy of network bandwidth, can greatly improve the response speed of the application, and improves the performance of the application.
[0119] In some embodiments, the first control module 802 includes:
[0120] The control submodule is used to control the publishing process to send the first topology message to the subscribing process when the publishing process has not sent the first topology message to the subscribing process.
[0121] In some embodiments, the first control module 802 includes:
[0122] The receiving submodule is used to receive the second topology message from the subscription process when the second topology message of the subscription process is not stored locally.
[0123] In some embodiments, it also includes:
[0124] The second control module is used to control the publishing process to publish the associated information of the application service to the subscribing process when the second topology information of the subscribing process is stored locally.
[0125] In some embodiments, the second control module is used to:
[0126] Determine whether there is a second topology message of the subscription process in a local communication record, where the local communication record is used to record topology messages of multiple subscription processes;
[0127] In a case where the second topology information of the subscription process exists in the local communication record, the publishing process is controlled to publish the associated information of the application service to the subscription process.
[0128] In some embodiments, the second control module is used to:
[0129] Determine whether the server corresponding to the subscription process is online;
[0130] When the server corresponding to the subscription process is online, determine whether the client corresponding to the subscription process is online;
[0131] When the client corresponding to the subscription process is online, the publishing process is controlled to publish the associated information of the application service to the subscription process.
[0132] In some embodiments, it also includes:
[0133] A cache module, used for caching the associated information of the application service when the second topology message of the subscription process is not stored locally;
[0134] The third control module is used to control the publishing process to publish the associated information of the application service to the subscribing process after receiving the second topology message of the subscribing process.
[0135] Fig. 9 is a structural block diagram of a communication device shown in an embodiment of the present disclosure, the device is applied to information subscribers of application services based on a publish-subscribe model, see Fig. 9 , the device includes a determination module 901 and a communication module 902. Wherein:
[0136] The determination module 901 is used to determine the publishing process and the subscription process of the application service in response to the subscription operation of the application service, wherein the publishing process is the process of the information publisher of the application service, and the subscription process is the process of the information subscriber of the application service;
[0137] The communication module 902 is used to receive a first topology message from the publishing process and control the subscription process to send a second topology message to the publishing process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message;
[0138] The first topology message includes the client topology message and the server topology message of the publishing process, and the second topology message includes the client topology message and the server topology message of the subscribing process.
[0139] The technical solution provided by the embodiment of the present disclosure, under the premise of having subscribed to an application service, sends the client topology message and the server topology message of the subscription process to the publishing process of the application service through the subscription process of the application service, and simultaneously receives the client topology message and the server topology message from the publishing process, so as to subsequently communicate by using the client topology messages and the server topology messages of the two. A method for notifying topology messages from the client-server dimension is provided, which can quickly and efficiently notify topology messages, reduces the occupancy of network bandwidth, can greatly improve the response speed of the application, and improves the performance of the application.
[0140] In some embodiments, the communication module 902 includes:
[0141] The receiving submodule is used to receive the first topology message from the publishing process when the first topology message of the publishing process is not stored locally.
[0142] In some embodiments, the communication module 902 includes:
[0143] The control submodule is used to control the subscription process to send the second topology message to the publishing process when the subscription process has not sent the second topology message to the publishing process.
[0144] In some embodiments, the device further includes a receiving module for:
[0145] Receive association information of the application service from the publishing process.
[0146] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the communication method provided by the present disclosure.
[0147] According to an embodiment of the present disclosure, the present disclosure further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable an electronic device to execute the communication method provided by the present disclosure.
[0148] According to an embodiment of the present disclosure, the present disclosure further provides a computer program product, including a computer program, which implements the communication method provided by the present disclosure when being executed by a processor.
[0149] In some embodiments, the electronic device may be the above Figure 1 The first electronic device or the second electronic device shown in . Fig.10 A schematic block diagram of an example electronic device 1000 that can be used to implement an embodiment of the present disclosure is shown. The electronic device 1000 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 1000 can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0150] like Fig.10 As shown, the electronic device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 to a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0151] Multiple components in the electronic device 1000 are connected to the I / O interface 1005, including: an input unit 1006, such as a keyboard, a mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a disk, an optical disk, etc.; and a communication unit 1009, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the device 1000 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0152] The computing unit 1001 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1001 performs the various methods and processes described above, such as communication methods. For example, in some embodiments, the communication method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 1000 via the ROM 1002 and / or the communication unit 1009. When the computer program is loaded into the RAM 1003 and executed by the computing unit 1001, one or more steps of the communication method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to execute the communication method in any other appropriate manner (eg, by means of firmware).
[0153] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard parts (ASSPs), system on chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0154] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0155] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0156] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user, such as a cathode ray tube (CRT) or a liquid crystal display (LCD) monitor; and a keyboard and a pointing device (e.g., a mouse or a trackball), through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0157] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
[0158] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0159] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of this disclosure can be achieved, and this document is not limited here.
[0160] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A communication method, applied to an information publisher of an application service based on a publish-subscribe model, comprising: In response to starting the application service, determining a publishing process and a subscription process of the application service, wherein the publishing process is a process of an information publisher of the application service, and the subscription process is a process of an information subscriber of the application service; Controlling the publishing process to send a first topology message to the subscribing process and to receive a second topology message from the subscribing process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message; The first topology message includes the client topology message and the server topology message of the publishing process, and the second topology message includes the client topology message and the server topology message of the subscribing process.
2. The method according to claim 1, wherein: The controlling the publishing process to send a first topology message to the subscribing process includes: In a case where the publishing process has not sent the first topology message to the subscribing process, controlling the publishing process to send the first topology message to the subscribing process.
3. The method according to claim 1, wherein: The receiving a second topology message from the subscription process includes: In a case where the second topology message of the subscription process is not stored locally, a second topology message from the subscription process is received.
4. The method according to claim 1, further comprising: In a case where the second topology information of the subscription process is stored locally, the publishing process is controlled to publish the associated information of the application service to the subscription process.
5. The method according to claim 4, wherein: In the case where the second topology information of the subscription process is stored locally, controlling the publishing process to publish the associated information of the application service to the subscription process includes: Determine whether there is a second topology message of the subscription process in a local communication record, where the local communication record is used to record topology messages of multiple subscription processes; In a case where the second topology information of the subscription process exists in the local communication record, the publishing process is controlled to publish the associated information of the application service to the subscription process.
6. The method according to claim 4 or 5, wherein: The controlling the publishing process to publish the associated information of the application service to the subscribing process includes: Determine whether the server corresponding to the subscription process is online; When the server corresponding to the subscription process is online, determining whether the client corresponding to the subscription process is online; When the client corresponding to the subscription process is online, the publishing process is controlled to publish the associated information of the application service to the subscription process.
7. The method according to any one of claims 4 to 6, further comprising: When the second topology message of the subscription process is not stored locally, cache the association information of the application service; After receiving the second topology message of the subscription process, the publishing process is controlled to publish the associated information of the application service to the subscription process.
8. A communication method, applied to an information subscriber of an application service based on a publish-subscribe model, comprising: In response to a subscription operation to the application service, determining a publishing process and a subscription process of the application service, wherein the publishing process is a process of an information publisher of the application service, and the subscription process is a process of an information subscriber of the application service; Receiving a first topology message from the publishing process and controlling the subscribing process to send a second topology message to the publishing process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message; The first topology message includes the client topology message and the server topology message of the publishing process, and the second topology message includes the client topology message and the server topology message of the subscribing process.
9. The method according to claim 8, wherein: The receiving a first topology message from the publishing process includes: In a case where the first topology message of the publishing process is not stored locally, the first topology message from the publishing process is received.
10. The method according to claim 8, wherein: The controlling the subscription process to send a second topology message to the publishing process includes: In a case where the subscription process has not sent the second topology message to the publishing process, the subscription process is controlled to send the second topology message to the publishing process.
11. The method according to claim 8, further comprising: Receiving association information of the application service from the publishing process.
12. A communication device, applied to an information publisher of an application service based on a publish-subscribe model, comprising: a determination module, configured to determine, in response to starting the application service, a publishing process and a subscription process of the application service, wherein the publishing process is a process of an information publisher of the application service, and the subscription process is a process of an information subscriber of the application service; A first control module, used to control the publishing process to send a first topology message to the subscribing process and receive a second topology message from the subscribing process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message; The first topology message includes the client topology message and the server topology message of the publishing process, and the second topology message includes the client topology message and the server topology message of the subscribing process.
13. The device according to claim 12, wherein: The first control module comprises: The control submodule is used to control the publishing process to send the first topology message to the subscribing process when the publishing process has not sent the first topology message to the subscribing process.
14. The device according to claim 12, wherein: The first control module comprises: The receiving submodule is used to receive the second topology message from the subscription process when the second topology message of the subscription process is not stored locally.
15. A communication device, applied to an information subscriber of an application service based on a publish-subscribe model, comprising: a determination module, configured to determine, in response to a subscription operation on the application service, a publishing process and a subscription process of the application service, wherein the publishing process is a process of an information publisher of the application service, and the subscription process is a process of an information subscriber of the application service; A communication module, configured to receive a first topology message from the publishing process and control the subscribing process to send a second topology message to the publishing process, so as to establish a communication connection between the information publisher and the information subscriber according to the first topology message and the second topology message; The first topology message includes the client topology message and the server topology message of the publishing process, and the second topology message includes the client topology message and the server topology message of the subscribing process.
16. The device according to claim 15, wherein: The communication module comprises: The receiving submodule is used to receive the first topology message from the publishing process when the first topology message of the publishing process is not stored locally.
17. The device according to claim 15, wherein: The communication module comprises: The control submodule is used to control the subscription process to send the second topology message to the publishing process when the subscription process has not sent the second topology message to the publishing process.
18. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 7 or 8 to 11.
19. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause an electronic device to execute a method according to any one of claims 1 to 7 or 8 to 11.
20. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7 or 8 to 11.
