Nothing Special   »   [go: up one dir, main page]

CN114979157A - Load balancing method, system, storage medium and computer based on SOME/IP protocol - Google Patents

Load balancing method, system, storage medium and computer based on SOME/IP protocol Download PDF

Info

Publication number
CN114979157A
CN114979157A CN202210535561.6A CN202210535561A CN114979157A CN 114979157 A CN114979157 A CN 114979157A CN 202210535561 A CN202210535561 A CN 202210535561A CN 114979157 A CN114979157 A CN 114979157A
Authority
CN
China
Prior art keywords
service
service node
load balancing
nodes
list
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210535561.6A
Other languages
Chinese (zh)
Other versions
CN114979157B (en
Inventor
吴名芝
邓添男
朱元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanchang Intelligent New Energy Vehicle Research Institute
Original Assignee
Nanchang Intelligent New Energy Vehicle Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanchang Intelligent New Energy Vehicle Research Institute filed Critical Nanchang Intelligent New Energy Vehicle Research Institute
Priority to CN202210535561.6A priority Critical patent/CN114979157B/en
Publication of CN114979157A publication Critical patent/CN114979157A/en
Application granted granted Critical
Publication of CN114979157B publication Critical patent/CN114979157B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides a load balancing method, a system, a storage medium and a computer based on an SOME/IP protocol, wherein the method comprises the following steps: when a service calling request sent by a client is obtained, a service node list is obtained according to the service calling request; comparing the priority values of the service nodes in the service node list, and judging whether a plurality of service nodes with the same lowest priority value exist in each service node; if yes, taking a plurality of service nodes with the same lowest priority value as a new service node list; and calculating the current weight value of each service node in the new service node list, screening the optimal service node in the new service node list according to the current weight value, and binding the service of the client by using the optimal service node. The invention can uniformly call the service nodes in a certain service cluster, and prevent the single service node from being distributed with too much or too little request flow, thereby causing the fault downtime or performance waste of the service node.

Description

Load balancing method, system, storage medium and computer based on SOME/IP protocol
Technical Field
The invention relates to the technical field of communication, in particular to a load balancing method, a system, a storage medium and a computer based on an SOME/IP protocol.
Background
With the development of intelligent networked automobiles, the software architecture of the intelligent automobiles is changed from the traditional E/E architecture to a service-oriented architecture. Service-Oriented architecture (SOA) effectively solves the problems of difficult software development, high debugging difficulty, low code reuse rate and the like of the traditional E/E architecture. The method abstracts code logic operated on the automobile ECU into service and provides an interface for calling the service outwards, so that other ECUs can conveniently and flexibly use functions on the ECU, loose coupling among service applications is realized, software and hardware isomerism is shielded, platform interoperability is improved, software reuse rate is increased, and the like.
An automotive Adaptive Platform (AP) is a novel automotive electronic system architecture standard proposed by the automotive alliance in 2015, and provides a solution for development of a vehicle-mounted high-performance ECU (electronic control unit). SOME/IP is a standard protocol for service-oriented communications designed specifically for the automotive field. Compared with the traditional bus protocols such as CAN, PROFIBUS and the like, the SOME/IP has more dynamic flexibility and expandability, so that the SOME/IP CAN be used for realizing the functions of vehicle-mounted diagnosis, information entertainment, even safety-related auxiliary driving and the like in the automobile.
At present, a plurality of ECUs are provided on an automobile, a single ECU or a plurality of ECUs are combined to provide a certain service function outwards, and the ECUs are effectively managed based on a service-oriented architecture to form a distributed system of a vehicle-mounted end. Because the number of ECUs is large, the service dependency relationship is complex, a complete service invoking link relates to a plurality of upstream services and downstream services, and if a certain service is unavailable, the ECUs on the link can be influenced to execute tasks. In order to avoid a failure caused by a large number of service invocation requests of a service deployed by a single ECU, the hot spot services generally need to be expanded laterally, that is, the same service is deployed on a plurality of different ECUs, a plurality of service instances of the same service are realized, and then a suitable load balancing algorithm is selected to uniformly distribute the request traffic to the plurality of ECUs for processing.
At the present stage, although the load balancing technology is widely applied to the internet related industries, the load balancing technology is not widely popularized and used in the automobile field, and the reasons are as follows:
1. application layer protocol without adaptation. The load balancing technology depends on an application layer protocol, for example, Nginx uniformly distributes the flow for accessing the Web server based on an HTTP protocol; the Dubbo service framework customizes an application layer protocol on the basis of TCP, and provides other service governance related functions besides realizing load balancing. The automobile field just introduces the Ethernet technology, and the traditional bus protocol is used as an automobile internal communication mode before.
2. Automobiles have higher requirements for safety and real-time. While the SOA architecture is now the mainstream of automotive software architecture, relying on a load balancer for each service call to distribute the call to the appropriate ECU will increase the communication time cost and also extend the risk of service call failure.
3. Automotive software development tools are expensive. Although the AUTOSAR alliance has promulgated AP-to-SOME/IP related design standards, few companies have the ability to fall on the floor to implement the standards. Currently, VECTOR provides Adaptive MICROROSAR development suite, ETAS and BOSCH company jointly provide RTA-VRTE development tool, but because the purchase cost is too high, the number of developers is small, and corresponding free community resources are scarce.
Disclosure of Invention
Based on this, the present invention provides a load balancing method, system, storage medium and computer based on SOME/IP protocol to solve at least the above technical deficiencies.
The invention provides a load balancing method based on an SOME/IP protocol, which comprises the following steps:
when a service calling request sent by a client is acquired, acquiring a corresponding service node list according to the service calling request;
comparing the priority values of the service nodes in the service node list, and judging whether a plurality of service nodes with the same lowest priority value exist in the service nodes;
if a plurality of service nodes with the same lowest priority value exist in each service node, taking the service nodes with the same lowest priority value as a new service node list;
and calculating the current weight value of each service node in the new service node list, screening out the optimal service node in the new service node list according to the current weight value, and binding the service of the client by using the optimal service node.
Further, before the step of acquiring the service invocation request sent by the client, the method further includes:
the method comprises the steps of obtaining SOME/IP service providing messages sent by a plurality of service terminals when the service terminals issue services, and adding load balancing parameters corresponding to the service terminals in each SOME/IP service providing message to construct a corresponding service instance list, wherein the load balancing parameters comprise the priority of service instances and the weight value of the service instances.
Further, before the step of acquiring the service invocation request sent by the client, the method further includes:
the method comprises the steps of obtaining SOME/IP service searching messages sent by a plurality of clients when searching services, setting instance IDs in the SOME/IP service searching messages into a preset format, searching all service instances in a service instance list in a preset range, and forming a corresponding service node list.
Further, the step of screening out the optimal service node in the new service node list according to the current weight value includes:
acquiring an initial weight value of each service node in the new service node list;
and superposing the current weight value and the initial weight value of each service node in the new service node list, and screening the service node with the maximum weight value as the optimal service node.
Further, the formula for calculating the weight value of the optimal service node is as follows:
CurrentWeight i +=OriginalWeight i
BestNode=Max(CurrentWeight i )→Node;
BestNode.CurrentWeight-=Sum(OriginalWeight i );
wherein, CurrentWeight i And OriginalWeight i Respectively representing the current weight and the initial weight of the ith node, and the BestNode represents the optimal service node.
The invention also provides a load balancing system based on the SOME/IP protocol, which comprises:
the first acquisition module is used for acquiring a corresponding service node list according to a service calling request when the service calling request sent by a client is acquired;
the judging module is used for comparing the priority values of all service nodes in the service node list and judging whether a plurality of service nodes with the same lowest priority value exist in all the service nodes;
the processing module is used for taking a plurality of service nodes with the same lowest priority value as a new service node list if the service nodes have the same lowest priority value;
and the calculation module is used for calculating the current weight value of each service node in the new service node list, screening out the optimal service node in the new service node list according to the current weight value, and binding the service of the client by using the optimal service node.
Further, the system further comprises:
the second obtaining module is used for obtaining SOME/IP service providing messages sent by a plurality of service terminals when the service terminals issue services, and adding load balancing parameters corresponding to the service terminals in each SOME/IP service providing message to construct a corresponding service instance list, wherein the load balancing parameters comprise priorities of the service instances and weight values of the service instances.
Further, the system further comprises:
and the third acquisition module is used for acquiring SOME/IP service searching messages sent by a plurality of clients during service searching, setting instance IDs in the SOME/IP service searching messages into a preset format, searching all service instances in the service instance list within a preset range, and forming a corresponding service node list.
Further, the calculation module comprises:
an obtaining unit, configured to obtain an initial weight value of each service node in the new service node list;
and the calculating unit is used for superposing the current weight value and the initial weight value of each service node in the new service node list and screening the service node with the maximum weight value as the optimal service node.
The present invention also provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the SOME/IP protocol-based load balancing method is implemented.
The invention also provides a computer, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor implements the load balancing method based on the SOME/IP protocol when executing the computer program.
The load balancing method, the system, the storage medium and the computer based on the SOME/IP protocol select the optimal service node according to the priority value by calling the corresponding service node list and comparing the priority value of each service node in the service node list, and when a plurality of service nodes with the same lowest priority value exist in each service node, calculate the current weight values of the service nodes with the same lowest priority value, and select the optimal service node according to the current weight values; under the premise of using the SOME/IP protocol as an application layer protocol between services, load balancing is realized by combining a smooth weighted polling algorithm, so that SOME/IP application can uniformly call service nodes in a certain service cluster, and excessive or insufficient request flow distributed to a single service node is prevented, so that the service node is in failure or wasted in performance.
Drawings
FIG. 1 is a flowchart of a load balancing method based on SOME/IP protocol according to a first embodiment of the present invention;
FIG. 2 is a detailed flowchart of step S104 in FIG. 1;
FIG. 3 is a flowchart of a load balancing method based on SOME/IP protocol according to a second embodiment of the present invention;
FIG. 4 is a flow chart of a service publishing and subscribing process between a service provider Server and a service consumer Client according to a second embodiment of the present invention;
FIG. 5 is a flow chart illustrating a service invocation of a Client of a service consumer in a second embodiment of the present invention;
FIG. 6 is a diagram showing a comparison between before and after the modification of VSOMEIP communication framework in the second embodiment of the present invention;
FIG. 7 is a diagram of the operation of the simulated SWRR algorithm in a second embodiment of the present invention;
FIG. 8 is a block diagram of a load balancing system based on SOME/IP protocol according to a third embodiment of the present invention;
fig. 9 is a block diagram showing a configuration of a computer in a fourth embodiment of the present invention.
Description of the main element symbols:
memory device 10 Judging module 12
Processor with a memory having a plurality of memory cells 20 Processing module 13
Computer program 30 Computing module 14
First acquisition module 11
The following detailed description will further illustrate the invention in conjunction with the above-described figures.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Several embodiments of the invention are presented in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. The terms "vertical," "horizontal," "left," "right," and the like as used herein are for illustrative purposes only.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
Firstly, it should be noted that the present invention aims to solve the problem that the load balancing technology is limited to be difficult to be applied to the SOA distributed system in the automobile field, and to realize a load balancing technology based on the SOME/IP protocol and the smooth weighted round robin algorithm, thereby effectively ensuring the reliability and the high efficiency of the service.
Example one
Referring to fig. 1, a load balancing method based on the SOME/IP protocol in the first embodiment of the present invention is shown, and the method specifically includes steps S101 to S104:
s101, when a service calling request sent by a client is obtained, a corresponding service node list is obtained according to the service calling request;
in specific implementation, service-based communication is realized through an SOME/IP protocol, in this embodiment, a vsome IP communication framework of an open source is selected as a bottom layer communication component, a source code is modified and a load balancing function is added on the basis of the vsome IP, when a service invocation request sent by a client is obtained, a service invocation message sent by the client is received, and a service node list of the request of the client this time is obtained according to the service invocation message;
it can be understood that the service node list can upload all node information therein to a corresponding service registry through the client when searching for a service, and further generate a service node list including all node information of the client.
S102, comparing the priority values of all service nodes in the service node list, and judging whether a plurality of service nodes with the same lowest priority value exist in all the service nodes;
in specific implementation, after a service node list is obtained, the priority values of service nodes in the service node list are compared by using an SWRR algorithm, whether a plurality of service nodes with the same lowest priority value exist in the priority values of the service nodes is judged, if the priority values of the service nodes do not have the service nodes with the same lowest priority value, the priority of each service node is calculated according to the priority value of each service node, the service node with the highest priority is used as the optimal service node of the request, and service binding is performed through the optimal service node.
S103, if a plurality of service nodes with the same lowest priority value exist in each service node, using the service nodes with the same lowest priority value as a new service node list;
and S104, calculating the current weight value of each service node in the new service node list, screening out the optimal service node in the new service node list according to the current weight value, and binding the service of the client by using the optimal service node.
Further, referring to fig. 2, the step S104 specifically includes steps S1041 to S1042:
s1041, obtaining an initial weight value of each service node in the new service node list;
and S1042, superposing the current weight value and the initial weight value of each service node in the new service node list, and screening the service node with the maximum weight value as an optimal service node.
In specific implementation, if a plurality of service nodes with the same lowest priority value exist in each service node, the service nodes with the same lowest priority value are used as a new service node list, an initial weight value of each service node in the new service node list is obtained, a current weight value of each service node in the new service node list is superposed with the initial weight value, the service node with the largest weight value is screened out to be used as an optimal service node, and then the optimal service node is used for service binding of the client.
The calculation formula of the weight value of the optimal service node is as follows:
CurrentWeight i +=OriginalWeight i
BestNode=Max(CurrentWeight i )→Node;
BestNode.CurrentWeight-=Sum(OriginalWeight i );
wherein, CurrentWeight i And OriginalWeight i Respectively representing the current weight and the initial weight of the ith node, and the BestNode representing the optimal service node。
In summary, in the load balancing method based on the SOME/IP protocol in the above embodiment of the present invention, the optimal service node is selected according to the priority value by calling the corresponding service node list and according to the priority value of each service node in the service node list, and when a plurality of service nodes having the same lowest priority value exist in each service node, the current weight values of the plurality of service nodes having the same lowest priority value are calculated, and the optimal service node is selected according to the current weight values; under the premise of using the SOME/IP protocol as an application layer protocol between services, load balancing is realized by combining a smooth weighted polling algorithm, so that SOME/IP application can uniformly call service nodes in a certain service cluster, and excessive or insufficient request flow distributed to a single service node is prevented, so that the service node is in failure or wasted in performance.
Example two
Referring to fig. 3, a load balancing method based on SOME/IP protocol in a second embodiment of the present invention is shown, where the method specifically includes steps S201 to S206:
s201, obtaining SOME/IP service providing messages sent by a plurality of service terminals when releasing services, and adding load balancing parameters corresponding to each service terminal in each SOME/IP service providing message to construct a corresponding service instance list, wherein the load balancing parameters comprise the priority of service instances and the weight value of the service instances;
s202, obtaining SOME/IP searching service messages sent by a plurality of clients when searching services, setting instance IDs in each SOME/IP searching service message into a preset format, searching all service instances of the service instance list in a preset range, and forming a corresponding service node list;
s203, when a service calling request sent by a client is obtained, obtaining the service node list according to the service calling request;
s204, comparing the priority values of the service nodes in the service node list, and judging whether a plurality of service nodes with the same lowest priority value exist in the service nodes;
s205, if a plurality of service nodes with the same lowest priority value exist in each service node, using the service nodes with the same lowest priority value as a new service node list;
s206, calculating the current weight value of each service node in the new service node list, screening out the optimal service node in the new service node list according to the current weight value, and binding the service of the client by using the optimal service node.
In specific implementation, a Load Balancing Option field is added to an SOME/IP-SD message of an Offer Service when a Service provider Server (Service end) issues a Service to a Service registration center, so that the priority and the weight value of a Service instance provided by a Service node are transmitted. When a Service consumer Client (Client) searches for a Service, instanceID (instance ID) of Entry in an SOME/IP-SD message of a Find Service is set to 0xFFFF, then a corresponding Service instance list containing Service instance addresses, priorities, weight values and the like is obtained from a Service registration center, information is transmitted to a load balancer, and when the Client calls the Service, the load balancer selects an optimal node through an SWRR algorithm to bind the Service and send a call request. The flow chart of the Server and Client service publishing and subscribing is shown in fig. 4, and the flow chart of the Client service calling is shown in fig. 5.
Further, the format of the Offer Service Entry in the SOME/IP-SD OS is shown in the following Table 1:
TABLE 1
Figure BDA0003647889740000091
The format of IPv4 Endpoint Option in SOME/IP-SD OS is shown in the following Table 2:
TABLE 2
Figure BDA0003647889740000092
The format of Load Balancing Option in SOME/IP-SD OS is shown in Table 3 below:
TABLE 3
Figure BDA0003647889740000093
In this embodiment, the service provider Server sends the SOME/IP-SD message containing the Load Balancing Option field in a UDP multicast format to issue a service. The message is added with specific information of the Server side Service Instance, (Service ID, Instance ID, IP Address, Port, Priority, Weight) and the like, so that the Client side depending on the Service can sense the existence of the Service Instance and store the Service Instance information for the load balancer to use. Wherein Priority and Weight values of Load Balancing Option are necessary information for the Load balancer to execute the SWRR algorithm. Priority and Weight can be set to static values through configuration files, and can be dynamically adjusted according to the CPU and memory states of the ECU. The lower the Priority value, the higher the Priority, and the higher the Weight value, the more likely the service instance is to be selected.
Specifically, the format of the Find Service Entry in the SOME/IP-SD FS is shown in the following table 4:
TABLE 4
Figure BDA0003647889740000101
In the embodiment, the service consumer Client sends the SOME/IP-SD message to search for the service in a UDP multicast mode. The message is added with Service Instance information (Service ID, Instance ID) required by the Client, wherein the Instance ID is set to 0xFFFF, which indicates that the Client not only aims at a certain single Service Instance, but also searches all Service instances under the Service ID in a network range, and forms a Service node list for the load balancer to use, so that the Service availability and reliability are improved.
In the embodiment, service-based communication is realized through an SOME/IP protocol, an open-source VSOMEIP communication framework is selected as a bottom-layer communication component, and a source code is modified and a load balancing function is added on the basis of VSOMEIP.
Specifically, the application program uses the interface provided by the vsome ip to implement functions such as simple service registration, service discovery, service request, service routing, and the like. VSOMEIP shields the complicated message packaging and analyzing process of the bottom layer, and the application program can dynamically sense the service existing in the network. The improved VSOMEIP also supports the establishment of a service cluster with multiple service instances, and an application program flexibly selects service nodes through a load balancer to call services. Before and after the vsome ip is improved, as shown in fig. 6, the application program must set the service instance ID in advance before the improvement, and when the service is called, only the corresponding Endpoint (communication port) can be selected to communicate with the service instance. After improvement, the ID of the service instance is set to be 0xFFFF, and when the service is called, VSOMEIP dynamically selects Endpoint through the load balancer to establish connection communication with the appropriate service instance.
Furthermore, the Client end of the Service consumer receives the Offer Service message and then stores the corresponding Service instance information. When initiating service call, the load balancer first selects the node with the lowest Priority value from the service node list, if the Priority values of a plurality of nodes are the same and the lowest, then executes SWRR algorithm, and selects the optimal service instance from the rest nodes.
The SWRR algorithm is formulated as follows:
CurrentWeight i +=OriginalWeight i
BestNode=Max(CurrentWeight i )→Node;
BestNode.CurrentWeight-=Sum(OriginalWeight i );
wherein, CurrentWeight i And OriginalWeight i Respectively representing the current weight and the initial weight of the ith node, and the BestNode represents the optimal service node.
a. Adding currentWeight (current weight) of each node in the list to originalWeight (initial weight), wherein currentWeight is initially equal to originalWeight;
b. screening out the service node with the maximum currentWeight from the list as the current optimal node;
c. currentWeight of the optimal node minus the sum of the initial weights of all nodes.
The SWRR pseudo code is realized as follows:
Figure BDA0003647889740000111
Figure BDA0003647889740000121
for example, referring to fig. 7, a simulated SWRR algorithm operation is shown, in this example, with A, B, C service nodes listed, with initial weights of 6, 2, and 1, respectively. At the end of the 9 th operation of the algorithm, the current weight value of each node is restored to the initial weight value. In the previous 9 running processes, the node A is called most frequently and B times, but the calling time of the node A is not concentrated, so that the condition that the request is concentrated and inclined to a certain service node in a short time, the node is busy, and other nodes are too idle is avoided.
In summary, in the load balancing method based on the SOME/IP protocol in the above embodiment of the present invention, the corresponding service node list is called, the optimal service node is selected according to the priority value by comparing the priority values of the service nodes in the service node list, and when a plurality of service nodes with the same lowest priority value exist in each service node, the current weight values of the plurality of service nodes with the same lowest priority value are calculated, and the optimal service node is selected according to the current weight values; under the premise of using the SOME/IP protocol as an application layer protocol between services, load balancing is realized by combining a smooth weighted polling algorithm, so that SOME/IP application can uniformly call service nodes in a certain service cluster, and excessive or insufficient request flow distributed to a single service node is prevented, so that the service node is in failure or wasted in performance.
EXAMPLE III
Referring to fig. 8, a system for implementing load balancing is shown as a load balancing system based on the SOME/IP protocol in a third embodiment of the present invention, where the system includes:
the first obtaining module 11 is configured to, when a service invocation request sent by a client is obtained, obtain a corresponding service node list according to the service invocation request;
a judging module 12, configured to compare priority values of service nodes in the service node list, and judge whether multiple service nodes with the same lowest priority value exist in each service node;
a processing module 13, configured to use, if multiple service nodes with the same lowest priority value exist in each service node, the service node with the same lowest priority value as a new service node list;
and the calculating module 14 is configured to calculate a current weight value of each service node in the new service node list, screen out an optimal service node in the new service node list according to the current weight value, and perform service binding on the client by using the optimal service node.
Further, the calculation module 14 includes:
an obtaining unit, configured to obtain an initial weight value of each service node in the new service node list;
and the calculating unit is used for superposing the current weight value and the initial weight value of each service node in the new service node list and screening the service node with the maximum weight value as the optimal service node.
In some optional embodiments, the system further comprises:
the second obtaining module is used for obtaining SOME/IP service providing messages sent by a plurality of service terminals when the service terminals issue services, and adding load balancing parameters corresponding to the service terminals in each SOME/IP service providing message to construct a corresponding service instance list, wherein the load balancing parameters comprise priorities of the service instances and weight values of the service instances.
In some optional embodiments, the system further comprises:
and the third acquisition module is used for acquiring SOME/IP service searching messages sent by a plurality of clients during service searching, setting instance IDs in the SOME/IP service searching messages into a preset format, searching all service instances in the service instance list within a preset range, and forming a corresponding service node list.
The functions or operation steps of the modules and units when executed are substantially the same as those of the method embodiments, and are not described herein again.
The SOME/IP protocol-based load balancing system provided in the embodiment of the present invention has the same implementation principle and technical effect as those of the foregoing method embodiment, and for brief description, reference may be made to corresponding contents in the foregoing method embodiment for the part of the system embodiment that is not mentioned.
Example four
Referring to fig. 9, a computer according to a fourth embodiment of the present invention is shown, which includes a memory 10, a processor 20, and a computer program 30 stored in the memory 10 and executable on the processor 20, and when the processor 20 executes the computer program 30, the SOME/IP protocol-based load balancing method is implemented.
The memory 10 includes at least one type of storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 10 may in some embodiments be an internal storage unit of a computer, for example a hard disk of the computer. The memory 10 may also be an external storage device in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 10 may also include both an internal storage unit and an external storage device of the computer. The memory 10 may be used not only to store application software installed in a computer and various types of data, but also to temporarily store data that has been output or will be output.
In some embodiments, the processor 20 may be an Electronic Control Unit (ECU), a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor or other data Processing chip, and is configured to run program codes stored in the memory 10 or process data, such as executing an access restriction program.
It should be noted that the configuration shown in fig. 9 does not constitute a limitation of the computer, and in other embodiments the computer may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
An embodiment of the present invention further provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the above SOME/IP protocol-based load balancing method.
Those of skill in the art will understand that the logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be viewed as implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following technologies, which are well known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A load balancing method based on SOME/IP protocol is characterized by comprising the following steps:
when a service calling request sent by a client is acquired, acquiring a corresponding service node list according to the service calling request;
comparing the priority values of the service nodes in the service node list, and judging whether a plurality of service nodes with the same lowest priority value exist in the service nodes;
if a plurality of service nodes with the same lowest priority value exist in each service node, taking the service nodes with the same lowest priority value as a new service node list;
and calculating the current weight value of each service node in the new service node list, screening out the optimal service node in the new service node list according to the current weight value, and binding the service of the client by using the optimal service node.
2. The SOME/IP protocol-based load balancing method according to claim 1, wherein before the step of obtaining the service invocation request sent by the client, the method further comprises:
the method comprises the steps of obtaining SOME/IP service providing messages sent by a plurality of service terminals when the service terminals issue services, and adding load balancing parameters corresponding to the service terminals in each SOME/IP service providing message to construct a corresponding service instance list, wherein the load balancing parameters comprise the priority of service instances and the weight value of the service instances.
3. The SOME/IP protocol-based load balancing method according to claim 1, wherein before the step of obtaining the service invocation request sent by the client, the method further comprises:
the method comprises the steps of obtaining SOME/IP service searching messages sent by a plurality of clients when searching for services, setting instance IDs in the SOME/IP service searching messages into a preset format, searching all service instances in a service instance list within a preset range, and forming a corresponding service node list.
4. The SOME/IP protocol-based load balancing method according to claim 1, wherein the step of filtering out the optimal service node in the new service node list according to the current weight value comprises:
acquiring an initial weight value of each service node in the new service node list;
and superposing the current weight value and the initial weight value of each service node in the new service node list, and screening the service node with the maximum weight value as the optimal service node.
5. The SOME/IP protocol-based load balancing method according to claim 1, wherein the weight value of the optimal service node is calculated by the following formula:
CurrentWeight i +=OriginalWeight i
BeStNode=Max(CurrentWeight i )→Mode;
BestNode.CurrentWeight-=Sum(OriginalWeight i );
wherein, CurrentWeight i And OriginalWeight i Respectively representing the current weight and the initial weight of the ith node, and the BestNode represents the optimal service node.
6. A load balancing system based on SOME/IP protocol, the system comprising:
the first acquisition module is used for acquiring a corresponding service node list according to a service calling request when the service calling request sent by a client is acquired;
the judging module is used for comparing the priority values of all service nodes in the service node list and judging whether a plurality of service nodes with the same lowest priority value exist in all the service nodes;
the processing module is used for taking a plurality of service nodes with the same lowest priority value as a new service node list if the service nodes have the same lowest priority value;
and the calculation module is used for calculating the current weight value of each service node in the new service node list, screening out the optimal service node in the new service node list according to the current weight value, and binding the service of the client by using the optimal service node.
7. The SOME/IP protocol based load balancing system according to claim 6, further comprising:
the second obtaining module is used for obtaining SOME/IP service providing messages sent by a plurality of service terminals when the service terminals issue services, and adding load balancing parameters corresponding to the service terminals in each SOME/IP service providing message to construct a corresponding service instance list, wherein the load balancing parameters comprise priorities of the service instances and weight values of the service instances.
8. The SOME/IP protocol based load balancing system according to claim 6, further comprising:
and the third acquisition module is used for acquiring SOME/IP service searching messages sent by a plurality of clients during service searching, setting instance IDs in the SOME/IP service searching messages into a preset format, searching all service instances in the service instance list within a preset range, and forming a corresponding service node list.
9. A storage medium on which a computer program is stored, which computer program, when being executed by a processor, implements the SOME/IP protocol based load balancing method according to any one of claims 1 to 5.
10. A computer comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the SOME/IP protocol based load balancing method according to any one of claims 1 to 5 when executing the computer program.
CN202210535561.6A 2022-05-17 2022-05-17 Load balancing method, system, storage medium and computer based on SOME/IP protocol Active CN114979157B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210535561.6A CN114979157B (en) 2022-05-17 2022-05-17 Load balancing method, system, storage medium and computer based on SOME/IP protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210535561.6A CN114979157B (en) 2022-05-17 2022-05-17 Load balancing method, system, storage medium and computer based on SOME/IP protocol

Publications (2)

Publication Number Publication Date
CN114979157A true CN114979157A (en) 2022-08-30
CN114979157B CN114979157B (en) 2024-03-22

Family

ID=82983367

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210535561.6A Active CN114979157B (en) 2022-05-17 2022-05-17 Load balancing method, system, storage medium and computer based on SOME/IP protocol

Country Status (1)

Country Link
CN (1) CN114979157B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116319505A (en) * 2023-02-10 2023-06-23 安芯网盾(北京)科技有限公司 Route distribution method and device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150312166A1 (en) * 2014-04-25 2015-10-29 Rami El-Charif Software load balancer to maximize utilization
CN110740164A (en) * 2019-09-04 2020-01-31 无锡华云数据技术服务有限公司 Server determination method, regulation and control method, device, equipment and storage medium
US20200192898A1 (en) * 2018-12-14 2020-06-18 Amazon Technologies, Inc. Multi-tenant storage for analytics with push down filtering
CN112948104A (en) * 2019-12-11 2021-06-11 中盈优创资讯科技有限公司 Load balancing data acquisition method and device
CN113765966A (en) * 2020-09-01 2021-12-07 北京沃东天骏信息技术有限公司 Load balancing method and device
CN113824795A (en) * 2021-10-21 2021-12-21 上海波顿诺华智能科技有限公司 Communication method, device and system of vehicle end and cloud end
CN113934512A (en) * 2021-10-21 2022-01-14 平安国际智慧城市科技股份有限公司 Load balancing implementation method, device, equipment and storage medium
CN114095445A (en) * 2020-07-29 2022-02-25 华人运通(上海)自动驾驶科技有限公司 Data transmission control method and device for vehicle-mounted Ethernet, electronic equipment and storage medium
CN114157666A (en) * 2021-10-25 2022-03-08 北京千方科技股份有限公司 Load balancing system, method, medium and device based on intelligent cloud platform

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150312166A1 (en) * 2014-04-25 2015-10-29 Rami El-Charif Software load balancer to maximize utilization
US20200192898A1 (en) * 2018-12-14 2020-06-18 Amazon Technologies, Inc. Multi-tenant storage for analytics with push down filtering
CN110740164A (en) * 2019-09-04 2020-01-31 无锡华云数据技术服务有限公司 Server determination method, regulation and control method, device, equipment and storage medium
CN112948104A (en) * 2019-12-11 2021-06-11 中盈优创资讯科技有限公司 Load balancing data acquisition method and device
CN114095445A (en) * 2020-07-29 2022-02-25 华人运通(上海)自动驾驶科技有限公司 Data transmission control method and device for vehicle-mounted Ethernet, electronic equipment and storage medium
CN113765966A (en) * 2020-09-01 2021-12-07 北京沃东天骏信息技术有限公司 Load balancing method and device
CN113824795A (en) * 2021-10-21 2021-12-21 上海波顿诺华智能科技有限公司 Communication method, device and system of vehicle end and cloud end
CN113934512A (en) * 2021-10-21 2022-01-14 平安国际智慧城市科技股份有限公司 Load balancing implementation method, device, equipment and storage medium
CN114157666A (en) * 2021-10-25 2022-03-08 北京千方科技股份有限公司 Load balancing system, method, medium and device based on intelligent cloud platform

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
吴欢欢, 万晓冬: "一种服务器/均衡器合作式集群体系的结构", 科技广场, no. 06 *
李阳春;: "基于SOME/IP的整车电气通信网络设计研究", 汽车文摘, no. 08 *
郭灿;崔根群;唐风敏;: "基于服务的车载以太网研究与开发", 现代电子技术, no. 05 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116319505A (en) * 2023-02-10 2023-06-23 安芯网盾(北京)科技有限公司 Route distribution method and device

Also Published As

Publication number Publication date
CN114979157B (en) 2024-03-22

Similar Documents

Publication Publication Date Title
WO2020093500A1 (en) Intelligent scheduling method, terminal device, edge node cluster and intelligent scheduling system
CN110557357B (en) Remote procedure call protocol self-adaption method, related device and server
CN112367233B (en) Vehicle-mounted network ECU communication method and device based on service-oriented architecture
CN108702316B (en) VNF resource allocation method and device
US10681184B2 (en) Method and device for transmitting a message in a vehicle
CN110554927A (en) Micro-service calling method based on block chain
CN113746928B (en) Cross-cloud service calling method, device and system
CN113220484A (en) Micro-service calling method and device, electronic equipment and storage medium
CN113434249A (en) Mirror image synchronization method and device, docker host and storage medium
CN114189525A (en) Service request method and device and electronic equipment
CN114363233B (en) Packet routing method, device, electronic equipment and storage medium
CN114979157B (en) Load balancing method, system, storage medium and computer based on SOME/IP protocol
CN109271259B (en) Enterprise service bus system, data processing method, terminal and storage medium
CN109120680B (en) Control system, method and related equipment
CN108111630B (en) Zookeeper cluster system and connection method and system thereof
CN109639555B (en) Link layer message generation method, link layer message generation device and terminal equipment
CN104253702A (en) Terminal management method and system
CN112968825B (en) Message sending method, device, equipment and storage medium
CN109495331B (en) System monitoring method and device of network management system
CN115952003A (en) Method, device, equipment and storage medium for cluster server load balancing
CN112988405B (en) Automatic degradation method and device for micro-service and computing equipment
WO2014031044A1 (en) Method and node for enabling automatic deployment of resource components
WO2023143057A1 (en) Resource flow method, apparatus and device
CN111654527B (en) Message receiving and transmitting method and device
CN118869660A (en) Interaction method, device, equipment and medium supporting service-oriented software architecture

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant