Data transmission method and device based on token ring and storage medium

By using the token ring mechanism in data transmission, it ensures that the data sending device sends data after obtaining enough tokens, which solves the problem of channel blocking in data transmission, improves resource utilization, and achieves efficient data transmission.

CN118842849APending Publication Date: 2024-10-25GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310458546.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-25
Publication Date
2024-10-25

AI Technical Summary

Technical Problem

During the data transmission process, the sending master does not know the receiving capability of the receiving master, which may cause channel blocking. Although the existing technology solves the blocking problem, the resource utilization rate is low, resulting in resource waste.

Method used

Using the data transmission method based on the token ring, the data sending device only sends data to the data receiving device after obtaining enough tokens, ensuring that the receiving end has sufficient storage space, avoiding channel blocking, and realizing the data receiving device through the token ring. Storage space sharing improves resource utilization.

Benefits of technology

It achieves non-blocking transmission during data transmission, improves transmission efficiency and resource utilization, and avoids channel blocking and resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118842849A_ABST
    Figure CN118842849A_ABST
Patent Text Reader

Abstract

The invention provides a data transmission method and device based on a token ring and a storage medium. According to the technical scheme, a data sending device firstly obtains to-be-sent data sent to a data receiving device, and the data receiving device and the data sending device are connected through a token ring; the method comprises the steps that a token ring is established, then a target number of tokens of data receiving equipment are obtained from the token ring, the target number of tokens correspond to the data size of data to be sent, finally, the data to be sent are sent to the data receiving equipment based on the target number of tokens, and correspondingly, the data receiving equipment receives and stores the data to be sent. According to the data transmission method based on the token ring, the data sending device firstly obtains sufficient tokens of the data receiving device in the token ring and then carries out data transmission, non-blocking transmission in the data transmission process can be achieved, the transmission efficiency is improved, and the data transmission efficiency is improved. And the storage space of the data receiving equipment is shared for all the data sending equipment, so that the memory utilization rate can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data transmission, and in particular to a token ring-based data transmission method, device and storage medium. Background Art

[0002] With the development of data transmission technology, data transmission between devices (masters) that can actively initiate read and write memory access is becoming more and more widely used. In the application process of masters, it is often necessary to transmit data between multiple masters to meet the needs, such as data transmission between mobile phones and computers.

[0003] In the current related technology, multiple masters are generally based on a bus matrix during data transmission, and for a certain master being accessed, the RAM resources of the master are shared with the master initiating the transmission, that is, the data of the master initiating the transmission are mixed together and placed in the accessed master.

[0004] However, before the sending master sends data to the receiving master, the sending master does not know whether the receiving master can receive it. When the receiving master cannot receive it, the output channel of the sending master will be blocked.

[0005] Therefore, how to avoid channel blockage when transmitting data between masters has become a technical problem that needs to be solved urgently. Summary of the invention

[0006] The present application provides a data transmission method, device and storage medium based on a token ring, which can avoid channel blocking when transmitting data between masters and realize non-blocking transmission during the data transmission process.

[0007] In a first aspect, the present application provides a token ring-based data transmission method, which is applied to a data sending device, the method comprising: obtaining data to be sent to a data receiving device, the data receiving device and the data sending device being connected via a token ring; obtaining a target number of tokens of the data receiving device from the token ring, the target number of tokens corresponding to the data volume of the data to be sent; and sending the data to be sent to the data receiving device based on the target number of tokens.

[0008] In an embodiment of the present application, when a data sending device has data to be sent to a data receiving device, the data sending device first obtains a token of the data receiving device in a token ring, and when sufficient tokens are obtained, the data to be sent is sent to the data receiving device based on the token. This method can achieve non-blocking transmission between the data sending device and the data receiving device by first obtaining sufficient tokens and then transmitting data, thereby improving transmission efficiency; and the storage space of the data receiving device is shared by all data sending devices, so the memory utilization of the data receiving device can also be improved.

[0009] In a second aspect, the present application provides a data transmission method based on a token ring, which is applied to a data receiving device, and the method includes: receiving data to be sent sent by a data sending device, the data to be sent is data sent by the data sending device based on a target number of tokens of the data receiving device, the data receiving device and the data sending device are connected via a token ring, and the target number of tokens corresponds to the data volume of the data to be sent; and storing the data to be sent.

[0010] In this embodiment, the data receiving device receives and stores the data to be sent from the data sending device. Since the data to be sent is sent by the data sending device based on the target number of tokens, it means that the data sending device has obtained enough tokens, that is, there is enough storage space in the data receiving device, so it will not cause channel blockage during data transmission, and the transmission efficiency is high.

[0011] In the third aspect, the present application provides a token ring-based data transmission device, which is applied to a data sending device, and the device includes: an acquisition module, used to acquire data to be sent to a data receiving device, and the data receiving device and the data sending device are connected via a token ring; the acquisition module is also used to acquire a target number of tokens of the data receiving device from the token ring, and the target number of tokens corresponds to the data volume of the data to be sent; a sending module is used to send the data to be sent to the data receiving device based on the target number of tokens.

[0012] In a fourth aspect, the present application provides a token ring-based data transmission device, which is applied to a data receiving device, and the device includes: a receiving module, which is used to receive the data to be sent by a data sending device, and the data to be sent is the data sent by the data sending device based on the target number of tokens. The data receiving device and the data sending device are connected through a token ring, and the target number of tokens corresponds to the data volume of the data to be sent; a storage module, which is used to store the data to be sent.

[0013] In a fifth aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the memory is used to store code instructions; the processor is used to execute the code instructions to implement the method in the first aspect or the second aspect above.

[0014] Optionally, there are one or more processors and one or more memories.

[0015] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.

[0016] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be set on different chips respectively. The embodiments of the present application do not limit the type of memory and the setting method of the memory and the processor.

[0017] In a sixth aspect, the present application provides a computer-readable storage medium, which stores a computer program (also referred to as code, or instruction) which, when executed on a computer, enables the computer to execute the method in the first or second aspect above.

[0018] In a seventh aspect, the present application provides a computer program product, comprising: a computer program (also referred to as code, or instruction), which enables a computer to execute the method in the first aspect or the second aspect when the computer program is executed. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 An exemplary structural diagram of multiple masters transmitting data to each other provided in one embodiment of the present application;

