Message transmission method, apparatus and system, storage medium, electronic device, and product
By obtaining the target instance service node identifier, the problem of message splitting after the robot is disconnected from the server is solved, and the integrity and efficient processing of messages are achieved.
Patent Information
- Application Number
- PCT/CN2025/085133
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-27
- Filing Date
- 2025-03-26
- Publication Date
- 2025-10-02
AI Technical Summary
In the IoT environment, when the gRPC persistent connection between the robot and the server is disconnected, the message information is split across multiple server instances, making it impossible to return complete information at once, reducing the message processing efficiency of the server.
By responding to the robot's message sending request, the identifier of the target instance service node is obtained, and the message is sent to the target node, ensuring that the message is processed on the same server instance node to avoid information fragmentation.
Improves the server's message processing efficiency and ensures message integrity and consistency.
Smart Images

Figure CN2025085133_02102025_PF_FP_ABST
Abstract
Description
Message transmission method, device, system, storage medium, electronic device and product
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This disclosure claims priority to Chinese patent application number 202410363789.0, filed with the China Patent Office on March 27, 2024, entitled “Message Transmission Method, Device, System, Storage Medium and Electronic Device,” the entire contents of which are incorporated by reference into this disclosure. Technical Field
[0003] The present disclosure relates to the field of computer technology, and in particular to a message transmission method, device, system, storage medium, electronic device, and product. Background Art
[0004] Currently, in the IoT environment, the server and client can exchange information by establishing and maintaining a gRPC (Google Remote Procedure Call) persistent connection. Based on the gRPC persistent connection, the communication system can ensure that the server sends tasks to the corresponding client in a timely manner so that the client can receive and respond to the task. Summary of the Invention
[0005] The purpose of the present disclosure is to provide a message transmission method, device, system, storage medium, electronic device and product to solve related technical problems existing in the prior art.
[0006] To achieve the above objective, according to a first aspect of an embodiment of the present disclosure, a message transmission method is provided, the method comprising:
[0007] In response to a message sending request sent by a first target client of the robot, obtaining a target node identifier of a first target instance service node corresponding to the first target client on a server, the server including multiple instance service nodes, with different clients corresponding to different instance service nodes, the message sending request being used to request sending a target message;
[0008] According to the message sending request, the target message is sent to the first target instance service node corresponding to the target node identifier.
[0009] Optionally, obtaining the target node identifier of the first target instance service node corresponding to the first target client on the server side includes:
[0010] When a historical instance service node corresponding to the client identifier is determined according to the robot identifier corresponding to the first target client, the historical instance service node is used as the first target instance service node;
[0011] Obtain a target node identifier of the first target instance service node.
[0012] Optionally, the method further includes:
[0013] If a historical instance service node corresponding to the client identifier of the first target client is not determined according to the client identifier of the first target client, determining the first target instance service node from multiple instance service nodes;
[0014] Obtain a target node identifier of the first target instance service node.
[0015] Optionally, determining the first target instance service node from multiple instance service nodes includes:
[0016] A first target instance service node is determined from the multiple instance service nodes according to the first identifier of the robot corresponding to the first target client and the node queue lengths of the multiple instance service nodes.
[0017] Optionally, determining the first target instance service node from the multiple instance service nodes according to the first identifier of the first target client and the node queue lengths of the multiple instance service nodes includes:
[0018] Performing hash processing on the first identifier of the robot corresponding to the first target client to obtain a first value;
[0019] determining a second value according to node queue lengths of the plurality of instance service nodes;
[0020] Taking the modulus of the first value and the second value to obtain a target index value;
[0021] A first target instance service node is determined from a plurality of instance service nodes according to the target index value.
[0022] Optionally, the method further includes:
[0023] In response to the message reply request of the second target instance service node, obtaining a second target client corresponding to the second target instance service node;
[0024] According to the second target client, the message to be replied by the second target instance service node is sent to the second target client.
[0025] Optionally, obtaining the second target client corresponding to the second target instance service node includes:
[0026] Determining, according to the node identifier of the second target instance service node, a second identifier of the robot corresponding to the second target instance service node;
[0027] Determine, from among the multiple clients of the robot, a client that has transmitted a message most recently as a historical client;
[0028] The historical client is used as the second target client.
[0029] According to a second aspect of an embodiment of the present disclosure, a message transmission device is provided, the device comprising:
[0030] A first acquisition module is configured to, in response to a message sending request sent by a first target client of the robot, obtain a target node identifier of a first target instance service node corresponding to the first target client on a server side, wherein the server side includes multiple instance service nodes, and different clients correspond to different instance service nodes, and the message sending request is used to request sending a target message;
[0031] The first sending module is configured to send the target message to a first target instance service node corresponding to the target node identifier according to the message sending request.
[0032] Optionally, the first acquisition module includes:
[0033] A first determining submodule is configured to, upon determining a historical instance service node corresponding to the client identifier based on the robot identifier corresponding to the first target client, use the historical instance service node as the first target instance service node;
[0034] The first acquisition submodule is configured to acquire a target node identifier of the first target instance service node.
[0035] Optionally, the first acquisition module further includes:
[0036] a second determining submodule, configured to determine the first target instance service node from a plurality of instance service nodes if a historical instance service node corresponding to the client identifier is not determined according to the client identifier of the first target client;
[0037] The second acquisition submodule is configured to acquire a target node identifier of the first target instance service node.
[0038] Optionally, the second determining submodule is configured to determine a first target instance service node from multiple instance service nodes according to a first identifier of the robot corresponding to the first target client and node queue lengths of the multiple instance service nodes.
[0039] Optionally, the second determination submodule is used to hash the first identifier of the robot corresponding to the first target client to obtain a first value; determine the second value based on the node queue length of multiple instance service nodes; take the modulus of the first value and the second value to obtain a target index value; and determine the first target instance service node from multiple instance service nodes based on the target index value.
[0040] Optionally, the device further comprises:
[0041] A second acquisition module is configured to acquire a second target client corresponding to the second target instance service node in response to a message reply request from the second target instance service node;
[0042] The second sending module is configured to send the message to be replied by the second target instance service node to the second target client according to the second target client.
[0043] Optionally, the second acquisition module includes:
[0044] A third determining submodule, configured to determine a second identifier of a robot corresponding to the second target instance service node according to the node identifier of the second target instance service node;
[0045] a fourth determining submodule, configured to determine, from among the multiple clients of the robot, a client that has transmitted a message most recently as a historical client;
[0046] The fifth determining submodule is configured to use the historical client as the second target client.
[0047] According to a third aspect of an embodiment of the present disclosure, a message transmission system is provided, comprising a server, a service registration center, a cache center, and a client, wherein the server is connected to a plurality of clients via the service registration center, and the server is connected to a plurality of clients via the cache center, and the server comprises a plurality of instance service nodes, wherein different clients correspond to different instance service nodes;
[0048] The service registration center is configured to respond to a message sending request sent by a client of the robot, obtain a node identifier of an instance service node corresponding to the client on the server side; and send a message to the instance service node corresponding to the node identifier according to the message sending request;
[0049] The client is used to request to send a message;
[0050] The instance service node is configured to receive the message sent by the client through the service registration center.
[0051] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the method provided in the first aspect of the present disclosure.
[0052] According to a fifth aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a memory on which a computer program is stored; and a processor for executing the computer program in the memory to implement the steps of the method provided in the first aspect of the present disclosure.
[0053] According to the sixth aspect of an embodiment of the present disclosure, a computer program product is provided, which includes a computer program that can be executed by a programmable device, and the computer program has a code portion for executing the method described in the first aspect of the present disclosure when executed by the programmable device.
[0054] Through the above technical solution, by responding to the message sending request sent by the first target client of the robot, the target node identifier of the first target instance service node corresponding to the first target client on the server side is obtained. The server side includes multiple instance service nodes, and different clients correspond to different instance service nodes. The message sending request is used to request the sending of a target message; according to the message sending request, the target message is sent to the first target instance service node corresponding to the target node identifier. In this way, when the robot client sends a message, it can determine the first target instance service node from the multiple instance service nodes to send the message, and can connect to the server instance node that was connected last time. In this way, multiple messages can be sent to the same server instance node, avoiding the server side from being unable to return complete message information to the client at one time, and can improve the server side's processing efficiency of message information.
[0055] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following detailed description, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings:
[0057] Fig. 1 is a flowchart showing a message transmission method according to an exemplary embodiment.
[0058] Fig. 2 is a flowchart showing a message transmission method according to an exemplary embodiment.
[0059] Fig. 3 is a flowchart showing a message transmission method according to an exemplary embodiment.
[0060] Fig. 4 is a flowchart showing a message transmission method according to an exemplary embodiment.
[0061] Fig. 5 is a block diagram showing a message transmission device according to an exemplary embodiment.
[0062] FIG6 is a block diagram of a first acquisition module according to the embodiment shown in FIG5 .
[0063] FIG. 7 is a block diagram of a first acquisition module according to the embodiment shown in FIG. 5 .
[0064] FIG8 is a block diagram of another message transmission device according to the embodiment shown in FIG5 .
[0065] FIG9 is a block diagram of a second acquisition module according to the embodiment shown in FIG8 .
[0066] Fig. 10 is a schematic diagram showing a message transmission system according to an exemplary embodiment.
[0067] Fig. 11 is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0068] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0069] Before introducing the message transmission method, device, system, storage medium, electronic device and product provided by the present disclosure, the application scenarios involved in each embodiment of the present disclosure are first introduced.
[0070] The disclosed embodiments can be applied to application scenarios of information transmission of robots. At present, in the Internet of Things environment, the server and the client can exchange information by establishing and maintaining a long connection of gRPC (Google Remote Procedure Call); based on the gRPC long connection, the communication system can ensure that the server sends the task to the corresponding client in a timely manner so that the client can receive and respond to the task. Among them, when the client and the server are deployed in multiple instances, the client connects to the server according to the domain name, and usually connects to a certain instance of the server randomly. However, if the client and the server gRPC connection is disconnected after transmitting part of the message, the next time the client connects to the server, it will not be connected to the previous server instance, resulting in the complete message information being split and placed on multiple server instances, causing the server to be unable to return the complete message information to the client at one time, reducing the server's processing efficiency of the message information.
[0071] For example, as a client, the robot can integrate audio stream events, video stream events, CV (Computer Vision) face recognition and other multimodal events, so that the robot has a comprehensive and all-round perception of the current scene's vision, hearing, information about people in the scene, and events occurring in the current scene, and then can send the obtained multimodal event messages to the server.
[0072] Currently, robots and servers typically connect using gRPC persistent connections. However, because Google's gRPC protocol is deployed with multiple instances on both the client and server, when a client establishes a persistent gRPC connection, if it connects to the server using a domain name, it will randomly connect to a server instance. This results in the client and server disconnecting after the gRPC connection is completed and a portion of the message is transmitted. The next time the client connects to the server, it is highly likely that the server will not connect to the previous server instance. This causes the complete message information to be stored on multiple server instances, making it impossible for the server to return the complete message to a fixed client after processing.
[0073] In related technologies, in order to ensure that gRPC connections requested multiple times by the same robot are called to the same server for message fusion, the multimodal messages uploaded by the robot to the server will undergo multiple gRPC connections, which will make message transmission inefficient.
[0074] In order to solve the above problems, the present disclosure provides a message transmission method, device, system, storage medium, electronic device and product. Through the above technical solution, by responding to the message sending request sent by the first target client of the robot, the target node identifier of the first target instance service node corresponding to the first target client on the server side is obtained. The server side includes multiple instance service nodes, and different clients correspond to different instance service nodes. The message sending request is used to request the sending of a target message; according to the message sending request, the target message is sent to the first target instance service node corresponding to the target node identifier. In this way, when the robot client sends a message, it can determine the first target instance service node from the multiple instance service nodes to send the message, and can connect to the server instance node that was connected last time. In this way, multiple messages can be sent to the same server instance node, avoiding the server side from being unable to return complete message information to the client at one time, and can improve the server side's processing efficiency of message information.
[0075] The present disclosure is described below with reference to specific embodiments.
[0076] Fig. 1 is a flow chart of a message transmission method according to an exemplary embodiment. As shown in Fig. 1 , the method can be applied to a robot, and the method can include the following steps.
[0077] In step S101, in response to a message sending request sent by a first target client of the robot, a target node identifier of a first target instance service node corresponding to the first target client on the server side is obtained.
[0078] The server includes multiple instance service nodes, different clients correspond to different instance service nodes, and the message sending request is used to request sending a target message.
[0079] The first target client can be the different ports used by the robot to obtain different types of information. For example, when the robot obtains voice information, the corresponding client can be the voice acquisition port. Correspondingly, when the robot obtains video information, the corresponding client can be the video acquisition port.
[0080] In this step, when the robot obtains the information to be sent, it can determine the message sending request based on the information to be sent. When the message sending request sent by the robot's first target client is detected, the target node identifier of the first target instance service node corresponding to the first target client on the server side can be obtained.
[0081] In step S102, according to the message sending request, the target message is sent to the first target instance service node corresponding to the target node identifier.
[0082] According to the above technical solution, by responding to the message sending request sent by the first target client of the robot, the target node identifier of the first target instance service node corresponding to the first target client on the server side is obtained. The server side includes multiple instance service nodes, and different clients correspond to different instance service nodes. The message sending request is used to request the sending of the target message; according to the message sending request, the target message is sent to the first target instance service node corresponding to the target node identifier. In this way, when the robot client sends a message, it can determine the first target instance service node from the multiple instance service nodes to send the message, and can connect to the server instance node that was connected last time. In this way, multiple messages can be sent to the same server instance node, avoiding the server side from being unable to return complete message information to the client at one time, and can improve the server side's message information processing efficiency.
[0083] In some embodiments, as shown in FIG2 , the target node identifier of the first target instance service node corresponding to the first target client on the server side may be obtained through the following steps.
[0084] In step S1011, when a historical instance service node corresponding to the client identifier is determined according to the robot identifier corresponding to the first target client, the historical instance service node is used as the first target instance service node.
[0085] The robot identifier may be a unique identifier of the robot, which is represented by a key. For example, it may be represented as [key, A], that is, A is used as the unique identifier of the robot.
[0086] In this step, when a message sending request sent by the first target client of the robot is detected, in response to the message sending request, the robot identifier of the robot corresponding to the first target client is first obtained, and then the historical instance service node corresponding to the robot identifier in the historical data is obtained, and the historical instance service node is used as the first target instance service node.
[0087] For example, the robot identifier of the robot can be represented as A. The robot can include multiple clients, such as a voice acquisition client, a video acquisition client, etc. When the voice acquisition client obtains voice information, it can send a message sending request to the server connected to the voice acquisition client through the service registration center. When the service registration center detects the message sending request, it can obtain the robot identifier of the robot to which the voice acquisition client corresponding to the message sending request belongs. When the service registration center obtains the robot identifier A, it can search in the connected cache center to see whether a historical instance service node corresponding to the A robot identifier is stored. Each time the client successfully sends a message to the instance service node of the server, the correspondence between the identifier of the historical instance service node and the robot identifier will be stored in the cache center.
[0088] Secondly, when the cache center finds a historical instance service node storing the identifier of robot A, the historical instance service node can be used as the first target instance service node.
[0089] In step S1012, the target node identifier of the first target instance service node is obtained.
[0090] By adopting the above technical solution, when the robot's client sends a message, it can connect to the server instance node that was connected last time based on the historical instance service node. In this way, messages sent multiple times can be sent to the same server instance node, avoiding the server from being unable to return complete message information to the client at one time, and improving the server's efficiency in processing message information.
[0091] In some embodiments, as shown in FIG3 , the target node identifier of the first target instance service node corresponding to the first target client on the server side may also be obtained through the following steps.
[0092] In step S1013 , when the historical instance service node corresponding to the client identifier of the first target client is not determined according to the client identifier of the first target client, the first target instance service node is determined from multiple instance service nodes.
[0093] In this step, when a message sending request sent by the first target client of the robot is detected, in response to the message sending request, the robot identifier of the robot corresponding to the first target client is first obtained, and then the historical instance service node corresponding to the robot identifier in the historical data is obtained. If the historical instance service node is not obtained, the first target instance service node can be determined from multiple instance service nodes.
[0094] For example, the robot identifier of the robot can be represented as A. The robot can include multiple clients, such as a voice acquisition client, a video acquisition client, etc. When the voice acquisition client obtains voice information, it can send a message sending request to the server connected to the voice acquisition client through the service registration center. When the service registration center detects the message sending request, it can obtain the robot identifier of the robot to which the voice acquisition client corresponding to the message sending request belongs. When the service registration center obtains the robot identifier as A, it can search in the connected cache center to see whether a historical instance service node corresponding to the A robot identifier is stored. When the historical instance service node corresponding to the A robot identifier is not found in the cache center, the first target instance service node can be determined from multiple instance service nodes.
[0095] In some embodiments, the first target instance service node may be determined from the multiple instance service nodes according to the first identifier of the robot corresponding to the first target client and the node queue lengths of the multiple instance service nodes.
[0096] Optionally, the first identifier of the robot corresponding to the first target client can be hashed to obtain a first value; then the second value can be determined based on the node queue length of multiple instance service nodes; the first value and the second value are modulo each other to obtain a target index value; then, based on the target index value, the first target instance service node can be determined from multiple instance service nodes.
[0097] For example, each time the robot obtains a message and needs to call and pass it to the server, it can first determine whether the historical instance service node to be accessed, stored with the robot identifier, already exists in the redis cache center. If not, it obtains the queues of multiple instance service nodes from the registration center and sorts the queues. The robot identifier can then be hashed to obtain a first value, and the node queue lengths of the multiple instance service nodes are used as the second value. The first value and the second value are then modulo-operated to obtain a random number that is smaller than the node queue lengths of the multiple instance service nodes. This random number can then be used as the subscript index of the queues of the multiple instance service nodes to obtain the corresponding first target instance service node, and the IP:port address of the above-mentioned first target instance service node is stored in the redis cache center, where the key is the robot identifier and the value is the IP:port address of this node. In other words, the cache center can store information of [key, IP:port].
[0098] In step S1014, the target node identifier of the first target instance service node is obtained.
[0099] By adopting the above technical solution, when the robot's client sends a message, if the server instance node connected last time is not found, the non-repeated first target instance service node can be determined from multiple instance service nodes each time. In this way, the robot's corresponding client only establishes a link with one instance service node each time it sends a message, saving resources.
[0100] In some embodiments, as shown in FIG4 , after sending the target message to the first target instance service node corresponding to the target node identifier according to the message sending request, the method further includes the following steps.
[0101] In step S103, in response to the message reply request of the second target instance service node, a second target client corresponding to the second target instance service node is obtained.
[0102] In this step, when the second target instance service node replies to the robot client, the second target client corresponding to the second target instance service node can be obtained first.
[0103] Optionally, the second identifier of the robot corresponding to the second target instance service node can be first determined based on the node identifier of the second target instance service node; then the client that last transmitted a message can be determined as the historical client from multiple clients of the robot; and then the historical client can be used as the second target client.
[0104] In step S104, according to the second target client, the message to be replied by the second target instance service node is sent to the second target client.
[0105] Considering that the multimodal messages transmitted by different clients of the robot are different, which may include information such as the movements, gestures, clothing, appearance, expressions and language text of the person talking to the robot, and the text and multimodal messages uploaded by the robot are called from different instance service nodes, the server always retains the connection of the client with the latest language text. By adopting the above technical solution, it can be achieved that every time the server returns to the client, it returns to the client corresponding to the latest language text, thus ensuring the availability and correctness of the program.
[0106] FIG5 is a block diagram of a message transmission device according to an exemplary embodiment. As shown in FIG5 , the device 200 includes:
[0107] A first acquisition module 201 is configured to, in response to a message sending request sent by a first target client of the robot, obtain a target node identifier of a first target instance service node corresponding to the first target client on a server side. The server side includes multiple instance service nodes, and different clients correspond to different instance service nodes. The message sending request is used to request sending a target message.
[0108] The first sending module 202 is configured to send the target message to the first target instance service node corresponding to the target node identifier according to the message sending request.
[0109] FIG6 is a block diagram of a first acquisition module according to the embodiment shown in FIG5 . As shown in FIG6 , the first acquisition module 201 includes:
[0110] A first determining submodule 2011 is configured to, when a historical instance service node corresponding to the client identifier is determined based on the robot identifier corresponding to the first target client, use the historical instance service node as the first target instance service node;
[0111] The first acquisition submodule 2012 is configured to acquire the target node identifier of the first target instance service node.
[0112] FIG7 is a block diagram of a first acquisition module according to the embodiment shown in FIG5 . As shown in FIG7 , the first acquisition module 201 further includes:
[0113] The second determining submodule 2013 is configured to determine the first target instance service node from multiple instance service nodes if the historical instance service node corresponding to the client identifier is not determined according to the client identifier of the first target client;
[0114] The second acquisition submodule 2014 is configured to acquire the target node identifier of the first target instance service node.
[0115] Optionally, the second determining submodule 2013 is configured to determine a first target instance service node from the multiple instance service nodes according to the first identifier of the robot corresponding to the first target client and the node queue lengths of the multiple instance service nodes.
[0116] Optionally, the second determination submodule 2013 is used to hash the first identifier of the robot corresponding to the first target client to obtain a first value; determine the second value based on the node queue length of multiple instance service nodes; take the modulus of the first value and the second value to obtain a target index value; and determine the first target instance service node from multiple instance service nodes based on the target index value.
[0117] FIG8 is a block diagram of another message transmission device according to the embodiment shown in FIG5 . As shown in FIG8 , the device 200 further includes:
[0118] A second acquisition module 203 is configured to respond to a message reply request from the second target instance service node and acquire a second target client corresponding to the second target instance service node;
[0119] The second sending module 204 is configured to send the message to be replied by the second target instance service node to the second target client according to the second target client.
[0120] FIG9 is a block diagram of a second acquisition module according to the embodiment shown in FIG8 . As shown in FIG9 , the second acquisition module 203 includes:
[0121] The third determining submodule 2031 is configured to determine, according to the node identifier of the second target instance service node, a second identifier of the robot corresponding to the second target instance service node;
[0122] The fourth determining submodule 2032 is configured to determine, from among the multiple clients of the robot, the client that has transmitted a message most recently as a historical client;
[0123] The fifth determining submodule 2033 is configured to use the historical client as the second target client.
[0124] By adopting the above-mentioned device, when the robot client sends a message, it can determine the first target instance service node from multiple instance service nodes to send the message, and can connect to the server instance node connected last time. In this way, multiple messages can be sent to the same server instance node, avoiding the server from being unable to return complete message information to the client at one time, and can improve the server's processing efficiency of message information.
[0125] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0126] Figure 10 is a schematic diagram of a message transmission system according to an exemplary embodiment. As shown in Figure 10, the system includes a server 1001, a service registration center 1002, a cache center 1003, and a client 1004. The server 1001 is connected to multiple clients 1004 through the service registration center 1002, and the server 1001 is connected to multiple clients 1004 through the cache center 1003. The server 1001 includes multiple instance service nodes, and different clients 1004 correspond to different instance service nodes.
[0127] The service registration center 1002 is configured to respond to a message sending request sent by the robot client 1004, obtain the node identifier of the instance service node corresponding to the client 1004 on the server 1001; and send a message to the instance service node corresponding to the node identifier according to the message sending request;
[0128] The client 1004 is shown, for requesting to send a message;
[0129] The instance service node is used to receive the message sent by the client 1004 through the service registration center.
[0130] FIG11 is a block diagram of an electronic device 1100 according to an exemplary embodiment. As shown in FIG11 , the electronic device 1100 may include a processor 1101 and a memory 1102. The electronic device 1100 may also include one or more of a multimedia component 1103, an input / output (I / O) interface 1104, and a communication component 1105.
[0131] The processor 1101 is used to control the overall operation of the electronic device 1100 to complete all or part of the steps in the above-mentioned message transmission method. The memory 1102 is used to store various types of data to support the operation of the electronic device 1100. Such data may include, for example, instructions for any application or method operating on the electronic device 1100, as well as application-related data, such as contact information, sent and received messages, pictures, audio, video, etc. The memory 1102 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 1103 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 1102 or transmitted via the communication component 1105. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 1104 provides an interface between the processor 1101 and other interface modules, which may be a keyboard, a mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 1105 is used for wired or wireless communication between the electronic device 1100 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more thereof, is not limited here. Therefore, the corresponding communication component 1105 may include: a Wi-Fi module, a Bluetooth module, an NFC module, etc.
[0132] In an exemplary embodiment, the electronic device 1100 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the above-mentioned message transmission method.
[0133] In another exemplary embodiment, a computer-readable storage medium including program instructions is further provided. When the program instructions are executed by a processor, the steps of the above-described message transmission method are implemented. For example, the computer-readable storage medium may be the aforementioned memory 1102 including the program instructions. The program instructions may be executed by the processor 1101 of the electronic device 1100 to implement the above-described message transmission method.
[0134] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program that can be executed by a programmable device, and the computer program has a code portion for executing the above-mentioned message transmission method when executed by the programmable device.
[0135] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings. However, the present disclosure is not limited to the specific details of the above embodiments. Within the technical concept of the present disclosure, various simple modifications can be made to the technical solutions of the present disclosure, and these simple modifications all fall within the scope of protection of the present disclosure.
[0136] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any appropriate manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.
[0137] In addition, the various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. A message transmission method, characterized in that: The method comprises: In response to a message sending request sent by a first target client of the robot, obtaining a target node identifier of a first target instance service node corresponding to the first target client on a server, the server including multiple instance service nodes, with different clients corresponding to different instance service nodes, the message sending request being used to request sending a target message; According to the message sending request, the target message is sent to the first target instance service node corresponding to the target node identifier.
2. The message transmission method according to claim 1, wherein: The step of obtaining the target node identifier of the first target instance service node corresponding to the first target client on the server side includes: When a historical instance service node corresponding to the client identifier is determined according to the robot identifier corresponding to the first target client, the historical instance service node is used as the first target instance service node; Obtain a target node identifier of the first target instance service node.
3. The message transmission method according to claim 2, wherein: The method further comprises: If a historical instance service node corresponding to the client identifier of the first target client is not determined according to the client identifier of the first target client, determining the first target instance service node from multiple instance service nodes; Obtain a target node identifier of the first target instance service node.
4. The message transmission method according to claim 3, wherein: The determining the first target instance service node from a plurality of instance service nodes includes: A first target instance service node is determined from the multiple instance service nodes according to the first identifier of the robot corresponding to the first target client and the node queue lengths of the multiple instance service nodes.
5. The message transmission method according to claim 4, characterized in that: The determining, according to the first identifier of the first target client and the node queue lengths of the multiple instance service nodes, a first target instance service node from the multiple instance service nodes includes: Performing hash processing on the first identifier of the robot corresponding to the first target client to obtain a first value; determining a second value according to node queue lengths of the plurality of instance service nodes; Taking the modulus of the first value and the second value to obtain a target index value; A first target instance service node is determined from a plurality of instance service nodes according to the target index value.
6. The message transmission method according to any one of claims 1 to 5, characterized in that: The method further comprises: In response to the message reply request of the second target instance service node, obtaining a second target client corresponding to the second target instance service node; According to the second target client, the message to be replied by the second target instance service node is sent to the second target client.
7. The message transmission method according to claim 6, characterized in that: The acquiring the second target client corresponding to the second target instance service node includes: Determining, according to the node identifier of the second target instance service node, a second identifier of the robot corresponding to the second target instance service node; Determine, from among the multiple clients of the robot, a client that has transmitted a message most recently as a historical client; The historical client is used as the second target client.
8. A message transmission device, characterized in that: The device comprises: A first acquisition module is configured to, in response to a message sending request sent by a first target client of the robot, obtain a target node identifier of a first target instance service node corresponding to the first target client on a server side, wherein the server side includes multiple instance service nodes, and different clients correspond to different instance service nodes, and the message sending request is used to request sending a target message; The first sending module is configured to send the target message to a first target instance service node corresponding to the target node identifier according to the message sending request.
9. A message transmission system, characterized in that: The system includes a server, a service registration center, a cache center, and a client. The server is connected to multiple clients via the service registration center, and the server is connected to multiple clients via the cache center. The server includes multiple instance service nodes, and different clients correspond to different instance service nodes. The service registration center is configured to respond to a message sending request sent by a client of the robot, obtain a node identifier of an instance service node corresponding to the client on the server side; and send a message to the instance service node corresponding to the node identifier according to the message sending request; The client is used to request to send a message; The instance service node is configured to receive the message sent by the client through the service registration center.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 7.
12. A computer program product comprising a computer program executable by a programmable device, the computer program having code portions for performing the method according to any one of claims 1 to 7 when executed by the programmable device.
Citation Information
Patent Citations
Routing method and device of service request, computer equipment and storage medium
CN108134828A
Data transmission method and device, related equipment and storage medium
CN115701076A
Service message transmission method and device, computer equipment and readable storage medium
CN116962486A
Message transmission method, device and system, storage medium and electronic equipment
CN118301147A
Conference message pushing method, conference server, and electronic device
WO2023045363A1