Communication method and communication device

By multiplexing the socket identifiers of the server and client in the SOME/IP protocol, the problem of high resource consumption in the system is solved, and multiple services communicate with port numbers through the same address, improving system efficiency and user experience.

CN118784706BActive Publication Date: 2024-11-22CHENGDU CELIS TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411267119.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-11-22
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

In a system designed based on a service-oriented architecture, configuring independent IP addresses and port numbers for each service and client leads to a large resource consumption and excessive system load.

Method used

In the SOME/IP protocol, the client receives the address information of the server, sends a connection establishment request message, and after receiving the feedback message of the connection established, the socket identification is obtained, and the same server IP address and port are multiplexed. The communication connection between the number and the client IP address and port number, transmitting information of multiple services.

Benefits of technology

Multiple services communicate with port numbers through the same address, saving communication overhead, improving resource utilization, improving user experience, and supporting iteration and update of software functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784706B_ABST
    Figure CN118784706B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of communication technology, and provides a communication method and a communication device. The method establishes a communication link for a server providing a first target service and a client using the first target service based on the SOME / IP protocol. First, the client uses the acquired server IP address and server port number to send a connection establishment request to the server. If the server feedbacks that the connection has been established, the SOCKET identifier of the established connection is queried from the configuration information storage object, and then the communication link corresponding to the queried SOCKET identifier is used as a path for transmitting the first target service between the client and the server, so that the communication connection between the same server IP address and server port number and the same client IP address and client port number can be reused to transmit information of multiple services, saving communication overhead, improving resource utilization, and enhancing user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a communication method and a communication device. Background Art

[0002] Over-the-Air Technology (OTA) has gradually evolved from the early "function-oriented" OTA to the "service-oriented" OTA. The service-oriented architecture (SOA) provides a strong support capability and foundation for OTA. The development of software-defined cars and the implementation of SOA architecture can better unleash the potential of OTA, reduce the difficulty of OTA, and improve upgrade efficiency.

[0003] SOA is a thought and a design method, and the carrier of SOA is a design of a communication mechanism, which is often implemented using the Scalable Service-Oriented Middleware (SOME / IP) protocol based on the Internet Protocol (IP). The SOME / IP protocol is a service-oriented communication middleware that provides a standard service interface for the client / server communication mechanism of automotive Ethernet.

[0004] As smart cars become more and more functional, the number of electronic control units (ECUs) for various functions increases, and the number of services established by SOME / IP increases. After the client and the server have completed the search or service provision, they need to establish a User Datagram Protocol (UDP) or Transmission Control Protocol (TCP) connection. Once a connection is established for the same address and port number, other services using the same address and port number will not be able to establish a connection. If a different address or port number is assigned to each service, multiple service connections need to be established, which consumes a large amount of the system's central processing unit (CPU) and memory resources, and may even cause the system to be overwhelmed and abnormal. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a communication method and a communication device to solve the problem in the prior art that in a system designed based on a service-oriented architecture, an independent IP address and port number need to be configured for each service and client, resulting in high resource consumption.

[0006] A first aspect of an embodiment of the present invention provides a communication method, including:

[0007] The target client receives the target server address information of the first target service sent by the target server, where the target server address information includes the target server international interconnection protocol IP address and the target server port number;

[0008] The target client sends a connection request SOME / IP message to the target server. The message type of the connection request SOME / IP message is IP type, the source IP address is the target client IP address, the source port number is the target client port number, the destination IP address is the target server IP address, and the target port number is the target server port number.

[0009] In response to receiving the connection established feedback message, the target client obtains the target socket SOCKET identifier corresponding to the connection establishment request SOME / IP message from the configuration information storage object;

[0010] The target client and the target server communicate using the communication link corresponding to the target socket identifier SOCKET to transmit information of the first target service.

[0011] A second aspect of an embodiment of the present invention provides a communication device, wherein the method is used to establish and provide communication services for a server and a client based on an extensible service-oriented middleware SOME / IP protocol of an international interconnection protocol, including:

[0012] A receiving module is configured to receive, by a target client, target server address information of a first target service sent by a target server, wherein the target server address information includes an international interconnection protocol IP address of the target server and a port number of the target server;

[0013] The sending module is configured to send a connection establishment request SOME / IP message from the target client to the target server, wherein the message type of the connection establishment request SOME / IP message is IP type, the source IP address is the target client IP address, the source port number is the target client port number, the destination IP address is the target server IP address, and the target port number is the target server port number;

[0014] The query module is configured to, in response to receiving a connection established feedback message, query the target client from the configuration information storage object to obtain a target socket SOCKET identifier corresponding to the connection establishment request SOME / IP message;

[0015] The transmission module is configured so that the target client and the target server communicate using the communication link corresponding to the target socket SOCKET identifier to transmit the information of the first target service.

[0016] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: when the embodiments of the present invention establish a communication link between a server providing a first target service and a client using the first target service based on the SOME / IP protocol, the client first sends a connection establishment request to the server using the acquired server IP address and server port number; if the server feeds back that the connection has been established, the SOCKET identifier of the established connection is obtained by querying from the configuration information storage object; then, the communication link corresponding to the SOCKET identifier obtained by querying is used as a path for transmitting the first target service between the client and the server, thereby being able to reuse the communication connection between the same server IP address and server port number and the same client IP address and client port number to transmit information of multiple services, that is, being able to realize communication between multiple services through the same address and port number, saving communication overhead, improving resource utilization, and enhancing user experience.

[0017] Furthermore, the technical solution provided by the embodiment of the present invention is based on service-oriented design, can achieve layered design and decoupling of software and hardware, and can more easily iterate and update software functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 This is a schematic diagram of a vehicle system built on the SOA architecture.

[0020] Figure 2 A schematic diagram of a vehicle communication architecture.

[0021] Figure 3 It is a schematic diagram of the method by which the client and server communicate via SOME / IP.

[0022] Figure 4 It is a schematic diagram of the vehicle's electronic and electrical architecture designed using an Ethernet ring network architecture.

[0023] Figure 5 It is a flow chart of a communication method provided by an embodiment of the present invention.

[0024] Figure 6 It is a schematic diagram of the SOME / IP message format provided by an embodiment of the present invention.

[0025] Figure 7The present invention provides a flowchart of a method for obtaining a target socket SOCKET ID corresponding to a connection establishment request SOME / IP message by querying a configuration information storage object provided by a target client in an embodiment of the present invention.

[0026] Figure 8 It is a flow chart of another method provided by an embodiment of the present invention for obtaining a target socket SOCKET ID corresponding to a connection establishment request SOME / IP message by querying a configuration information storage object by a target client.

[0027] Fig. 9 It is a flowchart of another communication method provided by an embodiment of the present invention.

[0028] Fig.10 It is a flowchart of another communication method provided by an embodiment of the present invention.

[0029] Fig.11 It is a flowchart of another communication method provided by an embodiment of the present invention.

[0030] Fig.12 It is a schematic diagram of the SOME / IP message data structure provided by an embodiment of the present invention.

[0031] Fig.13 It is a schematic diagram of the SOME / IP-SD message data structure provided by an embodiment of the present invention.

[0032] Fig.14 It is a schematic diagram of a SOME / IP-SD message data structure of a discovery service provided by an embodiment of the present invention.