[0020] Figure 2 An exemplary structural diagram of multiple masters transmitting data to each other provided in another embodiment of the present application;

[0021] Figure 3 A schematic diagram of a system architecture of an electronic device provided by an embodiment of the present application;

[0022] Figure 4 A schematic flow chart of a token ring-based data transmission method provided by one embodiment of the present application;

[0023] Figure 5 A schematic flow chart of a token ring-based data transmission method provided in another embodiment of the present application;

[0024] Figure 6An exemplary structural diagram of a plurality of masters connected via a token ring transmitting data to each other provided by an embodiment of the present application;

[0025] Figure 7 A timing diagram of a token ring provided for one embodiment of the present application;

[0026] Figure 8 A schematic diagram of the use process of a token ring provided by an embodiment of the present application;

[0027] Fig. 9 A schematic structural diagram of a token ring-based data transmission device provided by one embodiment of the present application;

[0028] Fig.10 A schematic structural diagram of a token ring-based data transmission device provided by another embodiment of the present application;

[0029] Fig.11 A structural schematic diagram of a token ring-based data transmission device provided in yet another embodiment of the present application. DETAILED DESCRIPTION

[0030] The technical solution in this application will be described below in conjunction with the accompanying drawings.

[0031] In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference.

[0032] It should be noted that, in this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0033] In addition, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can mean: a, or b, or c, or a and b, or a and c, or b and c, or a, b and c, where a, b, c can be single or multiple.

[0034] With the rapid development of the information age, people are paying more and more attention to the performance of communication networks that realize information exchange and transmission. Based on communication networks, data transmission between devices (masters) that can actively initiate read and write memory access is also becoming more and more widely used. In the process of master application, it is often necessary for multiple masters to transmit data to each other to meet the needs, such as data transmission between mobile phones and computers.

[0035] For example, please refer to Figure 1 , the four masters A, B, C and D need to transmit data to each other in their business, that is, they need to access each other's random access memory (RAM). The RAM in A is named ram_A, its data output channel is channel 1, and its data input channel is channel 2; the RAM in B is named ram_B, its data output channel is channel 3, and its data input channel is channel 4; the RAM in C is named ram_C, its data output channel is channel 5, and its data input channel is channel 6; the RAM in D is named ram_D, its data output channel is channel 7, and its data input channel is channel 8.

[0036] Among them, the four masters A, B, C and D exchange data through the bus matrix. Figure 1The Bus Matrix in the example is based on the bus protocol (Advanced Extensible Interface, AXI). AXI is a high-performance and high-bandwidth on-chip bus protocol proposed by ARM, which is widely used in system-on-chip (SOC). The AXI bus adopts a transmission mechanism of read-write separation, address / control and data separation. By defining five independent transmission channels, namely, read address channel (AR), read data channel (R), write address channel (AW), write data channel (W), and write response channel (B), the transmission efficiency is greatly improved. In the SOC based on the AXI bus protocol, multiple masters often exchange data through the Bus Matrix.

[0037] It should be understood that Figure 1 In the process of data transmission between the four masters A, B, C and D shown in the figure, for a certain master being accessed, the RAM of the master is shared by the other three masters initiating the transmission, that is, the data of the other three masters initiating the transmission are mixed together and put into this RAM. Among them, the paths for A, B, and C to access D are channel 1->channel 8, channel 3->channel 8, channel 5->channel 8 respectively; the paths for A, B, and D to access C are channel 1->channel 6, channel 3->channel 6, channel 7->channel 6 respectively; the paths for A, C, and D to access B are channel 1->channel 4, channel 5->channel 4, channel 7->channel 4 respectively; the paths for B, C, and D to access A are channel 3->channel 2, channel 5->channel 2, channel 7->channel 2 respectively.

[0038] However, taking A, B, and C accessing D as an example, the corresponding Figure 1 The paths in are channel 1->channel 8, channel 3->channel 8, channel 5->channel 8. The data sent by A, B and C to D are all stored in the RAM in D, which is shared by A, B and C. However, A, B and C do not know how much remaining space is in the current RAM, and A, B or C does not know whether the other two masters are sending data to D except themselves. Therefore, once the space in the RAM is used up, the input port of D will be back-pressured. If one or more masters among A, B and C that send data to D continue to send data to D, then back-pressure will be applied step by step, and the output ports of this or these masters will be back-pressured all the time. For example, suppose A and B keep sending data to D, but D's RAM is full, then the output paths 1 and 3 of A and B will be blocked. Then, the path from A to B and C is blocked, and the path from B to A and C is also blocked.

[0039] In other words, the above Figure 1In the technical solution, before the sending end sends data to the receiving end, it is not known whether the receiving end can receive the data. When the receiving end cannot receive the data, the AXI Bus Matrix will be blocked.

[0040] In response to the situation that may cause AXI Bus Matrix to be blocked, a new technical solution is proposed in the related art, that is, the sending end checks whether the receiving end has enough space before sending data; if the receiving end has enough space, the data is sent; otherwise, the data is not sent.

[0041] For example, please refer to Figure 2 , taking the bus matrix based on AXI as an example, among the accessed masters, for each master that wants to send data to it, there is an independent ram corresponding inside. For example, A includes ram_B_A, ram_C_A and ram_D_A, which are used to store the data sent to A by B, C and D respectively; B includes ram_A_B, ram_C_B and ram_D_B, which are used to store the data sent to B by A, C and D respectively; C includes ram_A_C, ram_B_C and ram_D_C, which are used to store the data sent to C by A, B and D respectively; D includes ram_A_D, ram_B_D and ram_C_D, which are used to store the data sent to D by A, B and C respectively. Among them, the paths for A, B, and C to access D are channel 1->channel 8, channel 3->channel 8, and channel 5->channel 8 respectively; the paths for A, B, and D to access C are channel 1->channel 6, channel 3->channel 6, and channel 7->channel 6 respectively; the paths for A, C, and D to access B are channel 1->channel 4, channel 5->channel 4, and channel 7->channel 4 respectively; the paths for B, C, and D to access A are channel 3->channel 2, channel 5->channel 2, and channel 7->channel 2 respectively.

[0042] Take A, B, C accessing D as an example, ram_A_D, ram_B_D, ram_C_D store the data sent by A, B, C to D respectively. The space in ram is used sequentially, and the remaining space is notified to each other through pointers. For example, the ram in A has a write pointer (wptr) and a read pointer (rptr). Wptr indicates where A's data is written, and rptr indicates the position where the written data is no longer useful. The space from rptr to wptr is the space that A can continue to write.

