Communication method and electronic device

CN122933358APending Publication Date: 2026-10-16DAWNING INFORMATION IND (BEIJING) CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611146255.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

而在相关方案中,通信消息的格式在定义后难以随业务需求灵活变动,导致消息格式中积累大量无效字段

Benefits of technology

[0008] According to embodiments of this disclosure, by querying a preset negotiation result table before sending a message, the negotiation results can be reused, avoiding repeated negotiation of the same message type, reducing the number of interactions in the communication process, and thus improving the overall efficiency of data synchronization between nodes in the storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122933358A_ABST
    Figure CN122933358A_ABST
Patent Text Reader

Abstract

The present disclosure provides a communication method and an electronic device, which are applied to the technical field of data communication. The communication method comprises the following steps: sending a negotiation request to a to-be-communicated node, wherein the negotiation request comprises a to-be-sent message, a message type identifier of the to-be-sent message, and a plurality of candidate version information supported by a target communication node for the message type identifier, each candidate version information corresponding to a different message format; receiving target version information corresponding to the message type identifier returned by the to-be-communicated node, wherein the target version information is determined by the to-be-communicated node from the plurality of candidate version information; reconstructing the to-be-sent message according to the message format corresponding to the target version information, and sending the reconstructed to-be-sent message to the to-be-communicated node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data communication technology, and in particular to a communication method and electronic device. Background Technology

[0002] In storage systems, different nodes need to transmit various types of communication messages. However, in related solutions, the format of communication messages, once defined, is difficult to change flexibly according to business needs, resulting in a large accumulation of invalid fields in the message format. Alternatively, additional format description information needs to be carried in each message, thus increasing communication overhead.

[0003] Therefore, the communication methods in the relevant schemes all limit the efficiency of data communication to varying degrees. Summary of the Invention

[0004] In view of this, the present disclosure provides a communication method and an electronic device.

[0005] According to a first aspect of this disclosure, a communication method is provided, applied to a target communication node in a storage system. The method includes: sending a negotiation request to a node to be communicated, the negotiation request including a message to be sent, a message type identifier of the message to be sent, and multiple candidate version information supported by the target communication node for the message type identifier, each candidate version information corresponding to a different message format; receiving target version information corresponding to the message type identifier returned by the node to be communicated, the target version information being determined by the node to be communicated from the multiple candidate version information; reconstructing the message to be sent according to the message format corresponding to the target version information, and sending the reconstructed message to be sent to the node to be communicated.

[0006] According to embodiments of this disclosure, the target communication node sends a negotiation request carrying multiple candidate version information to the node to be communicated, enabling the node to select the target version information supported by both parties and return it. The target communication node then reconstructs the message to be sent according to the corresponding message format and sends it. This achieves flexible adaptation of message format and avoids carrying format description information in each business message, thereby reducing communication overhead and improving the data interaction efficiency between storage system nodes.

[0007] According to embodiments of this disclosure, before sending a negotiation request to the node to be communicated, the method further includes: querying a preset negotiation result table for target version information corresponding to the message type identifier of the message to be sent; the preset negotiation result table is used to record the correspondence between the negotiated message type identifier and the version information; if the target version information is found, reconstructing the message to be sent according to the message format corresponding to the target version information, and sending the reconstructed message to be sent to the node to be communicated; if the target version information is not found, sending a negotiation request to the node to be communicated.

[0008] According to embodiments of this disclosure, by querying a preset negotiation result table before sending a message, the negotiation results can be reused, avoiding repeated negotiation of the same message type, reducing the number of interactions in the communication process, and thus improving the overall efficiency of data synchronization between nodes in the storage system.

[0009] According to embodiments of this disclosure, after receiving the target version information corresponding to the message type identifier returned by the node to be communicated, the method further includes: recording the correspondence between the message type identifier and the target version information in a preset negotiation result table.

[0010] According to embodiments of this disclosure, by recording the negotiation results in a preset negotiation result table, persistent storage and fast retrieval of the negotiation results are achieved, enabling the negotiation results to be reused in subsequent communications and further reducing negotiation overhead.

[0011] According to embodiments of this disclosure, reconstructing a message to be sent according to a message format corresponding to a target version information includes: obtaining a target message format corresponding to the target version information from a preset version list, wherein the preset version list is used to store the correspondence between version information and message format; and reorganizing the data of the message to be sent into a reconstructed message to be sent according to the target message format.

[0012] According to embodiments of this disclosure, a preset version list stores the correspondence between version information and message format, enabling the target communication node to quickly query and apply the corresponding message format after obtaining the target version information, thereby achieving flexible and efficient message reconstruction based on the negotiation result.

[0013] The second aspect of this disclosure provides another communication method applied to a node to be communicated in a storage system. The method includes: receiving a negotiation request sent by a target communication node, the negotiation request carrying a message type identifier and multiple candidate version information supported by the target communication node for the message type identifier, each candidate version information corresponding to a different message format; determining the target version information corresponding to the message type identifier from the multiple candidate version information; sending the target version information to the target communication node so that the target communication node reconstructs the message to be sent according to the message format corresponding to the target version information; and receiving the reconstructed message to be sent sent by the target communication node.

[0014] According to embodiments of this disclosure, after the pending communication node receives a negotiation request carrying multiple candidate version information sent by the target communication node, it selects the target version information that both parties support based on its own locally supported version information and returns it to the target communication node. This enables the target communication node to reconstruct the message to be sent according to the corresponding message format and send it. The pending communication node then receives the reconstructed message, thereby completing the correct reception of the message without parsing the format description information, reducing the processing overhead of the receiving end, and improving the communication efficiency between storage system nodes.

