CN109962963B - Message processing method and device - Google Patents

Message processing method and device Download PDF

Info

Publication number
CN109962963B
CN109962963B CN201711436020.3A CN201711436020A CN109962963B CN 109962963 B CN109962963 B CN 109962963B CN 201711436020 A CN201711436020 A CN 201711436020A CN 109962963 B CN109962963 B CN 109962963B
Authority
CN
China
Prior art keywords
quota
host
linked list
message
resource
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.)
Active
Application number
CN201711436020.3A
Other languages
Chinese (zh)
Other versions
CN109962963A (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.)
China Mobile Communications Group Co Ltd
China Mobile Group Inner Mongolia Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Inner Mongolia Co Ltd
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 China Mobile Communications Group Co Ltd, China Mobile Group Inner Mongolia Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201711436020.3A priority Critical patent/CN109962963B/en
Publication of CN109962963A publication Critical patent/CN109962963A/en
Application granted granted Critical
Publication of CN109962963B publication Critical patent/CN109962963B/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
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/58Message adaptation for wireless communication
    • 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

Abstract

The embodiment of the invention provides a message processing method and a device, wherein the method comprises the following steps: acquiring the service type of a message to be processed; determining a unique host IP and a port ID capable of processing the message to be processed according to the service type and a pre-generated resource quota linked list matrix; sending the message to be processed to a host corresponding to the host IP, so that an application program corresponding to a port ID on the host processes the message to be processed; the resource quota linked list matrix is updated, the dynamic capacity expansion capability of the system is increased on the basis of realizing load balance, the timeliness of high-concurrency message processing is greatly improved, and the condition that the message processing fails due to the system performance is reduced.

Description