[0043] However, in the above technical solution, for each sending master, a receiving end has to prepare a piece of RAM respectively, resulting in low RAM utilization. For example, A and B send data to D, but C does not send data, then ram_A_D and ram_B_D can be used, and ram_C_D will be idle.

[0044] That is to say, Figure 2 Although the technical solution in can solve the problem of data blocking when transmitting data between masters, it will bring new problems, namely, low resource utilization, resulting in resource waste. Therefore, how to better solve the channel blocking that occurs when transmitting data between masters has become a technical problem that needs to be solved urgently.

[0045] In view of this, the present application provides a data transmission method, device and storage medium based on a token ring. In the technical solution of the present application, the data sending device first obtains the data to be sent to the data receiving device, and the data receiving device and the data sending device are connected through a token ring; then the target number of tokens of the data receiving device is obtained from the token ring, and the target number of tokens corresponds to the data volume of the data to be sent. Finally, based on the target number of tokens, the data to be sent is sent to the data receiving device, and accordingly, the data receiving device receives and stores the data to be sent. In the data transmission method based on a token ring of the present application, the data sending device first obtains enough tokens of the data receiving device in the token ring, and then performs data transmission, which can realize non-blocking transmission during the data transmission process and improve transmission efficiency.

[0046] It should be understood that the data sending device and the data receiving device involved in the embodiments of the present application can be a mobile phone, a tablet computer, a laptop computer, a PDA, a mobile Internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a smart screen, an artificial intelligence (AI) speaker, a headset, a terminal in industrial control, a terminal in self driving, a terminal in remote medical surgery, a terminal in a smart grid, a terminal in transportation safety, a terminal in a smart city, a terminal in a smart home, a personal digital assistant (PDA), etc., and the embodiments of the present application are not limited to this.

[0047] The data sending device and the data receiving device may be collectively referred to as electronic devices. For example, Figure 3 A schematic diagram of the system architecture of an electronic device provided in one embodiment of the present application. Figure 3As shown, the electronic device includes components such as a processor 310, a memory 320, a transceiver 330, a display unit 340, an input unit 350, a sensor 360, an audio circuit 370, and a power module 380.

[0048] The processor 310 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 320, and calling data stored in the memory 320, the processor 310 performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 310 may include one or more processing units; optionally, the processor 310 may integrate an application processor, which mainly processes operating devices, user interfaces, and application programs, etc. Of course, other processors may also be included, which are not listed here one by one.

[0049] The memory 320 can be used to store software programs and modules. The processor 310 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 320. The memory 320 mainly includes a program storage area and a data storage area, wherein the program storage area can store operating devices, at least one application required for a function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the memory 320 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0050] The transceiver 330 can provide wireless communication solutions for electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The transceiver 330 can be one or more devices integrating at least one communication processing module, for example, an antenna and a baseband processor are integrated into the transceiver 330, or an antenna and a modem processor are integrated into the transceiver 330, etc., which are not limited here.

[0051] The display unit 340 may be used to display information input by the user or information provided to the user and various menus of the electronic device. The display unit 340 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc., which is not limited here.

[0052] The input unit 350 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the input unit 350 can collect the user's operations on or near it, and drive the corresponding connection device according to a pre-set program. In addition, the input unit 350 may include a touch panel, which can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel, the input unit 350 may also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of function keys (such as volume control keys, switch keys, etc.), trackballs, joysticks, etc.

[0053] The electronic device may also include at least one sensor 360, such as a gyroscope sensor, a motion sensor, and other sensors. The motion sensor may include an accelerometer sensor for detecting the magnitude of acceleration in all directions, and the magnitude and direction of gravity when stationary, which can be used for applications to identify the posture of the electronic device, such as horizontal and vertical screen switching, related games, magnetometer posture calibration, etc. As for other sensors that may be configured in the electronic device, such as a pressure gauge, a barometer, a hygrometer, a thermometer, an infrared sensor, a fingerprint sensor, etc., they will not be described in detail here.

[0054] The audio circuit 370 may include a speaker and a microphone, and may provide an audio interface between the user and the electronic device. The audio circuit 370 may transmit the received audio data to the speaker after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 370 and converted into audio data, and then the audio data is output to the processor 310 for processing, and then sent to another electronic device through the video circuit, or the audio data is output to the memory 320 for further processing.

[0055] The electronic device also includes a power module 380 for supplying power to various components. Optionally, the power module 380 can be logically connected to the processor 310 through a power management device, so that the power management device can manage charging, discharging, power consumption and other functions.

[0056] Although not shown, the electronic device may further include a camera. Optionally, the camera may be located at the front or rear of the electronic device, which is not limited in the present embodiment.

[0057] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0058] It should be noted that the master in the embodiment of the present application can also be called an electronic device, or a data sending device or a data receiving device, and the present application does not limit this.

[0059] In order to make the purpose and technical solution of the present application clearer and more intuitive, the data transmission method, device and storage medium based on token ring provided by the embodiment of the present application will be described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0060] Please refer to Figure 4 , is a schematic flow chart of a token ring-based data transmission method provided by an embodiment of the present application. The method can be applied to Figure 3 The electronic equipment shown is described in detail below Figure 4 The various steps in the method shown in the flowchart include:

[0061] S401, a data sending device obtains data to be sent to a data receiving device, and the data receiving device and the data sending device are connected via a token ring.

[0062] It should be understood that a token ring is composed of several ring lines, and there are multiple tokens on the token ring. The space size of each token is the same. The specific space size value can be selected according to different scenarios. This application does not limit the specific space size value of the token. For electronic devices connected by the token ring, whoever has the token has the transmission permission. In other words, when multiple senders send data to one receiver, those with tokens can send, and those without tokens cannot send.

[0063] It should also be understood that the data sending device may obtain the data to be sent to the data receiving device by identifying whether there is a relevant identifier of the data receiving device in the data to be sent, or by other means, which is not limited in this application.

[0064] S402: The data sending device obtains a target number of tokens of the data receiving device from the token ring, where the target number of tokens corresponds to the amount of data to be sent.