[0015] According to embodiments of this disclosure, before determining the target version information corresponding to the message type identifier from multiple candidate version information, the method includes: querying the target version information corresponding to the message type identifier from a preset negotiation result table, wherein the preset negotiation result table is used to record the correspondence between the negotiated message type identifier and the version information; if the target version information is found, sending the target version information to the target communication node; if the target version information is not found, determining the target version information corresponding to the message type identifier from multiple candidate version information.

[0016] According to embodiments of this disclosure, by setting a preset negotiation result table on the side of the node to be communicated, the negotiation result can be reused, avoiding repeated negotiation between the same node to be communicated and different target communication nodes for the same message type, and further improving the efficiency of inter-node communication in the storage system.

[0017] According to embodiments of this disclosure, determining the target version information corresponding to the message type identifier from multiple candidate version information includes: obtaining the version information supported by the node to be communicated for the message type identifier; matching the version information supported by the node to be communicated with multiple candidate version information, and using the successfully matched candidate version information as the target version information.

[0018] According to embodiments of this disclosure, the local supported version information of the node to be communicated is matched with multiple candidate version information provided by the target communication node to ensure that the determined target version information is version information supported by both communicating parties, thereby avoiding communication failure due to version mismatch.

[0019] According to embodiments of this disclosure, matching the version information supported by the node to be communicated with multiple candidate version information, and using the successfully matched candidate version information as the target version information includes: filtering out version information that is the same as the version information supported by the node to be communicated from multiple candidate version information, as a set of commonly supported version information; and determining the target version information from the set of commonly supported version information.

[0020] According to embodiments of this disclosure, by filtering out a set of commonly supported version information and selecting the version information with the largest version number from the set as the target version information, it is ensured that the finally determined target version information is the latest version jointly supported by both communicating parties, which not only guarantees compatibility but also enables the optimization of the latest version format.

[0021] A third aspect of this disclosure provides an electronic device, a memory configured to store a message to be sent and a message type identifier of the message to be sent; and a processor connected to the memory, the processor being configured to: acquire the message to be sent and send a negotiation request to a node to be communicated with, the negotiation request carrying the message type identifier of the message to be sent and multiple candidate version information supported by the target communication node for the message type identifier, each candidate version information corresponding to a different message format; receive target version information corresponding to the message type identifier returned by the node to be communicated, the target version information being determined by the node to be communicated from the multiple candidate version information; reconstruct the message to be sent according to the message format corresponding to the target version information, and send the reconstructed message to be sent to the node to be communicated.

[0022] A fourth aspect of this disclosure provides another electronic device, a memory configured to store a negotiation request; and a processor connected to the memory, the processor being configured to: receive a negotiation request sent by a target communication node, the negotiation request carrying a message type identifier and multiple candidate version information supported by the target communication node for the message type identifier, each candidate version information corresponding to a different message format; determine, from the multiple candidate version information, target version information corresponding to the message type identifier; send the target version information to the target communication node so that the target communication node reconstructs the message to be sent according to the message format corresponding to the target version information; and receive the reconstructed message to be sent sent by the target communication node.

[0023] A fifth aspect of this disclosure provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to implement the methods described above.

[0024] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0025] The above and other objects, features and advantages of this disclosure will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0026] Figure 1 This diagram schematically illustrates an application scenario of the communication method according to an embodiment of the present disclosure.

[0027] Figure 2 A flowchart illustrating a communication method according to an embodiment of the present disclosure is shown schematically;

[0028] Figure 3 The diagram illustrates the negotiation and communication between nodes in a communication method according to an embodiment of the present disclosure;

[0029] Figure 4 A flowchart illustrating another communication method according to an embodiment of the present disclosure is shown schematically;

[0030] Figure 5 A schematic diagram illustrating a complete flow chart of a communication method according to embodiments of the present disclosure is shown.

[0031] Figure 6 This is a structural block diagram of a communication device according to an embodiment of this application;

[0032] Figure 7 This is a structural block diagram of another communication device according to an embodiment of this application. Detailed Implementation

[0033] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely examples and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.

[0034] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0035] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0036] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0037] Before introducing the technical solutions provided in the embodiments of this disclosure, the relevant technologies involved in this disclosure will be explained first.

[0038] In related technologies, taking storage systems as an example, existing communication solutions typically employ fixed-format message structures. When message fields need adjustment, the fixed structure makes it difficult to handle newly added or obsolete fields, causing the message body to continuously expand. For simplicity, this will be referred to as a fixed-format solution below.

[0039] Existing storage system communication schemes, such as those using self-describing message formats, where each message carries field description information, allow for flexible message format adjustments. However, this scheme requires additional format description information in each message, further increasing communication overhead and reducing the data interaction efficiency of the storage system.

[0040] It is evident that existing storage system communication schemes, whether in fixed or self-describing formats, present a difficult challenge in balancing flexibility and communication efficiency.

[0041] In view of the above, embodiments of this disclosure provide a communication method applied to a storage system. The method includes: sending a negotiation request to a node to be communicated, the negotiation request including a message to be sent, a message type identifier of the message to be sent, and multiple candidate version information supported by the target communication node for the message type identifier, each candidate version information corresponding to a different message format; receiving target version information corresponding to the message type identifier returned by the node to be communicated, the target version information being determined by the node to be communicated from the multiple candidate version information; reconstructing the message to be sent according to the message format corresponding to the target version information, and sending the reconstructed message to be sent to the node to be communicated.

[0042] The embodiments of this disclosure can determine the target version information before communication through a negotiation mechanism, and reconstruct the message to be sent according to the message format corresponding to the target version information. There is no need to carry format description information in each message, thereby significantly reducing communication overhead while ensuring the flexible evolution of message format.

[0043] The electronic devices disclosed herein may include, but are not limited to: storage systems, distributed storage clusters, data center storage nodes, (Redundant Arrays of Independent Disks, RAID) disk arrays, (Artificial Intelligence, AI) artificial intelligence training platform storage nodes, and other enterprise-level storage devices that require communication and interaction between multiple storage nodes.

