A data processing method, device and system based on message middleware

The registration and business request allocation are implemented in the server cluster through message middleware, which solves the problem of cumbersome operations during server cluster maintenance and expansion, improves user experience and reduces maintenance costs.

CN112948141BActive Publication Date: 2025-03-18BEIJING QIYU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110156452.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-04
Publication Date
2025-03-18
Estimated Expiration
2041-02-04

AI Technical Summary

Technical Problem

When maintaining or expanding the server cluster, cumbersome operations may affect the user experience and increase maintenance costs.

Method used

Server registration and business request allocation are realized through message middleware. The client only needs to communicate with the message middleware, and the message middleware allocates the appropriate server based on the registration information.

Benefits of technology

Reduces server-client negotiation steps, simplifies maintenance and expansion processes, improves user experience, and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112948141B_ABST
    Figure CN112948141B_ABST
Patent Text Reader

Abstract

The present invention discloses a data processing method, device and system based on message middleware, wherein the method comprises: one or more first servers send a registration request to a second server, the second server returns a registration success message to the first server according to the registration request, and sends the registration success message to the message middleware server; the client sends a service request to the message middleware server; the message middleware server allocates a first server to the client according to the service request and the registration success message, and forwards the service request to the allocated first server. With this technical solution, the first server is managed by setting a second server, and the registration information of the first server is uploaded to the message middleware. When the first server is maintained or expanded, it does not need to negotiate with the client again, and the maintenance or expansion is performed without the user's perception, which improves the user's experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer information processing, and in particular to a data processing method, device and system based on message middleware. Background Art

[0002] With the development of Internet technology in recent years, people have an increasing demand for exchanging and obtaining messages through the network. At the same time, due to the increasing demand of users for network message communication, ensuring the stable and efficient push of massive messages has become the primary task of network service providers. The commonly used method at present is to use message middleware to deliver messages. Message middleware uses efficient and reliable message delivery mechanisms for platform-independent data exchange and integrates distributed systems based on data communication. By providing message delivery and message queuing models, it can expand inter-process communication in a distributed environment.

[0003] In the existing method, the server clusters that provide different services need to negotiate and debug with the client in advance to determine the corresponding IP addresses and port numbers. The client uses the corresponding IP address and port number to access the server. However, when the server cluster needs maintenance or expansion, the server must negotiate and debug with the client. The cumbersome operation may affect user use, resulting in a poor user experience and high maintenance costs. Summary of the invention

[0004] The present invention aims to solve the problem that when a server cluster needs to be maintained or expanded, the operation is complicated, which may affect the use of users, resulting in a bad user experience and high maintenance costs.

[0005] In order to solve the above technical problems, the first aspect of the present invention proposes a data processing method based on message middleware, the method comprising:

[0006] One or more first servers send a registration request to a second server, and the second server returns a registration success message to the first server according to the registration request, and sends the registration success message to the message middleware server;

[0007] The client sends a service request to the message middleware server;

[0008] The message middleware server allocates a first server to the client according to the service request and the registration success information, and forwards the service request to the allocated first server.

[0009] According to a preferred implementation manner of the present invention, the registration request includes a service type of the first server.

[0010] According to a preferred embodiment of the present invention, the second server returns registration success information to the first server according to the registration request further comprising:

[0011] The second server allocates an IP address and a port number to the first server, and the second server allocates a service ID to the first server according to the service type of the first server included in the registration request.

[0012] According to a preferred embodiment of the present invention, sending the registration success information to the message middleware server further comprises:

[0013] The IP address, port number, and business ID corresponding to the business type assigned to the first server are uploaded to a message middleware server, where the message middleware server is a Kafka server.

[0014] According to a preferred implementation manner of the present invention, the service request includes a service type of the service request.

[0015] According to a preferred implementation manner of the present invention, the message middleware server assigning the first server to the client according to the service request and the registration success information further comprises:

[0016] The message middleware server receives a service request sent by a client and obtains a service type of the service request;

[0017] Determine the corresponding service ID according to the correspondence between the service type and the service ID;

[0018] A first server is allocated to the service request according to the service ID, and the service request is pushed to the allocated first server.

[0019] According to a preferred embodiment of the present invention, allocating a first server to the service request according to the service ID, and pushing the service request to the allocated first server further comprises:

[0020] The registration request sent by the first server to the second server includes the carrying capacity of the first server;