[0065] It should be understood that after the data receiving device is reset, all the space in the RAM is free, and then the data receiving device puts its total number of tokens on the token ring in a preset clock cycle. When the data sending device has data to be sent to the data receiving device, it obtains the target number of tokens of the data receiving device corresponding to the data amount of the data to be sent from the token ring.

[0066] S403: The data sending device sends the data to be sent to the data receiving device based on the target number of tokens.

[0067] Correspondingly, the data receiving device receives the data to be sent.

[0068] It should be understood that the data sending device can obtain the target number of tokens, which means that the data receiving device can store the data to be sent without causing channel blocking; then the data to be sent is sent to the data receiving device based on the target number of tokens.

[0069] S404: The data receiving device stores the data to be sent.

[0070] It should be understood that after receiving the data to be sent, the data receiving device stores the data to be sent in its own database for backup.

[0071] In this embodiment, when the data sending device has data to be sent to the data receiving device, it first obtains the token of the data receiving device in the token ring, and when sufficient tokens are obtained, the data to be sent is sent to the data receiving device based on the token. This method can achieve non-blocking transmission between the data sending device and the data receiving device by first obtaining sufficient tokens and then transmitting data, thereby improving transmission efficiency; and the storage space of the data receiving device is shared by all data sending devices, so the memory utilization of the data receiving device can also be improved.

[0072] Based on the above embodiments, Figure 5 A schematic flow chart of a token ring-based data transmission method provided in another embodiment of the present application, Figure 5 In the embodiment shown, the data sending device needs to obtain the number of tokens of the data receiving device in the token ring at the current moment and compare the number of tokens with the target number before obtaining the target number of tokens of the data receiving device from the token ring. The following is an example of a detailed description. Figure 5 The various steps in the method shown in the flowchart include:

[0073] S501, a data sending device obtains data to be sent to a data receiving device, and the data receiving device and the data sending device are connected via a token ring.

[0074] This step and Figure 4 Similar parts in step S401 in the illustrated embodiment are not described in detail here.

[0075] It should also be understood that the token ring pre-stores the tokens of the data receiving device, and the number of tokens of the data receiving device is determined according to the remaining storage space in the data receiving device.

[0076] Exemplarily, after the data receiving device is reset, its storage space is all free, that is, all the space in the RAM is free. At this time, the data receiving device can put all its own tokens on the token ring when it turns over, that is, the token ring stores all the tokens of the data receiving device; or the data receiving device may also have some reserved designated tokens that are not put on, and put other tokens except the designated tokens into the token ring. At this time, the token ring stores some tokens of the data receiving device, that is, the number of tokens of the data receiving device pre-stored in the token ring is determined according to the remaining storage space in the data receiving device, which can be all the tokens or some of the tokens, and the present application does not limit this.

[0077] S502: The data sending device obtains the number of tokens of the data receiving device in the token ring at the current moment.

[0078] It should be understood that the data sending device obtains the number of tokens of the data receiving device in the token ring at the current moment, which may be the number of all tokens of the data receiving device or the number of some tokens.

[0079] S503, the data sending device compares the number of tokens of the data receiving device in the token ring at the current moment with a target number, where the target number of tokens corresponds to the amount of data to be sent.

[0080] It should be understood that each token corresponds to a space size, for example, a token can correspond to a space of 3 bytes. The data sending device can obtain the required number of tokens corresponding to the amount of data to be sent, that is, the target number, by calculation, and then compare the number of tokens of the data receiving device in the token ring at the current moment with the size of the target number.

[0081] S504: When the number of tokens of the data receiving devices in the token ring at the current moment is greater than or equal to the target number, the data sending device acquires the target number of tokens of the data receiving devices from the token ring.

[0082] It should be understood that if the number of tokens of the data receiving device in the token ring at the current moment is greater than or equal to the target number, it means that the data receiving device has enough space to receive and store the data to be sent. At this time, the data sending device correspondingly obtains the target number of tokens of the data receiving device in the token ring.

[0083] Furthermore, the token ring includes a target parameter (pend_ptr), which is used to indicate whether the data receiving device is in a state of insufficient tokens before the current moment. Specifically, taking the master as an example, pend_ptr indicates that the tokens are insufficient after being allocated to a certain master last time. Its bit width n is determined by the number N of masters in the token ring, and satisfies 2 n- 1≤N<2 n At the same time, in addition to being able to represent N masters, n bits also require an additional number to represent the default value, which indicates that there is currently no shortage of tokens.

[0084] It should also be understood that the token ring also includes the signal start (start) and the number of tokens (token_num). Among them, start is a 1-bit signal, indicating the starting information of the token ring; token_num indicates the number of tokens, and its bit width is determined by the largest RAM space in the master. For example, in bytes, the maximum RAM is M bytes, then the bit width m satisfies 2 m-1 <M≤2 m .

[0085] In a possible implementation, before the data sending device obtains the target number of tokens of the data receiving device from the token ring, it is also necessary to determine whether the target parameter of the data receiving device is a target value. The target value is used to indicate that the data receiving device is not in a state of insufficient tokens before the current moment. The target value is also the default value mentioned above.

[0086] It should be noted that the target value in the embodiment of the present application can also be referred to as a default value.

[0087] Furthermore, when the target parameter of the data receiving device is a target value, the data sending device obtains a target number of tokens of the data receiving device from the token ring.

[0088] It should be understood that when the target parameter of the data receiving device is the target value, it means that the data receiving device is not in a state of insufficient tokens. At this time, any device that needs its token can directly obtain it.

[0089] Accordingly, when the target parameter of the data receiving device is not the target value, the data sending device determines whether the value corresponding to the target parameter corresponds to the data sending device. When the value corresponding to the target parameter corresponds to the data sending device, the data sending device obtains the target number of tokens of the data receiving device from the token ring.

[0090] It should be understood that if the target parameter of the data receiving device is not the target value, it means that the data receiving device is in a state of insufficient tokens and may have stopped at a data sending device last time. When the data receiving device has a token again, it will prioritize the data sending device where it stopped to obtain it.

[0091] Furthermore, the data sending device determines whether the value corresponding to the target parameter corresponds to the data sending device, that is, determines whether the data receiving device has stopped at the data sending device. If the value corresponding to the target parameter corresponds to the data sending device, it means that the data receiving device stopped at the data sending device last time, and the data sending device can obtain the target number of tokens of the data receiving device from the token ring.

[0092] S505: The data sending device updates the target parameters of the data receiving device in the token ring.