[0044] The embodiments of this disclosure provide a communication method and an electronic device.

[0045] Figure 1 The diagram illustrates an application scenario of the communication method according to an embodiment of the present disclosure.

[0046] like Figure 1 As shown, the application scenarios according to this embodiment include storage system communication and interaction scenarios, specifically including multiple storage nodes (such as...). Figure 1 The diagram schematically shows the target communication node 101, the node to be communicated 103, and the node to be communicated 104, as well as the network 102 connecting each storage node. The network 102 is the medium for communication between the storage nodes and may include connection types such as wired, wireless communication links, or fiber optic cables.

[0047] It should be noted that the storage node in this disclosure is a broad concept, and its specific implementation can be flexibly varied according to the actual application scenario. Specifically, inter-node communication in the storage system can be communication between nodes within the storage system; it can also be communication between nodes within a centralized storage system; it can also be communication between different processes or different microservices within a node, in which case the process or microservice is equivalent to a communication node; furthermore, it can also be communication between multiple storage systems, in which case each storage system as a whole is equivalent to a communication node. All of the above implementation forms fall within the protection scope of this disclosure.

[0048] In this application scenario, any storage node in the storage system can serve as a target communication node, and any storage node can also serve as a node to be communicated with. When a storage node needs to send a message to another storage node, the sending node is the target communication node, and the receiving node is the node to be communicated with. Furthermore, the role of the same storage node can be interchanged in different communication scenarios—a storage node that acts as a target communication node (sender) in one communication process can act as a node to be communicated with (receiver) in another communication process, and vice versa.

[0049] For example, target communication node 101 acquires a message to be sent and sends a negotiation request to node 103 to be communicated with. This negotiation request includes a message type identifier for the message to be sent and multiple candidate version information supported by target communication node 101 for the message type identifier, each candidate version information corresponding to a different message format. After receiving the negotiation request, node 103 to be communicated determines the target version information corresponding to the message type identifier from the multiple candidate version information and returns the target version information to target communication node 101. Target communication node 101 receives the target version information, reconstructs the message to be sent according to the message format corresponding to the target version information, and sends the reconstructed message to node 103 to be communicated with.

[0050] Similarly, target communication node 101 can also send negotiation requests to other nodes such as node 104 to conduct independent version negotiations with each node. Each node returns its corresponding target version information. When sending messages to different nodes, target communication node 101 reconstructs the message to be sent according to its respective target version information and sends it. Likewise, when node 103 or 104 needs to send a message to target communication node 101 or other nodes, it can also initiate a negotiation request as the target communication node and execute the same communication process.

[0051] It should be noted that a storage node can be an independently configured storage server, a distributed storage cluster node, a storage node in a cloud storage platform, a storage controller or storage chip integrated within a computing device, or a combination of the above devices. This disclosure does not limit the specific implementation form of the storage node, as long as it can interact with other storage nodes and execute communication methods. A storage node can be a single physical server, a virtual machine or container instance, or a computing cluster composed of multiple physical devices; this disclosure does not limit this.

[0052] The communication method of the present disclosure will be described in detail below.

[0053] Figure 2 A flowchart illustrating a communication method according to an embodiment of the present disclosure is shown schematically.

[0054] like Figure 2 As shown, the communication method of this embodiment is applied to a target communication node in a storage system, and the communication method includes operations S210 to S230.

[0055] In operation S210, a negotiation request is sent to the node to be communicated.

[0056] In this embodiment of the disclosure, the negotiation request includes a message to be sent, a message type identifier for the message to be sent, and multiple candidate version information supported by the target communication node for the message type identifier. Each candidate version information corresponds to a different message format. The target communication node can be a storage node in the storage system that needs to send a message, while the node to be communicated with can be the peer storage node to which the target communication node needs to send a message, i.e., the receiving node.

[0057] The message to be sent is the business data message that the target communication node needs to send to the node to be communicated with, such as a student information synchronization message. The message type identifier is used to distinguish messages of different business types, such as distinguishing between student information synchronization and teacher information synchronization. The multiple candidate version information consists of all versions supported by this message type that are pre-configured locally on the target communication node, with each version corresponding to a different message format.

[0058] In operation S220, the target version information corresponding to the message type identifier is received from the node to be communicated.

[0059] In this embodiment of the disclosure, the target version information is determined by the communication node from multiple candidate version information. Specifically, the target version information can be a version number selected by the communication node from multiple candidate version information, which is used to indicate which message format the target communication node should use when reconstructing the message to be sent, so as to ensure that the sender and receiver have a consistent understanding of the message structure.

[0060] In operation S230, the message to be sent is reconstructed according to the message format corresponding to the target version information, and the reconstructed message to be sent is sent to the node to be communicated.

[0061] In this embodiment, after obtaining the target version information, the target communication node uses the target version information as an index to retrieve the corresponding message format from a local preset version list. This message format defines the order, type, and length of fields in the message body. Following this message format, the target communication node reorganizes the business data in the message to be sent into a message body that conforms to the format requirements, generates the reconstructed message to be sent, and sends it to the communication node.

[0062] In this embodiment of the disclosure, the target communication node sends a negotiation request carrying multiple candidate version information to the node to be communicated, enabling the node to select the target version information that both parties support and return it. The target communication node then reconstructs the message to be sent according to the corresponding message format and sends it. This achieves flexible adaptation of message format and avoids carrying format description information in each business message, thereby reducing communication overhead and improving the data interaction efficiency between storage system nodes.

