WO2024193483A1 - Method and apparatus for transmitting data in system, and electronic device - Google Patents

Method and apparatus for transmitting data in system, and electronic device Download PDF

Info

Publication number
WO2024193483A1
WO2024193483A1 PCT/CN2024/082057 CN2024082057W WO2024193483A1 WO 2024193483 A1 WO2024193483 A1 WO 2024193483A1 CN 2024082057 W CN2024082057 W CN 2024082057W WO 2024193483 A1 WO2024193483 A1 WO 2024193483A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
node
processed
message
target node
Prior art date
Application number
PCT/CN2024/082057
Other languages
French (fr)
Chinese (zh)
Inventor
江鑫
Original Assignee
北京有竹居网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京有竹居网络技术有限公司 filed Critical 北京有竹居网络技术有限公司
Publication of WO2024193483A1 publication Critical patent/WO2024193483A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/42Loop networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Definitions

  • the present disclosure relates to the field of Internet communication technology, and in particular to a method, device and electronic device for transmitting data in a system.
  • the present disclosure provides a method, device and electronic device for transmitting data in a system.
  • a method for transmitting data in a system comprising:
  • the target node obtains data to be processed, wherein the data to be processed includes a message to be processed and a destination node identifier corresponding to the message to be processed;
  • the target node processes the message to be processed
  • the target node transmits the data to be processed to an adjacent node of the target node.
  • a device for transmitting data in a system wherein the device is applied to a data transmission system, wherein the data transmission system comprises a plurality of nodes, and the plurality of nodes constitute a ring-shaped communication link; Any target node, the device comprises:
  • An acquisition module used to acquire data to be processed, wherein the data to be processed includes a message to be processed and a destination node identifier corresponding to the message to be processed;
  • a processing module configured to process the message to be processed when the destination node identifier corresponding to the message to be processed is the same as the identifier of the target node;
  • the transmission module is used to transmit the data to be processed to an adjacent node of the target node when the destination node identifier corresponding to the message to be processed is different from the identifier of the target node.
  • a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of the above-mentioned first aspects is implemented.
  • an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any one of the first aspects is implemented.
  • FIG1 is a schematic diagram of a scenario of transmitting data in a system according to an exemplary embodiment of the present disclosure
  • FIG2 is a flow chart of a method for transmitting data in a system according to an exemplary embodiment of the present disclosure
  • FIG3A is a schematic diagram of a scenario of transmitting data in another system according to an exemplary embodiment of the present disclosure
  • FIG3B is a schematic diagram of a scenario of transmitting data in another system according to an exemplary embodiment of the present disclosure
  • FIG4 is a block diagram of a device for transmitting data in a system according to an exemplary embodiment of the present disclosure
  • FIG5 is a schematic block diagram of an electronic device provided by some embodiments of the present disclosure.
  • FIG6 is a schematic block diagram of another electronic device provided by some embodiments of the present disclosure.
  • FIG. 7 is a schematic diagram of a storage medium provided by some embodiments of the present disclosure.
  • first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.
  • word "if” as used herein may be interpreted as "at the time of” or "when” or "in response to determining”.
  • the computer room routes in the data transmission system are usually configured by region, so that the computer rooms can communicate through the routes, thereby realizing data transmission between computer rooms.
  • data transmission between computer rooms is difficult to manage.
  • the computer room transmits data it is necessary to first find and obtain the address of the destination computer room of the data to be transmitted, and then determine the transmission path of the data to be transmitted, and finally transmit the data according to the transmission path. Therefore, only the data with the same path is transmitted each time, the data transmission efficiency is low, and the error rate and packet loss rate are high.
  • the present disclosure provides a method for transmitting data in a system, which forms a ring-shaped communication link composed of multiple nodes by organizing at least one computer room in the data transmission system into a node.
  • the data to be processed including the message to be processed and its destination node identifier is obtained. If the destination node of the message to be processed is the node, the message is directly processed. If the destination node of the message to be processed is not the node, the data to be processed is sent to the adjacent node connected to the node, so that each message to be processed is transmitted to the destination node corresponding to the message to be processed through the communication link. Since the transmission flow of data between nodes is simple, the data transmission between nodes is easy to manage.
  • FIG. 1 it is a schematic diagram showing a scenario of transmitting data in a system according to an exemplary embodiment.
  • the system may include, for example, 8 nodes, node 1 to node 8.
  • Each node may correspond to at least one A computer room, each of which may include one or more devices, servers or equipment clusters with computing and processing capabilities. It is understood that although FIG. 1 shows that the system includes 8 nodes, the embodiments of this specification are not limited thereto, but may include other numbers of nodes.
  • the 8 nodes constitute a ring-shaped communication link, and each node is connected to the other two nodes through the communication link, and the communication link may be unidirectional or bidirectional.
  • node 1 performs data transmission once every period T. For example, at time T0 when a period expires, node 1 checks whether there is a message to be transmitted from the pre-stored data. If there is no message to be transmitted, it waits for time T1 when the next period expires. If there is a message to be transmitted, at least one message to be transmitted can be obtained from the pre-stored data, and the message to be transmitted can be packaged into data packet a and sent to node 2.
  • node 1 receives data packet b sent by node 8, and can obtain multiple messages included in data packet b and information about the destination node corresponding to each message (such as the identifier of the destination node).
  • the multiple messages may include message b1 and message b2, etc.
  • the destination node corresponding to message b1 is node 1
  • the destination node corresponding to message b2 is node 3.
  • node 1 determines the destination nodes corresponding to message b1 and message b2, it processes message b1 and saves message b2 as a message to be transmitted.
  • node 1 generates message c1
  • the destination node corresponding to message c1 is node 4.
  • node 1 can directly save message c1 as a message to be transmitted.
  • node 1 can obtain the message b2 and message c1 to be transmitted from the pre-stored data, and package the message b2 and message c1 into a data packet c, which includes the message b2 and the message c1, as well as the information of the destination node node 3 corresponding to the message b2 and the information of the destination node node 4 corresponding to the message c1. Then, node 1 sends the data packet c to node 2. Thereafter, every other cycle, if there is data to be transmitted in node 1, the data is transmitted to node 2 once. Similarly, other nodes also perform data transmission periodically in this way. Therefore, message b2 is transmitted to node 3 via node 2, and message c1 is transmitted to node 4 via node 2 and node 3. It should be noted that the data transmission cycle of each node can be the same or different.
  • node 1 If the communication link is bidirectional, taking node 1 as an example, node 1 still performs data transmission every period T. Node 1 stores messages to be transmitted in two transmission directions. Messages to be transmitted in the direction of node 2 can be stored in message group 1 to be transmitted, and messages to be transmitted in the direction of node 8 can be stored in message group 2 to be transmitted. At time T0 when the period expires, node 1 checks whether there is a message to be transmitted to node 2 from the pre-stored message group 1 to be transmitted, and checks whether there is a message to be transmitted to node 8 from the pre-stored message group 2 to be transmitted. If neither exists, wait for time T1 when the next period expires.
  • node 1 receives data packet b sent by node 8, obtains message b1 and message b2 included in data packet b, and information about node 1 (the destination node corresponding to message b1) and node 3 (the destination node corresponding to message b2). After node 1 determines the destination nodes corresponding to message b1 and message b2, it processes message b1 and stores message b2 in message group 1 to be transmitted. On the other hand, node 1 receives data packet d sent by node 2, obtains message d1 included in data packet d, and information about node 6 (the destination node corresponding to message d1).
  • Node 1 determines the destination node corresponding to message d1. After that, the message d1 is stored in the message group 2 to be transmitted. On the other hand, node 1 generates message c1, and the destination node corresponding to message c1 is node 4. After generating message c1, node 1 can store message c1 in the message group 1 to be transmitted and the message group 2 to be transmitted.
  • node 1 can obtain the to-be-transmitted messages b2 and c1 from the pre-stored to-be-transmitted message group 1, and package the messages b2 and c1 into a data packet c. Then, node 1 sends data packet c to node 2. At the same time, node 1 can also obtain the to-be-transmitted messages d1 and c1 from the pre-stored to-be-transmitted message group 2, and package the messages d1 and c1 into a data packet e. Then, node 1 sends data packet e to node 8. Similarly, other nodes also perform periodic data transmission in this way.
  • message b2 is transmitted to node 3 via node 2
  • message d1 is transmitted to node 6 via node 8 and node 7.
  • message c1 is first transmitted to node 4 via node 2 and node 3, then when message c1 in another transmission direction is transmitted to node 4 via node 8-node 5, node 4 can directly ignore message c1. If the link between node 2 and node 3 fails and is disconnected, message c1 cannot be transmitted to node 4 via node 2 and node 3, but can be transmitted to node 4 via node 8-node 5 in another transmission direction. Therefore, this embodiment can reduce the data loss rate to a greater extent.
  • FIG2 is a flow chart of a method for transmitting data in a system according to an exemplary embodiment.
  • the method is applied to a data transmission system, which may include multiple nodes, which form a ring-shaped communication link, and the communication link may be a unidirectional communication link or a bidirectional communication link.
  • the target node may be any node among the multiple nodes, and the method may include the following steps:
  • step 201 the target node obtains data to be processed, and in step 202 , if the destination node identifier corresponding to the message to be processed is the same as the identifier of the target node, the target node processes the message to be processed.
  • the target node may be adjacent to two nodes, and the two nodes adjacent to the target node include a first adjacent node and a second adjacent node.
  • the communication link is a unidirectional communication link, and data is transmitted along a first transmission direction between multiple nodes through the communication link.
  • the first adjacent node may be the previous node of the target node
  • the second adjacent node may be the next node of the target node. That is, the first adjacent node transmits data unidirectionally to the target node, and the target node transmits data unidirectionally to the second adjacent node.
  • direction x is the first transmission direction
  • data is transmitted between nodes along direction x.
  • the first adjacent node of the target node is the previous node m that transmits data to the target node
  • the second adjacent node of the target node is the next node n that receives data transmitted by the target node.
  • the communication link is a bidirectional communication link, and data can be transmitted between multiple nodes along a first transmission direction and a second transmission direction respectively through the communication link, and the first transmission direction and the second transmission direction are opposite.
  • the first adjacent node can be the previous node of the target node
  • the second adjacent node can be the next node of the target node. That is, the first adjacent node transmits data to the target node, and the target node transmits data to the second adjacent node.
  • the second adjacent node can be the previous node of the target node, and the first adjacent node can be the next node of the target node.
  • the second adjacent node transmits data to the target node
  • the target node transmits data to the first adjacent node.
  • direction x is the first transmission direction
  • direction y is the second transmission direction
  • nodes transmit data along direction x and direction y, respectively.
  • the first adjacent node of the target node is the previous node m that transmits data to the target node
  • the second adjacent node of the target node is the next node n that receives data transmitted by the target node.
  • the second adjacent node of the target node is the previous node n that transmits data to the target node
  • the first adjacent node of the target node is the next node m that receives data transmitted by the target node.
  • the data to be processed may include a message to be processed and a destination node identifier corresponding to the message to be processed.
  • the target node may receive the first data to be processed from the first adjacent node. Then, the target node may determine the destination node identifier corresponding to the first message to be processed included in the first data to be processed. If the destination node identifier corresponding to the first message to be processed is the same as the identifier of the target node, the target node processes the first message to be processed.
  • the target node can receive the first data to be processed transmitted along the first transmission direction from the first adjacent node, and determine the destination node identifier corresponding to the first message to be processed included in the first data to be processed. If the destination node identifier corresponding to the first message to be processed is the same as the identifier of the target node, the target node processes the first message to be processed. On the other hand, the target node can also receive the second data to be processed transmitted along the second transmission direction from the second adjacent node, and determine the destination node identifier corresponding to the second message to be processed included in the second data to be processed. If the destination node identifier corresponding to the second message to be processed is the same as the identifier of the target node, the target node processes the second message to be processed.
  • step 203 if the destination node identifier corresponding to the message to be processed is different from the identifier of the target node, the target node transmits the data to be processed to the neighboring node of the target node.
  • the target node receives the first data to be processed from the first adjacent node, and determines the destination node identifier corresponding to the first message to be processed included in the first data to be processed. If the destination node identifier corresponding to the first message to be processed is different from the identifier of the target node, the target node can store the received first data to be processed in the first pre-stored data, and the first pre-stored data is used to store data transmitted in the first transmission direction.
  • part or all of the data stored in the preset time period can be obtained from the first pre-stored data as the target data to be transmitted, and the target data includes the first data to be processed. Then, the target node can generate a first data packet carrying the first data to be processed based on the target data, and transmit the first data packet to the second adjacent node.
  • the target node receives the first data to be processed transmitted along the first transmission direction from the first adjacent node, and determines the destination node identifier corresponding to the first message to be processed included in the first data to be processed. If the destination node identifier corresponding to the first message to be processed is different from the identifier of the target node, the target node stores the received first data to be processed in the first pre-stored data. When the first time condition is met, the target data can be obtained from the first pre-stored data, and a first data packet carrying the first data to be processed is generated based on the target data. and transmits the first data packet to the second adjacent node.
  • the target node receives the second data to be processed transmitted along the second transmission direction from the second adjacent node, and determines the destination node identifier corresponding to the second message to be processed included in the second data to be processed. If the destination node identifier corresponding to the second message to be processed is different from the identifier of the target node, the target node stores the received second data to be processed in the second pre-stored data, and the second pre-stored data is used to store data transmitted in the second transmission direction.
  • the target data can be obtained from the second pre-stored data, and a second data packet carrying the second data to be processed is generated based on the target data, and the second data packet is transmitted to the first adjacent node.
  • the target data may include at least one message to be processed, each message to be processed corresponds to a source node and a destination node, and any message to be processed is generated by its corresponding source node and needs to be transmitted to its corresponding destination node for processing. If there are multiple messages to be processed, the source nodes and destination nodes corresponding to different messages to be processed may be the same or different.
  • the data packet generated based on the target data may include a key information header and a message body, and the message body may include each message to be processed.
  • the key information header may include information on the source node and destination node corresponding to each message to be processed, as well as the generation time corresponding to each message to be processed.
  • the target node can generate a message as a third message to be processed.
  • the target node can use the generated third message to be processed and the target node identifier corresponding to the third message to be processed as third data to be processed, and store the third data to be processed in the first pre-stored data and the second pre-stored data.
  • the present disclosure provides a method for transmitting data in a system, which forms a ring-shaped communication link composed of multiple nodes by organizing at least one computer room in the data transmission system into a node.
  • the data to be processed including the message to be processed and its destination node identifier is obtained. If the destination node of the message to be processed is the node, the message is directly processed. If the destination node of the message to be processed is not the node, the data to be processed is sent to the adjacent node connected to the node, so that each message to be processed is transmitted to the destination node corresponding to the message to be processed through the communication link. Since the transmission flow of data between nodes is simple, the data transmission between nodes is easy to manage. In addition, when a node transmits data, it is not necessary to determine the transmission path of the data to be transmitted, and the data only needs to be transmitted according to the ring link. The data transmission efficiency is improved and the error rate and packet loss rate are reduced.
  • the embodiment of the present disclosure provides a method and device for transmitting data in a system, which forms a ring-shaped communication link composed of multiple nodes by organizing at least one computer room in the data transmission system into a node.
  • the data to be processed including the message to be processed and its destination node identifier is obtained. If the destination node of the message to be processed is the node, the message is directly processed. If the destination node of the message to be processed is not the node, the message is sent to the corresponding node connected to the node. The neighboring node sends the data to be processed, so that each message to be processed is transmitted to the destination node corresponding to the message to be processed through the communication link.
  • the data transmission flow between nodes is simple, the data transmission between nodes is easy to manage.
  • a node transmits data, it does not need to determine the transmission path of the data to be transmitted, but only needs to transmit the data according to the ring link. This improves the data transmission efficiency and reduces the error rate and packet loss rate.
  • the present disclosure also provides an embodiment of an apparatus for transmitting data in the system.
  • Figure 4 is a block diagram of a device for transmitting data in a system shown in the present disclosure according to an exemplary embodiment.
  • the device is applied to a data transmission system.
  • the data transmission system includes multiple nodes, and the multiple nodes form a ring-shaped communication link.
  • the device is deployed at any target node among the multiple nodes.
  • the device may include: an acquisition module 401, a processing module 402 and a transmission module 403.
  • the acquisition module 401 is used to acquire data to be processed, wherein the data to be processed includes a message to be processed and a destination node identifier corresponding to the message to be processed.
  • the processing module 402 is used to process the message to be processed when the destination node identifier corresponding to the message to be processed is the same as the identifier of the target node.
  • the transmission module 403 is used to transmit the data to be processed to an adjacent node of the target node when the destination node identifier corresponding to the message to be processed is different from the identifier of the target node.
  • data is transmitted between multiple nodes along a first transmission direction via a communication link, and the data to be processed includes first data to be processed.
  • the acquisition module 401 is configured to: receive the first data to be processed from a first adjacent node corresponding to the target node, the first adjacent node is connected to the target node via a communication link, and in the first transmission direction, the first adjacent node is the previous node of the target node.
  • the transmission module 403 is configured to: store the received first data to be processed into the first pre-stored data, the first pre-stored data is used to store the data transmitted in the first transmission direction, and when the first time condition is met, obtain the first data to be processed from the first pre-stored data, and transmit the first data to be processed to the second adjacent node.
  • the second adjacent node is connected to the target node via a communication link, and in the first transmission direction, the second adjacent node is the next node of the target node.
  • the communication link is a bidirectional communication link, and data is also transmitted between the multiple nodes through the communication link along a second transmission direction, the second transmission direction being opposite to the first transmission direction, wherein the first adjacent node is the next node of the target node in the second transmission direction.
  • the data to be processed also includes second data to be processed.
  • the acquisition module 401 is further configured to: receive the second data to be processed from a second adjacent node, the second adjacent node is connected to the target node via the communication link, and in the first transmission direction, the second adjacent node is the next node of the target node. In the second transmission direction, the second adjacent node is the previous node of the target node.
  • the transmission module 403 is configured to: store the received second data to be processed into second pre-stored data, the second pre-stored data is used to store data transmitted in the second transmission direction.
  • the second data to be processed is obtained from the second pre-stored data, and the second data to be processed is transmitted to the first adjacent node.
  • the data to be processed further includes third data to be processed, wherein the acquisition module 401 is further configured to: generate the third data to be processed by the target node.
  • the relevant parts can refer to the partial description of the method embodiment.
  • the device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiment scheme of the present disclosure. A person of ordinary skill in the art can understand and implement it without paying creative labor.
  • FIG5 is a schematic block diagram of an electronic device provided in some embodiments of the present disclosure.
  • the electronic device 910 includes a processor 911 and a memory 912, which can be used to implement a client or a server.
  • the memory 912 is used to store computer executable instructions (e.g., one or more computer program modules) non-transiently.
  • the processor 911 is used to run the computer executable instructions, and when the computer executable instructions are run by the processor 911, one or more steps in the method for transmitting data in the system described above can be executed, thereby implementing the method for transmitting data in the system described above.
  • the memory 912 and the processor 911 can be interconnected via a bus system and/or other forms of connection mechanisms (not shown).
  • the processor 911 may be a central processing unit (CPU), a graphics processing unit (GPU), or other forms of processing units having data processing capabilities and/or program execution capabilities.
  • the central processing unit (CPU) may be an X86 or ARM architecture, etc.
  • the processor 911 may be a general-purpose processor or a dedicated processor, and may control other components in the electronic device 910 to perform desired functions.
  • the memory 912 may include any combination of one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory.
  • Volatile memory may include, for example, random access memory (RAM) and/or cache memory (cache), etc.
  • Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, flash memory, etc.
  • One or more computer program modules may be stored on the computer-readable storage medium, and the processor 911 may run one or more computer program modules to implement various functions of the electronic device 910.
  • Various applications and various data, as well as various data used and/or generated by the application, etc. may also be stored in the computer-readable storage medium.
  • FIG6 is a schematic block diagram of another electronic device provided in some embodiments of the present disclosure.
  • the electronic device 920 is suitable for implementing the method for transmitting data in the system provided in the embodiment of the present disclosure, for example.
  • the electronic device 920 may be a terminal device, etc., and may be used to implement a client or a server.
  • the electronic device 920 may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable electronic devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc.
  • PDAs personal digital assistants
  • PADs tablet computers
  • PMPs portable multimedia players
  • vehicle-mounted terminals such as vehicle-mounted navigation terminals
  • wearable electronic devices etc.
  • fixed terminals such as digital TVs, desktop computers, smart home devices, etc.
  • the electronic device 920 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 921, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 922 or a program loaded from a storage device 928 to a random access memory (RAM) 923.
  • ROM read-only memory
  • RAM random access memory
  • various programs and data required for the operation of the electronic device 920 are also stored.
  • the processing device 921, the ROM 922, and the RAM 923 are connected to each other via a bus 924.
  • An input/output (I/O) interface 925 is also connected to the bus 924.
  • the following devices may be connected to the I/O interface 925: input devices 926 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 927 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 928 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 929.
  • the communication devices 929 may allow the electronic device 920 to communicate with other electronic devices wirelessly or by wire to exchange data.
  • FIG. 6 shows an electronic device 920 having various devices, it should be understood that it is not required to implement or have all of the devices shown, and the electronic device 920 may alternatively implement or have more or fewer devices.
  • the method for transmitting data in the above-mentioned system can be implemented as a computer software program.
  • an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method for transmitting data in the above-mentioned system.
  • the computer program can be downloaded and installed from the network through the communication device 929, or installed from the storage device 928, or installed from the ROM 922.
  • the processing device 921 the functions defined in the method for transmitting data in the system provided by the embodiment of the present disclosure can be implemented.
  • FIG7 is a schematic diagram of a storage medium provided by some embodiments of the present disclosure.
  • the storage medium 930 may be a non-transitory computer-readable storage medium for storing a non-transitory computer-executable instruction 931.
  • the non-transitory computer-executable instruction 931 is executed by a processor, the method for transmitting data in the system described in the embodiment of the present disclosure may be implemented.
  • the non-transitory computer-executable instruction 931 is executed by a processor, one or more steps in the method for transmitting data in the system described above may be executed.
  • the storage medium 930 may be applied to the above-mentioned electronic device.
  • the storage medium 930 may include a memory in the electronic device.
  • the storage medium may include a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), flash memory, or any combination of the above storage media, or other applicable storage media.
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • CD-ROM portable compact disk read-only memory
  • flash memory or any combination of the above storage media, or other applicable storage media.
  • the description of the storage medium 930 can refer to the description of the memory in the embodiment of the electronic device, and the repeated parts are not repeated.
  • the specific functions and technical effects of the storage medium 930 can refer to the description of the method for transmitting data in the system above, and are not repeated here.
  • a computer-readable medium may be a tangible medium that may contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment.
  • a computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • a computer-readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above.
  • Computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by an instruction execution system, device or device or used in combination with it.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device.
  • the program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