[0033] Fig.15 It is a schematic diagram of a SOME / IP-SD message data structure providing a service provided by an embodiment of the present invention.

[0034] Fig.16 It is an interaction diagram of a communication method provided by an embodiment of the present invention for a client to search for a discovery version service from a server.

[0035] Fig.17 It is an interaction diagram of a communication method for a client to search and discover an upgrade service from a server, provided by an embodiment of the present invention.

[0036] Fig.18 It is a schematic diagram of a communication device provided by an embodiment of the present invention.

[0037] Fig.19 is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0038] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0039] A communication method and device according to an embodiment of the present invention will be described in detail below with reference to the accompanying drawings.

[0040] As mentioned above, SOA is a concept and a design method. SOA contains multiple services, and the services will eventually provide a series of functions through cooperation. SOA expresses a software architecture concept, which is defined as using services to meet the needs of software users. In the SOA environment, nodes on the network open their resources to other participants on the network in the form of independent services, and other participants use resources in a standard way. Different from the traditional point-to-point architecture, various SOAs are composed of loosely coupled and highly interoperable application services.

[0041] Automotive OTA upgrades refer to firmware and software upgrades based on over-the-air download technology. OTA not only brings a more convenient way to upgrade vehicles, but also allows consumers to experience a smarter and more convenient car experience. By downloading new software update packages from a remote server over the network to upgrade the system itself, system defects can be quickly repaired, products and user experience can be improved quickly, and both automotive service providers and users can save time and money. The development of software-defined cars and the implementation of SOA architecture can better unleash the potential of OTA, reduce the difficulty of OTA, and improve upgrade efficiency.

[0042] Figure 1 This is a schematic diagram of a vehicle system built on the SOA architecture. Figure 1As shown, in a vehicle system built with SOA architecture, an extensible electronic and electrical architecture may be included, namely, a computing and communication architecture, an extensible hardware computing platform, an operating system kernel, a basic software framework, a device abstraction layer, an atomic service layer, and an application APP / combined service layer. Among them, the application APP / combined service layer may include, for example, OTA applications, body applications, cockpit applications, and other applications. The atomic service layer may include, for example, OTA domain atomic services, body domain atomic services, and other domain atomic services. The OTA domain atomic services may further include identity authentication, download management, upgrade management, log management, etc. The body domain atomic services may further include headlight control, rear light control, door control, window control, chair control, etc. The device abstraction layer may include, for example, controller abstraction, actuator abstraction, traditional ECU abstraction, etc. The controller abstraction can further include the controller area network (CAN) controller, the port number physical layer (PHY) controller, the universal asynchronous receiver / transmitter (UART) controller, the wireless communication (WIFI) module, the subscriber identity module (SIM) card, etc. The actuator abstraction can further include relays, light switches, door locks, seat motors, steering motors, etc.

[0043] In other words, the entire SOA architecture can build a system that decouples software and hardware, completes service abstraction and adaptation, and establishes a standardized service system. The service system includes an extensible electronic and electrical architecture (also known as a computing and communication architecture), an extensible hardware computing platform, an operating system kernel, a device abstraction layer, an atomic service layer, and an application and composite service layer.

[0044] This 6-layer architecture design realizes the decoupling of software, hardware, and vehicle platform. Good architecture design is the key to solving many problems. Including:

[0045] 1) Development based on standard services can increase the iteration speed of applications and allow product managers to be more deeply involved in the product development process.

[0046] 2) Layered architecture design facilitates layered testing and verification, reduces the pressure of integration testing, discovers problems more fully, and speeds up version releases.

[0047] 3) It is convenient to form a division of labor between product line and platform line. The product line is responsible for specific vehicle project, and the platform line is responsible for building the technical middle platform.

[0048] 4) Scalable hardware computing platform that is compatible with a variety of sensors and external devices, while supporting chip and hardware upgrades.

[0049] 5) The scalable computing and communication architecture can speed up vehicle model development. The platform can be quickly adapted to new models. The layered structure minimizes the differences between models and can reduce the pressure of maintaining multiple product lines in the later stage.

[0050] SOME / IP refers to an extensible service-oriented middleware based on IP. It is a service-oriented automotive Ethernet communication protocol, located on top of TCP / UDP, and is compatible with the basic software development platform currently being discussed internationally. The SOME / IP protocol adopts a client / server (C / S) communication architecture, where the server is the service provider and the client is the service consumer. According to the service interface type, the remote procedure call mechanism is used to enable data to be transmitted in the network through data serialization and deserialization. The dynamic configuration of services is achieved through the available service discovery (SD) mechanism.

[0051] Figure 2 is a schematic diagram of a vehicle communication architecture. Figure 2 As shown, the vehicle communication architecture can be divided into vehicle application, application layer, presentation layer, session layer, transport layer, network layer, link layer and physical layer.

[0052] Among them, at the vehicle application layer, it can include Unified Diagnostic Services (UDS) remote diagnosis applications, SOA communication service applications, Ethernet measurement and calibration applications, H264 video transmission applications and precision communication services.

[0053] At the application layer, presentation layer, and session layer, the Diagnostic communication over Internet Protocol (DoIP), SOME / IP, Explicit Control Protocol (XCP), Dynamic Host Configuration Protocol (DHCP), and IEEE 1733 Real-time Transport Protocol (RTP) can be used.

[0054] At the transport layer, you can use TCP or UDP protocols. As you can see, SOME / IP is located on top of TCP / UDP.

[0055] At the network layer, Internet Protocol version 4 (IPv4), Internet Protocol version 6 (IPv6), Address Resolution Protocol (ARP), and Internet Control Message Protocol (ICMP) can be used.

[0056] At the link layer, addressing can be done using Media Access Control Address (MAC) and Virtual Local Area Network (VLAN).

[0057] At the physical layer, protocols such as 100BASE-T1 / 1000BASE-T1 / 100BASE-Tx specified by IEEE802.3 can be used.

[0058] Furthermore, IEEE 1722 Audio / Video Bridging Transport Protocol (AVBTP), IEEE802.1 AS Precision Time Synchronization Protocol, IEEE802.1 Qat Stream Reservation Protocol, IEEE802.1 Qav Queue and Forwarding Protocol and IEEE 802.1 CB / Qcr / Qci / Qbu can work across the application layer, presentation layer, session layer, transport layer, network layer and link layer.

[0059] Figure 3 This is a schematic diagram of the method by which the client and server communicate via SOME / IP. Figure 3 As shown, the applications in the client and server can communicate via the middleware SOME / IP and the Ethernet network. The information in the applications in the client and server can be directly transmitted through the Ethernet after being processed by the middleware SOME / IP, or the information can be transmitted through the Ethernet after being processed by the middleware SOME / IP and controlled by the operating system.

[0060] Figure 4 This is a schematic diagram of the vehicle's electrical and electronic architecture designed using an Ethernet ring network architecture. Figure 4As shown in the figure, the ring network architecture supports SOA service and communication channel protection, supports the nearest access of each ECU according to functional classification, and saves wiring harness costs. The smart cockpit (Cockpit Domain Controller, CDC) is connected to the cloud through 4G / 5G and WIFI channels. It is the channel for communication between the car and the outside world. The vehicle integration gateway (Vehicle Integration Unit, VIU) 1~4 is connected through Ethernet to form a ring network structure, and related ECU components are hung below.