[0063] In this embodiment of the present disclosure, before the above-described operation S210, the method may further include: querying the target version information corresponding to the message type identifier of the message to be sent from a preset negotiation result table, wherein the preset negotiation result table is used to record the correspondence between the negotiated message type identifier and the version information; if the target version information is found, reconstructing the message to be sent according to the message format corresponding to the target version information, and sending the reconstructed message to be sent to the communication node; if the target version information is not found, sending a negotiation request to the communication node.

[0064] In this embodiment of the disclosure, before sending a message to a node to be communicated with, the target communication node first obtains the stored record corresponding to the message type identifier of the message to be sent in a local preset negotiation result table. The preset negotiation result table is a mapping table maintained locally by the storage node, using the message type identifier as the index key and the corresponding negotiated version information as the index value, and is used to record the version information that has been negotiated and confirmed as valid between the storage node and each node to be communicated with.

[0065] During a query, the target communication node accesses the table using the message type identifier as the query condition. If the query finds a match, it means that the message type has already undergone version negotiation, and the negotiation result is still valid. The target communication node directly reads the target version information recorded in the table, reconstructs the message to be sent according to the message format corresponding to the target version information, and sends it to the communication node without re-executing the negotiation process. If the query fails to find a match, it means that the message type has not been negotiated, or the negotiation record has been cleared. The target communication node then continues to execute the negotiation request sending process.

[0066] For example, when the target communication node sends a student information synchronization message to the node to be communicated for the first time, if there is no record in the local negotiation result table, the negotiation process is triggered. After the negotiation is completed, the target communication node records the correspondence between the "student information" message type and the V2 version information determined by the negotiation in the preset negotiation result table. When the target communication node sends a student information synchronization message to the same node to be communicated again, it queries the preset negotiation result table and finds a V2 record, directly reconstructs the message according to the message format corresponding to V2 and sends it, without the need for renegotiation.

[0067] In this embodiment of the disclosure, by querying a preset negotiation result table before sending a message, the negotiation result is reused, avoiding repeated negotiation of the same message type, reducing the number of interactions in the communication process, and thus improving the overall efficiency of data synchronization between nodes in the storage system.

[0068] In this embodiment of the disclosure, after the above-described operation S220, the following may be further included: recording the correspondence between the message type identifier and the target version information in a preset negotiation result table.

[0069] In this embodiment of the disclosure, after receiving the target version information returned by the communication node to be communicated, the target communication node establishes a correspondence between the message type identifier of the message to be sent and the target version information, and stores it in a local preset negotiation result table. This preset negotiation result table uses the message type identifier as an index and the target version information as an index value to record version information that has been negotiated.

[0070] It should be noted that when sending messages of the same type subsequently, the corresponding target version information can be directly obtained by querying this table without initiating a new negotiation process. Furthermore, when the version information for this message type changes, the corresponding record in this table will be cleared or updated to trigger a renegotiation for that message type.

[0071] In this embodiment of the disclosure, by recording the negotiation results in a preset negotiation result table, persistent storage and fast query of the negotiation results are achieved, enabling the negotiation results to be reused in subsequent communications and further reducing negotiation overhead.

[0072] In this embodiment of the disclosure, if it is determined that the version information supported by the target communication node for the message type identifier has changed, the record corresponding to the message type identifier in the preset negotiation result table is cleared.

[0073] In this embodiment of the disclosure, the version information locally supported by the target communication node is not fixed. When the storage node undergoes software upgrades, configuration updates, or functional expansions, its list of supported versions for specific message types may change. For example, a higher version format definition may be added, or some older versions may be removed due to compatibility adjustments.

[0074] In this situation, the negotiation results stored in the preset negotiation result table for that message type may no longer be applicable. Therefore, when the target communication node detects a change in the version information it supports for a certain message type identifier, it proactively clears the record corresponding to that message type identifier from the preset negotiation result table.

[0075] The clearing operation only affects the negotiation record corresponding to this message type, and does not affect the negotiation records corresponding to other message types in the preset negotiation result table, thus avoiding interference with the communication process of message types that have not changed.

[0076] For example, target communication node A initially supports versions V1 and V2 of message type L1. After negotiating with the target communication node B, the result is recorded as version V1. Subsequently, target communication node A undergoes a software upgrade, adding support for version V3. At this time, target communication node A detects the change in version information for message type L1 and actively clears the negotiation record corresponding to message type L1 from the preset negotiation result table. When target communication node A sends a message of message type L1 to the target communication node B again, the query to the preset negotiation result table does not find a match, triggering a renegotiation process, thus using version V3 for communication.

[0077] In this embodiment of the disclosure, by actively clearing the corresponding negotiation record when the version information changes, the problem of negotiation results becoming invalid due to changes in the version list is avoided, ensuring that both communicating parties always use valid version information supported by each other for communication, thereby improving the system's adaptability.

[0078] In this embodiment of the disclosure, the above-mentioned operation S230, which reconstructs the message to be sent according to the message format corresponding to the target version information, may further include: obtaining the target message format corresponding to the target version information from a preset version list, wherein the preset version list is used to store the correspondence between version information and message format; and reorganizing the data of the message to be sent into the reconstructed message to be sent according to the target message format.

[0079] In this embodiment, a preset version list is stored locally on the target communication node to maintain the mapping relationship between version information and message formats. Each version information uniquely corresponds to a message format, which defines the order, type, and length of fields in the message body. After obtaining the target version information, the target communication node queries the preset version list using the target version information as an index to obtain the corresponding target message format. After obtaining the target message format, the target communication node reorganizes the business data in the message to be sent according to the field layout defined in the target message format, generating a message body that conforms to the format requirements, thus completing the message reconstruction operation.

[0080] For example, target communication node A and target communication node B negotiate and determine the target version information as version V2 for message type L1. Target communication node A queries its local preset version list using version V2 as an index to obtain the message format corresponding to version V2. This format defines the message body to include a student ID field and an age field, with the student ID field located in the first 4 bytes and the age field located in the 5th byte. Target communication node A reorganizes the business data to be sent according to this format, generates the reconstructed message to be sent, and sends it to target communication node B.