Landscapes

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

Abstract

The present disclosure provides a method and apparatus for transmitting data in a system, and an electronic device. The method is applied to a data transmission system, the data transmission system comprises a plurality of nodes, and the plurality of nodes form an annular communication link. The method comprises: for any target node among the plurality of nodes, the target node acquires data to be processed, wherein the data to be processed comprises a message to be processed and an identifier of a destination node corresponding to said message; if the identifier of the destination node corresponding to said message is the same as an identifier of the target node, the target node processes said message; and if the identifier of the destination node corresponding to said message is different from the identifier of the target node, the target node transmits, to an adjacent node of the target node, the data to be processed. This implementation mode improves data transmission efficiency and reduces an error rate and a packet loss rate.

Description

系统中传输数据的方法、装置及电子设备Method, device and electronic device for transmitting data in system
本申请要求2023年03月17日递交的,标题为“系统中传输数据的方法、装置及电子设备”、申请号为202310264788.6的中国发明专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application claims priority to the Chinese invention patent application entitled “Method, device and electronic device for transmitting data in a system” and application number 202310264788.6, filed on March 17, 2023. The entire contents of this application are incorporated by reference into this application.
技术领域Technical Field
本公开涉及互联网通信技术领域,特别涉及一种系统中传输数据的方法、装置及电子设备。The present disclosure relates to the field of Internet communication technology, and in particular to a method, device and electronic device for transmitting data in a system.
背景技术Background Art
随着互联网技术的高速发展,网络通信技术也变得越来越重要。目前,需要数据传输系统中的节点之间进行通信,从而实现节点之间的数据传输。但由于数据在节点之间的传输流向复杂,使得节点之间的数据传输难以管理。当前需要一种高效地在数据传输系统的节点之间传输数据的方案。With the rapid development of Internet technology, network communication technology has become increasingly important. At present, it is necessary for nodes in a data transmission system to communicate with each other so as to realize data transmission between nodes. However, due to the complex transmission flow of data between nodes, data transmission between nodes is difficult to manage. Currently, a solution is needed to efficiently transmit data between nodes in a data transmission system.
发明内容Summary of the invention
本公开提供一种系统中传输数据的方法、装置及电子设备。The present disclosure provides a method, device and electronic device for transmitting data in a system.
根据第一方面,提供一种系统中传输数据的方法,所述方法应用于数据传输系统,所述数据传输系统包括多个节点,且所述多个节点构成环状的通信链路;所述方法包括:According to a first aspect, a method for transmitting data in a system is provided, the method being applied to a data transmission system, the data transmission system comprising a plurality of nodes, and the plurality of nodes forming a ring-shaped communication link; the method comprising:
针对所述多个节点中的任一目标节点,所述目标节点获取待处理数据,其中,所述待处理数据包括待处理消息和所述待处理消息对应的目的节点标识;For any target node among the multiple nodes, the target node obtains data to be processed, wherein the data to be processed includes a message to be processed and a destination node identifier corresponding to the message to be processed;
若所述待处理消息对应的目的节点标识与所述目标节点的标识相同,所述目标节点处理所述待处理消息;If the destination node identifier corresponding to the message to be processed is the same as the identifier of the target node, the target node processes the message to be processed;
若所述待处理消息对应的目的节点标识与所述目标节点的标识不同,所述目标节点将所述待处理数据传输至所述目标节点的相邻节点。If the destination node identifier corresponding to the message to be processed is different from the identifier of the target node, the target node transmits the data to be processed to an adjacent node of the target node.
根据第二方面,提供一种系统中传输数据的装置,所述装置应用于数据传输系统,所述数据传输系统包括多个节点,且所述多个节点构成环状的通信链路;针对所述多个节点中的 任一目标节点,所述装置包括:According to a second aspect, a device for transmitting data in a system is provided, wherein the device is applied to a data transmission system, wherein the data transmission system comprises a plurality of nodes, and the plurality of nodes constitute a ring-shaped communication link; Any target node, the device comprises:
获取模块,用于获取待处理数据,其中,所述待处理数据包括待处理消息和所述待处理消息对应的目的节点标识;An acquisition module, used to acquire data to be processed, wherein the data to be processed includes a message to be processed and a destination node identifier corresponding to the message to be processed;
处理模块,用于在所述待处理消息对应的目的节点标识与所述目标节点的标识相同时,处理所述待处理消息;A processing module, configured to process the message to be processed when the destination node identifier corresponding to the message to be processed is the same as the identifier of the target node;
传输模块,用于在所述待处理消息对应的目的节点标识与所述目标节点的标识不同时,将所述待处理数据传输至所述目标节点的相邻节点。The transmission module is used to transmit the data to be processed to an adjacent node of the target node when the destination node identifier corresponding to the message to be processed is different from the identifier of the target node.
根据第三方面,提供一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面中任一项所述的方法。According to a third aspect, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of the above-mentioned first aspects is implemented.
根据第四方面,提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现第一方面中任一项所述的方法。According to a fourth aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any one of the first aspects is implemented.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
图1是本公开根据一示例性实施例示出的一种系统中传输数据的场景示意图;FIG1 is a schematic diagram of a scenario of transmitting data in a system according to an exemplary embodiment of the present disclosure;
图2是本公开根据一示例性实施例示出的一种系统中传输数据的方法的流程图;FIG2 is a flow chart of a method for transmitting data in a system according to an exemplary embodiment of the present disclosure;
图3A是本公开根据一示例性实施例示出的另一种系统中传输数据的场景示意图;FIG3A is a schematic diagram of a scenario of transmitting data in another system according to an exemplary embodiment of the present disclosure;
图3B是本公开根据一示例性实施例示出的另一种系统中传输数据的场景示意图;FIG3B is a schematic diagram of a scenario of transmitting data in another system according to an exemplary embodiment of the present disclosure;
图4是本公开根据一示例性实施例示出的一种系统中传输数据的装置的框图;FIG4 is a block diagram of a device for transmitting data in a system according to an exemplary embodiment of the present disclosure;
图5是本公开一些实施例提供的一种电子设备的示意框图;FIG5 is a schematic block diagram of an electronic device provided by some embodiments of the present disclosure;
图6是本公开一些实施例提供的另一种电子设备的示意框图;FIG6 is a schematic block diagram of another electronic device provided by some embodiments of the present disclosure;
图7是本公开一些实施例提供的一种存储介质的示意图。FIG. 7 is a schematic diagram of a storage medium provided by some embodiments of the present disclosure.
具体实施方式DETAILED DESCRIPTION
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施 例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. The examples are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are only examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.
在本公开使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开。在本公开中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terms used in this disclosure are only for the purpose of describing specific embodiments and are not intended to limit the disclosure. The singular forms of "a", "the" and "the" used in this disclosure are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and/or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
应当理解,尽管在本公开可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
随着互联网技术的高速发展,网络通信技术也变得越来越重要。目前,通常按地区对数据传输系统中的机房路由进行配置,使机房之间通过路由进行通信,从而实现机房之间的数据传输。但由于数据在机房之间的传输流向复杂,使得机房之间的数据传输难以管理。并且,当机房传输数据时,需要先查找并获取待传输数据的目的机房的地址,然后再确定待传输数据的传输路径,最后按照该传输路径传输数据。因此,每次只传输路径相同的数据,数据传输效率低,出错率和丢包率高。With the rapid development of Internet technology, network communication technology has become increasingly important. At present, the computer room routes in the data transmission system are usually configured by region, so that the computer rooms can communicate through the routes, thereby realizing data transmission between computer rooms. However, due to the complex transmission flow of data between computer rooms, data transmission between computer rooms is difficult to manage. In addition, when the computer room transmits data, it is necessary to first find and obtain the address of the destination computer room of the data to be transmitted, and then determine the transmission path of the data to be transmitted, and finally transmit the data according to the transmission path. Therefore, only the data with the same path is transmitted each time, the data transmission efficiency is low, and the error rate and packet loss rate are high.
本公开提供的一种系统中传输数据的方法,通过将数据传输系统中的至少一个机房组织成一个节点的方式,形成由多个节点构成的环状的通信链路。针对任一节点,获取包括待处理消息及其目的节点标识的待处理数据,如果该待处理消息的目的节点为该节点,则直接处理该消息,如果该待处理消息的目的节点不是该节点,则向与该节点连接的相邻节点发送该待处理数据,从而使每条待处理消息通过通信链路,传输至该待处理消息对应的目的节点。由于数据在节点之间的传输流向简单,使得节点之间的数据传输便于管理。并且,当节点传输数据时,无需确定待传输数据的传输路径,仅需按照环形链路传输数据。可以同时传输目的节点不同的数据,提高了数据传输效率,降低了出错率和丢包率。The present disclosure provides a method for transmitting data in a system, which forms a ring-shaped communication link composed of multiple nodes by organizing at least one computer room in the data transmission system into a node. For any node, the data to be processed including the message to be processed and its destination node identifier is obtained. If the destination node of the message to be processed is the node, the message is directly processed. If the destination node of the message to be processed is not the node, the data to be processed is sent to the adjacent node connected to the node, so that each message to be processed is transmitted to the destination node corresponding to the message to be processed through the communication link. Since the transmission flow of data between nodes is simple, the data transmission between nodes is easy to manage. In addition, when a node transmits data, it is not necessary to determine the transmission path of the data to be transmitted, and the data only needs to be transmitted according to the ring link. Data with different destination nodes can be transmitted at the same time, which improves the data transmission efficiency and reduces the error rate and packet loss rate.
参见图1,为根据一示例性实施例示出的一种系统中传输数据的场景示意图。Referring to Fig. 1 , it is a schematic diagram showing a scenario of transmitting data in a system according to an exemplary embodiment.
如图1所示,该系统例如可以包括节点1~节点8共8个节点。每个节点可以对应于至少一 个机房,每个机房可以包括一个或多个具有计算、处理能力的装置、服务器或设备集群。可以理解,图1中虽然示出了系统中包括8个节点,本说明书实施例不限于此,而是可以包括其他数目的节点。该8个节点构成环状的通信链路,每个节点通过该通信链路与其它两个节点连接,该通信链路可以是单向的,也可以是双向的。As shown in FIG1 , the system may include, for example, 8 nodes, node 1 to node 8. Each node may correspond to at least one A computer room, each of which may include one or more devices, servers or equipment clusters with computing and processing capabilities. It is understood that although FIG. 1 shows that the system includes 8 nodes, the embodiments of this specification are not limited thereto, but may include other numbers of nodes. The 8 nodes constitute a ring-shaped communication link, and each node is connected to the other two nodes through the communication link, and the communication link may be unidirectional or bidirectional.
若该通信链路为单向,下面以节点1为例,对数据的具体传输过程进行示例性说明。具体来说,节点1每隔周期T进行一次数据传输。例如,在一个周期期满的T0时刻,节点1从预存的数据中查看是否存在待传输的消息,如果不存在待传输的消息,等待下一个周期期满的T1时刻。如果存在待传输的消息,可以从预存的数据中获取至少一条待传输的消息,并将该待传输的消息打包成数据包a之后,发送给节点2。If the communication link is unidirectional, the specific data transmission process is illustrated below by taking node 1 as an example. Specifically, node 1 performs data transmission once every period T. For example, at time T0 when a period expires, node 1 checks whether there is a message to be transmitted from the pre-stored data. If there is no message to be transmitted, it waits for time T1 when the next period expires. If there is a message to be transmitted, at least one message to be transmitted can be obtained from the pre-stored data, and the message to be transmitted can be packaged into data packet a and sent to node 2.
在T0时刻至下一个周期期满的T1时刻期间,一方面,节点1接收到节点8发送的数据包b,可以获取数据包b包括的多条消息以及每条消息对应的目的节点的信息(如目的节点的标识)。例如,该多条消息可以包括消息b1和消息b2等,消息b1对应的目的节点为节点1,消息b2对应的目的节点为节点3。节点1确定消息b1和消息b2对应的目的节点之后,处理消息b1,并将消息b2存为待传输消息。另一方面,节点1生成消息c1,消息c1对应的目的节点为节4,节点1可以在生成消息c1之后,直接将消息c1存为待传输消息。During the period from time T0 to time T1 when the next cycle expires, on the one hand, node 1 receives data packet b sent by node 8, and can obtain multiple messages included in data packet b and information about the destination node corresponding to each message (such as the identifier of the destination node). For example, the multiple messages may include message b1 and message b2, etc. The destination node corresponding to message b1 is node 1, and the destination node corresponding to message b2 is node 3. After node 1 determines the destination nodes corresponding to message b1 and message b2, it processes message b1 and saves message b2 as a message to be transmitted. On the other hand, node 1 generates message c1, and the destination node corresponding to message c1 is node 4. After generating message c1, node 1 can directly save message c1 as a message to be transmitted.
在周期期满的T1时刻,节点1可以从预存的数据中获取待传输的消息b2和消息c1,将消息b2和消息c1打包成数据包c,数据包c中包括消息b2和消息c1,以及消息b2对应的目的节点节点3的信息和消息c1对应的目的节点节点4的信息等。然后,节点1将数据包c发送给节点2。此后,每隔一个周期,如果节点1中存在待传输的数据,则向节点2传输一次数据。同样,其它节点也通过此方式周期性进行数据传输。因此,消息b2经由节点2传输至节点3,消息c1经由节点2和节点3传输至节点4。需要说明的是,每个节点传输数据的周期可以相同,也可以不同。At time T1 when the cycle expires, node 1 can obtain the message b2 and message c1 to be transmitted from the pre-stored data, and package the message b2 and message c1 into a data packet c, which includes the message b2 and the message c1, as well as the information of the destination node node 3 corresponding to the message b2 and the information of the destination node node 4 corresponding to the message c1. Then, node 1 sends the data packet c to node 2. Thereafter, every other cycle, if there is data to be transmitted in node 1, the data is transmitted to node 2 once. Similarly, other nodes also perform data transmission periodically in this way. Therefore, message b2 is transmitted to node 3 via node 2, and message c1 is transmitted to node 4 via node 2 and node 3. It should be noted that the data transmission cycle of each node can be the same or different.
若该通信链路为双向,还以节点1为例,节点1还是每隔周期T进行一次数据传输。节点1中存储有两个传输方向的待传输消息,可以将向节点2方向传输的消息存入待传输消息组1,将向节点8方向传输的消息存入待传输消息组2。在周期期满的T0时刻,节点1从预存的待传输消息组1中查看是否存在向节点2方向传输的待传输消息,以及从待传输消息组2中查看是否存在向节点8方向传输的待传输消息。如果都不存在,等待下一个周期期满的T1时刻。If the communication link is bidirectional, taking node 1 as an example, node 1 still performs data transmission every period T. Node 1 stores messages to be transmitted in two transmission directions. Messages to be transmitted in the direction of node 2 can be stored in message group 1 to be transmitted, and messages to be transmitted in the direction of node 8 can be stored in message group 2 to be transmitted. At time T0 when the period expires, node 1 checks whether there is a message to be transmitted to node 2 from the pre-stored message group 1 to be transmitted, and checks whether there is a message to be transmitted to node 8 from the pre-stored message group 2 to be transmitted. If neither exists, wait for time T1 when the next period expires.
在T0时刻至下一个周期期满的T1时刻期间,一方面,节点1接收到节点8发送的数据包b,获取数据包b包括的消息b1和消息b2,以及节点1(消息b1对应的目的节点)和节点3(消息b2对应的目的节点)的信息。节点1确定消息b1和消息b2对应的目的节点之后,处理消息b1,并将消息b2存入待传输消息组1中。另一方面,节点1接收到节点2发送的数据包d,获取数据包d包括的消息d1以及节点6(消息d1对应的目的节点)的信息。节点1确定消息d1对应的目的节 点之后,将消息d1存入待传输消息组2中。再一方面,节点1生成消息c1,消息c1对应的目的节点为节4,节点1可以在生成消息c1之后,将消息c1存入待传输消息组1和待传输消息组2中。During the period from time T0 to time T1 when the next cycle expires, on the one hand, node 1 receives data packet b sent by node 8, obtains message b1 and message b2 included in data packet b, and information about node 1 (the destination node corresponding to message b1) and node 3 (the destination node corresponding to message b2). After node 1 determines the destination nodes corresponding to message b1 and message b2, it processes message b1 and stores message b2 in message group 1 to be transmitted. On the other hand, node 1 receives data packet d sent by node 2, obtains message d1 included in data packet d, and information about node 6 (the destination node corresponding to message d1). Node 1 determines the destination node corresponding to message d1. After that, the message d1 is stored in the message group 2 to be transmitted. On the other hand, node 1 generates message c1, and the destination node corresponding to message c1 is node 4. After generating message c1, node 1 can store message c1 in the message group 1 to be transmitted and the message group 2 to be transmitted.
在周期期满的T1时刻,节点1可以从预存的待传输消息组1中获取待传输的消息b2和消息c1,将消息b2和消息c1打包成数据包c。然后,节点1将数据包c发送给节点2。同时,节点1还可以从预存的待传输消息组2中获取待传输的消息d1和消息c1,将消息d1和消息c1打包成数据包e。然后,节点1将数据包e发送给节点8。同样,其它节点也通过此方式周期性进行数据传输。因此,消息b2经由节点2传输至节点3,消息d1经由节点8和节点7传输至节点6。需要说明的是,如果消息c1先经由节点2和节点3传输至节点4,那么,当另一个传输方向的消息c1经由节点8-节点5传输至节点4时,节点4可以直接忽略消息c1。而如果节点2和节点3之间的链路出现故障而断开连接时,消息c1无法经由节点2和节点3传输至节点4,但可以通过另一个传输方向,经由节点8-节点5传输至节点4。因此,本实施例可以更大程度地降低数据的丢失率。At time T1 when the cycle expires, node 1 can obtain the to-be-transmitted messages b2 and c1 from the pre-stored to-be-transmitted message group 1, and package the messages b2 and c1 into a data packet c. Then, node 1 sends data packet c to node 2. At the same time, node 1 can also obtain the to-be-transmitted messages d1 and c1 from the pre-stored to-be-transmitted message group 2, and package the messages d1 and c1 into a data packet e. Then, node 1 sends data packet e to node 8. Similarly, other nodes also perform periodic data transmission in this way. Therefore, message b2 is transmitted to node 3 via node 2, and message d1 is transmitted to node 6 via node 8 and node 7. It should be noted that if message c1 is first transmitted to node 4 via node 2 and node 3, then when message c1 in another transmission direction is transmitted to node 4 via node 8-node 5, node 4 can directly ignore message c1. If the link between node 2 and node 3 fails and is disconnected, message c1 cannot be transmitted to node 4 via node 2 and node 3, but can be transmitted to node 4 via node 8-node 5 in another transmission direction. Therefore, this embodiment can reduce the data loss rate to a greater extent.
下面将结合具体的实施例对本公开进行详细描述。The present disclosure will be described in detail below in conjunction with specific embodiments.
图2为根据一示例性实施例示出的一种系统中传输数据的方法的流程图。该方法应用于数据传输系统,该数据传输系统可以包括多个节点,该多个节点构成环状的通信链路,该通信链路可以是单向通信链路,也可以是双向通信链路。目标节点可以是上述多个节点中的任一节点,该方法可以包括以下步骤:FIG2 is a flow chart of a method for transmitting data in a system according to an exemplary embodiment. The method is applied to a data transmission system, which may include multiple nodes, which form a ring-shaped communication link, and the communication link may be a unidirectional communication link or a bidirectional communication link. The target node may be any node among the multiple nodes, and the method may include the following steps:
如图2所示,在步骤201中,目标节点获取待处理数据,以及在步骤202中,若待处理消息对应的目的节点标识与目标节点的标识相同,目标节点处理该待处理消息。As shown in FIG. 2 , in step 201 , the target node obtains data to be processed, and in step 202 , if the destination node identifier corresponding to the message to be processed is the same as the identifier of the target node, the target node processes the message to be processed.
在本实施例中,目标节点可以与两个节点相邻,与目标节点相邻的两个节点包括第一相邻节点和第二相邻节点。在一种实现方式中,该通信链路为单向通信链路,在多个节点之间,通过通信链路沿第一传输方向传输数据,在第一传输方向上,第一相邻节点可以是目标节点的上一个节点,第二相邻节点可以是目标节点的下一个节点。即第一相邻节点向目标节点单向传输数据,目标节点向第二相邻节点单向传输数据。例如,如图3A所示,方向x为第一传输方向,节点之间沿方向x传输数据。目标节点的第一相邻节点为向目标节点传输数据的上一个节点m,目标节点的第二相邻节点为接收目标节点传输的数据的下一个节点n。In this embodiment, the target node may be adjacent to two nodes, and the two nodes adjacent to the target node include a first adjacent node and a second adjacent node. In one implementation, the communication link is a unidirectional communication link, and data is transmitted along a first transmission direction between multiple nodes through the communication link. In the first transmission direction, the first adjacent node may be the previous node of the target node, and the second adjacent node may be the next node of the target node. That is, the first adjacent node transmits data unidirectionally to the target node, and the target node transmits data unidirectionally to the second adjacent node. For example, as shown in FIG3A, direction x is the first transmission direction, and data is transmitted between nodes along direction x. The first adjacent node of the target node is the previous node m that transmits data to the target node, and the second adjacent node of the target node is the next node n that receives data transmitted by the target node.
在另一种实现方式中,该通信链路为双向通信链路,在多个节点之间,可以通过通信链路沿第一传输方向和第二传输方向分别传输数据,第一传输方向和第二传输方向相反。在第一传输方向上,第一相邻节点可以是目标节点的上一个节点,第二相邻节点可以是目标节点的下一个节点。即第一相邻节点向目标节点传输数据,目标节点向第二相邻节点传输数据。在第二传输方向上,第二相邻节点可以是目标节点的上一个节点,第一相邻节点可以是目标节点的下一个节点。即第二相邻节点向目标节点传输数据,目标节点向第一相邻节点传输数 据。例如,如图3B所示,方向x为第一传输方向,方向y为第二传输方向,节点之间分别沿方向x和方向y传输数据。在方向x上,目标节点的第一相邻节点为向目标节点传输数据的上一个节点m,目标节点的第二相邻节点为接收目标节点传输的数据的下一个节点n。在方向y上,目标节点的第二相邻节点为向目标节点传输数据的上一个节点n,目标节点的第一相邻节点为接收目标节点传输的数据的下一个节点m。In another implementation, the communication link is a bidirectional communication link, and data can be transmitted between multiple nodes along a first transmission direction and a second transmission direction respectively through the communication link, and the first transmission direction and the second transmission direction are opposite. In the first transmission direction, the first adjacent node can be the previous node of the target node, and the second adjacent node can be the next node of the target node. That is, the first adjacent node transmits data to the target node, and the target node transmits data to the second adjacent node. In the second transmission direction, the second adjacent node can be the previous node of the target node, and the first adjacent node can be the next node of the target node. That is, the second adjacent node transmits data to the target node, and the target node transmits data to the first adjacent node. For example, as shown in FIG3B , direction x is the first transmission direction, direction y is the second transmission direction, and nodes transmit data along direction x and direction y, respectively. In direction x, the first adjacent node of the target node is the previous node m that transmits data to the target node, and the second adjacent node of the target node is the next node n that receives data transmitted by the target node. In direction y, the second adjacent node of the target node is the previous node n that transmits data to the target node, and the first adjacent node of the target node is the next node m that receives data transmitted by the target node.
在本实施例中,待处理数据可以包括待处理消息和该待处理消息对应的目的节点标识。具体来说,在一种实现方式中,若该通信链路为单向通信链路,目标节点可以从第一相邻节点接收第一待处理数据。接着,目标节点可以确定第一待处理数据中包括的第一待处理消息对应的目的节点标识。如果该第一待处理消息对应的目的节点标识与目标节点的标识相同,目标节点处理该第一待处理消息。In this embodiment, the data to be processed may include a message to be processed and a destination node identifier corresponding to the message to be processed. Specifically, in one implementation, if the communication link is a unidirectional communication link, the target node may receive the first data to be processed from the first adjacent node. Then, the target node may determine the destination node identifier corresponding to the first message to be processed included in the first data to be processed. If the destination node identifier corresponding to the first message to be processed is the same as the identifier of the target node, the target node processes the first message to be processed.
在另一种实现方式中,若该通信链路为双向通信链路,一方面,目标节点可以从第一相邻节点接收沿第一传输方向传输的第一待处理数据,并确定第一待处理数据中包括的第一待处理消息对应的目的节点标识。如果该第一待处理消息对应的目的节点标识与目标节点的标识相同,目标节点处理该第一待处理消息。另一方面,目标节点还可以从第二相邻节点接收沿第二传输方向传输的第二待处理数据,并确定第二待处理数据中包括的第二待处理消息对应的目的节点标识。如果该第二待处理消息对应的目的节点标识与目标节点的标识相同,目标节点处理该第二待处理消息。In another implementation, if the communication link is a bidirectional communication link, on the one hand, the target node can receive the first data to be processed transmitted along the first transmission direction from the first adjacent node, and determine the destination node identifier corresponding to the first message to be processed included in the first data to be processed. If the destination node identifier corresponding to the first message to be processed is the same as the identifier of the target node, the target node processes the first message to be processed. On the other hand, the target node can also receive the second data to be processed transmitted along the second transmission direction from the second adjacent node, and determine the destination node identifier corresponding to the second message to be processed included in the second data to be processed. If the destination node identifier corresponding to the second message to be processed is the same as the identifier of the target node, the target node processes the second message to be processed.
在步骤203中,若待处理消息对应的目的节点标识与目标节点的标识不同,目标节点将待处理数据传输至目标节点的相邻节点。In step 203, if the destination node identifier corresponding to the message to be processed is different from the identifier of the target node, the target node transmits the data to be processed to the neighboring node of the target node.
在一种实现方式中,若该通信链路为单向通信链路,目标节点从第一相邻节点接收到第一待处理数据,并确定第一待处理数据中包括的第一待处理消息对应的目的节点标识。如果第一待处理消息对应的目的节点标识与目标节点的标识不同,目标节点可以将接收的第一待处理数据存入第一预存数据中,第一预存数据用于存储向第一传输方向传输的数据。在满足第一时间条件时(例如预设周期期满时),可以从第一预存数据中获取预设时段内存储的部分或全部数据作为待传输的目标数据,目标数据中包括第一待处理数据。然后,目标节点可以基于目标数据生成携带第一待处理数据的第一数据包,并向第二相邻节点传输第一数据包。In one implementation, if the communication link is a unidirectional communication link, the target node receives the first data to be processed from the first adjacent node, and determines the destination node identifier corresponding to the first message to be processed included in the first data to be processed. If the destination node identifier corresponding to the first message to be processed is different from the identifier of the target node, the target node can store the received first data to be processed in the first pre-stored data, and the first pre-stored data is used to store data transmitted in the first transmission direction. When the first time condition is met (for example, when the preset period expires), part or all of the data stored in the preset time period can be obtained from the first pre-stored data as the target data to be transmitted, and the target data includes the first data to be processed. Then, the target node can generate a first data packet carrying the first data to be processed based on the target data, and transmit the first data packet to the second adjacent node.
在另一种实现方式中,若该通信链路为双向通信链路,一方面,目标节点从第一相邻节点接收到沿第一传输方向传输的第一待处理数据,并确定第一待处理数据中包括的第一待处理消息对应的目的节点标识。如果该第一待处理消息对应的目的节点标识与目标节点的标识不同,目标节点将接收的第一待处理数据存入第一预存数据中。在满足第一时间条件时,可以从第一预存数据中获取目标数据,并基于目标数据生成携带第一待处理数据的第一数据包, 并向第二相邻节点传输第一数据包。另一方面,目标节点从第二相邻节点接收到沿第二传输方向传输的第二待处理数据,并确定第二待处理数据中包括的第二待处理消息对应的目的节点标识。如果该第二待处理消息对应的目的节点标识与目标节点的标识不同,目标节点将接收的第二待处理数据存入第二预存数据中,第二预存数据用于存储向第二传输方向传输的数据。在满足第二时间条件时,可以从第二预存数据中获取目标数据,并基于目标数据生成携带第二待处理数据的第二数据包,并向第一相邻节点传输第二数据包。In another implementation, if the communication link is a bidirectional communication link, on the one hand, the target node receives the first data to be processed transmitted along the first transmission direction from the first adjacent node, and determines the destination node identifier corresponding to the first message to be processed included in the first data to be processed. If the destination node identifier corresponding to the first message to be processed is different from the identifier of the target node, the target node stores the received first data to be processed in the first pre-stored data. When the first time condition is met, the target data can be obtained from the first pre-stored data, and a first data packet carrying the first data to be processed is generated based on the target data. and transmits the first data packet to the second adjacent node. On the other hand, the target node receives the second data to be processed transmitted along the second transmission direction from the second adjacent node, and determines the destination node identifier corresponding to the second message to be processed included in the second data to be processed. If the destination node identifier corresponding to the second message to be processed is different from the identifier of the target node, the target node stores the received second data to be processed in the second pre-stored data, and the second pre-stored data is used to store data transmitted in the second transmission direction. When the second time condition is met, the target data can be obtained from the second pre-stored data, and a second data packet carrying the second data to be processed is generated based on the target data, and the second data packet is transmitted to the first adjacent node.
需要说明的是,目标数据可以包括至少一条待处理消息,每条待处理消息均对应于源节点和目的节点,任一待处理消息由其对应的源节点生成,需要传输至其对应的目的节点进行处理。如果待处理消息有多条,不同待处理消息对应的源节点和目的节点都可以相同,也可以不同。其中,基于目标数据生成的数据包可以包括关键信息头和消息体,消息体可以包括各条待处理消息,关键信息头可以包括每条待处理消息对应的源节点和目的节点的信息,以及包括每条待处理消息对应的生成时间等。It should be noted that the target data may include at least one message to be processed, each message to be processed corresponds to a source node and a destination node, and any message to be processed is generated by its corresponding source node and needs to be transmitted to its corresponding destination node for processing. If there are multiple messages to be processed, the source nodes and destination nodes corresponding to different messages to be processed may be the same or different. Among them, the data packet generated based on the target data may include a key information header and a message body, and the message body may include each message to be processed. The key information header may include information on the source node and destination node corresponding to each message to be processed, as well as the generation time corresponding to each message to be processed.
需要说明的是,目标节点可以生成消息作为第三待处理消息,目标节点可以将生成的第三待处理消息以及第三待处理消息对应的目标节点标识作为第三待处理数据,将第三待处理数据存入第一预存数据以及第二预存数据中。It should be noted that the target node can generate a message as a third message to be processed. The target node can use the generated third message to be processed and the target node identifier corresponding to the third message to be processed as third data to be processed, and store the third data to be processed in the first pre-stored data and the second pre-stored data.
本公开提供的一种系统中传输数据的方法,通过将数据传输系统中的至少一个机房组织成一个节点的方式,形成由多个节点构成的环状的通信链路。针对任一节点,获取包括待处理消息及其目的节点标识的待处理数据,如果该待处理消息的目的节点为该节点,则直接处理该消息,如果该待处理消息的目的节点不是该节点,则向与该节点连接的相邻节点发送该待处理数据,从而使每条待处理消息通过通信链路,传输至该待处理消息对应的目的节点。由于数据在节点之间的传输流向简单,使得节点之间的数据传输便于管理。并且,当节点传输数据时,无需确定待传输数据的传输路径,仅需按照环形链路传输数据。提高了数据传输效率,降低了出错率和丢包率。The present disclosure provides a method for transmitting data in a system, which forms a ring-shaped communication link composed of multiple nodes by organizing at least one computer room in the data transmission system into a node. For any node, the data to be processed including the message to be processed and its destination node identifier is obtained. If the destination node of the message to be processed is the node, the message is directly processed. If the destination node of the message to be processed is not the node, the data to be processed is sent to the adjacent node connected to the node, so that each message to be processed is transmitted to the destination node corresponding to the message to be processed through the communication link. Since the transmission flow of data between nodes is simple, the data transmission between nodes is easy to manage. In addition, when a node transmits data, it is not necessary to determine the transmission path of the data to be transmitted, and the data only needs to be transmitted according to the ring link. The data transmission efficiency is improved and the error rate and packet loss rate are reduced.
应当注意,尽管在上述实施例中,以特定顺序描述了本公开实施例的方法的操作,但是,这并非要求或者暗示必须按照该特定顺序来执行这些操作,或是必须执行全部所示的操作才能实现期望的结果。相反,流程图中描绘的步骤可以改变执行顺序。附加地或备选地,可以省略某些步骤,将多个步骤合并为一个步骤执行,和/或将一个步骤分解为多个步骤执行。It should be noted that although the operations of the method of the disclosed embodiment are described in a specific order in the above embodiments, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted in the flowchart can change the order of execution. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and/or one step can be decomposed into multiple steps for execution.
本公开的实施例提供的一种系统中传输数据的方法及装置,通过将数据传输系统中的至少一个机房组织成一个节点的方式,形成由多个节点构成的环状的通信链路。针对任一节点,获取包括待处理消息及其目的节点标识的待处理数据,如果该待处理消息的目的节点为该节点,则直接处理该消息,如果该待处理消息的目的节点不是该节点,则向与该节点连接的相 邻节点发送该待处理数据,从而使每条待处理消息通过通信链路,传输至该待处理消息对应的目的节点。由于数据在节点之间的传输流向简单,使得节点之间的数据传输便于管理。并且,当节点传输数据时,无需确定待传输数据的传输路径,仅需按照环形链路传输数据。从而提高了数据传输效率,降低了出错率和丢包率。The embodiment of the present disclosure provides a method and device for transmitting data in a system, which forms a ring-shaped communication link composed of multiple nodes by organizing at least one computer room in the data transmission system into a node. For any node, the data to be processed including the message to be processed and its destination node identifier is obtained. If the destination node of the message to be processed is the node, the message is directly processed. If the destination node of the message to be processed is not the node, the message is sent to the corresponding node connected to the node. The neighboring node sends the data to be processed, so that each message to be processed is transmitted to the destination node corresponding to the message to be processed through the communication link. Since the data transmission flow between nodes is simple, the data transmission between nodes is easy to manage. In addition, when a node transmits data, it does not need to determine the transmission path of the data to be transmitted, but only needs to transmit the data according to the ring link. This improves the data transmission efficiency and reduces the error rate and packet loss rate.
与前述系统中传输数据的方法实施例相对应,本公开还提供了系统中传输数据的装置的实施例。Corresponding to the aforementioned method embodiment for transmitting data in the system, the present disclosure also provides an embodiment of an apparatus for transmitting data in the system.
如图4所示,图4是本公开根据一示例性实施例示出的一种系统中传输数据的装置的框图,该装置应用于数据传输系统,数据传输系统系统包括多个节点,且多个节点构成环状的通信链路,该装置部署于多个节点中的任一目标节点,该装置可以包括:获取模块401,处理模块402和传输模块403。As shown in Figure 4, Figure 4 is a block diagram of a device for transmitting data in a system shown in the present disclosure according to an exemplary embodiment. The device is applied to a data transmission system. The data transmission system includes multiple nodes, and the multiple nodes form a ring-shaped communication link. The device is deployed at any target node among the multiple nodes. The device may include: an acquisition module 401, a processing module 402 and a transmission module 403.
其中,获取模块401,用于获取待处理数据,其中,待处理数据包括待处理消息和待处理消息对应的目的节点标识。The acquisition module 401 is used to acquire data to be processed, wherein the data to be processed includes a message to be processed and a destination node identifier corresponding to the message to be processed.
处理模块402,用于在待处理消息对应的目的节点标识与目标节点的标识相同时,处理待处理消息。The processing module 402 is used to process the message to be processed when the destination node identifier corresponding to the message to be processed is the same as the identifier of the target node.
传输模块403,用于在待处理消息对应的目的节点标识与目标节点的标识不同时,将待处理数据传输至目标节点的相邻节点。The transmission module 403 is used to transmit the data to be processed to an adjacent node of the target node when the destination node identifier corresponding to the message to be processed is different from the identifier of the target node.
在一些实施方式中,在多个节点之间,通过通信链路沿第一传输方向传输数据,待处理数据包括第一待处理数据。其中,获取模块401被配置用于:从目标节点对应的第一相邻节点接收第一待处理数据,第一相邻节点通过通信链路与目标节点相连接,在第一传输方向上,第一相邻节点为目标节点的上一个节点。In some embodiments, data is transmitted between multiple nodes along a first transmission direction via a communication link, and the data to be processed includes first data to be processed. The acquisition module 401 is configured to: receive the first data to be processed from a first adjacent node corresponding to the target node, the first adjacent node is connected to the target node via a communication link, and in the first transmission direction, the first adjacent node is the previous node of the target node.
在另一些实施方式中,传输模块403被配置用于:将接收的第一待处理数据存入第一预存数据中,第一预存数据用于存储向第一传输方向传输的数据,在满足第一时间条件时,从第一预存数据中获取第一待处理数据,向第二相邻节点传输第一待处理数据。第二相邻节点通过通信链路与目标节点相连接,在第一传输方向上,第二相邻节点为目标节点的下一个节点。In other embodiments, the transmission module 403 is configured to: store the received first data to be processed into the first pre-stored data, the first pre-stored data is used to store the data transmitted in the first transmission direction, and when the first time condition is met, obtain the first data to be processed from the first pre-stored data, and transmit the first data to be processed to the second adjacent node. The second adjacent node is connected to the target node via a communication link, and in the first transmission direction, the second adjacent node is the next node of the target node.
在另一些实施方式中,该通信链路为双向通信链路,在多个节点之间,还通过通信链路沿第二传输方向传输数据,第二传输方向与第一传输方向相反。其中,第一相邻节点在第二传输方向上为目标节点的下一个节点。In other embodiments, the communication link is a bidirectional communication link, and data is also transmitted between the multiple nodes through the communication link along a second transmission direction, the second transmission direction being opposite to the first transmission direction, wherein the first adjacent node is the next node of the target node in the second transmission direction.
在另一些实施方式中,待处理数据还包括第二待处理数据。其中,获取模块401还被配置用于:从第二相邻节点接收第二待处理数据,第二相邻节点通过该通信链路与目标节点相连接,在第一传输方向上,第二相邻节点为目标节点的下一个节点。在第二传输方向上,第二相邻节点为目标节点的上一个节点。 In some other embodiments, the data to be processed also includes second data to be processed. The acquisition module 401 is further configured to: receive the second data to be processed from a second adjacent node, the second adjacent node is connected to the target node via the communication link, and in the first transmission direction, the second adjacent node is the next node of the target node. In the second transmission direction, the second adjacent node is the previous node of the target node.
在另一些实施方式中,传输模块403被配置用于:将接收的第二待处理数据存入第二预存数据中,第二预存数据用于存储向第二传输方向传输的数据。在满足第二时间条件时,从第二预存数据中获取第二待处理数据,向第一相邻节点传输第二待处理数据。In some other embodiments, the transmission module 403 is configured to: store the received second data to be processed into second pre-stored data, the second pre-stored data is used to store data transmitted in the second transmission direction. When the second time condition is met, the second data to be processed is obtained from the second pre-stored data, and the second data to be processed is transmitted to the first adjacent node.
在另一些实施方式中,待处理数据还包括第三待处理数据,其中,获取模块401还被配置用于:由目标节点生成第三待处理数据。In some other implementations, the data to be processed further includes third data to be processed, wherein the acquisition module 401 is further configured to: generate the third data to be processed by the target node.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本公开实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiment scheme of the present disclosure. A person of ordinary skill in the art can understand and implement it without paying creative labor.
图5为本公开一些实施例提供的一种电子设备的示意框图。如图5所示,该电子设备910包括处理器911和存储器912,可以用于实现客户端或服务器。存储器912用于非瞬时性地存储有计算机可执行指令(例如一个或多个计算机程序模块)。处理器911用于运行该计算机可执行指令,该计算机可执行指令被处理器911运行时可以执行上文所述的系统中传输数据的方法中的一个或多个步骤,进而实现上文所述的系统中传输数据的方法。存储器912和处理器911可以通过总线系统和/或其它形式的连接机构(未示出)互连。FIG5 is a schematic block diagram of an electronic device provided in some embodiments of the present disclosure. As shown in FIG5 , the electronic device 910 includes a processor 911 and a memory 912, which can be used to implement a client or a server. The memory 912 is used to store computer executable instructions (e.g., one or more computer program modules) non-transiently. The processor 911 is used to run the computer executable instructions, and when the computer executable instructions are run by the processor 911, one or more steps in the method for transmitting data in the system described above can be executed, thereby implementing the method for transmitting data in the system described above. The memory 912 and the processor 911 can be interconnected via a bus system and/or other forms of connection mechanisms (not shown).
例如,处理器911可以是中央处理单元(CPU)、图形处理单元(GPU)或者具有数据处理能力和/或程序执行能力的其它形式的处理单元。例如,中央处理单元(CPU)可以为X86或ARM架构等。处理器911可以为通用处理器或专用处理器,可以控制电子设备910中的其它组件以执行期望的功能。For example, the processor 911 may be a central processing unit (CPU), a graphics processing unit (GPU), or other forms of processing units having data processing capabilities and/or program execution capabilities. For example, the central processing unit (CPU) may be an X86 or ARM architecture, etc. The processor 911 may be a general-purpose processor or a dedicated processor, and may control other components in the electronic device 910 to perform desired functions.
例如,存储器912可以包括一个或多个计算机程序产品的任意组合,计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。非易失性存储器例如可以包括只读存储器(ROM)、硬盘、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、USB存储器、闪存等。在计算机可读存储介质上可以存储一个或多个计算机程序模块,处理器911可以运行一个或多个计算机程序模块,以实现电子设备910的各种功能。在计算机可读存储介质中还可以存储各种应用程序和各种数据以及应用程序使用和/或产生的各种数据等。For example, the memory 912 may include any combination of one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and/or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, flash memory, etc. One or more computer program modules may be stored on the computer-readable storage medium, and the processor 911 may run one or more computer program modules to implement various functions of the electronic device 910. Various applications and various data, as well as various data used and/or generated by the application, etc. may also be stored in the computer-readable storage medium.
需要说明的是,本公开的实施例中,电子设备910的具体功能和技术效果可以参考上文中关于系统中传输数据的方法的描述,此处不再赘述。 It should be noted that, in the embodiment of the present disclosure, the specific functions and technical effects of the electronic device 910 can refer to the above description of the method for transmitting data in the system, which will not be repeated here.
图6为本公开一些实施例提供的另一种电子设备的示意框图。该电子设备920例如适于用来实施本公开实施例提供的系统中传输数据的方法。电子设备920可以是终端设备等,可以用于实现客户端或服务器。电子设备920可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)、可穿戴电子设备等等的移动终端以及诸如数字TV、台式计算机、智能家居设备等等的固定终端。需要注意的是,图6示出的电子设备920仅仅是一个示例,其不会对本公开实施例的功能和使用范围带来任何限制。FIG6 is a schematic block diagram of another electronic device provided in some embodiments of the present disclosure. The electronic device 920 is suitable for implementing the method for transmitting data in the system provided in the embodiment of the present disclosure, for example. The electronic device 920 may be a terminal device, etc., and may be used to implement a client or a server. The electronic device 920 may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable electronic devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc. It should be noted that the electronic device 920 shown in FIG6 is only an example, which does not impose any restrictions on the functions and scope of use of the embodiments of the present disclosure.
如图6所示,电子设备920可以包括处理装置(例如中央处理器、图形处理器等)921,其可以根据存储在只读存储器(ROM)922中的程序或者从存储装置928加载到随机访问存储器(RAM)923中的程序而执行各种适当的动作和处理。在RAM 923中,还存储有电子设备920操作所需的各种程序和数据。处理装置921、ROM 922以及RAM 923通过总线924彼此相连。输入/输出(I/O)接口925也连接至总线924。As shown in FIG6 , the electronic device 920 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 921, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 922 or a program loaded from a storage device 928 to a random access memory (RAM) 923. In the RAM 923, various programs and data required for the operation of the electronic device 920 are also stored. The processing device 921, the ROM 922, and the RAM 923 are connected to each other via a bus 924. An input/output (I/O) interface 925 is also connected to the bus 924.
通常,以下装置可以连接至I/O接口925:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置926;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置927;包括例如磁带、硬盘等的存储装置928;以及通信装置929。通信装置929可以允许电子设备920与其他电子设备进行无线或有线通信以交换数据。虽然图6示出了具有各种装置的电子设备920,但应理解的是,并不要求实施或具备所有示出的装置,电子设备920可以替代地实施或具备更多或更少的装置。Typically, the following devices may be connected to the I/O interface 925: input devices 926 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 927 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 928 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 929. The communication devices 929 may allow the electronic device 920 to communicate with other electronic devices wirelessly or by wire to exchange data. Although FIG. 6 shows an electronic device 920 having various devices, it should be understood that it is not required to implement or have all of the devices shown, and the electronic device 920 may alternatively implement or have more or fewer devices.
例如,根据本公开的实施例,上述系统中传输数据的方法可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包括用于执行上述系统中传输数据的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置929从网络上被下载和安装,或者从存储装置928安装,或者从ROM922安装。在该计算机程序被处理装置921执行时,可以实现本公开实施例提供的系统中传输数据的方法中限定的功能。For example, according to an embodiment of the present disclosure, the method for transmitting data in the above-mentioned system can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method for transmitting data in the above-mentioned system. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 929, or installed from the storage device 928, or installed from the ROM 922. When the computer program is executed by the processing device 921, the functions defined in the method for transmitting data in the system provided by the embodiment of the present disclosure can be implemented.
图7为本公开一些实施例提供的一种存储介质的示意图。例如,如图7所示,存储介质930可以为非暂时性计算机可读存储介质,用于存储非暂时性计算机可执行指令931。当非暂时性计算机可执行指令931由处理器执行时可以实现本公开实施例所述的系统中传输数据的方法,例如,当非暂时性计算机可执行指令931由处理器执行时,可以执行根据上文所述的系统中传输数据的方法中的一个或多个步骤。FIG7 is a schematic diagram of a storage medium provided by some embodiments of the present disclosure. For example, as shown in FIG7, the storage medium 930 may be a non-transitory computer-readable storage medium for storing a non-transitory computer-executable instruction 931. When the non-transitory computer-executable instruction 931 is executed by a processor, the method for transmitting data in the system described in the embodiment of the present disclosure may be implemented. For example, when the non-transitory computer-executable instruction 931 is executed by a processor, one or more steps in the method for transmitting data in the system described above may be executed.
例如,该存储介质930可以应用于上述电子设备中,例如,该存储介质930可以包括电子设备中的存储器。 For example, the storage medium 930 may be applied to the above-mentioned electronic device. For example, the storage medium 930 may include a memory in the electronic device.
例如,存储介质可以包括智能电话的存储卡、平板电脑的存储部件、个人计算机的硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、闪存、或者上述存储介质的任意组合,也可以为其他适用的存储介质。For example, the storage medium may include a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), flash memory, or any combination of the above storage media, or other applicable storage media.
例如,关于存储介质930的说明可以参考电子设备的实施例中对于存储器的描述,重复之处不再赘述。存储介质930的具体功能和技术效果可以参考上文中关于系统中传输数据的方法的描述,此处不再赘述。For example, the description of the storage medium 930 can refer to the description of the memory in the embodiment of the electronic device, and the repeated parts are not repeated. The specific functions and technical effects of the storage medium 930 can refer to the description of the method for transmitting data in the system above, and are not repeated here.
需要说明的是,在本公开的上下文中,计算机可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是,但不限于:电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that in the context of the present disclosure, a computer-readable medium may be a tangible medium that may contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A computer-readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by an instruction execution system, device or device or used in combination with it. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。 It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

  1. 一种系统中传输数据的方法,所述方法应用于数据传输系统,所述数据传输系统包括多个节点,且所述多个节点构成环状的通信链路;所述方法包括:A method for transmitting data in a system, the method being applied to a data transmission system, the data transmission system comprising a plurality of nodes, and the plurality of nodes forming a ring-shaped communication link; the method comprising:
    针对所述多个节点中的任一目标节点,所述目标节点获取待处理数据,其中,所述待处理数据包括待处理消息和所述待处理消息对应的目的节点标识;For any target node among the multiple nodes, the target node obtains data to be processed, wherein the data to be processed includes a message to be processed and a destination node identifier corresponding to the message to be processed;
    若所述待处理消息对应的目的节点标识与所述目标节点的标识相同,所述目标节点处理所述待处理消息;If the destination node identifier corresponding to the message to be processed is the same as the identifier of the target node, the target node processes the message to be processed;
    若所述待处理消息对应的目的节点标识与所述目标节点的标识不同,所述目标节点将所述待处理数据传输至所述目标节点的相邻节点。If the destination node identifier corresponding to the message to be processed is different from the identifier of the target node, the target node transmits the data to be processed to an adjacent node of the target node.
  2. 根据权利要求1所述的方法,在所述多个节点之间,通过所述通信链路沿第一传输方向传输数据;所述待处理数据包括第一待处理数据;其中,所述获取待处理数据,包括:According to the method of claim 1, data is transmitted between the plurality of nodes through the communication link along a first transmission direction; the data to be processed includes first data to be processed; wherein obtaining the data to be processed includes:
    从所述目标节点对应的第一相邻节点接收所述第一待处理数据;所述第一相邻节点通过所述通信链路与所述目标节点相连接,在所述第一传输方向上,所述第一相邻节点为所述目标节点的上一个节点。The first to-be-processed data is received from a first adjacent node corresponding to the target node; the first adjacent node is connected to the target node via the communication link, and in the first transmission direction, the first adjacent node is the previous node of the target node.
  3. 根据权利要求2所述的方法,其中,所述将所述待处理数据传输至所述目标节点的相邻节点,包括:The method according to claim 2, wherein the transmitting the to-be-processed data to a neighboring node of the target node comprises:
    将接收的所述第一待处理数据存入所述第一预存数据中;所述第一预存数据用于存储向所述第一传输方向传输的数据;storing the received first data to be processed into the first pre-stored data; the first pre-stored data is used to store data transmitted in the first transmission direction;
    在满足第一时间条件时,从所述第一预存数据中获取所述第一待处理数据;When a first time condition is met, obtaining the first data to be processed from the first pre-stored data;
    向第二相邻节点传输所述第一待处理数据;所述第二相邻节点通过所述通信链路与所述目标节点相连接,在所述第一传输方向上,所述第二相邻节点为所述目标节点的下一个节点。The first data to be processed is transmitted to a second adjacent node; the second adjacent node is connected to the target node via the communication link, and in the first transmission direction, the second adjacent node is the next node of the target node.
  4. 根据权利要求2所述的方法,其中,所述通信链路为双向通信链路;在所述多个节点之间,还通过所述通信链路沿第二传输方向传输数据;所述第二传输方向与所述第一传输方向相反;其中,所述第一相邻节点在所述第二传输方向上为所述目标节点的下一个节点。The method according to claim 2, wherein the communication link is a bidirectional communication link; data is also transmitted along a second transmission direction between the multiple nodes through the communication link; the second transmission direction is opposite to the first transmission direction; wherein the first adjacent node is the next node of the target node in the second transmission direction.
  5. 根据权利要求4所述的方法,其中,所述待处理数据还包括第二待处理数据;其中,所述获取待处理数据,还包括:从第二相邻节点接收所述第二待处理数据;所述第二相邻节点通过所述通信链路与所述目标节点相连接;在所述第一传输方向上,所述第二相邻节点为所述目标节点的下一个节点;在所述第二传输方向上,所述第二相邻节点为所述目标节点的上一个节点。According to the method of claim 4, wherein the data to be processed also includes second data to be processed; wherein the obtaining of the data to be processed also includes: receiving the second data to be processed from a second adjacent node; the second adjacent node is connected to the target node through the communication link; in the first transmission direction, the second adjacent node is the next node of the target node; in the second transmission direction, the second adjacent node is the previous node of the target node.
  6. 根据权利要求5所述的方法,其中,所述将所述待处理数据传输至所述目标节点的相 邻节点,包括:The method according to claim 5, wherein the step of transmitting the to-be-processed data to the target node comprises: Neighboring nodes include:
    将接收的所述第二待处理数据存入所述第二预存数据中;所述第二预存数据用于存储向所述第二传输方向传输的数据;storing the received second data to be processed into the second pre-stored data; the second pre-stored data is used to store data transmitted in the second transmission direction;
    在满足第二时间条件时,从所述第二预存数据中获取所述第二待处理数据;When a second time condition is met, acquiring the second data to be processed from the second pre-stored data;
    向所述第一相邻节点传输所述第二待处理数据。Transmit the second to-be-processed data to the first neighboring node.
  7. 根据权利要求2所述的方法,其中,所述待处理数据还包括第三待处理数据;其中,所述获取待处理数据,还包括:由所述目标节点生成所述第三待处理数据。The method according to claim 2, wherein the data to be processed also includes third data to be processed; wherein obtaining the data to be processed further includes: generating the third data to be processed by the target node.
  8. 一种系统中传输数据的装置,所述装置应用于数据传输系统,所述数据传输系统包括多个节点,且所述多个节点构成环状的通信链路;针对所述多个节点中的任一目标节点,所述装置包括:A device for transmitting data in a system, the device being applied to a data transmission system, the data transmission system comprising a plurality of nodes, and the plurality of nodes forming a ring-shaped communication link; for any target node among the plurality of nodes, the device comprises:
    获取模块,用于获取待处理数据,其中,所述待处理数据包括待处理消息和所述待处理消息对应的目的节点标识;An acquisition module, used to acquire data to be processed, wherein the data to be processed includes a message to be processed and a destination node identifier corresponding to the message to be processed;
    处理模块,用于在所述待处理消息对应的目的节点标识与所述目标节点的标识相同时,处理所述待处理消息;A processing module, configured to process the message to be processed when the destination node identifier corresponding to the message to be processed is the same as the identifier of the target node;
    传输模块,用于在所述待处理消息对应的目的节点标识与所述目标节点的标识不同时,将所述待处理数据传输至所述目标节点的相邻节点。The transmission module is used to transmit the data to be processed to an adjacent node of the target node when the destination node identifier corresponding to the message to be processed is different from the identifier of the target node.
  9. 一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令所述计算机执行权利要求1-7中任一项所述的方法。A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 7.
  10. 一种电子设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现权利要求1-7中任一项所述的方法。 An electronic device comprises a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 7 is implemented.