[0061] Among them, CDC, Vehicle Domain Controller (VDC) and VIU1~4 can be used as the master UMC for OTA upgrade, and the ECUs under it can be used as slave US. VDC can be connected to CDC through communication path 1, or connected to CDC through communication path 2, so as to have functions such as channel protection during OTA upgrade.

[0062] As smart cars become more and more versatile, there are more and more ECUs for various functions, and more and more services are established by SOME / IP. After the client and the server have completed the search or service provision, a UDP or TCP connection needs to be established. Once a connection is established for the same address and port number, other services using the same address and port number will not be able to establish a connection. If a different address or port number is assigned to each service, multiple service connections need to be established, which consumes a large amount of CPU and memory resources of the system, and may even cause the system to be overloaded and abnormal.

[0063] In view of this, an embodiment of the present invention provides a communication method. When a communication link is established between a server providing a first target service and a client using the first target service based on the SOME / IP protocol, the client first uses the obtained server IP address and server port number to send a connection establishment request to the server. If the server feedbacks that the connection has been established, the SOCKET identifier of the established connection is queried from the configuration information storage object, and then the communication link corresponding to the queried SOCKET identifier is used as a path for transmitting the first target service between the client and the server, so that the communication connection between the same server IP address and server port number and the same client IP address and client port number can be reused to transmit information of multiple services, that is, multiple services can communicate through the same address and port number, saving communication overhead, improving resource utilization, and enhancing user experience.

[0064] Furthermore, the communication method provided by the embodiment of the present invention saves the established communication connection identification (Identity document, ID), address information, and port number information, and records the number of such information. If a new connection needs to use the same address, port number, and protocol type, the SOCKET ID is assigned to the new connection, and the number of connections is increased by one. This allows multiple services to use the same address and port number, greatly saving system resources and load rate.

[0065] Figure 5 FIG. 1 is a flow chart of a communication method provided by an embodiment of the present invention. Figure 5 As shown, the method comprises the following steps:

[0066] In step S501, the target client receives the target server address information of the first target service sent by the target server.

[0067] The target server address information includes the target server IP address and the target server port number.

[0068] In step S502, the target client sends a connection establishment request SOME / IP message to the target server.

[0069] Among them, the message type of the connection request SOME / IP message is IP type, the source IP address is the target client IP address, the source port number is the target client port number, the destination IP address is the target server IP address, and the target port number is the target server port number.

[0070] In step S503, in response to receiving the connection established feedback message, the target client queries the configuration information storage object to obtain the target socket SOCKET ID corresponding to the connection establishment request SOME / IP message.

[0071] In step S504, the target client communicates with the target server using the communication link corresponding to the target socket ID to transmit information of the first target service.

[0072] In an embodiment of the present invention, the method can be executed by a client in a system implemented based on SOA architecture, and is used to establish a communication connection between the server and the client based on the SOME / IP protocol and provide communication services.

[0073] In the embodiment of the present invention, the target client may receive the target server address information of the first target service sent by the target server, where the target server address information includes the target server IP address and the target server port number.

[0074] Among them, the target client can multicast the service discovery (SD) message of SOME / IP, and the target server that can provide the first target service can respond to the message after receiving the SOME / IP-SD message, and send its own IP address and port number to the target client. Alternatively, the target server that can provide the first target service can also actively send its own IP address and port number to multiple clients by multicasting when the first target is updated or in other situations, and the target client can learn the IP address and port number of the target server after receiving the multicast message.

[0075] In the embodiment of the present invention, after obtaining the IP address and port number of the target server, the target client can send a connection establishment request SOME / IP message to the target server. In the connection establishment request SOME / IP message, the protocol type is set to the IP type, the source IP address is set to the target client IP address, the source port number is set to the target client port number, the destination IP address is set to the target server IP address, and the target port number is set to the target server port number.

[0076] After receiving the connection establishment request, if the target server determines that the target server has already established a connection with the IP address and port number of the target client using the IP address and port number, in the related technology, a new IP address and port number will be reassigned to the target server, and the new IP address and port number will be used to establish a connection with the target client. This will result in each service requiring an IP address and port number, and when there are many services, the IP address and port number resources will be insufficient.

[0077] In view of this, in an embodiment of the present invention, if it is determined that the target server has established a connection with the IP address and port number of the target client using the IP address and port number, the target server will feedback a connection establishment message to the target client. After receiving the connection establishment feedback message, the target client can query the configuration information storage object to obtain the target socket SOCKET ID corresponding to the connection establishment request SOME / IP message. Then, the target client and the target server directly communicate using the communication link corresponding to the target socket SOCKET identifier to transmit the information of the first target service.

[0078] That is, the target client can query in the configuration information storage object, use the target server IP address and port number and the target client IP address and port number to establish a communication link, and obtain the SOCKET ID of the communication link as the target socket SOCKET ID. Subsequently, the target client and the target server do not need to establish an additional communication link, and directly use the communication link corresponding to the target socket SOCKET ID to transmit the information of the first target service, thereby realizing the reuse of a communication link between the server and the client in different services, and improving resource utilization.

[0079] According to the technical solution provided by the embodiment of the present invention, when a communication link is established between a server providing a first target service and a client using the first target service based on the SOME / IP protocol, the client first sends a connection establishment request to the server using the acquired server IP address and server port number. If the server feeds back that the connection has been established, the SOCKET ID of the established connection is obtained by querying from the configuration information storage object, and then the communication link corresponding to the queried SOCKET ID is used as a path for transmitting the first target service between the client and the server, thereby being able to reuse the communication connection between the same server IP address and server port number and the same client IP address and client port number to transmit information of multiple services, that is, being able to realize communication between multiple services through the same address and port number, saving communication overhead, improving resource utilization, and enhancing user experience.

[0080] In the embodiment of the present invention, the configuration information storage object may be an independent storage object or a configuration information field in the SOME / IP message data field. The independent storage object may be located locally on the client or on a server or cloud. Further, the configuration information includes at least a SOCKET ID, a protocol type, a source IP address, a source port number, a destination IP address, and a destination port number.

[0081] Figure 6 FIG. 1 is a schematic diagram of the SOME / IP message format provided by an embodiment of the present invention. Figure 6 As shown, the SOME / IP message includes an Ethernet header EthHead, an IP header IPHead, a TCP / UDP header TCP / UDP Head, a SOME / IP data field and a check bit FCS. The SOME / IP data field includes a SOME / IP header and SOME / IP data. In an example, the SOME / IP data field may be 1460 bytes, of which the SOME / IP header occupies 16 bytes and the SOME / IP data occupies 1384 bytes.

[0082] Furthermore, the SOME / IP header may include a server ID, data length, client ID, version number, interface version, message type, and response code. The server ID may be 4 bytes, and different values ​​correspond to different services. In one example, when the server ID value is 1, it corresponds to the OTA upgrade identity confirmation service, 2 corresponds to the OTA encryption algorithm confirmation service, 3 corresponds to the OTA download confirmation service, 4 corresponds to the OTA upgrade confirmation service, 5 corresponds to the OTA data packet transmission confirmation service, 6 corresponds to the OTA transmission completion confirmation service, 7 corresponds to the OTA upgrade completion confirmation service, 8 corresponds to the cloud channel configuration confirmation service, 9 corresponds to the cloud aggregation configuration confirmation service, 10 corresponds to the vehicle-side channel configuration confirmation service, 11 corresponds to the vehicle-side aggregation configuration confirmation service, 12 corresponds to the wireless channel priority confirmation service, etc. It should be noted that the server ID number can also be identified in other ways, such as A001, B020, etc., which are not limited here.