[0021] The second server uploads the carrying capacity of the first server to the message middleware server;

[0022] The message middleware server performs load balancing processing according to the bearing capacity and load condition of the first server, and pushes the service request.

[0023] A second aspect of the present invention provides a data processing device based on message middleware, the device comprising:

[0024] A registration upload module, which is used for one or more first servers to send a registration request to a second server, and the second server returns a registration success message to the first server according to the registration request, and sends the registration success message to the message middleware server;

[0025] A service request sending module, used for the client to send a service request to the message middleware server;

[0026] The service request push module is used for the message middleware server to allocate a first server to the client according to the service request and the registration success information, and forward the service request to the allocated first server.

[0027] According to a preferred implementation manner of the present invention, the registration request includes a service type of the first server.

[0028] According to a preferred embodiment of the present invention, the second server returns registration success information to the first server according to the registration request further comprising:

[0029] The second server allocates an IP address and a port number to the first server, and the second server allocates a service ID to the first server according to the service type of the first server included in the registration request.

[0030] According to a preferred embodiment of the present invention, sending the registration success information to the message middleware server further comprises:

[0031] The IP address, port number, and business ID corresponding to the business type assigned to the first server are uploaded to a message middleware server, where the message middleware server is a Kafka server.

[0032] According to a preferred implementation manner of the present invention, the service request includes a service type of the service request.

[0033] According to a preferred implementation manner of the present invention, the message middleware server assigning the first server to the client according to the service request and the registration success information further comprises:

[0034] The message middleware server receives a service request sent by a client and obtains a service type of the service request;

[0035] Determine the corresponding service ID according to the correspondence between the service type and the service ID;

[0036] A first server is allocated to the service request according to the service ID, and the service request is pushed to the allocated first server.

[0037] According to a preferred embodiment of the present invention, allocating a first server to the service request according to the service ID, and pushing the service request to the allocated first server further comprises:

[0038] The registration request sent by the first server to the second server includes the carrying capacity of the first server;

[0039] The second server uploads the carrying capacity of the first server to the message middleware server;

[0040] The message middleware server performs load balancing processing according to the bearing capacity and load condition of the first server, and pushes the service request.

[0041] A third aspect of the present invention provides a first server, comprising:

[0042] A first sending unit, used to send a registration request to the second server, and also used to return a business result message to the message middleware server;

[0043] A first receiving unit is used to receive a registration success message returned by the second server, and is also used to receive a service request sent by a client and pushed by a message middleware server;

[0044] The first processing unit is configured to process the service request received by the first receiving unit to generate a service result message, and send the service result message to the first sending unit.

[0045] According to a preferred implementation manner of the present invention, the registration request includes a service type of the first server.

[0046] According to a preferred implementation manner of the present invention, the registration request also includes the carrying capacity of the first server.

[0047] A fourth aspect of the present invention provides a second server, comprising:

[0048] A second receiving unit, configured to receive a registration request sent by the first server;

[0049] A second sending unit, used to send a registration success message to the first server, and upload the registration success message to the message middleware server;

[0050] A management unit is used to allocate an IP address, a port number and a service ID to the first server.

[0051] A fifth aspect of the present invention provides a message middleware server, comprising:

[0052] The third receiving unit is used to receive a registration success message uploaded by the message middleware server, and send the IP address, port number, service ID and bearer establishment of the first server carried in the registration success message to the storage unit, and is also used to receive a service request sent by the client and a service result message returned by the first server;

[0053] A push unit, configured to parse the service request, obtain the service type carried in the service request, and determine the first server corresponding to the service request according to the correspondence between the service type and the service ID stored in the storage unit;

[0054] The third sending unit is used to push the service request to the corresponding first server, and send the service result message returned by the first server to the corresponding client.

[0055] A sixth aspect of the present invention provides a client, comprising:

[0056] A fourth sending unit, configured to send a service request to the message middleware server, wherein the service request includes a service type;

[0057] The fourth receiving unit is used to receive the service result message returned by the message middleware server.

[0058] A seventh aspect of the present invention provides a data processing system based on message middleware, comprising:

[0059] A storage unit for storing a computer executable program;

[0060] The processing unit is used to read the computer executable program in the storage unit to execute the data processing method based on the message middleware.