Message processing method and device
Technical Field
The embodiment of the invention relates to the technical field of mobile communication, in particular to a message processing method and device.
Background
Today, the distributed deployment of applications is applied to different fields more and more, and the capability of a distributed system to process high concurrent services is one of the most important technical indexes of the system. In order to improve the processing of high-concurrency messages by a distributed system, equipment manufacturers provide different load balancing strategies, and currently, most manufacturers adopt a polling strategy or a minimum connection number strategy to realize the load balancing of the system.
The polling method is to distribute the requests to the back-end servers in turn in sequence, and treat each back-end server in a balanced way without concerning the actual connection number of the servers and the current system load; the minimum connection number method is flexible and intelligent, because the configuration of the back-end servers is different, the processing speed of the request is slow, and the method dynamically selects one server with the least current backlog connection number to process the current request according to the current connection condition of the back-end servers, so that the utilization efficiency of the back-end services is improved as much as possible, and the responsibility is reasonably distributed to each server. However, neither the polling method nor the minimum connection number method can ensure reasonable distribution of messages in the distributed system in a multi-service scenario, and in practical application, a certain server or a certain process still runs in an overload manner.
Disclosure of Invention
The invention provides a message processing method and a message processing device, which are used for solving the problem that reasonable distribution of distributed system messages under a multi-service scene cannot be guaranteed in the prior art.
In a first aspect, an embodiment of the present invention provides a message processing method, including:
acquiring the service type of a message to be processed;
determining a unique host IP and a port ID capable of processing the message to be processed according to the service type and a pre-generated resource quota linked list matrix;
sending the message to be processed to a host corresponding to the host IP, so that an application program corresponding to a port ID on the host processes the message to be processed;
and updating the resource quota linked list matrix.
In a second aspect, an embodiment of the present invention provides a message processing apparatus, including:
the message management module is used for acquiring the service type of the message to be processed;
a quota management module, configured to determine, according to the service type and a pre-generated resource quota linked list matrix, a unique host IP and a port ID that can process the message to be processed;
the execution module is used for sending the message to be processed to a host corresponding to the IP of the host, so that an application program corresponding to the port ID on the host processes the message to be processed;
and the updating module is used for updating the resource quota linked list matrix.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory, a bus, and a computer program stored on the memory and executable on the processor;
the processor and the memory complete mutual communication through the bus;
the processor, when executing the computer program, implements the method as described above.
In a fourth aspect, embodiments of the present invention provide a non-transitory computer-readable storage medium having a computer program stored thereon, which when executed by a processor implements the method as described above.
According to the technical scheme, the message processing method and the message processing device provided by the embodiment of the invention have the advantages that the service type of the message to be processed is obtained, the only host IP and the port ID capable of processing the message to be processed are determined according to the service type and the pre-generated resource quota linked list matrix, the message to be processed is sent to the host corresponding to the host IP, the message to be processed is processed by the application program corresponding to the port ID on the host, and finally the resource quota linked list matrix is updated, so that the dynamic capacity expansion capacity of the system is increased on the basis of realizing load balance, the timeliness of high-concurrency message processing is greatly improved, and the condition that the message processing fails due to the system performance is reduced.
Drawings
Fig. 1 is a schematic flowchart of a message processing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an initialized resource quota linked list matrix according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of acquiring a host IP and a port ID according to an embodiment of the present invention;
fig. 4 is a schematic application deployment diagram of a message processing method according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a linked list matrix generated by the load balancing system according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of the linked list matrix of FIG. 5 after being updated;
fig. 7 is a schematic flowchart of acquiring a host IP and a port ID according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a linked list matrix generated by the load balancing system according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of the linked list matrix of FIG. 8 after being updated;
fig. 10 is a schematic structural diagram of a message processing apparatus according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
Fig. 1 shows that an embodiment of the present invention provides a message processing method, including:
and S11, acquiring the service type of the message to be processed.
In this step, it should be noted that, in the embodiment of the present invention, the load balancing system may receive a to-be-processed message sent by an external peripheral system, and at this time, the load balancing system may analyze the to-be-processed message according to a preset analysis criterion to obtain an identification field of the to-be-processed message, and then obtain a service type of the to-be-processed message according to a correspondence between the identification field, the preset identification field, and the service type. The corresponding relationship between the identification field and the service type is a corresponding relationship preset by the load balancing system for each service message capable of being processed, and is used for confirming the service type of the message after receiving the message.
S12, determining a unique host IP and a port ID capable of processing the message to be processed according to the service type and the pre-generated resource quota linked list matrix.
In this step, it should be noted that, in the embodiment of the present invention, after the load balancing system is started, the load balancing system receives the report information of the load balancing agent deployed on each host, where the report information includes a service type, a host IP, a port number, a quota, and the like. And the load balancing system generates a resource quota linked list matrix according to the reported information.
The resource quota linked list matrix includes a transverse linked list corresponding to each traffic type.
The head node data structure of each transverse linked list is: traffic type, complexity factor.
The data structure of the intermediate nodes (i.e., quota nodes) of each transverse linked list is: host IP, port number, maximum quota, used quota.
The data structure of the tail node of each transverse linked list is: host IP, port number, maximum quota, used quota, terminator (typically 0). Namely: adding a terminator to the data structure of the last quota node.
Meanwhile, the host performance factor of each host needs to be stored as a separate item for calculating the quota residual amount. The performance factor of the host is comprehensively evaluated according to indexes such as CUP, memory and the like.
For example, there are m traffic types, each with A, for accessing the load balancing system1……AmThe back end system has K hosts, and the hosts IP respectively use IP1……IPkThe number of processes deployed by each host for different applications is N1……Nm、M1……Mm,……,P1……Pm. Then service a1The port numbers on the host 1 are respectively B111、B112……B11N1The quota is C111、C112……C11N1(ii) a Service A1The port numbers (port IDs) on the host 2 are respectively B211、B212……B21M1The quota is C211、C212……C21M1(ii) a … …, respectively; service A1The port numbers on the host K are respectively BK11、BK12……BK1P1The quota is CK11、CK12……CK1P1(ii) a According to service ADescription of the invention in connection with other services A2……AmPort numbers and quota amounts are allocated on different hosts, and a required initialized resource quota linked list matrix can be obtained, as shown in fig. 2.
The amount of used quota of the initialized resource quota linked list matrix is 0. When a service message is sent to a host, and an application program of a port on the host is enabled to process, the amount of quota used on the quota node where the port is located is 1. And by analogy, the used quota amount is larger than 1 due to the processing of the service message on other quota nodes. At this time, the resource quota linked list matrix is the matrix in use.
The load balancing system may determine, according to the service type of the message to be processed, a unique host IP and a port ID capable of processing the message to be processed according to the service type and a pre-generated resource quota linked list matrix, as shown in fig. 3, specifically:
s121, acquiring a transverse linked list corresponding to the service type from the resource quota linked list matrix according to the service type;
s122, determining a plurality of host IPs capable of processing the message to be processed according to quota surplus of all quota nodes in the transverse linked list;
s123, obtaining the resource residual quantity corresponding to each host IP according to the resource quota linked list matrix and a preset resource residual quantity calculation formula;
s124, determining a unique host IP according to the resource residual amount corresponding to each host IP;
and S125, obtaining quota nodes matched with the unique host IP from the transverse linked list, and determining the port ID according to quota surplus of the quota nodes.
For step S121 to step S125, it should be noted that, in the embodiment of the present invention, a transverse linked list using the service type as a head node is matched in a resource quota linked list matrix, and then quota remaining amounts (quota total amount-used quota amount) of each quota node are calculated. And if the quota surplus is not zero, acquiring the host IP recorded by the corresponding quota node.
And the load balancing system obtains the resource residual quantity corresponding to each host IP according to the resource quota linked list matrix and a preset resource residual quantity calculation formula. The resource remaining amount corresponding to each host IP calculated at this time is only the resource remaining amount corresponding to the host that can continue processing the service message.
For example, if there are 10 hosts in the backend system, and the IP of 4 hosts is obtained from the quota remaining amount, the resource remaining amount of only these four hosts is calculated.
It should be noted that, in the embodiment of the present invention, the resource surplus calculation formula may be:
resource surplus is the host performance factor- (A)1Used quota volume of service × U1+A2Used quota volume of service × U2+,……,+AmUsed quota volume of service × Um)。
And the load balancing system selects the host IP corresponding to the maximum resource surplus as the only host IP. And if a plurality of same maximum resource residual quantities exist, selecting one host IP as the unique host IP.
And the load balancing system selects a quota node with the maximum quota surplus from the quota nodes matched with the unique host IP, so as to obtain the port ID in the quota node. If a plurality of same maximum quota surplus exist, one quota node is selected optionally, and therefore the port ID in the quota node is obtained.
S13, sending the message to be processed to the host corresponding to the host IP, so that the application program corresponding to the port ID on the host processes the message to be processed.
In this step, it should be noted that, in the embodiment of the present invention, the load balancing system sends the to-be-processed message to the host corresponding to the host IP, so that the to-be-processed message is processed by the application program corresponding to the port ID on the host.
And S14, updating the resource quota linked list matrix.
In this step, it should be noted that, in the embodiment of the present invention, since the used quota amount in the selected quota node is used once, the load balancing system updates the resource quota linked list matrix.
The above steps are explained below with specific examples:
for example, there are 3 hosts in the current backend system, the performance factors of the hosts are 200, 300, and 400, respectively, the types of services to be processed by the backend system are 3 types, and a is a1、A2、A3The service complexity coefficients corresponding to each type of service are 1, 2, and 3, three hosts are responsible for processing the three types of services, and the application deployment for processing each type of service on each host is as shown in fig. 4. Deployment according to fig. 4 shows that:
application A in host 11The processing quota of (1) is divided into: 3. 4, the used quota is 1, 2; applications A2The processing quotas are respectively as follows: 4. 6, 8, the used quota is 2, 3, 6; applications A3The processing quotas are respectively as follows: 3. 5, the used quota is 0, 3;
application A in host 21The processing quota of (1) is divided into: 2. 3, 8, the used quota is 1, 2, 4; applications A2The processing quotas are respectively as follows: 5. 7, the used quota is 3, 3; applications A3The processing quotas are respectively as follows: 9, the used quota is 5;
application A in host 31The processing quota of (1) is divided into: 5, the used quota is 3; applications A2The processing quotas are respectively as follows: 3. 7, the used quota is 3, 4; applications A3The processing quotas are respectively as follows: 10. 6, 8, the used quota is 6, 3, 5.
According to the above application deployment, the linked list matrix generated by the load balancing system is shown in fig. 5.
When the load balancing system receives the message to be processed, the message is analyzed, and the service type of the message is A2Selecting the host capable of processing the service from the linked list matrix, wherein the three hosts can process the service with the type A when the final result is obtained2The message of (2). Then, calculating according to a resource residual quantity calculation formula:
the quota remaining amount of the host 1 is 200- (3 × 1+11 × 2+3 × 3) — 166.
The quota remaining amount of the host 2 is 300- (7 × 1+6 × 2+5 × 3) — 266.
The quota remaining amount of the host 3 is 400- (3 × 1+7 × 2+14 × 3) ═ 341.
According to the above selection method, the host 3 can be selected with the port B323The application program corresponding to the port processes the message to be processed and updates the linked list matrix, see fig. 6 after the update.
According to the message processing method provided by the embodiment of the invention, the service type of the message to be processed is obtained, the only host IP and the port ID capable of processing the message to be processed are determined according to the service type and the pre-generated resource quota linked list matrix, the message to be processed is sent to the host corresponding to the host IP, the message to be processed is processed by the application program corresponding to the port ID on the host, and finally the resource quota linked list matrix is updated.
An embodiment of the present invention provides a message processing method, including:
s21, acquiring the service type of the message to be processed;
s22, determining a unique host IP and a port ID capable of processing the message to be processed according to the service type and the pre-generated resource quota linked list matrix;
s23, sending the message to be processed to a host corresponding to the IP of the host, so that an application program corresponding to a port ID on the host processes the message to be processed;
and S24, updating the resource quota linked list matrix.
For the present embodiment, it should be noted that step S21, step S23 to step S24 in the present embodiment are the same as step S11, step S13 to step S14 in the above embodiment in principle, and are not described again here.
It should be noted that step S22 of the embodiment of the present invention is different from the case where step S12 of the embodiment of the present invention acquires the host IP and the port ID.
As shown in fig. 7, step S22 of this embodiment may specifically be:
s221, acquiring a transverse linked list corresponding to the service type from the resource quota linked list matrix according to the service type;
s222, determining that no host IP capable of processing the message to be processed exists according to quota surplus of all quota nodes in the transverse linked list;
s223, obtaining the resource residual quantity corresponding to each host IP according to the resource quota linked list matrix and a preset resource residual quantity calculation formula;
s224, determining the host IP to be distributed according to the resource surplus corresponding to each host IP;
s225, inserting a new quota node matched with the IP of the host to be allocated at the tail of the table of the transverse linked list according to the service type;
s226, acquiring the port ID from the new quota node.
For step S221 to step S226, it should be noted that, in the embodiment of the present invention, a transverse linked list using the service type as a head node is matched in a resource quota linked list matrix, and then quota remaining amounts (quota total amount-used quota amount) of each quota node are calculated. If the quota residual amounts on all quota nodes in the transverse linked list are zero, a new quota node needs to be configured on the transverse linked list, and the new quota node needs to acquire the IP of the host to be allocated.
At this time, the load balancing system obtains the resource residual amount corresponding to each host IP according to the resource quota linked list matrix and a preset resource residual amount calculation formula.
It should be noted that, in the embodiment of the present invention, the resource surplus calculation formula may be:
resource surplus is the host performance factor- (A)1Used quota volume of service × U1+A2Used quota volume of service × U2+,……,+AmUsed quota volume of service × Um)。
And the load balancing system selects the host IP corresponding to the maximum resource surplus as the host IP to be distributed. And if a plurality of same maximum resource residual quantities exist, selecting one host IP as the host IP to be distributed.
And the load balancing system inserts a new quota node matched with the IP of the host to be allocated at the table tail of the transverse linked list according to the service type, and acquires the port ID from the new quota node.
The steps of this embodiment are explained with three hosts of the above embodiment:
according to the above application deployment, the linked list matrix generated by the load balancing system is shown in fig. 8.
The load balancing system monitors A1Available quota of<If 0, the assignable host quota is calculated according to the condition of the current linked list matrix:
the quota remaining amount of the host 1 is 200- (7 × 1+13 × 2+5 × 3) ═ 152.
The quota remaining amount of the host 2 is 300- (7 × 1+6 × 2+5 × 3) — 266.
The quota remaining amount of the host 3 is 400- (3 × 1+7 × 2+14 × 3) ═ 341.
At this time, the host 3 may be selected as the host which newly applies for quota. The load balancing system will be in A according to the host IP and the service type1Inserting new applied node information into the tail end of the linked list corresponding to the service, and the IP address is IP3The port is B312The quota amount is 10, the processed quota is 0, and the new chain table matrix is shown in fig. 9.
In addition, in the message processing process, if the quota surplus of any quota node in the resource quota linked list matrix is 0, the quota node is deleted from the corresponding transverse linked list, and the resource quota linked list matrix is updated, so that the resource space can be reduced.
According to the message processing method provided by the embodiment of the invention, the service type of the message to be processed is obtained, the host IP and the port ID capable of processing the message to be processed are determined according to the service type and the pre-generated resource quota linked list matrix, the message to be processed is sent to the host corresponding to the host IP, the message to be processed is processed by the application program corresponding to the port ID on the host, and finally the resource quota linked list matrix is updated, so that the dynamic capacity expansion capability of the system is increased on the basis of realizing load balance, the timeliness of high concurrent message processing is greatly improved, and the condition that the message processing fails due to the system performance is reduced.
Fig. 10 shows a message processing apparatus provided in an embodiment of the present invention, which includes a message management module 31, a quota management module 32, an execution module 33, and an update module 34, where:
the message management module 31 is configured to obtain a service type of a message to be processed;
a quota management module 32, configured to determine, according to the service type and a pre-generated resource quota linked list matrix, a unique host IP and a port ID that can process the to-be-processed message, and specifically configured to:
acquiring a transverse linked list corresponding to the service type from the resource quota linked list matrix according to the service type;
determining a plurality of host IPs capable of processing the message to be processed according to quota surplus of all quota nodes in the transverse linked list;
obtaining the resource residual quantity corresponding to each host IP according to the resource quota linked list matrix and a preset resource residual quantity calculation formula;
determining a unique host IP according to the resource residual amount corresponding to each host IP;
and obtaining quota nodes matched with the unique host IP from the transverse linked list, and determining the port ID according to quota surplus of the quota nodes.
The execution module 33 is configured to send the to-be-processed message to a host corresponding to the host IP, so that an application program corresponding to the port ID on the host processes the to-be-processed message;
an updating module 34, configured to update the resource quota linked list matrix.
Since the principle of the apparatus according to the embodiment of the present invention is the same as that of the method according to the above embodiment, further details are not described herein for further explanation.
It should be noted that, in the embodiment of the present invention, the relevant functional module may be implemented by a hardware processor (hardware processor).
According to the message processing device provided by the embodiment of the invention, the service type of the message to be processed is obtained, the only host IP and the port ID capable of processing the message to be processed are determined according to the service type and the pre-generated resource quota linked list matrix, the message to be processed is sent to the host corresponding to the host IP, the message to be processed is processed by the application program corresponding to the port ID on the host, and finally the resource quota linked list matrix is updated.
The message processing device provided by the embodiment of the invention comprises a message management module, a quota management module, an execution module and an updating module, wherein:
the message management module is used for acquiring the service type of the message to be processed;
a quota management module, configured to determine, according to the service type and a pre-generated resource quota linked list matrix, a unique host IP and a port ID that can process the to-be-processed message, and specifically configured to:
acquiring a transverse linked list corresponding to the service type from the resource quota linked list matrix according to the service type;
determining that a host IP capable of processing the message to be processed does not exist according to quota surplus of all quota nodes in the transverse linked list;
obtaining the resource residual quantity corresponding to each host IP according to the resource quota linked list matrix and a preset resource residual quantity calculation formula;
determining the host IP to be distributed according to the resource surplus corresponding to each host IP;
inserting a new quota node matched with the IP of the host to be allocated at the tail of the table of the transverse linked list according to the service type;
and acquiring the port ID from the new quota node.
The execution module is used for sending the message to be processed to a host corresponding to the IP of the host, so that an application program corresponding to the port ID on the host processes the message to be processed;
and the updating module is used for updating the resource quota linked list matrix.
In addition, the system further comprises a deleting module, configured to delete a quota node from a corresponding transverse linked list if the quota residual amount of any quota node in the resource quota linked list matrix is 0, and update the resource quota linked list matrix.
Since the principle of the apparatus according to the embodiment of the present invention is the same as that of the method according to the above embodiment, further details are not described herein for further explanation.
It should be noted that, in the embodiment of the present invention, the relevant functional module may be implemented by a hardware processor (hardware processor).
According to the message processing device provided by the embodiment of the invention, the service type of the message to be processed is obtained, the host IP and the port ID capable of processing the message to be processed are determined according to the service type and the pre-generated resource quota linked list matrix, the message to be processed is sent to the host corresponding to the host IP, the message to be processed is processed by the application program corresponding to the port ID on the host, and finally the resource quota linked list matrix is updated, so that the dynamic capacity expansion capability of the system is increased on the basis of realizing load balance, the timeliness of high concurrent message processing is greatly improved, and the condition that the message processing fails due to the system performance is reduced.
Fig. 11 shows an electronic device provided in an embodiment of the present invention, including: a processor 401, a memory 402, a bus 403, and computer programs stored on the memory and executable on the processor;
the processor and the memory complete mutual communication through the bus;
the processor, when executing the computer program, implements a method as described above, for example comprising: acquiring the service type of a message to be processed; determining a unique host IP and a port ID capable of processing the message to be processed according to the service type and a pre-generated resource quota linked list matrix; sending the message to be processed to a host corresponding to the host IP, so that an application program corresponding to a port ID on the host processes the message to be processed; and updating the resource quota linked list matrix.
An embodiment of the present invention provides a non-transitory computer readable storage medium, on which a computer program is stored, and when executed by a processor, the computer program implements the method as described above, for example, including: acquiring the service type of a message to be processed; determining a unique host IP and a port ID capable of processing the message to be processed according to the service type and a pre-generated resource quota linked list matrix; sending the message to be processed to a host corresponding to the host IP, so that an application program corresponding to a port ID on the host processes the message to be processed; and updating the resource quota linked list matrix.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
Those of ordinary skill in the art will understand that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions and scope of the present invention as defined in the appended claims.