[0081] For example, target communication node A and node B can also negotiate and determine the target version information as version V2 for the message type "student information". The message format corresponding to version V2 is defined by structure V2, which contains a student ID field and an age field. The student ID field is an unsigned integer type located in the first 4 bytes, and the age field is an unsigned character type located in the 5th byte. Target communication node A queries its local preset version list using version V2 as an index to obtain the message format corresponding to structure V2, reorganizes the business data to be sent according to this format, generates the reconstructed message to be sent, and sends it to node B.

[0082] Meanwhile, this message type also has a corresponding message format for version V1, defined by structure V1, which includes fields for name, student ID, and age. Version V2 removes the name field compared to version V1, reflecting the evolution of the message format according to business needs. The addition or deletion of fields between different versions is distinguished by version information, and the communicating parties negotiate to determine the version to use, thus enabling the free evolution of the message format while ensuring compatibility.

[0083] In this embodiment of the disclosure, a preset version list is used to store the correspondence between version information and message format, so that the target communication node can quickly query and apply the corresponding message format after obtaining the target version information, thereby realizing flexible and efficient message reconstruction based on the negotiation result.

[0084] Figure 3 The diagram illustrates a negotiation and communication between nodes in a communication method according to an embodiment of the present disclosure.

[0085] like Figure 3 As shown, this communication method is applied to the communication process between the target communication node and the node to be communicated in the storage system. Figure 3 The left side shows the local data structure of the target communication node A, including the list of versions supported by message type L1 and the list of versions supported by message type L2. Figure 3 The right side shows the local data structure of the node B to be communicated, which also includes the list of versions supported by message type L1 and the list of versions supported by message type L2, as well as the negotiation result table of each node.

[0086] Before communication begins, both the target communication node A and the node B to be communicated with have pre-configured version lists for each message type locally. Taking message type L1 as an example, the version list supported by target communication node A includes versions V1 and V2, and the version list supported by node B to be communicated with also includes versions V1 and V2. Taking message type L2 as an example, the version lists supported by target communication node A include versions V1 and V2, and the version list supported by node B to be communicated with also includes versions V1 and V2. Each version information corresponds to a different message format.

[0087] Before sending a message of type L1 to the target communication node B, the target communication node A first queries its local negotiation result table. At this point, the negotiation result table has not yet recorded the negotiation result between the target communication node A and the target communication node B regarding message type L1. Therefore, the target communication node A initiates a negotiation request to the target communication node B. This negotiation request carries the identifier of message type L1 and a list of versions supported by the target communication node A for message type L1.

[0088] After receiving the negotiation request, communication node B matches the list of versions supported by target communication node A with its own list of supported versions to determine the mutually supported version information. Communication node B then selects the target version from the mutually supported version information and returns it to target communication node A. Upon receiving the target version information, target communication node A records the negotiation result in its local negotiation result table, and communication node B also records the negotiation result in its local negotiation result table.

[0089] After recording, target communication node A reconstructs the message to be sent according to the message format corresponding to the target version information, and sends the reconstructed message to the communication node B. For message type L2, target communication node A also queries its local negotiation result table. At this time, the negotiation result table has not yet recorded the negotiation result between target communication node A and the communication node B for message type L2, so target communication node A also initiates a negotiation request.

[0090] After receiving the negotiation request, communication node B matches the list of versions supported by target communication node A with its own list of supported versions to determine the mutually supported version information and select the target version information, then returns the target version information to target communication node A. Upon receiving the target version information, target communication node A records the negotiation result in its local negotiation result table, and target communication node B also records the negotiation result in its local negotiation result table.

[0091] like Figure 3 As shown, after the negotiation is completed, the negotiation result table of the target communication node A records that the negotiation result between node A and node B for message type L1 is version V1, and there is no negotiation result for message type L2; similarly, the negotiation result table of the node to be communicated B records that the negotiation result between node B and node A for message type L1 is version V1, and there is no negotiation result for message type L2.

[0092] When target communication node A sends a message of message type L1 to node B, it queries the negotiation result table to obtain version V1, reconstructs the message to be sent according to the message format corresponding to version V1, and sends it. When target communication node A needs to send a message of message type L2 to node B, since there is no corresponding record in the negotiation result table, the negotiation process is initiated again.

[0093] In this embodiment of the disclosure, a negotiation request is sent to at least one communication node. The negotiation request carries a message type identifier and multiple candidate version information supported by the target communication node for the message type identifier. Each candidate version information corresponds to a different message format. Target version information corresponding to the message type identifier is received from each communication node. Each target version information is determined by the corresponding communication node based on the multiple candidate version information. When a message corresponding to the message type identifier is sent to a target communication node among the at least one communication nodes, a message is constructed according to the message format corresponding to the target version information of the target communication node, and the constructed message is sent to the target communication node.

[0094] In this embodiment of the disclosure, when a target communication node needs to communicate with multiple nodes to be communicated in the storage system, it sends a negotiation request to each node to be communicated. Each negotiation request carries the same message type identifier and multiple candidate version information supported by the target communication node for that message type identifier. After receiving the negotiation request, each node to be communicated independently determines its corresponding target version information from the multiple candidate version information based on its own version information supported for that message type identifier, and returns it to the target communication node.

[0095] After receiving the target version information returned by each pending communication node, the target communication node locally records the target version information corresponding to each pending communication node. When the target communication node needs to send a message corresponding to the message type identifier to one of multiple pending communication nodes, the target communication node constructs the message according to the message format corresponding to the target version information of that target pending communication node, and sends the constructed message to that target pending communication node. When the target communication node sends the same message type to different pending communication nodes, it can use its respective target version information; each target version information is independent and does not affect the others.