[0061] An eighth aspect of the present invention proposes a computer-readable medium for storing a computer-readable program, wherein the computer-readable program is used to execute the data processing method based on the message middleware.

[0062] By adopting this technical solution, a second server is set up to manage the first server, and the registration information of the first server is uploaded to the message middleware. When the first server is maintained or expanded, there is no need to negotiate with the client again. Maintenance or expansion can be performed without the user's perception, which improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to make the technical problems solved by the present invention, the technical means adopted and the technical effects achieved more clearly, the specific embodiments of the present invention will be described in detail with reference to the accompanying drawings. However, it should be noted that the drawings described below are only drawings of exemplary embodiments of the present invention, and those skilled in the art can obtain drawings of other embodiments based on these drawings without creative work.

[0064] Figure 1 It is a schematic diagram of the network structure of the message middleware in the prior art;

[0065] Figure 2 It is a schematic diagram of a network topology structure based on a message middleware in an embodiment of the present invention;

[0066] Figure 3 It is a flow chart of a data processing method based on message middleware in an embodiment of the present invention;

[0067] Figure 4 It is a structural schematic diagram of a data processing device based on message middleware in an embodiment of the present invention;

[0068] Figure 5 is a schematic diagram of the structure of a first server in an embodiment of the present invention;

[0069] Figure 6 is a schematic diagram of the structure of the second server in an embodiment of the present invention;

[0070] Figure 7 It is a schematic diagram of the structure of a message middleware server in an embodiment of the present invention;

[0071] Figure 8 is a schematic diagram of the structure of a client in an embodiment of the present invention;

[0072] Fig. 9 It is a schematic diagram of the structural framework of a data processing system based on message middleware in an embodiment of the present invention;

[0073] Fig.10 It is a schematic diagram of the structure of a computer-readable storage medium in an embodiment of the present invention. DETAILED DESCRIPTION

[0074] The exemplary embodiments of the present invention will now be described more fully with reference to the accompanying drawings. Although each exemplary embodiment can be implemented in a variety of specific ways, it should not be understood that the present invention is limited to the embodiments set forth herein. On the contrary, these exemplary embodiments are provided to make the content of the present invention more complete and to facilitate the comprehensive communication of the inventive concept to those skilled in the art.

[0075] Under the premise of conforming to the technical concept of the present invention, the structure, performance, effect or other characteristics described in a specific embodiment may be combined with one or more other embodiments in any appropriate manner.

[0076] In the process of introducing specific embodiments, the detailed description of the structure, performance, effect or other characteristics is to enable those skilled in the art to fully understand the embodiments. However, it does not exclude that those skilled in the art can implement the present invention with a technical solution that does not contain the above-mentioned structure, performance, effect or other characteristics under certain circumstances.

[0077] The flowchart in the accompanying drawings is only an exemplary process demonstration, and does not mean that the solution of the present invention must include all the contents, operations and steps in the flowchart, nor does it mean that it must be executed in the order shown in the figure. For example, some operations / steps in the flowchart can be decomposed, some operations / steps can be combined or partially combined, etc. The execution order shown in the flowchart can be changed according to the actual situation without departing from the main purpose of the present invention.

[0078] Frames in the attached figure Figure 1 Generally, it refers to functional entities, which do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processing unit devices and / or microcontroller devices.

[0079] The same reference numerals in the drawings represent the same or similar elements, components or parts, and thus the repeated description of the same or similar elements, components or parts may be omitted below. It should also be understood that although the first, second, third and other attributives representing the numbers may be used herein to describe various devices, elements, components or parts, these devices, elements, components or parts should not be limited by these attributives. In other words, these attributives are only used to distinguish one from another. For example, the first device may also be called the second device, but it does not deviate from the essential technical solution of the present invention. In addition, the terms "and / or" and "and / or" refer to all combinations including any one or more of the listed items.

[0080] Figure 1 It is a schematic diagram of the network structure of the message middleware in the prior art.

[0081] like Figure 1 As shown in the figure, the message middleware is located between the producer and the consumer. The functions of the three in this structure are:

[0082] The producer is responsible for pushing message information to the designated server;

[0083] Consumers are responsible for obtaining the content of messages through the server;

[0084] Message middleware is responsible for storing messages. That is, when consumers do not have time to process all messages, they can buffer the message content in the message middleware. Therefore, message middleware is often called message queue middleware.