Claims (10)

1. A message processing method, comprising:
acquiring the service type of a message to be processed;
determining a unique host IP and a port ID capable of processing the message to be processed according to the service type and a pre-generated resource quota linked list matrix;
sending the message to be processed to a host corresponding to the host IP, so that an application program corresponding to a port ID on the host processes the message to be processed;
updating the resource quota linked list matrix;
determining a host IP and a port ID according to the service type and a pre-generated resource quota linked list matrix, wherein the determining comprises the following steps:
acquiring a transverse linked list corresponding to the service type from the resource quota linked list matrix according to the service type;
determining a plurality of host IPs capable of processing the message to be processed according to quota surplus of all quota nodes in the transverse linked list;
obtaining the resource residual quantity corresponding to each host IP according to the resource quota linked list matrix and a preset resource residual quantity calculation formula;
determining a unique host IP according to the resource residual amount corresponding to each host IP;
and obtaining quota nodes matched with the unique host IP from the transverse linked list, and determining the port ID according to quota surplus of the quota nodes.
2. The method of claim 1, wherein determining a host IP and a port ID according to the traffic type and a pre-generated resource quota linked list matrix comprises:
acquiring a transverse linked list corresponding to the service type from the resource quota linked list matrix according to the service type;
determining that a host IP capable of processing the message to be processed does not exist according to quota surplus of all quota nodes in the transverse linked list;
obtaining the resource residual quantity corresponding to each host IP according to the resource quota linked list matrix and a preset resource residual quantity calculation formula;
determining the host IP to be distributed according to the resource surplus corresponding to each host IP;
inserting a new quota node matched with the IP of the host to be allocated at the tail of the table of the transverse linked list according to the service type;
and acquiring the port ID from the new quota node.
3. The method of claim 1, further comprising:
and if the quota surplus of any quota node in the resource quota linked list matrix is 0, deleting the quota node from the corresponding transverse linked list, and updating the resource quota linked list matrix.
4. The method of claim 1, wherein the obtaining the service type of the message to be processed comprises:
analyzing the message to be processed to obtain a corresponding identification field;
and obtaining the service type of the message to be processed according to the corresponding relation between the identification field and the preset identification field and the service type.
5. A message processing apparatus, comprising:
the message management module is used for acquiring the service type of the message to be processed;
a quota management module, configured to determine, according to the service type and a pre-generated resource quota linked list matrix, a unique host IP and a port ID that can process the message to be processed;
the execution module is used for sending the message to be processed to a host corresponding to the IP of the host, so that an application program corresponding to the port ID on the host processes the message to be processed;
the updating module is used for updating the resource quota linked list matrix;
wherein the quota management module is specifically configured to:
acquiring a transverse linked list corresponding to the service type from the resource quota linked list matrix according to the service type;
determining a plurality of host IPs capable of processing the message to be processed according to quota surplus of all quota nodes in the transverse linked list;
obtaining the resource residual quantity corresponding to each host IP according to the resource quota linked list matrix and a preset resource residual quantity calculation formula;
determining a unique host IP according to the resource residual amount corresponding to each host IP;
and obtaining quota nodes matched with the unique host IP from the transverse linked list, and determining the port ID according to quota surplus of the quota nodes.
6. The apparatus of claim 5, wherein the quota management module is specifically configured to:
acquiring a transverse linked list corresponding to the service type from the resource quota linked list matrix according to the service type;
determining that a host IP capable of processing the message to be processed does not exist according to quota surplus of all quota nodes in the transverse linked list;
obtaining the resource residual quantity corresponding to each host IP according to the resource quota linked list matrix and a preset resource residual quantity calculation formula;
determining the host IP to be distributed according to the resource surplus corresponding to each host IP;
inserting a new quota node matched with the IP of the host to be allocated at the tail of the table of the transverse linked list according to the service type;
and acquiring the port ID from the new quota node.
7. The apparatus of claim 5, further comprising a deletion module to: and if the quota surplus of any quota node in the resource quota linked list matrix is 0, deleting the quota node from the corresponding transverse linked list, and updating the resource quota linked list matrix.
8. The apparatus of claim 5, wherein the message management module is specifically configured to:
analyzing the message to be processed to obtain a corresponding identification field;
and obtaining the service type of the message to be processed according to the corresponding relation between the identification field and the preset identification field and the service type.
9. An electronic device, comprising: a processor, a memory, a bus, and a computer program stored on the memory and executable on the processor;
the processor and the memory complete mutual communication through the bus;
the processor, when executing the computer program, implements the method of any of claims 1-4.
10. A non-transitory computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, implements the method of any one of claims 1-4.
CN201711436020.3A 2017-12-26 2017-12-26 Message processing method and device Active CN109962963B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711436020.3A CN109962963B (en) 2017-12-26 2017-12-26 Message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711436020.3A CN109962963B (en) 2017-12-26 2017-12-26 Message processing method and device