[0093] It should be understood that, when the target parameter of the data receiving device is the target value, the data sending device maintains the target value unchanged after obtaining the target number of tokens of the data receiving device from the token ring; when the target parameter of the data receiving device is not the target value, the data sending device updates the target parameter of the data receiving device in the token ring to the target value after obtaining the target number of tokens of the data receiving device from the token ring.

[0094] In addition, after the data sending device obtains the target number of tokens of the data receiving device from the token ring, it will also update the number of tokens of the data receiving device in the token ring, that is, update it to the target number of tokens, which is the difference between the number of tokens of the data receiving device in the token ring at the current moment and the target number.

[0095] Accordingly, during the data transmission process, the data receiving device will also timely update the number of tokens of the data receiving device in the token ring according to its own token release situation, for example, updating the number of tokens of the data receiving device in the token ring according to a preset period.

[0096] Exemplarily, the data receiving device first determines whether the token ring is the token of the data receiving device at the current moment; if the token ring is the token of the data receiving device at the current moment, the tokens that have been released in the data receiving device are added to the token ring according to a preset period to update the number of tokens of the data receiving device in the token ring.

[0097] In another possible implementation, when the number of tokens of the data receiving device in the token ring of the data sending device at the current moment is less than the target number, and / or the target parameter of the data receiving device is not the target value, and the value corresponding to the target parameter does not correspond to the data sending device, the data sending device does not first obtain the token of the data receiving device, and then waits for the data sending device to obtain the token of the data receiving device next time.

[0098] Based on the above description of the data sending device acquiring the target number of tokens of the data receiving device from the token ring, the following describes in detail the situation in which the data sending device acquires the target number of tokens of the data receiving device from the token ring using a specific example.

[0099] For example, please refer to Figure 6 , is an exemplary structural diagram of data transmission between multiple masters connected through a token ring provided by an embodiment of the present application. The four masters A, B, C and D are connected through a token ring, and the four masters A, B, C and D need to transmit data to each other in business, that is, they need to access each other's RAM. The RAM in A is named ram_A, and its data output channel is channel 1, and its data input channel is channel 2; the RAM in B is named ram_B, and its data output channel is channel 3, and its data input channel is channel 4; the RAM in C is named ram_C, and its data output channel is channel 5, and its data input channel is channel 6; the RAM in D is named ram_D, and its data output channel is channel 7, and its data input channel is channel 8. The four masters A, B, C and D exchange data through a bus matrix. Figure 6 The bus matrix in the example also takes the AXI-based Bus Matrix as an example.

[0100] Among them, the paths for A, B, and C to access D are channel 1->channel 8, channel 3->channel 8, and channel 5->channel 8 respectively; the paths for A, B, and D to access C are channel 1->channel 6, channel 3->channel 6, and channel 7->channel 6 respectively; the paths for A, C, and D to access B are channel 1->channel 4, channel 5->channel 4, and channel 7->channel 4 respectively; the paths for B, C, and D to access A are channel 3->channel 2, channel 5->channel 2, and channel 7->channel 2 respectively.

[0101] It should be understood that Figure 6In the process of data transmission between the four masters A, B, C and D shown in the figure, for all masters to send data, the RAM on the master to receive data is shared. Taking A, B, C accessing D as an example, the data sent by A, B and C to D are all stored in ram_D in D, and the ram_D is shared by A, B and C. Compared with the related art in which an independent RAM space is set inside the master for each master to send data to it, this method can improve the resource utilization of RAM.

[0102] For the storage space management of ram_D, if the data of A, B and C are received one by one according to the released granularity, sequential management is used, that is, pointer management; if the received granularity is different from the released granularity, a linked storage mechanism can be used to implement it.

[0103] Among them, sequential management corresponds to a sequential storage structure. In the sequential storage structure, a group of data must occupy a continuous memory address. This requires us to find a space in the memory that is large enough to hold these data in advance. The space must be long enough and there must be no other data in the middle. Then the data are stored one by one. During the management process, the corresponding configuration can be made according to the operations of the read pointer and the write pointer. The linked storage mechanism corresponds to the linked storage structure. The core idea of ​​this storage structure is that the data is not stored in the memory according to the actual order or relationship, but is placed at any address you want. However, each stored data must also contain the storage location of each data associated with it. This storage method does not require finding a continuous memory unit when storing data, and it is more convenient to add data.

[0104] Further, based on Figure 6 For the structural diagram shown, please refer to Figure 7 , is the timing diagram of the corresponding token ring, such as Figure 7 As shown in the figure, the "clk" signal is the reference signal of the corresponding clock; the start signal is used as the scale of the token ring, defining the transmission content on each beat of the ring. For example, in the beat of the start high pulse, the token_num and pend_ptr contain the information of A, and the 2nd, 3rd, and 4th beats contain the information of B, C, and D respectively. token_num indicates the number of tokens. pend_ptr indicates that the token is insufficient after being allocated to a master last time. Its default value is [N, 2 n-1]. If the value of pend_ptr is a certain master, pend_ptr will not be restored to the default value until the number of tokens on the Ring is enough for this master to use and is first taken away by this master, so as to ensure the fairness of data transmission.

[0105] It should be noted that the definition of each beat here is only an example, and the present application does not limit this. In the embodiment of the present application, the start is the beat of the high pulse, the token_num and pend_ptr are A information, and the 2nd, 3rd, and 4th beats are B, C, and D information respectively.

[0106] The time between the rising edges of the two high-level pulses of start is a cycle of the Ring. In each cycle, the content of the Ring is repeated. The length of the cycle must be greater than or equal to N, and the smaller the better, provided that it is not less than N. It is determined by the path delay between the actual positions of the N masters.

[0107] The following example takes the data transmission between master A and master D as an example. Figure 8 , a schematic diagram of the use process of the token ring provided by an embodiment of the present application, assuming that A is a data sending device, D is a data receiving device, and the start high-level pulse is defined as the first clock cycle. First, after resetting the master in the token ring, the RAM in the master is in an idle state, then A puts its total number of tokens on the token ring Ring in the first clock cycle; D calculates the fourth clock cycle based on the first clock cycle, and then puts its total number of tokens on the Ring in the fourth clock cycle. Among them, the total number of tokens here corresponds to the available storage space of each RAM. For each master's token_num and pend_ptr, there are corresponding inputs token_num_in and pend_ptr_in, and outputs token_num_out and pend_ptr_out.