[0085] Producers can be various devices, such as mobile phones, desktop computers, laptops, PDAs and other electronic devices. When the messages sent by various devices are too many, the amount of data will definitely increase. If these messages are directly handed over to consumers, that is, various servers, for processing, the servers will not be able to process them correctly, which will lead to the loss of message data. The biggest function of message middleware is to buffer data. By setting up message middleware, the communication mode between producers and consumers is converted to asynchronous communication.

[0086] However, in this structure, consumers and producers need to negotiate to determine the corresponding IP addresses and port numbers, otherwise the message cannot be accurately pushed to the designated consumer, that is, the server. When the server needs maintenance or expansion, the server under maintenance and the newly added server need to negotiate with the producer to ensure that the information is not sent to the offline server or the message can be assigned to the newly online server.

[0087] In order to solve this problem, the present invention provides a data processing method based on message middleware, wherein the network topology diagram is as follows: Figure 2 The flow chart of the method is shown in Figure 3 As shown, the method includes:

[0088] S301, one or more first servers send a registration request to a second server, the second server returns registration success information to the first server according to the registration request, and sends the registration success information to a message middleware server.

[0089] In this embodiment, if Figure 2 As shown, a second server is set, and one or more first servers send a registration request to the second server. After the registration is successful, the second server returns a registration success message to the first server. After receiving the registration success message, the first server determines that the registration is successful. Otherwise, the first server sends a registration request to the second server every other application cycle until the registration success message is received. The application cycle is usually set at 50 milliseconds to 500 milliseconds.

[0090] After the first server is successfully registered, the second server also sends registration success information to the message middleware server.

[0091] Based on the above technical solution, further, the registration request includes a service type of the first server.

[0092] In this implementation, the registration request of the first server includes the service type of the first server, such as for natural language understanding (NLU) or for data storage, etc.

[0093] On the basis of the above technical solution, further, sending the registration success information to the message middleware server further includes:

[0094] The IP address, port number, and business ID corresponding to the business type assigned to the first server are uploaded to a message middleware server, where the message middleware server is a Kafka server.

[0095] In this embodiment, the second server belongs to the management server, which is provided with an IP pool, a port number pool and a business ID pool. The IP address, port number and business ID are allocated to the first server according to the registration request sent by the first server. For example, the business ID allocated to the NLU server is 1XXX, and the business ID allocated to the data storage server is 2XXX, where the first digit corresponds to the specific business type, and the last three digits are the serial number allocated by the server. The form of the business ID can be set as needed. In this embodiment, servers are divided into different groups according to different functions, such as after-sales group, sales group, consulting group, etc. The IP address and port number of the first server in the same group are the same, and the specific servers are distinguished by the business ID. The IP addresses and / or port numbers of the first servers in different groups are different.

[0096] In this embodiment, the second server allocates service IDs according to the registration order of the first servers. When the allocated first server goes offline, the service ID is recovered and put back into the service ID pool. When a new first server comes online, the service ID is allocated to the new first server.

[0097] The type of the message middleware server may be ActiveMQ, RabbitMQ, Kafka, RocketMQ, ZeroMQ, etc. In this embodiment, a Kafka server is used.

[0098] S302: The client sends a service request to the message middleware server.

[0099] On the basis of the above technical solution, further, the service request includes a service type of the service request.

[0100] In this embodiment, the client's service request includes a service type, such as NLU in the service request. The service request carries the service type, and the message middleware can accurately push the service request to the corresponding server.

[0101] In this embodiment, the service request of the client also includes the client IP address and the client ID. After the corresponding first server processes the service request sent by the client, it returns a service result message through the client IP address and the client ID.

[0102] S303: The message middleware server allocates a first server to the client according to the service request and the registration success information, and forwards the service request to the allocated first server.

[0103] In this embodiment, the message middleware receives the service request sent by the client, and pushes the service request to the corresponding first server for processing.

[0104] On the basis of the above technical solution, further, allocating a first server to the service request according to the service ID, and pushing the service request to the allocated first server further comprises:

[0105] The registration request sent by the first server to the second server includes the carrying capacity of the first server;

[0106] The second server uploads the carrying capacity of the first server to the message middleware server;

[0107] The message middleware server performs load balancing processing according to the bearing capacity and load condition of the first server, and pushes the service request.