[0083] The data length can be 4 bytes. The client ID can be 4 bytes, and different values ​​thereof correspond to different services. In one example, the services represented by different values ​​of the client ID can be the same as the services represented by the corresponding values ​​of the server ID. The version number, interface version, message type, and response code can be 1 byte each. When the message type value is 0, it can indicate that a response is required, and when the value is 1, it can indicate that no response is required.

[0084] SOME / IP data may include configuration information and message data, wherein the configuration information may be 18 bytes and the message data may include 1366 bytes. Further, the configuration information may include SOCKET ID, the number of same connections, protocol type, source IP address, destination IP address, source port number and destination port number. Among them, SOCKET ID may occupy 4 bytes, and the number of same connections indicates the number of services that use the communication link corresponding to the SOCKET ID to transmit information, which may occupy 1 byte. It should be noted that when using an independently stored configuration information storage object to store configuration information, the same number of connections field in the SOME / IP message may be empty or filled in according to actual conditions. The protocol type may also occupy 1 byte. In an example, a protocol type of 0 may represent a UDP protocol and a protocol type of 1 may represent a TCP protocol. The source IP address and the destination IP address each occupy 4 bytes, and the source port number and the destination port number each occupy 2 bytes.

[0085] Figure 7 The present invention provides a method for obtaining a target socket SOCKET ID corresponding to a connection request SOME / IP message by querying a configuration information storage object provided by a target client. Figure 7 As shown, the method comprises the following steps:

[0086] In step S701, in response to determining that the configuration information storage object is an independent storage object, the protocol type, source IP address, source port number, destination IP address and destination port number in the connection establishment request SOME / IP message are obtained.

[0087] In step S702, the configuration information including the protocol type, source IP address, source port number, destination IP address and destination port number in the configuration information storage object is determined as target configuration information.

[0088] In step S703, the SOCKET ID in the target configuration information is determined to be the target socket SOCKET ID.

[0089] In an embodiment of the present invention, if the configuration information storage object is an independent storage object, when the target client obtains the target socket SOCKET ID corresponding to the connection establishment request SOME / IP message from the configuration information storage object, the protocol type, source IP address, source port number, destination IP address and destination port number in the connection establishment request SOME / IP message can be obtained. Then, the configuration information storage object is queried, and if there is configuration information including the protocol type, source IP address, source port number, destination IP address and destination port number as the target configuration information, the SOCKET ID in the target configuration information is determined to be the target socket SOCKET ID.

[0090] That is, the configuration information can be stored in an independent configuration information storage object, and the format of each configuration information is the same as Figure 6 The data format of the configuration information field in the SOME / IP message shown is basically the same, wherein the source IP address and source port number can be represented by the first end IP address and the first end port number, and the destination IP address and destination port number can be represented by the second end IP address and the second end port number.

[0091] Use the protocol type, source IP address, source port number, destination IP address and destination port number in the connection establishment request SOME / IP message to query in an independent configuration information storage object. If configuration information exists, the protocol type therein is the same as the protocol type in the connection establishment request SOME / IP message, the first end IP address and the first end port number are the same as the source IP address and the source port number in the connection establishment request SOME / IP message, and the second end IP address and the second end port number are the same as the destination IP address and the destination port number in the connection establishment request SOME / IP message, then it can be determined that the configuration information is the target configuration information.

[0092] It should be noted that the independent configuration information storage object can be implemented in any desired manner and saved to any space accessible to the client, and there is no restriction here.

[0093] Figure 8 1 is a flow chart of another method provided by an embodiment of the present invention for obtaining a target socket SOCKET ID corresponding to a connection request SOME / IP message by querying a configuration information storage object from a target client. Figure 8 As shown, the method comprises the following steps:

[0094] In step S801, in response to determining that the configuration information is a configuration information field in a SOME / IP message data field, a target message is obtained by querying historical SOME / IP messages of a target client.

[0095] The historical SOME / IP message is a historical SOME / IP message sent or received by the target client, and the configuration information in the target message matches the configuration information in the connection establishment request SOME / IP message.

[0096] Further, the protocol type, source IP address, source port number, destination IP address and destination port number in the target message match the protocol type, source IP address, source port number, destination IP address and destination port number in the connection establishment request SOME / IP message.

[0097] In step S802, it is determined that the SOCKET ID in the information configuration field of the target message is the target socket SOCKET ID.

[0098] In the embodiment of the present invention, if the configuration information storage object is the configuration information field in the data domain of the SOME / IP message, when the target client obtains the target socket SOCKET ID corresponding to the connection establishment request SOME / IP message from the configuration information storage object, the SOME / IP message used as the information storage object should be the SOME / IP message sent by the target client and the target server in the communication link corresponding to the target socket SOCKET ID that has been established and the connection state is still maintained. Therefore, the SOME / IP message in which the time difference between the message sending time and the current time in the message sent by the target client is less than the preset time threshold, and the SOME / IP message in which the time difference between the message receiving time and the current time in the message received by the target client is less than the preset time threshold can be used as the historical SOME / IP message of the target client, and the SOME / IP message matching the configuration information in the configuration information in the above-mentioned connection establishment request SOME / IP message can be used as the target message.

[0099] The configuration information in the target message matches the configuration information in the connection request SOME / IP message, which may be that the protocol type, source IP address, source port number, destination IP address and destination port number in the configuration information of the target message are exactly the same as the protocol type, source IP address, source port number, destination IP address and destination port number in the configuration information of the connection request SOME / IP message. Alternatively, the protocol type in the configuration information of the target message is the same as the protocol type in the configuration information of the connection request SOME / IP message, the source IP address and source port number in the configuration information of the target message are the same as the destination IP address and destination port number in the configuration information of the connection request SOME / IP message, and the destination IP address and destination port number in the configuration information of the target message are the same as the source IP address and source port number in the configuration information of the connection request SOME / IP message.

[0100] That is to say, in response to determining that the target message is a message sent by the target client, the configuration information in the target message matches the configuration information in the connection establishment request SOME / IP message, and the protocol type in the target message is the same as the protocol type in the connection establishment request SOME / IP message; the source IP address and source port number in the target message are respectively the same as the source IP address and source port number in the connection establishment request SOME / IP message, and the destination IP address and destination port number in the target message are respectively the same as the destination IP address and destination port number in the connection establishment request SOME / IP message.

[0101] In response to determining that the target message is a message received by the target client, the configuration information in the target message matches the configuration information in the connection establishment request SOME / IP message, and the protocol type in the target message is the same as the protocol type in the connection establishment request SOME / IP message; the source IP address and source port number in the target message are respectively the same as the destination IP address and destination port number in the connection establishment request SOME / IP message, and the destination IP address and destination port number in the target message are respectively the same as the source IP address and source port number in the connection establishment request SOME / IP message.

[0102] In the embodiment of the present invention, the SOCKET ID in the information configuration field of the target message is finally set as the target socket SOCKET ID, thereby completing the query of the target socket SOCKET ID.