[0096] In this embodiment of the disclosure, by independently negotiating versions with each communication node and recording the target version information corresponding to each communication node, the target communication node can flexibly select the corresponding message format according to the version information supported by each communication node when sending the same message type to different communication nodes. This realizes differentiated version management in a one-to-many communication scenario in the storage system and improves the system's compatibility and flexibility.

[0097] Figure 4 A flowchart illustrating a communication method according to an embodiment of the present disclosure is shown schematically.

[0098] like Figure 4As shown, the communication method of this embodiment is applied to a node to be communicated in a storage system, and the communication method includes operations S410 to S440.

[0099] In operation S410, a negotiation request sent by the target communication node is received.

[0100] In this embodiment of the disclosure, the negotiation request carries a message type identifier and multiple candidate version information supported by the target communication node for the message type identifier, and each candidate version information corresponds to a different message format.

[0101] In operation S420, the target version information corresponding to the message type identifier is determined from multiple candidate version information.

[0102] In operation S430, target version information is sent to the target communication node so that the target communication node reconstructs the message to be sent according to the message format corresponding to the target version information.

[0103] In operation S440, the reconstructed message to be sent is received from the target communication node.

[0104] In this embodiment of the disclosure, after the pending communication node receives the negotiation request carrying multiple candidate version information sent by the target communication node, it selects the target version information that both parties support based on its own locally supported version information and returns it to the target communication node. This enables the target communication node to reconstruct the message to be sent according to the corresponding message format and send it. The pending communication node then receives the reconstructed message, thereby completing the correct reception of the message without parsing the format description information, reducing the processing overhead of the receiving end, and improving the communication efficiency between storage system nodes.

[0105] In this embodiment of the disclosure, prior to the above operation S420, the method may further include: querying the target version information corresponding to the message type identifier from a preset negotiation result table, wherein the preset negotiation result table is used to record the correspondence between the negotiated message type identifier and the version information; if the target version information is found, sending the target version information to the target communication node; if the target version information is not found, determining the target version information corresponding to the message type identifier from multiple candidate version information.

[0106] In this embodiment of the disclosure, after receiving a negotiation request from a target communication node, the pending communication node first queries a local preset negotiation result table. This preset negotiation result table records the correspondence between message type identifiers and version information that have been negotiated and determined between the pending communication node and each target communication node. The pending communication node queries this table using the message type identifier carried in the negotiation request as an index.

[0107] If the query finds a match, it means that the message type has already been negotiated, and the negotiation result is still valid. The pending communication node will directly return the target version information corresponding to the message type identifier recorded in the table to the target communication node, without needing to re-execute the negotiation process. If the query fails to find a match, it means that the message type has not been negotiated, or the negotiation record has been cleared. The pending communication node will then execute the process of determining the target version information based on the multiple candidate version information carried in the negotiation request.

[0108] For example, node B, the node to be communicated, has already negotiated with target node A for message type L1, and the negotiation result is version V1, which is recorded in a preset negotiation result table. When target node C sends a negotiation request for message type L1 to node B, node B queries the preset negotiation result table, finds the record for version V1, and directly returns version V1 as the target version information to target node C without re-executing the negotiation process.

[0109] In this embodiment of the disclosure, by setting a preset negotiation result table on the side of the node to be communicated, the negotiation result can be reused, avoiding repeated negotiation between the same node to be communicated and different target communication nodes for the same message type, and further improving the efficiency of inter-node communication in the storage system.

[0110] In this embodiment of the disclosure, the above operation S420 may further include: obtaining version information supported by the node to be communicated for the message type identifier; matching the version information supported by the node to be communicated with multiple candidate version information, and using the successfully matched candidate version information as the target version information.

[0111] In this embodiment of the disclosure, if the node to be communicated does not find the target version information in the preset negotiation result table, it obtains the version information it supports for the message type identifier carried in the negotiation request from its local storage. The node to be communicated then matches the version information it supports locally with multiple candidate version information sent by the target node, finds the version information that both support, and uses the successfully matched candidate version information as the target version information.

[0112] It should be noted that the matching operation can employ various strategies. In one implementation, the node to be communicated compares its locally supported version information with multiple candidate version information one by one, filters out the version information that exists in both, as a set of commonly supported version information, and then determines the target version information from this set.

[0113] In this embodiment of the disclosure, the local supported version information of the node to be communicated is matched with multiple candidate version information provided by the target communication node to ensure that the determined target version information is version information supported by both communicating parties, thereby avoiding communication failure due to version mismatch.

[0114] In this embodiment of the disclosure, matching the version information supported by the node to be communicated with multiple candidate version information, and using the successfully matched candidate version information as the target version information includes: filtering out version information that is the same as the version information supported by the node to be communicated from multiple candidate version information, as a set of commonly supported version information; and determining the target version information from the set of commonly supported version information.

[0115] In this embodiment of the disclosure, when the communicating node matches the version information it supports locally for the message type identifier with the multiple candidate version information sent by the target communicating node, the comparison is performed one by one on a version information basis. For each of the multiple candidate version information, the communicating node checks whether the version information also exists in the version information it supports locally. If it does, the version information is filtered as commonly supported version information. After filtering, all commonly supported version information constitutes a set of commonly supported version information.

[0116] After obtaining a set of mutually supported version information, the node to be communicated selects the version with the largest version number from this set as the target version. Selecting the version with the largest version number means that both communicating parties have chosen the latest version among their respective supported versions for communication, which helps to take advantage of the optimizations brought by the latest version's message format.

[0117] For example, target communication node A sends multiple candidate version information for message type L1, including version V1, version V2, and version V3. Node B, the node to be communicating, locally supports version information for message type L1, including version V1 and version V2. Node B matches the candidate version information with its locally supported version information, selecting versions V1 and V2 as a set of commonly supported version information. Node B then selects the version with the largest version number from the set of commonly supported version information, i.e., version V2, as the target version information.