[0108] Furthermore, A calculates the number of tokens required for the amount of data sent to D. At this time, A determines whether the token on the token ring Ring is A's in the current clock cycle. If so, the token released in A can be added to the token ring, and A's pend_ptr remains unchanged.

[0109] If the token on the token ring is not A's, when A measures the fourth clock cycle, that is, when D's token arrives, there are several implementation methods:

[0110] The first implementation method: A first determines whether the pend_ptr_D of D in the token ring is the default value. If pend_ptr_D is not the default value, and pend_ptr_D is not the serial number number_master_A of A, that is, the value of pend_ptr_D does not correspond to A, then A will not take the token of D, and pend_ptr_D will not change. Then the output and input of the corresponding token_num and pend_ptr of D are the same, that is, token_num_out = token_num_in, pend_ptr_out = pend_ptr_in.

[0111] Among them, the serial number number_master_A of A can be a preset value, for example, it can be 0 or 1, etc., and this application does not limit this.

[0112] The second implementation method: If pend_ptr_D is not the default value, and pend_ptr_D is A's serial number number_master_A, that is, the value of pend_ptr_D corresponds to A, but the number of tokens on the Ring, token_num_D, is insufficient, then A will not take D's token, and pend_ptr_D will not change. Then, the output and input of token_num and pend_ptr are the same. That is, token_num_out = token_num_in, pend_ptr_out = pend_ptr_in.

[0113] The third implementation method: If pend_ptr_D is not the default value, and pend_ptr_D is A's serial number number_master_A, that is, the value of pend_ptr_D corresponds to A, and the number of tokens token_num_D on the Ring is sufficient. Then A takes the required number of tokens token_num_taken, that is, the number of tokens token_num_D of D on the Ring should be subtracted from the number of tokens token_num_taken taken, and then A sends data to D; at this time, A needs to restore D's pend_ptr_D in the token ring to the default value (pend_ptr_default). Correspondingly, the output corresponding to D in the token ring is token_num_out = token_num_in-token_num_taken, pend_ptr_out = pend_ptr_default.

[0114] Fourth implementation: If pend_ptr_D is the default value, and A has no data to send to D, then A does not take D's token, and the output and input of D's token_num and pend_ptr in the token ring are the same, that is, token_num_out = token_num_in, pend_ptr_out = pend_ptr_in.

[0115] The fifth implementation method: If pend_ptr_D is the default value, and A has data to send to D, but the number of tokens in the Ring, token_num_D, is insufficient. Then, A does not take D's token, and the output of token_num is the same as the input; A assigns the value of pend_ptr_D of D in the token ring to the serial number of A, number_master_A. Accordingly, the output corresponding to D in the token ring is token_num_out = token_num_in, and pend_ptr_out = number_master_A.

[0116] The sixth implementation method: If pend_ptr_D is the default value, and A has data to send to D, and the number of tokens token_num_D on the Ring is sufficient. Then A takes the required number of tokens token_num_taken of D, that is, the number of tokens token_num_D of D on the Ring should be subtracted from the number of tokens token_num_taken taken, and then A sends data to D. At this time, pend_ptr_D remains unchanged and is still the default value. The output corresponding to D in the token ring is token_num_out = token_num_in-token_num_taken, and pend_ptr_out = pend_ptr_in.

[0117] It should be understood that as long as the number of tokens is sufficient, that is, the RAM can store the sent data, there will be no congestion in the entire path.

[0118] It should also be understood that, during the current clock cycle, if D finds that it is its own token when the token ring turns around, it will put the token that has been released in D into the token ring to update the number of D's tokens in the token ring.

[0119] It should be noted that the above description takes A as a data sending device and D as a data receiving device as an example. This method is also applicable when D is a data sending device and A is a data receiving device, except that A's token comes from the start high pulse.

[0120] It should also be understood that in the above embodiment, all masters in the token ring take one clock cycle to place tokens in the token ring, and operations such as obtaining tokens when data transmission is required take one clock cycle. The next clock cycle starts directly from obtaining tokens.

[0121] S506: The data sending device sends the to-be-sent data to the data receiving device based on the target number of tokens.

[0122] Correspondingly, the data receiving device receives the data to be sent.

[0123] This step and Figure 4 Step S403 in the illustrated embodiment is similar and will not be described in detail here.

[0124] S507: The data receiving device stores the data to be sent.

[0125] This step and Figure 4 Step S404 in the illustrated embodiment is similar and will not be described in detail here.

[0126] In this embodiment, when the data sending device has data to be sent to the data receiving device, it first determines whether the tokens of the corresponding data receiving device in the token ring are sufficient and whether the target parameter of the data receiving device is the target value, etc., and obtains sufficient tokens of the data receiving device from the token ring when certain conditions are met, and sends the data to be sent to the data receiving device based on the token. This method can achieve non-blocking transmission between the data sending device and the data receiving device by first obtaining sufficient tokens and then transmitting data, thereby improving transmission efficiency; and in the embodiment of the present application, by putting the tokens corresponding to the RAM space on the token ring, the token ring passes through each data sending device, and each takes off the token as needed, thereby achieving RAM sharing, which can improve the memory utilization of the data receiving device.

[0127] It should also be understood that the bus matrix AXI Bus Matrix mentioned in the above embodiment is only an example, and can also be replaced by other bus matrices, which is not limited in the present application. In addition, the RAM mentioned in the above embodiment is also only an example, and can also be replaced by dynamic storage space such as double data rate (DDR).

[0128] It should also be understood that the above embodiments may be coupled to each other, and this application does not limit this. Moreover, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0129] Combined with the above Figures 1 to 8, describes in detail the data transmission method based on the token ring of the embodiment of the present application, and will be combined with Figures 9 to 11 , a token ring-based data transmission device according to an embodiment of the present application is described in detail.

[0130] Fig. 9 A structural schematic diagram of a token ring-based data transmission device 900 provided in one embodiment of the present application, the device 900 includes: an acquisition module 901 and a sending module 902.

[0131] Among them, the acquisition module 901 is used to obtain the data to be sent to the data receiving device, and the data receiving device and the data sending device are connected through a token ring; the acquisition module 901 is also used to obtain the target number of tokens of the data receiving device from the token ring, and the target number of tokens corresponds to the data volume of the data to be sent; the sending module 902 is used to send the data to be sent to the data receiving device based on the target number of tokens.