[0103] Fig. 9 FIG. 1 is a flow chart of another communication method provided by an embodiment of the present invention. Fig. 9 Steps S901 to S904 in the embodiment shown are Figure 5 Steps S501 to S504 in the illustrated embodiment are substantially the same and will not be described in detail herein. Fig. 9 As shown, the method comprises the following steps:

[0104] In step S905, the target socket SOCKET ID is written into the configuration information of the SOME / IP message of the first target service.

[0105] The SOME / IP message of the first target service is a message used when the first target service information is transmitted between the target client and the target server.

[0106] In step S906, in the independent storage object, the number of the same connection in the configuration information where the target socket SOCKET ID is located is incremented by one.

[0107] In step S907, the first current number of identical connections is obtained from the configuration information field in the SOME / IP message data field as the information storage object.

[0108] In step S908, in the configuration information of the SOME / IP message of the first target service, the number of identical connections is set to the first current number of identical connections plus 1.

[0109] In an embodiment of the present invention, in response to the target client determining to use the communication link corresponding to the target socket SOCKET ID to communicate with the target server to transmit the information of the first target service, the target socket SOCKET ID can be written as the SOCKET ID in the configuration information field into all SOME / IP messages in which the target client and the target server transmit the information of the first target service. In some implementations, the same number of connections in these SOME / IP messages can also be modified by adding 1 to them. The SOME / IP message of the first target service is the message used when the first target service information is transmitted between the target client and the target server.

[0110] Further, if the configuration information storage object is an independent storage object, the same connection number in the configuration information where the target socket SOCKET ID is located can be incremented by 1. On the other hand, if the configuration information storage object is a configuration information field in the SOME / IP message data field, the first current same connection number can be first obtained from the configuration information field in the SOME / IP message data field as the information storage object, and then the same connection number can be set to the first current same connection number plus 1 in the configuration information of the SOME / IP message of the first target service.

[0111] Fig.10 FIG. 1 is a flow chart of another communication method provided by an embodiment of the present invention. Fig.10 Steps S1001 to S1004 in the embodiment shown are Figure 5 Steps S501 to S504 in the illustrated embodiment are substantially the same and will not be described in detail herein. Fig.10 As shown, the method comprises the following steps:

[0112] In step S1005, in response to the target client receiving a feedback message that the connection is successfully established, the SOCKET ID generated by the current connection establishment is written into the configuration information field in the SOME / IP message of the first target service, and the number of the same connection in the configuration information field of the SOME / IP message of the first target service is set to 1.

[0113] The SOME / IP message of the first target service is a message used when the first target service information is transmitted between the target client and the target server.

[0114] In step S1006, in response to the target client receiving feedback information that the connection is successfully established, a new configuration information is created in an independent configuration information storage object, in which the SOCKET ID generated by the connection establishment, the protocol type of the connection, the source IP address, the source port number, the destination IP address and the destination port number are written, and the number of the same connection in the newly created configuration information is set to 1.

[0115] In an embodiment of the present invention, if the target client successfully establishes a connection with the target server using the received target server IP address and port number, it indicates that this connection is the first connection, so the SOCKET ID of this connection can be written into the configuration information, and the number of the same connection can be set to 1 in the configuration information.

[0116] That is to say, in the case where the configuration information field of the SOME / IP message is used as a storage object, after the target client receives the feedback message of successful connection establishment, the SOCKET ID generated by this connection establishment can be written into the configuration information field in the SOME / IP message of the first target service, and the number of the same connection in the configuration information field of the SOME / IP message of the first target service can be set to 1. The SOME / IP message of the first target service is the message used for transmitting the first target service information between the target client and the target server.

[0117] For independent storage objects, after the target client receives the feedback message of successful connection establishment, it can create a new configuration information in the independent configuration information storage object, write the SOCKET ID generated by this connection establishment, the protocol type of this connection, the source IP address, source port number, destination IP address and destination port number, and set the number of the same connection in the newly created configuration information to 1.

[0118] Fig.11FIG. 1 is a flow chart of another communication method provided by an embodiment of the present invention. Fig.11 Steps S1101 to S1104 in the embodiment shown are Figure 5 Steps S501 to S504 in the illustrated embodiment are substantially the same and will not be described in detail herein. Fig.11 As shown, the method also includes the following steps:

[0119] In step S1105, it is determined that the second target service is terminated.

[0120] In step S1106, in the independent storage object, the number of the same connection in the configuration information where the target socket SOCKET ID is located is subtracted by 1.

[0121] In step S1107, the second current number of identical connections is obtained from the configuration information field in the SOME / IP message data field which is the configuration information storage object.

[0122] In step S1108, in the configuration information of the SOME / IP message of the third target service, the number of identical connections is set to the second current number of identical connections minus 1.

[0123] Wherein, the information of the second target service and the third target service are transmitted by the target client and the target server using the communication link corresponding to the target socket SOCKET ID. Further, the second target service can be the same as or different from the first target service. The third target service can be the same as or different from the first target service. The second target service is different from the third target service.

[0124] In the embodiment of the present invention, when it is determined that the second target service terminates the service, that is, it is determined that among the services that use the communication link corresponding to the target socket SOCKETID to transmit information, a certain service is completed and needs to exit the service, at this time, the number of the same connection can be reduced by 1 in the configuration information storage object. If the number of the same connection after reduction by 1 is greater than 0, it indicates that there are other services using the communication link to transmit information at this time, so the connection resources of the communication link cannot be released.

[0125] That is, for an independent storage object, when it is determined that the second target service is terminated, a subtraction operation of 1 may be performed on the same number of connections in the configuration information where the target socket SOCKET ID is located in the independent storage object.

[0126] In the case where the configuration information field in the data field of the SOME / IP message is used as a configuration information storage object, the current number of identical connections can be obtained from the configuration information field in the data field of the SOME / IP message used as the configuration information storage object, and then in the configuration information of the SOME / IP message of the third target service, the number of identical connections is set to the second current number of identical connections minus 1. The SOME / IP message of the third target service is a service that still uses the communication link corresponding to the target socket SOCKET ID to transmit information after the second target service terminates the service.

[0127] In the embodiment of the present invention, if it is determined that the number of the same connection in the configuration information corresponding to the target socket SOCKET ID in the storage object is 0, all connection resources of the communication link corresponding to the target socket SOCKET ID may be released.

[0128] Fig.12 Schematic diagram of the SOME / IP message data structure provided by an embodiment of the present invention. Fig.12 As shown, the numbers 0-31 represent the offset bytes. The service identifier is SERVICE ID, which is usually 16 bits and is used to identify a service. The method identifier is Method ID, which is usually 16 bits and is used to identify a method. The event identifier is Event ID, which is used to identify an event. The message length is Length, which is usually 32 bits and indicates the total length from the request Request ID to the end of the message. The client identifier is Client ID, which is usually 16 bits and is used to distinguish different clients. The session identifier is Session ID, which is used to distinguish multiple calls from the same client. The protocol version is Protocol Version, which is usually fixed to 0x01. The service interface version is Interface Version. The message type is Message Type. Currently, five types are available, namely REQUEST[0x00] (request expecting a response), REQUEST_NO_RETURN[0x01] (request not expecting a response), NOTIFICATION[0x02] (event notification), RESPONSE[0x80] (response message) and ERROR[0x81] (error message). The return code is Return Code. The data segment is Payload, which is the relevant data to be transmitted. The size of the SOME / IP payload field depends on the transport protocol used. The UDP SOME / IP payload should be between 0 and 1400 bytes. The limit of 1400 bytes is to allow future changes to the protocol stack (such as changing to IPv6 or adding security measures). Since TCP supports effective complex segmentation, it automatically supports larger payloads.