[0118] In this embodiment of the disclosure, by filtering out a set of commonly supported version information and selecting the version information with the largest version number from the set as the target version information, it is ensured that the final target version information is the latest version jointly supported by both communicating parties, which not only guarantees compatibility but also enables the optimization of the latest version's format.

[0119] Figure 5 A schematic diagram illustrating a complete flow embodiment of a communication method according to an embodiment of the present disclosure is provided.

[0120] like Figure 5 As shown in the diagram, this complete process embodiment illustrates the version negotiation and communication process between multiple storage nodes in the storage system for different message types. Figure 5The diagram schematically illustrates three storage nodes: communication node C, communication node D, and communication node E. Each communication node has a pre-configured version list for each message type locally.

[0121] For message type L1, communication node C supports versions V1 and V2, communication node D supports versions V1 and V2, and communication node E supports versions V1, V2, and V3. Communication nodes C and D have negotiated for message type L1, and the negotiated result is version V1, which is recorded in the negotiation result tables of communication nodes C and D respectively. Similarly, communication nodes C and E have negotiated for message type L1, and the negotiated result is version V1, which is also recorded in the negotiation result tables of communication nodes C and E respectively. Finally, communication nodes D and E have negotiated for message type L1, and the negotiated result is version V1, which is recorded in the negotiation result tables of communication nodes D and E respectively.

[0122] For message type L2, communication node C supports version V1, communication node D supports both version V1 and version V2, and communication node E supports both version V1 and version V2. Communication nodes C and D have completed negotiation for message type L2, with the negotiation result being version V1, and these results are recorded in the negotiation result tables of communication nodes C and D respectively. Communication nodes D and E have also completed negotiation for message type L2, with the negotiation result being version V2, and these results are recorded in the negotiation result tables of communication nodes D and E respectively. Communication nodes C and E have not yet negotiated for message type L2; the records for message type L2 between communication nodes C and E are empty, and the records for message type L2 between communication nodes E and C are also empty.

[0123] When communication node C needs to send a message of message type L2 to communication node E, communication node C queries its local negotiation result table. Since the records for message type L2 between communication node C and communication node E are empty, communication node C initiates a negotiation request to communication node E. Upon receiving the negotiation request, communication node E matches the list of versions supported by communication node C with its own list of supported versions, determines the mutually supported version information, selects the target version information, and returns the target version information to communication node C. After receiving the target version information, communication node C records the negotiation result in its local negotiation result table, and communication node E also records the negotiation result in its local negotiation result table. After the negotiation is complete, communication node C reconstructs the message to be sent according to the message format corresponding to the target version information and sends it to communication node E.

[0124] like Figure 5 As shown, the negotiation results for the same message type between different communication nodes can be different. For example, the negotiation result between communication node D and communication node C for message type L2 is version V1, while the negotiation result between communication node D and communication node E for message type L2 is version V2. This reflects the mechanism in this embodiment of the mechanism that the negotiation results are recorded separately by the communication peer, and the version negotiation between each communication node for the same message type is independent and does not affect each other.

[0125] Based on the above communication method, this application also provides a communication device. The following will be combined with... Figure 6 The device is described in detail.

[0126] Figure 6 This is a structural block diagram of a communication device according to an embodiment of this application.

[0127] like Figure 6 As shown, the communication device 600 in this embodiment includes a negotiation sending module 610, a version receiving module 620, and a message reconstruction module 630.

[0128] The negotiation sending module 610 is used to send a negotiation request to the node to be communicated. The negotiation request includes a message to be sent, a message type identifier of the message to be sent, and multiple candidate version information supported by the target communication node for the message type identifier. Each candidate version information corresponds to a different message format. In one embodiment, the negotiation sending module 610 can be used to perform the operation S210 described above, which will not be repeated here.

[0129] The version receiving module 620 is used to receive target version information corresponding to the message type identifier returned by the node to be communicated. The target version information is determined by the node to be communicated from multiple candidate version information. In one embodiment, the version receiving module 620 can be used to perform the operation S220 described above, which will not be repeated here.

[0130] The message reconstruction module 630 is used to reconstruct the message to be sent according to the message format corresponding to the target version information, and send the reconstructed message to the communication node. The message reconstruction module 630 can be used to perform the operation S230 described above, which will not be repeated here.

[0131] It should be noted that the description of the features in the embodiment corresponding to the communication device can be found in the relevant description of the embodiment corresponding to the communication method, and will not be repeated here.

[0132] Based on the above communication method, this application also provides another communication device. The following will be combined with... Figure 7 The device is described in detail.

[0133] Figure 7 This is a structural block diagram of another communication device according to an embodiment of this application.

[0134] like Figure 7 As shown, the communication device 700 in this embodiment includes a request receiving module 710, a version determination module 720, a version feedback module 730, and a message receiving module 740.

[0135] The request receiving module 710 is used to receive a negotiation request sent by the target communication node. The negotiation request carries a message type identifier and multiple candidate version information supported by the target communication node for the message type identifier. Each candidate version information corresponds to a different message format. In one embodiment, the request receiving module 710 can be used to perform the operation S410 described above, which will not be repeated here.

[0136] The version determination module 720 is used to determine the target version information corresponding to the message type identifier from multiple candidate version information. In one embodiment, the version determination module 720 can be used to perform the operation S420 described above, which will not be repeated here.

[0137] The version feedback module 730 is used to send target version information to the target communication node, so that the target communication node reconstructs the message to be sent according to the message format corresponding to the target version information. In one embodiment, the version feedback module 730 can be used to perform the operation S430 described above, which will not be repeated here.

[0138] The message receiving module 740 is used to receive the reconstructed message to be sent by the target communication node. In one embodiment, the message receiving module 740 can be used to perform the operation S440 described above, which will not be repeated here.