Publications (2)

Publication Number Publication Date
CN109962963A CN109962963A (en) 2019-07-02
CN109962963B true CN109962963B (en) 2020-08-18

Family

ID=67022475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711436020.3A Active CN109962963B (en) 2017-12-26 2017-12-26 Message processing method and device

Country Status (1)

Country Link
CN (1) CN109962963B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113055427B (en) * 2019-12-28 2022-12-23 浙江宇视科技有限公司 Service-based server cluster access method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR3003115A1 (en) * 2013-03-06 2014-09-12 France Telecom METHOD FOR ALLOCATING RESOURCES FOR IMPLEMENTING VIRTUAL NETWORKS IN A TELECOMMUNICATION NETWORK
CN104581219A (en) * 2014-12-22 2015-04-29 浙江工业大学 Control method of stream media forwarding server
WO2015180648A1 (en) * 2014-05-30 2015-12-03 华为技术有限公司 Resource allocation method and device
CN105872082A (en) * 2016-05-18 2016-08-17 上海交通大学 Fine-grained resource response system based on load balancing algorithm of container cluster
CN105978744A (en) * 2016-07-26 2016-09-28 浪潮电子信息产业股份有限公司 Resource allocation method, device and system
CN106302565A (en) * 2015-05-12 2017-01-04 浙江格林蓝德信息技术有限公司 The dispatching method of service server and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR3003115A1 (en) * 2013-03-06 2014-09-12 France Telecom METHOD FOR ALLOCATING RESOURCES FOR IMPLEMENTING VIRTUAL NETWORKS IN A TELECOMMUNICATION NETWORK
WO2015180648A1 (en) * 2014-05-30 2015-12-03 华为技术有限公司 Resource allocation method and device
CN104581219A (en) * 2014-12-22 2015-04-29 浙江工业大学 Control method of stream media forwarding server
CN106302565A (en) * 2015-05-12 2017-01-04 浙江格林蓝德信息技术有限公司 The dispatching method of service server and system
CN105872082A (en) * 2016-05-18 2016-08-17 上海交通大学 Fine-grained resource response system based on load balancing algorithm of container cluster
CN105978744A (en) * 2016-07-26 2016-09-28 浪潮电子信息产业股份有限公司 Resource allocation method, device and system