[0129] Fig.13 Schematic diagram of the SOME / IP-SD message data structure provided by an embodiment of the present invention. Fig.13 As shown, the upper part of the message data structure is Fig.12 The data structures of the SOME / IP packets shown are basically the same. The difference is that in the Payload part, the SOME / IP-SD packet includes a flag bit Flag, a reserved bit Reserved, an input group length Length of Entries Array, an input group Entries Array, an optional group length Length of Option Array, and an optional group Option Array.

[0130] Fig.14 FIG. 1 is a schematic diagram of a SOME / IP-SD message data structure of a discovery service provided by an embodiment of the present invention. Fig.14 As shown, the message ID is a combination of the Server ID and the Method ID or Event ID, for example, 0xFFFF 8100, the message length is 32 bytes, Protocol Version = 1, Interface Version = 1, Message Type = 2, and Return Code = 00. Further, Length of Entries Array = 0x10, EntriesArray includes Type Type, the first optional index index 1 st options, second optional index index 2 nd options, first option # of opt1, second option # of opt2, server ID, instance ID, major version, maximum transmission time TTL and minor version.

[0131] Type=0x00, indicating the discovery service type, index 1 st options=0, index 2 nd options=0, #of opt1=0 (none), #of opt2=0 (none) indicates that there are no options currently. Server ID=0xA001 or 0xA002 or ..., indicating that the message is a multicast message. Instance ID=0xFFFF (all). Major Version=0xff (all), TTL=3 seconds (or other), Minor Version=0xFFFFFFFF (any). Fig.14 The meanings of the parameters in the remaining fields are the same as Fig.12 The messages shown are the same.

[0132] Fig.15 FIG. 1 is a schematic diagram of a SOME / IP-SD message data structure providing a service provided by an embodiment of the present invention. Fig.15 As shown, the message Message ID is a combination of the Server ID and the Method ID or Event ID, for example, 0xFFFF 8100, the message length is 32 bytes, Protocol Version=1, Interface Version=1, Message Type=2, and Return Code=00.

[0133] Furthermore, Length of Entries Array = 0x10, Entries Array includes type Type, first optional index index 1 st options, second optional index index 2 nd options, first option # of opt1, second option # of opt2, server ID, instance ID, major version Major Version, maximum transmission time TTL and minor version Minor Version.

[0134] Type = 0x01, indicating the service type, index 1 st options=0, index 2 nd options = 0, #of opt1 = 1, #of opt2 = 0 (none) indicates that there are currently options. Server ID = 0xA001 or 0xA002 or ..., indicating that the message is a multicast message. Instance ID = 1. Major Version = 0x01, TTL = 3 seconds, MinorVersion = 0x00000010.

[0135] Furthermore, Length of Option Array = 12, and Option Array also includes optional group length Length, optional group type Type, reserved bit Reserved, IPv4 address IPv4 Address, L4 protocol L4-Protocol and port number Port Number.

[0136] Among them, Length=0x0009, Type=0x04, which means IPv4 endpoint, IPv4 Address=192.168.62.108, Reserved=0x00, L4-Protocol=0x11, indicating UDP protocol, Port Number=30490. Fig.15 The meanings of the parameters in the remaining fields are the same as Fig.12 The messages shown are the same.

[0137] Fig.16 1 is an interactive diagram of a communication method for a client to search for a version discovery service from a server provided by an embodiment of the present invention. Fig.16 As shown, the client CDC searches for the version service from the server OTA cloud, that is, CDC sends a SOME / IP-SD message to the OTA cloud in multicast mode through UDP port 30490. The OTA cloud replies with the provided version service information and provides the server's IP address OPT: 192.168.62.108 and port number PORT TCP: 31551 to CDC to establish a UDP / TCP connection. After CDC receives the service information, if there is a new version, it establishes a TCP connection with the OTA cloud's IP address 192.168.62.108 and port number 31551 through IP address 192.168.62.101 and port number 30501 to perform SOME / IP communication, and saves the established SOCKET ID, source IP address, destination IP address, source port, destination port, and protocol type in the corresponding configuration information in the configuration information storage object. At the same time, because the TCP connection has just been established, the same number of connections = 1 also needs to be saved in the corresponding configuration information in the configuration information storage object.

[0138] Fig.17 1 is an interactive diagram of a communication method for a client to search and discover an upgrade service from a server provided by an embodiment of the present invention. Fig.17As shown, the client CDC searches for the upgrade service on the server OTA cloud, that is, CDC sends a SOME / IP-SD message to the OTA cloud in multicast mode through UDP port 30490. The OTA cloud replies with the provided version service information, and provides the OTA cloud's IP address OPT: 192.168.62.108 and port number PORT TCP: 31551 to CDC to establish a UDP / TCP connection for communication. After receiving the service information, if the CDC can upgrade, it establishes a TCP connection with the OTA cloud's IP address 192.168.62.108 and port number 31551 through IP address 192.168.62.101 and port number 30501 to perform SOME / IP communication. If a communication connection is found to have been established when establishing a connection, the established SOCKET ID will be copied to the current service for communication, and the established SOCKET ID, source IP address, destination IP address, source port, destination port, protocol type information, and "number of same connections plus 1" will be saved in the corresponding configuration information in the configuration information storage object. At this time, multiple services can use the same channel for communication, realizing multi-service communication.

[0139] exist Fig.16 and Fig.17 In the embodiment shown, when the software version service is completed and needs to exit the service, the TCP connection needs to be released. At this time, if the query obtains the "number of same connections" = 2 of the corresponding configuration information in the configuration information storage object, it means that there are currently two connections using the same "SOCKET ID, source IP address, destination IP address, source port, destination port, protocol type information", so the connection cannot be "closed" yet, just set "number of same connections" -1 = 1, and set the SOCKET ID to -1. When all services are released, the connection is closed after "number of same connections" -1 = 0, and all connection resources are released.

[0140] By adopting the technical solution of the embodiment of the present invention, the established communication connection ID, address information, and port number information are saved, and the number of pieces of information is recorded. If a new connection needs to use the same address, port number, and protocol type, the SOCKET ID is assigned to the new connection, and the number of the same connection is increased by one. This allows multiple services to use the same address and port number, greatly saving system resources and load rate.

[0141] The technical solution of the embodiment of the present invention supports a method for multiple services to communicate through the same address and port; supports a method for copying the connection ID to the service communication when adding a service using the same address and port; supports a method for releasing the connection when the service exits using the same address and port only when all services do not use the connection ID; and supports a method for customizing data formats.

[0142] The technical solution of the embodiment of the present invention is adopted, based on service-oriented design, to achieve layered design and software and hardware decoupling, making it easier to iterate and update software functions. Multiple services communicate through the same address and port, and only one communication channel is needed, which saves the cost of establishing multiple channels and improves the reuse rate of communication channels.

[0143] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present invention, which will not be described in detail here.

[0144] The following are embodiments of the device of the present invention, which can be used to implement the method embodiments of the present invention. For details not disclosed in the device embodiments of the present invention, please refer to the method embodiments of the present invention.