[0132] In some embodiments, the tokens of the data receiving device are pre-stored in the token ring, and the number of tokens of the data receiving device is determined according to the remaining storage space in the data receiving device.

[0133] In some embodiments, the device further includes: a comparison module. The acquisition module 901 is further used to acquire the number of tokens of the data receiving device in the token ring at the current moment; the comparison module is used to compare the number of tokens of the data receiving device in the token ring at the current moment with the target number; the acquisition module 901 is further used to acquire the target number of tokens of the data receiving device from the token ring when the number of tokens of the data receiving device in the token ring at the current moment is greater than or equal to the target number.

[0134] In some embodiments, the token ring includes a target parameter, and the target parameter is used to indicate whether the data receiving device is in a state of insufficient tokens before the current moment.

[0135] In some embodiments, the apparatus further includes: a judgment module. The judgment module is used to judge whether the target parameter of the data receiving device is a target value, and the target value is used to indicate that the data receiving device is not in a state of insufficient tokens before the current moment; the acquisition module 901 is specifically used to: when the target parameter of the data receiving device is the target value, acquire the target number of tokens of the data receiving device from the token ring.

[0136] In some embodiments, the judgment module is also used to judge whether the value corresponding to the target parameter corresponds to the data sending device when the target parameter of the data receiving device is not the target value; the acquisition module 901 is also used to obtain the target number of tokens of the data receiving device from the token ring when the value corresponding to the target parameter corresponds to the data sending device.

[0137] In some embodiments, the apparatus further includes: a waiting module. The waiting module is used to wait for the data sending device to acquire the token of the data receiving device next time when the number of tokens of the data receiving device in the token ring at the current moment is less than the target number, and / or the target parameter of the data receiving device is not the target value, and the value corresponding to the target parameter does not correspond to the data sending device.

[0138] In some embodiments, the apparatus further comprises: an updating module, which is used to update target parameters of the data receiving device in the token ring.

[0139] In some embodiments, the update module is specifically used to: when the target parameter of the data receiving device is a target value, maintain the target value unchanged; when the target parameter of the data receiving device is not a target value, update the target parameter of the data receiving device in the token ring to the target value.

[0140] In some embodiments, the update module is further used to update the number of tokens of the data receiving device in the token ring to a target number of tokens, where the target number of tokens is the difference between the number of tokens of the data receiving device in the token ring at the current moment and the target number.

[0141] It should be understood that the device 900 here is embodied in the form of a functional module. The term "module" here may refer to an application specific integrated circuit (ASIC), an electronic circuit, a processor (e.g., a shared processor, a proprietary processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a merged logic circuit, and / or other suitable components that support the described functions. In an optional example, those skilled in the art will understand that the device 900 may be specifically a data sending device in the above-mentioned embodiment, or the function of the data sending device in the above-mentioned embodiment may be integrated in the device 900, and the device 900 may be used to execute the various processes and / or steps corresponding to the data sending device in the above-mentioned method embodiment, and to avoid repetition, it will not be repeated here.

[0142] The above-mentioned device 900 has the function of implementing the corresponding steps executed by the data sending device in the above-mentioned method; the above-mentioned function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned function.

[0143] Fig.10 A schematic structural diagram of a token ring-based data transmission device 1000 provided in one embodiment of the present application. The device 1000 includes: a receiving module 1001 and a storage module 1002.

[0144] Among them, the receiving module 1001 is used to receive the data to be sent by the data sending device, the data to be sent is the data sent by the data sending device based on the target number of tokens, the data receiving device and the data sending device are connected through a token ring, and the target number of tokens corresponds to the data volume of the data to be sent; the storage module 1002 is used to store the data to be sent.

[0145] In some embodiments, the tokens of the data receiving device are pre-stored in the token ring, and the number of tokens of the data receiving device is determined according to the remaining storage space in the data receiving device.

[0146] In some embodiments, the apparatus further comprises: an updating module, which is used to update the number of tokens of the data receiving device in the token ring.

[0147] In some embodiments, the updating module is specifically used to: update the number of tokens of the data receiving device in the token ring according to a preset period.

[0148] In some embodiments, the update module is specifically used to: determine whether the token ring is the token of the data receiving device at the current moment; if the token ring is the token of the data receiving device at the current moment, add the tokens that have been released in the data receiving device to the token ring according to the preset period to update the number of tokens of the data receiving device in the token ring.

[0149] In some embodiments, the token ring further includes a target parameter, and the target parameter is used to indicate whether the data receiving device is in a state of insufficient tokens before the current moment.

[0150] It should be understood that the device 1000 here is embodied in the form of a functional module. The term "module" here may refer to an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor or a group processor, etc.) and a memory for executing one or more software or firmware programs, a merged logic circuit and / or other suitable components that support the described functions. In an optional example, those skilled in the art may understand that the device 1000 may be specifically a data receiving device in the above-mentioned embodiment, or the function of the data receiving device in the above-mentioned embodiment may be integrated in the device 1000, and the device 1000 may be used to execute the various processes and / or steps corresponding to the data receiving device in the above-mentioned method embodiment, and to avoid repetition, it will not be repeated here.

[0151] The above-mentioned device 1000 has the function of implementing the corresponding steps executed by the data receiving device in the above-mentioned method; the above-mentioned function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned function.

[0152] Fig.11 A structural schematic diagram of a token ring-based data transmission device provided in accordance with another embodiment of the present application. Fig.11 The token ring-based data transmission device shown can be used to execute the method of any of the aforementioned embodiments.

[0153] like Fig.11 As shown, the device 1100 of this embodiment includes: a memory 1101, a processor 1102, a communication interface 1103 and a bus 1104. The memory 1101, the processor 1102 and the communication interface 1103 are connected to each other through the bus 1104.

[0154] The memory 1101 may be a read only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM). The memory 1101 may store a program. When the program stored in the memory 1101 is executed by the processor 1102, the processor 1102 is used to execute each step of the method shown in the above embodiment.

[0155] The processor 1102 can adopt a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits to execute relevant programs to implement the various methods shown in the embodiments of the present application.

[0156] The processor 1102 may also be an integrated circuit chip with signal processing capability. In the implementation process, each step of the method of the embodiment of the present application may be completed by an integrated logic circuit of hardware in the processor 1102 or by instructions in the form of software.