Also Published As

Publication number Publication date
CN109962963A (en) 2019-07-02

Similar Documents

Publication Publication Date Title
CN102281190B (en) Networking method for load balancing apparatus, server and client access method
CN110896355B (en) Network slice selection method and device
US10225145B2 (en) Method and device for updating client
US8069224B2 (en) Method, equipment and system for resource acquisition
KR102513998B1 (en) Communication methods and devices, entities and computer readable storage media
CN107210924B (en) Method and apparatus for configuring a communication system
CN107911470A (en) Distributed dynamic load-balancing method, computing device and computer-readable storage medium
CN109451088A (en) A kind of data access method and device
CN108989430B (en) Load balancing method, device and storage medium
EP3905589A1 (en) Slice resource deployment method and apparatus, and slice manager and computer storage medium
CN107105013B (en) File processing method, server, terminal and system
CN109151025B (en) Load balancing method and device based on URL, computer storage medium and equipment
WO2019170011A1 (en) Task allocation method and device, and distributed storage system
CN102724105B (en) A kind of load-balancing method and device
CN109104368B (en) Connection request method, device, server and computer readable storage medium
US11025490B2 (en) Method for dynamically managing a network service in a communication network
CN110515728B (en) Server scheduling method and device, electronic equipment and machine-readable storage medium
CN109962963B (en) Message processing method and device
CN108259605B (en) Data calling system and method based on multiple data centers
CN106790354B (en) Communication method and device for preventing data congestion
CN112596897A (en) Method and system for multi-tenant isolation
CN110798358B (en) Distributed service identification method and device, computer readable medium and electronic equipment
CN115952003A (en) Method, device, equipment and storage medium for cluster server load balancing
CN114070889B (en) Configuration method, traffic forwarding device, storage medium, and program product
CN114827177A (en) Deployment method and device of distributed file system and electronic equipment

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