[0145] Fig.18 Schematic diagram of a communication device provided by an embodiment of the present invention. Fig.18 As shown, the device comprises:

[0146] The receiving module 1801 is configured to receive, by the target client, the target server address information of the first target service sent by the target server, wherein the target server address information includes the target server international interconnection protocol IP address and the target server port number.

[0147] The sending module 1802 is configured to send a connection establishment request SOME / IP message from the target client to the target server. The message type of the connection establishment request SOME / IP message is IP type, the source IP address is the target client IP address, the source port number is the target client port number, the destination IP address is the target server IP address, and the target port number is the target server port number.

[0148] The query module 1803 is configured to query the target client from the configuration information storage object to obtain the target socket SOCKET identifier corresponding to the connection establishment request SOME / IP message in response to receiving the connection establishment feedback message.

[0149] The transmission module 1804 is configured so that the target client communicates with the target server using the communication link corresponding to the target socket identifier SOCKET to transmit the information of the first target service.

[0150] According to the technical solution provided by the embodiment of the present invention, when a communication link is established between a server providing a first target service and a client using the first target service based on the SOME / IP protocol, the client first sends a connection establishment request to the server using the acquired server IP address and server port number. If the server replies that the connection has been established, the SOCKET identifier of the established connection is obtained by querying from the configuration information storage object, and then the communication link corresponding to the queried SOCKET identifier is used as a path for transmitting the first target service between the client and the server, so that the communication connection between the same server IP address and server port number and the same client IP address and client port number can be reused to transmit information of multiple services, that is, multiple services can communicate through the same address and port number, saving communication overhead, improving resource utilization, and enhancing user experience.

[0151] In an embodiment of the present invention, the configuration information storage object is an independent storage object, or a configuration information field in the SOME / IP message data field; the configuration information at least includes a SOCKET identifier, a protocol type, a source IP address, a source port number, a destination IP address and a destination port number.

[0152] In an embodiment of the present invention, in response to determining that the configuration information storage object is an independent storage object, the target client queries the configuration information storage object to obtain the target socket SOCKET identifier corresponding to the connection establishment request SOME / IP message, including: obtaining the protocol type, source IP address, source port number, destination IP address and destination port number in the connection establishment request SOME / IP message; determining that the configuration information including the protocol type, source IP address, source port number, destination IP address and destination port number in the configuration information storage object is the target configuration information; and determining that the SOCKET identifier in the target configuration information is the target socket SOCKET identifier.

[0153] In an embodiment of the present invention, in response to determining that the configuration information is a configuration information field in a SOME / IP message data field, the target client obtains a target socket SOCKET identifier corresponding to a connection establishment request SOME / IP message from a configuration information storage object, including: obtaining a target message from a historical SOME / IP message of the target client, the historical SOME / IP message is a historical SOME / IP message sent or received by the target client, and the configuration information in the target message matches the configuration information in the connection establishment request SOME / IP message; the protocol type, source IP address, source port number, destination IP address and destination port number in the target message match the protocol type, source IP address, source port number, destination IP address and destination port number in the connection establishment request SOME / IP message; and determining that the SOCKET identifier in the information configuration field of the target message is the target socket SOCKET identifier.

[0154] In the embodiment of the present invention, in response to determining that the target message is a message sent by the target client, the configuration information in the target message matches the configuration information in the connection establishment request SOME / IP message, including: the protocol type in the target message is the same as the protocol type in the connection establishment request SOME / IP message; the source IP address and the source port number in the target message are respectively the same as the source IP address and the source port number in the connection establishment request SOME / IP message, and the destination IP address and the destination port number in the target message are respectively the same as the destination IP address and the destination port number in the connection establishment request SOME / IP message. In response to determining that the target message is a message received by the target client, the configuration information in the target message matches the configuration information in the connection establishment request SOME / IP message, including: the protocol type in the target message is the same as the protocol type in the connection establishment request SOME / IP message; the source IP address and the source port number in the target message are respectively the same as the destination IP address and the destination port number in the connection establishment request SOME / IP message, and the destination IP address and the destination port number in the target message are respectively the same as the source IP address and the source port number in the connection establishment request SOME / IP message.

[0155] In an embodiment of the present invention, the configuration information also includes the number of identical connections; and further includes: after the target client obtains the target socket SOCKET identifier by querying the self-configuration information storage object, writing the target socket SOCKET identifier into the configuration information of the SOME / IP message of the first target service, the SOME / IP message of the first target service is the message used when the first target service information is transmitted between the target client and the target server; in an independent storage object, performing a plus 1 operation on the number of identical connections in the configuration information where the target socket SOCKET is located; or obtaining the first current number of identical connections from the configuration information field in the SOME / IP message data domain as the information storage object; in the configuration information of the SOME / IP message of the first target service, setting the number of identical connections to the first current number of identical connections plus 1.

[0156] In an embodiment of the present invention, the configuration information also includes the number of identical connections; and further includes: in response to the target client receiving a feedback message of successful connection establishment, writing the SOCKET identifier generated by the current connection establishment into a configuration information field in a SOME / IP message of the first target service, and setting the number of identical connections in the configuration information field of the SOME / IP message of the first target service to 1, wherein the SOME / IP message of the first target service is a message used when the first target service information is transmitted between the target client and the target server; or in response to the target client receiving a feedback message of successful connection establishment, creating a new configuration information in an independent configuration information storage object, writing therein the SOCKET identifier generated by the current connection establishment, the protocol type of the current connection, the source IP address, the source port number, the destination IP address and the destination port number, and setting the number of identical connections in the newly created configuration information to 1.

[0157] In an embodiment of the present invention, the configuration information also includes the number of identical connections; and further includes: in response to determining that the second target service is terminated, in an independent storage object, performing a subtraction operation on the number of identical connections in the configuration information where the target socket SOCKET identifier is located; or in response to determining that the second target service is terminated, obtaining the second current number of identical connections from the configuration information field in the SOME / IP message data domain that serves as the configuration information storage object; in the configuration information of the SOME / IP message of the third target service, setting the number of identical connections to the second current number of identical connections minus 1; wherein information of the second target service and the third target service are both transmitted by the target client and the target server using the communication link corresponding to the target socket SOCKET identifier.

[0158] In the embodiment of the present invention, the method further includes: in response to determining that the number of the same connection in the configuration information corresponding to the target socket SOCKET identifier in the storage object is 0, releasing all connection resources of the communication link corresponding to the target socket SOCKET identifier.

[0159] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0160] Fig.19 Schematic diagram of an electronic device provided by an embodiment of the present invention. Fig.19As shown, the electronic device 19 of this embodiment includes: a processor 1901, a memory 1902, and a computer program 1903 stored in the memory 1902 and executable on the processor 1901. When the processor 1901 executes the computer program 1903, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 1901 executes the computer program 1903, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0161] The electronic device 19 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 19 may include, but is not limited to, a processor 1901 and a memory 1902. Those skilled in the art will appreciate that Fig.19 The electronic device 19 is merely an example and does not limit the electronic device 19 , and may include more or less components than those shown in the figure, or different components.