[0139] It should be noted that the description of the features in the embodiment corresponding to the communication device can be found in the relevant description of the embodiment corresponding to the communication method, and will not be repeated here.

[0140] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the communication method embodiments described above.

[0141] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described communication method embodiments when it is run.

[0142] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0143] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described communication method embodiments.

[0144] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described communication method embodiments.

[0145] Any of the components, modules, units, parts, methods, and operations described herein can be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or any combination thereof. Alternatively or additionally, any functionality described herein can be executed at least in part by one or more hardware logic components, such as, but not limited to, a central processing unit (CPU), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), an application-specific standard product (ASSP), a system-on-a-chip (SoC), a complex programmable logic device (CPLD), a microprocessor (MCU), etc. The terms "system," "computing device," or "apparatus" as used herein encompass various means, devices, and machines for processing data, including, for example, one or more programmable processors, computers, SoCs, or combinations thereof. The apparatus may also include code that creates an execution environment for the computer program in question, such as code constituting processor firmware, a protocol stack, a database management system, an operating system, a cross-platform runtime environment, a virtual machine, or one or more combinations thereof. The aforementioned computer program (also known as a program, software, software application, app, script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and can be deployed in any form, including as a standalone program or as a module, component, subroutine, object, or other unit suitable for a computing environment.

[0146] The units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0147] The communication method and electronic device provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.

Claims

1. A communication method applied to a target communication node in a storage system, characterized in that, include: A negotiation request is sent to the target communication node. The negotiation request includes a message to be sent, a message type identifier of the message to be sent, and multiple candidate version information supported by the target communication node for the message type identifier. Each candidate version information corresponds to a different message format. Receive target version information corresponding to the message type identifier returned by the node to be communicated, wherein the target version information is determined by the node to be communicated from the plurality of candidate version information; The message to be sent is reconstructed according to the message format corresponding to the target version information, and the reconstructed message to be sent is sent to the communication node.

2. The method according to claim 1, characterized in that, Before sending the negotiation request to the node to be communicated, the method further includes: The target version information corresponding to the message type identifier of the message to be sent is retrieved from the preset negotiation result table. The preset negotiation result table is used to record the correspondence between the negotiated message type identifier and the version information. If the target version information is found, the message to be sent is reconstructed according to the message format corresponding to the target version information, and the reconstructed message to be sent is sent to the communication node. If the target version information is not found, a negotiation request is sent to the node to be communicated.

3. The method according to claim 2, characterized in that, After receiving the target version information corresponding to the message type identifier returned by the node to be communicated, the method further includes: The correspondence between the message type identifier and the target version information is recorded in the preset negotiation result table.

4. The method according to claim 1, characterized in that, The step of reconstructing the message to be sent according to the message format corresponding to the target version information includes: From the preset version list, obtain the target message format corresponding to the target version information, wherein the preset version list is used to store the correspondence between version information and message format; According to the target message format, the data of the message to be sent is reorganized into the reconstructed message to be sent.

5. A communication method applied to nodes to be communicated in a storage system, characterized in that, include: Receive a negotiation request sent by a target communication node, the negotiation request carrying a message type identifier and multiple candidate version information supported by the target communication node for the message type identifier, each of the candidate version information corresponding to a different message format; From the plurality of candidate version information, determine the target version information corresponding to the message type identifier; Send the target version information to the target communication node so that the target communication node reconstructs the message to be sent according to the message format corresponding to the target version information; Receive the reconstructed message to be sent from the target communication node.

6. The method according to claim 5, characterized in that, Before determining the target version information corresponding to the message type identifier from the plurality of candidate version information, the method further includes: The target version information corresponding to the message type identifier is retrieved from the preset negotiation result table. The preset negotiation result table is used to record the correspondence between the negotiated message type identifier and the version information. If the target version information is found, the target version information is sent to the target communication node; If the target version information is not found, the target version information corresponding to the message type identifier is determined from the multiple candidate version information.

7. The method according to claim 1, characterized in that, The step of determining the target version information corresponding to the message type identifier from the plurality of candidate version information includes: Obtain the version information supported by the node to be communicated for the message type identifier; The version information supported by the node to be communicated is matched with the multiple candidate version information, and the successfully matched candidate version information is taken as the target version information.

8. The method according to claim 7, characterized in that, The step of matching the version information supported by the node to be communicated with the multiple candidate version information, and using the successfully matched candidate version information as the target version information, includes: The version information that is the same as the version information supported by the node to be communicated is selected from the multiple candidate version information and used as the common supported version information set. The target version information is determined from the set of commonly supported version information.

9. An electronic device, characterized in that, include: The memory is configured to store the message to be sent and the message type identifier of the message to be sent; A processor, connected to the memory, is configured to: acquire a message to be sent and send a negotiation request to a target communication node, the negotiation request carrying a message type identifier of the message to be sent and multiple candidate version information supported by the target communication node for the message type identifier, each of the candidate version information corresponding to a different message format; receive target version information returned by the target communication node corresponding to the message type identifier, the target version information being determined by the target communication node from the multiple candidate version information; reconstruct the message to be sent according to the message format corresponding to the target version information, and send the reconstructed message to the target communication node.

10. An electronic device, characterized in that, include: The memory is configured to request a memory negotiation. A processor, connected to the memory, is configured to: receive a negotiation request sent by a target communication node, the negotiation request carrying a message type identifier and multiple candidate version information supported by the target communication node for the message type identifier, each of the candidate version information corresponding to a different message format; and determine the target version information corresponding to the message type identifier from the multiple candidate version information. Send the target version information to the target communication node so that the target communication node reconstructs the message to be sent according to the message format corresponding to the target version information; receive the reconstructed message to be sent sent by the target communication node.