[0108] In this embodiment, different first servers have different carrying capacities, some servers have strong carrying capacities, and some servers have weak carrying capacities. If they are evenly distributed, the servers with small carrying capacities may be overloaded, while the servers with large carrying capacities only use a small part.

[0109] To this end, the message middleware needs to load balance the first server. When the first server registers with the second server, the registration request carries the carrying capacity of the first server, and the second server uploads the IP address, port number, service ID and carrying capacity of the first server to the message middleware server.

[0110] The message middleware server stores the IP address, port number, service ID and carrying capacity of each first server, and also stores the correspondence between service type and service ID. When the message middleware server receives the service request sent by the client, it extracts the service type from it, searches for the corresponding service ID according to the service type, and finally determines the assigned first server. For example, if the service type in the service request sent by the client is NLU, the corresponding service ID is 1001, 1002, 1003, and so on. When making an allocation, the message middleware also records the load rate of the first server, performs load balancing according to the load rate, and ensures that each first server is not overloaded. The load rate is calculated as follows:

[0111]

[0112] Each time a service request is allocated to the first server, the number of loaded service requests increases by 1, and each time the first server returns a service result message, the number of loaded service requests decreases by 1.

[0113] In this way, the IP address and port number of the first server of each group are fixed, and there is no need to negotiate with the client. When maintenance is performed, it is only necessary to upload the service ID of the first server to be maintained to the message middleware server, and the message middleware server will no longer allocate service requests to the first server. When a new first server is online or a maintained first server is back online, it is only necessary to register in the second server and upload the new service ID to the message middleware server. Using the solution of the present invention, the first server only needs to negotiate with the client once to determine the IP address and port number. Subsequent maintenance and the launch of the new server do not need to be negotiated again, so that the user is not aware of it and it will not affect the user's use, thereby improving the user's experience.

[0114] Figure 4 is a schematic diagram of the structure of a data processing device based on a message middleware in an embodiment of the present invention. Figure 4 As shown, the present invention provides a data processing device 400 based on message middleware, comprising:

[0115] The registration upload module 401 is used for one or more first servers to send a registration request to a second server, and the second server returns a registration success message to the first server according to the registration request, and sends the registration success message to the message middleware server.

[0116] In this embodiment, a second server is set, and one or more first servers send a registration request to the second server. After the registration is successful, the second server returns a registration success message to the first server. After receiving the registration success message, the first server determines that the registration is successful. Otherwise, the first server sends a registration request to the second server once every application cycle until the registration success message is received. The application cycle is usually set at 50 milliseconds to 500 milliseconds.

[0117] After the first server is successfully registered, the second server also sends registration success information to the message middleware server.

[0118] Based on the above technical solution, further, the registration request includes a service type of the first server.

[0119] In this implementation, the registration request of the first server includes the service type of the first server, such as for natural language understanding (NLU) or for data storage, etc.

[0120] On the basis of the above technical solution, further, sending the registration success information to the message middleware server further includes:

[0121] The IP address, port number, and business ID corresponding to the business type assigned to the first server are uploaded to a message middleware server, where the message middleware server is a Kafka server.

[0122] In this embodiment, the second server belongs to the management server, which is provided with an IP pool, a port number pool and a business ID pool. The IP address, port number and business ID are allocated to the first server according to the registration request sent by the first server. For example, the business ID allocated to the NLU server is 1XXX, and the business ID allocated to the data storage server is 2XXX, where the first digit corresponds to the specific business type, and the last three digits are the serial number allocated by the server. In this embodiment, the servers are divided into different groups according to their functions, such as after-sales group, sales group, consulting group, etc. The IP address and port number of the first server in the same group are the same, and the specific servers are distinguished by the business ID. The first servers in different groups have different IP addresses and / or port numbers.

[0123] In this embodiment, the second server allocates service IDs according to the registration order of the first servers. When the allocated first server goes offline, the service ID is recovered and put back into the service ID pool. When a new first server comes online, the service ID is allocated to the new first server.

[0124] The type of the message middleware server may be ActiveMQ, RabbitMQ, Kafka, RocketMQ, ZeroMQ, etc. In this embodiment, a Kafka server is used.

[0125] The service request sending module 402 is used for the client to send a service request to the message middleware server.

[0126] On the basis of the above technical solution, further, the service request includes a service type of the service request.