[0162] Processor 1901 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0163] The memory 1902 may be an internal storage unit of the electronic device 19, for example, a hard disk or memory of the electronic device 19. The memory 1902 may also be an external storage device of the electronic device 19, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (FlashCard), etc. equipped on the electronic device 19. The memory 1902 may also include both an internal storage unit of the electronic device 19 and an external storage device. The memory 1902 is used to store computer programs and other programs and data required by the electronic device.

[0164] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0165] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.

Claims

1. A communication method, It is characterized in that The method is used to establish a communication connection between a server and a client and provide communication services based on the scalable service-oriented middleware SOME / IP protocol of the international interconnection protocol; The method comprises: The target client receives the target server address information of the first target service sent by the target server, wherein the target server address information includes the target server international interconnection protocol IP address and the target server port number; The target client sends a connection establishment request SOME / IP message to the target server, where the message type of the connection establishment request SOME / IP message is IP type, the source IP address is the IP address of the target client, the source port number is the port number of the target client, the destination IP address is the IP address of the target server, and the target port number is the port number of the target server; In response to receiving the connection established feedback message, the target client obtains the target socket SOCKET identifier corresponding to the connection establishment request SOME / IP message from the configuration information storage object; The target client communicates with the target server using the communication link corresponding to the target socket identifier SOCKET to transmit information about the first target service; The configuration information in the configuration information storage object at least includes a SOCKET identifier, a protocol type, a source IP address, a source port number, a destination IP address and a destination port number.

2. The method according to claim 1, It is characterized in that The configuration information storage object is an independent storage object, or a configuration information field in a SOME / IP message data field.

3. The method according to claim 2, It is characterized in that In response to determining that the configuration information storage object is an independent storage object, the target client obtains a target socket SOCKET identifier corresponding to the connection establishment request SOME / IP message from the configuration information storage object, including: Obtain the protocol type, source IP address, source port number, destination IP address and destination port number in the connection establishment request SOME / IP message; Determine the configuration information including the protocol type, source IP address, source port number, destination IP address and destination port number in the configuration information storage object as target configuration information; Determine the SOCKET identifier in the target configuration information as the target socket SOCKET identifier.

4. The method according to claim 2, It is characterized in that In response to determining that the configuration information is a configuration information field in the data field of the SOME / IP message, the target client queries the configuration information storage object to obtain a target socket SOCKET identifier corresponding to the connection establishment request SOME / IP message, including: Obtaining a target message from a historical SOME / IP message of the target client, wherein the historical SOME / IP message is a historical SOME / IP message sent or received by the target client, and the configuration information in the target message matches the configuration information in the connection establishment request SOME / IP message; The protocol type, source IP address, source port number, destination IP address and destination port number in the target message match the protocol type, source IP address, source port number, destination IP address and destination port number in the connection establishment request SOME / IP message; Determine the SOCKET identifier in the information configuration field of the target message as the target socket SOCKET identifier.

5. The method according to claim 4, It is characterized in that In response to determining that the target message is a message sent by the target client, the configuration information in the target message matches the configuration information in the connection establishment request SOME / IP message, including: The protocol type in the target message is the same as the protocol type in the connection establishment request SOME / IP message; The source IP address and source port number in the target message are respectively the same as the source IP address and source port number in the connection establishment request SOME / IP message, and the destination IP address and destination port number in the target message are respectively the same as the destination IP address and destination port number in the connection establishment request SOME / IP message; In response to determining that the target message is a message received by the target client, the configuration information in the target message matches the configuration information in the connection establishment request SOME / IP message, including: The protocol type in the target message is the same as the protocol type in the connection establishment request SOME / IP message; The source IP address and source port number in the target message are respectively the same as the destination IP address and destination port number in the connection request SOME / IP message, and the destination IP address and destination port number in the target message are respectively the same as the source IP address and source port number in the connection request SOME / IP message.

6. The method according to claim 2, It is characterized in that The configuration information also includes the same number of connections; The method further comprises: After the target client obtains the target socket SOCKET identifier by querying the self-configuration information storage object, the target socket SOCKET identifier is written into the configuration information of the SOME / IP message of the first target service, where the SOME / IP message of the first target service is a message used when the first target service information is transmitted between the target client and the target server; In the independent storage object, the same number of connections in the configuration information of the target socket SOCKET is incremented by 1; or Obtaining the first current same connection number from the configuration information field in the SOME / IP message data field as the information storage object; In the configuration information of the SOME / IP message of the first target service, the number of the same connection is set to the first current number of the same connection plus 1.

7. The method according to claim 2, It is characterized in that The configuration information also includes the same number of connections; The method further comprises: In response to the target client receiving a successful connection establishment feedback message, writing the SOCKET identifier generated by the current connection establishment into a configuration information field in a SOME / IP message of the first target service, and setting the number of identical connections in the configuration information field of the SOME / IP message of the first target service to 1, the SOME / IP message of the first target service being a message used when transmitting the first target service information between the target client and the target server; or In response to the target client receiving feedback information that the connection is successfully established, a new configuration information is created in the independent configuration information storage object, in which the SOCKET identifier generated by the connection establishment, the protocol type of the connection, the source IP address, the source port number, the destination IP address and the destination port number are written, and the number of the same connection in the newly created configuration information is set to 1.

8. The method according to claim 2, It is characterized in that The configuration information also includes the same number of connections; The method further comprises: In response to determining that the second target service is terminated, in the independent storage object, a same connection number in the configuration information where the target socket SOCKET identifier is located is subtracted by 1; or In response to determining that the second target service is terminated, obtaining a second current number of identical connections from a configuration information field in a SOME / IP message data field as a configuration information storage object; In the configuration information of the SOME / IP message of the third target service, the number of the same connection is set to the second current number of the same connection minus 1; The information of the second target service and the third target service are both transmitted by the target client and the target server using the communication link corresponding to the target socket identifier SOCKET.

9. The method according to claim 8, It is characterized in that The method further comprises: In response to determining that the number of the same connection in the configuration information corresponding to the target socket SOCKET identifier in the storage object is 0, all connection resources of the communication link corresponding to the target socket SOCKET identifier are released.

10. A communication device, It is characterized in that include: A receiving module is configured to receive, by a target client, target server address information of a first target service sent by a target server, wherein the target server address information includes an international interconnection protocol IP address of the target server and a port number of the target server; a sending module configured to send a connection establishment request SOME / IP message from a target client to the target server, wherein the message type of the connection establishment request SOME / IP message is an IP type, the source IP address is the IP address of the target client, the source port number is the port number of the target client, the destination IP address is the IP address of the target server, and the target port number is the port number of the target server; A query module is configured to, in response to receiving a connection established feedback message, query the target client from the configuration information storage object to obtain a target socket SOCKET identifier corresponding to the connection establishment request SOME / IP message; A transmission module, configured to enable the target client to communicate with the target server using a communication link corresponding to the target socket identifier, and to transmit information of the first target service; The configuration information in the configuration information storage object at least includes a SOCKET identifier, a protocol type, a source IP address, a source port number, a destination IP address and a destination port number.

Citation Information

Patent Citations

  • Communication method and device between vehicle terminal subsystems, electronic equipment and medium

    CN113973126A

  • In-vehicle SOME / IP transmission method and device based on TSN time sensitive network

    CN114785474A

  • SOA service-based vehicle detection method and related equipment

    CN115542875A

  • Equipment interconnection method, related equipment and system

    CN117714554A

  • System architecture for implementing DDS communication based on autosar, communication method, and device

    US20240045657A1