[0157] The processor 1102 may also be a general purpose processor, a digital signal processor (DSP), an ASIC, a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0158] The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1101, and the processor 1102 reads the information in the memory 1101, and completes the functions required to be performed by the units included in the device of the present application in combination with its hardware.

[0159] The communication interface 1103 may use, but is not limited to, a transceiver or other transceiver device to implement communication between the apparatus 1100 and other devices or a communication network.

[0160] The bus 1104 may include a path for transmitting information between various components of the device 1100 (eg, the memory 1101 , the processor 1102 , and the communication interface 1103 ).

[0161] It should be understood that the device 1100 shown in the embodiment of the present application may be an electronic device, or may also be a chip configured in the electronic device.

[0162] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0163] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0164] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0165] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0166] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0167] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0168] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.

[0169] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data transmission method based on a token ring, characterized in that: Applied to a data sending device, the method comprises: Acquire data to be sent to a data receiving device, wherein the data receiving device and the data sending device are connected via a token ring; Acquire a target number of tokens of the data receiving device from the token ring, wherein the target number of tokens corresponds to the data volume of the data to be sent; Based on the target number of tokens, the to-be-sent data is sent to the data receiving device.

2. The method according to claim 1, characterized in that The token ring stores tokens of the data receiving device in advance, and the number of tokens of the data receiving device is determined according to the remaining storage space in the data receiving device.

3. The method according to claim 2, characterized in that Before acquiring the target number of tokens of the data receiving device from the token ring, the method further includes: Obtaining the number of tokens of the data receiving device in the token ring at the current moment; Compare the number of tokens of the data receiving device in the token ring at the current moment with the target number; In a case where the number of tokens of the data receiving device in the token ring at the current moment is greater than or equal to the target number, the target number of tokens of the data receiving device is acquired from the token ring.

4. The method according to claim 3, characterized in that The token ring includes a target parameter, and the target parameter is used to indicate whether the data receiving device is in a state of insufficient tokens before the current moment.

5. The method according to claim 4, characterized in that Before acquiring the target number of tokens of the data receiving device from the token ring, the method further includes: Determining whether a target parameter of the data receiving device is a target value, wherein the target value is used to indicate that the data receiving device is not in a state of insufficient tokens before the current moment; The step of acquiring a target number of tokens of the data receiving device from the token ring comprises: In a case where the target parameter of the data receiving device is a target value, the target number of tokens of the data receiving device is acquired from the token ring.

6. The method according to claim 5, characterized in that The method further comprises: In a case where the target parameter of the data receiving device is not the target value, determining whether the value corresponding to the target parameter corresponds to the data sending device; In a case where the value corresponding to the target parameter corresponds to the data sending device, the target number of tokens of the data receiving device is acquired from the token ring.

7. The method according to claim 6, characterized in that The method further comprises: When the number of tokens of the data receiving device in the token ring at the current moment is less than the target number, and / or the target parameter of the data receiving device is not the target value, and the value corresponding to the target parameter does not correspond to the data sending device, wait for the data sending device to obtain the token of the data receiving device next time.

8. The method according to claim 7, characterized in that After acquiring the target number of tokens of the data receiving device from the token ring, the method further comprises: The target parameters of the data receiving device in the token ring are updated.

9. The method according to claim 8, characterized in that The updating of the target parameters of the data receiving device in the token ring comprises: When the target parameter of the data receiving device is a target value, maintaining the target value unchanged; In a case where the target parameter of the data receiving device is not a target value, the target parameter of the data receiving device in the token ring is updated to the target value.

10. The method according to claim 7, characterized in that After acquiring the target number of tokens of the data receiving device from the token ring, the method further comprises: The number of tokens of the data receiving device in the token ring is updated to a target number of tokens, where the target number of tokens is a difference between the number of tokens of the data receiving device in the token ring at a current moment and the target number.

11. A data transmission method based on a token ring, characterized in that: Applied to a data receiving device, the method comprises: Receiving data to be sent sent by a data sending device, wherein the data to be sent is data sent by the data sending device based on a target number of tokens of the data receiving device, the data receiving device and the data sending device are connected via a token ring, and the target number of tokens corresponds to the data volume of the data to be sent; The data to be sent is stored.

12. The method according to claim 11, characterized in that The token ring stores tokens of the data receiving device in advance, and the number of tokens of the data receiving device is determined according to the remaining storage space in the data receiving device.

13. The method according to claim 12, characterized in that The method further comprises: The number of tokens of the data receiving device in the token ring is updated.

14. The method according to claim 13, characterized in that The updating of the number of tokens of the data receiving device in the token ring comprises: The number of tokens of the data receiving device in the token ring is updated according to a preset period.

15. The method according to claim 14, characterized in that The step of updating the number of tokens of the data receiving device in the token ring according to a preset period includes: Determining whether the token ring is the token of the data receiving device at the current moment; When the token ring is the token of the data receiving device at the current moment, the tokens released in the data receiving device are added to the token ring according to the preset period to update the number of tokens of the data receiving device in the token ring.

16. The method according to claim 15, characterized in that The token ring also includes a target parameter, and the target parameter is used to indicate whether the data receiving device is in a state of insufficient tokens before the current moment.

17. A data transmission device based on a token ring, characterized in that: Applied to a data sending device, the device comprises: An acquisition module, used for acquiring data to be sent to a data receiving device, wherein the data receiving device and the data sending device are connected via a token ring; The acquisition module is also used to acquire a target number of tokens of the data receiving device from the token ring, wherein the target number of tokens corresponds to the data volume of the data to be sent; A sending module is used to send the to-be-sent data to the data receiving device based on the target number of tokens.

18. A data transmission device based on a token ring, characterized in that: Applied to a data receiving device, the device comprises: A receiving module, used for receiving data to be sent from a data sending device, wherein the data to be sent is data sent by the data sending device based on the target number of tokens, the data receiving device and the data sending device are connected via a token ring, and the target number of tokens corresponds to the data volume of the data to be sent; The storage module is used to store the data to be sent.

19. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory is used to store code instructions; the processor is used to run the code instructions to execute the method according to any one of claims 1 to 10 or 11 to 16.

20. A computer-readable storage medium, characterized in that: Used to store a computer program, the computer program comprising instructions for implementing the method as claimed in any one of claims 1 to 10 or 11 to 16.