[0127] In this embodiment, the client's service request includes a service type, such as NLU in the service request. The service request carries the service type, and the message middleware can accurately push the service request to the corresponding server.

[0128] In this embodiment, the service request of the client also includes the client IP address and the client ID. After the corresponding first server processes the service request sent by the client, it returns a service result message through the client IP address and the client ID.

[0129] The service request push module 403 is used for the message middleware server to allocate a first server to the client according to the service request and the registration success information, and forward the service request to the allocated first server.

[0130] In this embodiment, the message middleware receives the service request sent by the client, and pushes the service request to the corresponding first server for processing.

[0131] On the basis of the above technical solution, further, allocating a first server to the service request according to the service ID, and pushing the service request to the allocated first server further comprises:

[0132] The registration request sent by the first server to the second server includes the carrying capacity of the first server;

[0133] The second server uploads the carrying capacity of the first server to the message middleware server;

[0134] The message middleware server performs load balancing processing according to the bearing capacity and load condition of the first server, and pushes the service request.

[0135] In this embodiment, different first servers have different carrying capacities, some servers have strong carrying capacities, and some servers have weak carrying capacities. If they are evenly distributed, the servers with small carrying capacities may be overloaded, while the servers with large carrying capacities only use a small part.

[0136] To this end, the message middleware needs to load balance the first server. When the first server registers with the second server, the registration request carries the carrying capacity of the first server, and the second server uploads the IP address, port number, service ID and carrying capacity of the first server to the message middleware server.

[0137] The message middleware server stores the IP address, port number, service ID and carrying capacity of each first server, and also stores the correspondence between service type and service ID. When the message middleware server receives the service request sent by the client, it extracts the service type from it, searches for the corresponding service ID according to the service type, and finally determines the assigned first server. For example, if the service type in the service request sent by the client is NLU, the corresponding service ID is 1001, 1002, 1003, and so on. When making an allocation, the message middleware also records the load rate of the first server, performs load balancing according to the load rate, and ensures that each first server is not overloaded. The load rate is calculated as follows:

[0138]

[0139] Each time a service request is allocated to the first server, the number of loaded service requests increases by 1, and each time the first server returns a service result message, the number of loaded service requests decreases by 1.

[0140] In this way, the IP address and port number of the first server of each group are fixed, and there is no need to negotiate with the client. When maintenance is performed, it is only necessary to upload the service ID of the first server to be maintained to the message middleware server, and the message middleware server will no longer allocate service requests to the first server. When a new first server is online or a maintained first server is back online, it is only necessary to register in the second server and upload the new service ID to the message middleware server. Using the solution of the present invention, the first server only needs to negotiate with the client once to determine the IP address and port number. Subsequent maintenance and the launch of the new server do not need to be negotiated again, so that the user is not aware of it and it will not affect the user's use, thereby improving the user's experience.

[0141] Figure 5 is a schematic diagram of the structure of the first server in an embodiment of the present invention. Figure 5 As shown, the first server includes:

[0142] The first sending unit 501 is used to send a registration request to the second server, and is also used to return a business result message to the message middleware server;

[0143] The first receiving unit 502 is used to receive a registration success message returned by the second server, and is also used to receive a service request sent by the client and pushed by the message middleware server;

[0144] The first processing unit 503 is configured to process the service request received by the first receiving unit to generate a service result message, and send the service result message to the first sending unit.

[0145] Based on the above technical solution, further, the registration request includes a service type of the first server.

[0146] In this implementation, since the IP addresses and port numbers of the first servers in the same group are the same, the specific first servers are distinguished by the service ID corresponding to the service type, so the service type needs to be carried in the registration request.

[0147] On the basis of the above technical solution, further, the registration request also includes the carrying capacity of the first server.

[0148] In this implementation, the message middleware server needs to perform load balancing on the first server, and therefore needs to know the carrying capacity of the first server.

[0149] Figure 6 is a schematic diagram of the structure of the second server in an embodiment of the present invention. Figure 6 As shown, a second server includes:

[0150] The second receiving unit 601 is used to receive a registration request sent by the first server;

[0151] The second sending unit 602 is used to send a registration success message to the first server, and upload the registration success message to the message middleware server;

[0152] The management unit 603 is used to allocate an IP address, a port number and a service ID to the first server.

[0153] Figure 7 Schematic diagram of the structure of the message middleware server in the embodiment of the present invention. Figure 7 As shown, the message middleware server includes:

[0154] The third receiving unit 701 is used to receive a registration success message uploaded by the message middleware server, and send the IP address, port number, service ID and bearer establishment of the first server carried in the registration success message to the storage unit, and is also used to receive a service request sent by the client and a service result message returned by the first server;

[0155] The push unit 702 is used to parse the service request, obtain the service type carried in the service request, and determine the first server corresponding to the service request according to the correspondence between the service type and the service ID stored in the storage unit;

[0156] The third sending unit 703 is used to push the service request to the corresponding first server, and send the service result message returned by the first server to the corresponding client.

[0157] Figure 8 is a schematic diagram of the structure of the client in an embodiment of the present invention. Figure 8 As shown, the client includes:

[0158] The fourth sending unit 801 is used to send a service request to the message middleware server, where the service request includes a service type;

[0159] The fourth receiving unit 802 is configured to receive a service result message returned by the message middleware server.

[0160] like Fig. 9 As shown, in one embodiment of the present invention, a data processing system based on message middleware is also disclosed. Fig. 9 The displayed context-based dialogue response system is merely an example and should not limit the functionality and scope of use of the embodiments of the present invention.

[0161] The data processing system 900 based on the message middleware includes a storage unit 920 for storing computer executable programs; and a processing unit 910 for reading the computer executable programs in the storage unit to execute the steps of various embodiments of the present invention.

[0162] In this embodiment, the data processing system 900 based on the message middleware further includes a bus 930 connecting different system components (including a storage unit 920 and a processing unit 910), a display unit 940, and the like.

[0163] The storage unit 920 stores a computer-readable program, which may be a source program or a code of a read-only program. The program may be executed by the processing unit 910, so that the processing unit 910 performs the steps of various embodiments of the present invention. For example, the processing unit 910 may perform the following steps: Figure 3 Steps shown.

[0164] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 9201 and / or a cache storage unit 9202, and may further include a read-only storage unit (ROM) 9203. The storage unit 920 may also include a program / utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include the implementation of a network environment.

[0165] Bus 930 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0166] The data processing system 900 based on the message middleware can also communicate with one or more external devices 970 (such as keyboards, displays, network devices, Bluetooth devices, etc.), so that users can interact with the processing unit 910 through these external devices 970 through the input / output (I / O) interface 950, and can also communicate with one or more networks (such as local area networks (LANs), wide area networks (WANs) and / or public networks, such as the Internet) through network adapters 960. The network adapter 960 can communicate with other modules of the data processing system 900 based on the message middleware through the bus 930. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in the data processing system 900 based on the message middleware, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0167] Fig.10 Schematic diagram of a computer readable medium embodiment of the present invention. Fig.10As shown, the computer program can be stored on one or more computer-readable media. The computer-readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory unit (RAM), a read-only memory unit (ROM), an erasable programmable read-only memory unit (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory unit (CD-ROM), an optical storage unit, a magnetic storage unit, or any suitable combination of the above. When the computer program is executed by one or more data processing devices, the computer-readable medium is enabled to implement the above method of the present invention, namely:

[0168] S301, one or more first servers send a registration request to a second server, the second server returns registration success information to the first server according to the registration request, and sends the registration success information to the message middleware server;

[0169] S302, the client sends a service request to the message middleware server;

[0170] S303: The message middleware server allocates a first server to the client according to the service request and the registration success information, and forwards the service request to the allocated first server.

[0171] Through the description of the above implementation modes, it is easy for those skilled in the art to understand that the exemplary embodiments described in the present invention can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation mode of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a data processing device (which can be a personal computer, a server, or a network device, etc.) to perform the above method according to the present invention.

[0172] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0173] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0174] In summary, the present invention can be implemented by a method, apparatus, electronic device or computer readable medium that executes a computer program. In practice, a general data processing device such as a microprocessor unit or a digital signal processing unit (DSP) can be used to implement some or all functions of the present invention.