PCT/CN2024/082057 2023-03-17 2024-03-15 Method and apparatus for transmitting data in system, and electronic device WO2024193483A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310264788.6 2023-03-17
CN202310264788.6A CN118677717A (en) 2023-03-17 2023-03-17 Method and device for transmitting data in system and electronic equipment

Publications (1)

Publication Number Publication Date
WO2024193483A1 true WO2024193483A1 (en) 2024-09-26

Family

ID=92727126

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/082057 WO2024193483A1 (en) 2023-03-17 2024-03-15 Method and apparatus for transmitting data in system, and electronic device

Country Status (2)

Country Link
CN (1) CN118677717A (en)
WO (1) WO2024193483A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120188912A1 (en) * 2009-11-11 2012-07-26 Jianqun Chen Method, apparatus, and system for updating ring network topology information
US20140348028A1 (en) * 2012-01-17 2014-11-27 Huawei Technologies Co., Ltd. Method for creating ring network label switched path, related device, and communications system
CN104767665A (en) * 2014-01-07 2015-07-08 艾默生网络能源有限公司 Ring communication network master station redundancy method, device and system
WO2019028979A1 (en) * 2017-08-09 2019-02-14 广州市百果园信息技术有限公司 Message transmission method and device within autonomous system, and corresponding message transmission system
US20200228361A1 (en) * 2017-09-27 2020-07-16 Huawei Technologies Co., Ltd. Multicast Packet Transmission Method, Apparatus, and System

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120188912A1 (en) * 2009-11-11 2012-07-26 Jianqun Chen Method, apparatus, and system for updating ring network topology information
US20140348028A1 (en) * 2012-01-17 2014-11-27 Huawei Technologies Co., Ltd. Method for creating ring network label switched path, related device, and communications system
CN104767665A (en) * 2014-01-07 2015-07-08 艾默生网络能源有限公司 Ring communication network master station redundancy method, device and system
WO2019028979A1 (en) * 2017-08-09 2019-02-14 广州市百果园信息技术有限公司 Message transmission method and device within autonomous system, and corresponding message transmission system
US20200228361A1 (en) * 2017-09-27 2020-07-16 Huawei Technologies Co., Ltd. Multicast Packet Transmission Method, Apparatus, and System

Also Published As

Publication number Publication date
CN118677717A (en) 2024-09-20

Similar Documents

Publication Publication Date Title
US12019652B2 (en) Method and device for synchronizing node data
CN111679990A (en) Test data generation method and device, readable medium and electronic equipment
US12075129B2 (en) Method, apparatus, medium and electronic device for configuring a gift list in a live broadcast room
US20220043898A1 (en) Methods and apparatuses for acquiring information
JP6758139B2 (en) Systems and methods for efficient call processing
CN112418389A (en) Data processing method and device, electronic equipment and computer readable storage medium
US11962929B2 (en) Method, apparatus, and device for configuring video special effect, and storage medium
CN111324470B (en) Method and device for generating information
CN110704050B (en) Module initializing method and device, electronic equipment and computer readable storage medium
US20150120826A1 (en) Node control in a distributed peer-to-peer network
WO2024193483A1 (en) Method and apparatus for transmitting data in system, and electronic device
CN115225586B (en) Data packet transmitting method, device, equipment and computer readable storage medium
CN115134254B (en) Network simulation method, device, equipment and storage medium
CN111626802A (en) Method and apparatus for processing information
JP7298008B2 (en) Systems, methods and apparatus for developing smart contracts
CN112257039B (en) Identity attribute adding method and device and electronic equipment
CN109491830A (en) The method and system in switch data source
CN111324386B (en) Method and device for starting split application program, electronic equipment and storage medium
EP4050483A1 (en) Data processing method, apparatus, electronic device and computer-readable storage medium
WO2020108124A1 (en) Data backup method and apparatus
CN114398098B (en) Application script execution method, device, electronic equipment and computer readable medium
WO2024198981A1 (en) Co-streaming method and apparatus, device, and storage medium
CN111694679B (en) Message processing method and device and electronic equipment
WO2023226787A1 (en) Communication method, system, and apparatus, and electronic device
CN113761548B (en) Data transmission method and device for Shuffle process