[0175] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the present invention is not inherently related to any specific computer, virtual device or electronic device, and various general devices can also implement the present invention. The above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A data processing method based on message middleware, characterized in that: Methods include: Set up a second server, including an IP pool, a port number pool, and a service ID pool; One or more first servers send a registration request containing the service type of the first server to a second server, and the second server allocates an IP address and a port number to the first server according to the registration request and allocates a service ID according to the registration order of the first server, wherein when the allocated first server goes offline, the service ID is recycled and put back into the service ID pool so that when a new first server goes online, the service ID is allocated to a new first server; After the first server successfully registers, the second server returns registration success information to the first server according to the registration request, and sends the registration success information to the message middleware server. After receiving the registration success information, the first server determines that the registration is successful, wherein the IP address, port number, service ID corresponding to the service type of the first server, and carrying capacity assigned to the first server are uploaded to the message middleware server; The client sends a service request to the message middleware server, wherein the service request includes a service type, a client IP address, and a client ID of the service request, so that when the corresponding first server processes the service request sent by the client, a service result message is returned through the client IP address and the client ID; The message middleware server allocates the first server to the client according to the service request and its corresponding service type, and the registration success information, and forwards the service request to the allocated first server, specifically including: the message middleware server receives the service request sent by the client and obtains the service type of the service request contained in the service request, determines the corresponding service ID according to the correspondence between the service type and the service ID, allocates the first server to the service request according to the corresponding service ID, and pushes the service request to the allocated first server after load balancing processing according to the carrying capacity and load condition of the first server; each time a service request is allocated to the first server, the number of loaded service requests is increased by 1, and each time the first server returns a service result message, the number of loaded service requests is reduced by 1.

2. The data processing method according to claim 1, characterized in that: The registration request includes the service type of the first server.

3. The method according to claim 1 or 2, characterized in that Allocating the service ID according to the registration order of the first server specifically includes: The second server allocates a service ID to the first server according to the service type of the first server included in the registration request and in accordance with the registration order of the first server.

4. The method according to claim 1, characterized in that The message middleware server includes the Kafka server.

5. The method according to claim 1, characterized in that Also includes: The message middleware server stores the IP address, port number, service ID, carrying capacity and the corresponding relationship between the service type and service ID of each first server.

6. The method according to claim 1, characterized in that Allocating a first server to the service request according to the service ID and pushing the service request to the allocated first server further comprises: The registration request sent by the first server to the second server includes the carrying capacity of the first server; The second server uploads the carrying capacity of the first server to the message middleware server; The message middleware server performs load balancing processing according to the bearing capacity and load condition of the first server, and pushes the service request.

7. A data processing device based on message middleware, characterized in that: The device includes: The registration upload module is used to set up the second server, including an IP pool, a port number pool, and a service ID pool; One or more first servers send a registration request containing the service type of the first server to a second server, and the second server allocates an IP address and a port number to the first server according to the registration request, and allocates a service ID according to the registration order of the first server, wherein the service ID is recovered when the allocated first server goes offline and is put back into the service ID pool so that the service ID can be allocated to a new first server when a new first server goes online; after the first server is successfully registered, the second server returns a registration success message to the first server according to the registration request, and sends the registration success message to the message middleware server, and the first server determines that the registration is successful after receiving the registration success message, wherein the IP address, port number, service ID corresponding to the service type of the first server, and carrying capacity allocated to the first server are uploaded to the message middleware server; A service request sending module, used for the client to send a service request to the message middleware server, wherein the service request includes the service type of the service request, the client IP address and the client ID, so that when the corresponding first server processes the service request sent by the client, it returns a service result message through the client IP address and the client ID; A service request push module, used for the message middleware server to allocate a first server to the client according to the service request and its corresponding service type, and the registration success information, and forward the service request to the allocated first server, specifically including: the message middleware server receives the service request sent by the client and obtains the service type of the service request contained in the service request, determines the corresponding service ID according to the correspondence between the service type and the service ID, allocates the first server to the service request according to the corresponding service ID, and pushes the service request to the allocated first server after load balancing processing according to the carrying capacity and load condition of the first server; wherein, each time a service request is allocated to the first server, the number of service requests that have been loaded is increased by 1, and each time the first server returns a service result message, the number of service requests that have been loaded is reduced by 1.

8. A data processing system based on message middleware, characterized in that: include: A storage unit for storing a computer executable program; A processing unit, used to read the computer executable program in the storage unit to execute the data processing method based on the message middleware according to any one of claims 1 to 6.

9. A computer-readable medium for storing a computer-readable program, characterized in that: The computer-readable program is used to execute the data processing method based on message middleware according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Load balance method and device

    CN106101232A

  • Platform management method, system, device and storage medium

    CN111258760A