Data transmission method, system, electronic device and storage medium
By traversing the transmission nodes in the wireless ad hoc network and calculating the connection weight ratio to select the target path, the load imbalance caused by the width-first search algorithm is solved, and data transmission efficiency is improved.
Patent Information
- Application Number
- CN202311828300.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2043-12-28
AI Technical Summary
In existing wireless ad hoc networks, the width-first search algorithm may cause some neighbor nodes to be overloaded when looking for the shortest path, reducing data transmission efficiency.
By obtaining network topology information, traversing the transmission nodes to obtain at least one shortest transmission path from the source node to the destination node, and calculating the connection weight ratio of neighboring nodes on the transmission path, selecting the transmission path corresponding to the smallest connection weight ratio as the target path, and performing data transmission.
Improve network load balancing, avoid the problem of excessive load on a single path, and improve data transmission efficiency.
Smart Images

Figure CN117896799B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data transmission method, system, electronic device and storage medium. Background Art
[0002] A wireless ad hoc network is a wireless communication network consisting of a group of interconnected mobile devices or nodes that communicate directly through wireless connections without relying on infrastructure networks such as routers or base stations. Due to the limited wireless coverage of the nodes, data communication in a wireless ad hoc network usually needs to be relayed through multiple nodes. This multi-hop communication method can extend the network range and overcome the coverage limitations of a single node.
[0003] In the related art, the breadth-first search algorithm is used to find the shortest path in the network. If there are multiple paths with the same shortest path length, the breadth-first search algorithm can only find one of the paths. When building the routing table, it may cause some neighbor nodes to be overloaded, reducing data transmission efficiency. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to provide a data transmission method, system, electronic device and storage medium, which can improve network load balancing and improve data transmission efficiency.
[0005] To achieve the above-mentioned purpose, the first aspect of an embodiment of the present application proposes a data transmission method, which includes: obtaining network topology information, source nodes and destination nodes; the network topology information includes multiple transmission nodes; traversing the transmission nodes to obtain at least one transmission path from the source node to the destination node, and the number of transmission hops between the source node and the destination node in the transmission path is the least; taking each transmission node adjacent to the source node on the transmission path as a neighbor node, calculating the connection weight ratio of the neighbor node, and selecting the transmission path corresponding to the smallest connection weight ratio as the target path, and transmitting data through the target path.
[0006] In some embodiments, traversing the transmission nodes to obtain at least one transmission path from the source node to the destination node includes: selecting at least one transmission node with a transmission distance of one hop from the source node as a first candidate node based on the network topology information, and storing the first candidate node in an initial candidate sequence; sequentially using the transmission nodes in the initial sequence as initial nodes, selecting at least one transmission node with a transmission distance of one hop from the initial node as a second candidate node based on the network topology information, and storing the second candidate node in a second candidate sequence; deduplicating the second candidate nodes in the second candidate sequence, using the second candidate sequence as the initial sequence, and repeating this step until the destination node is selected as the second candidate node; the initial value of the initial sequence is the initial candidate sequence; obtaining multiple candidate sequences based on the initial candidate sequence and at least one second candidate sequence according to the storage time; starting from the destination node, selecting one of the transmission nodes in the candidate sequence one by one in descending order until the source node is reached to obtain at least one transmission path.
[0007] In some embodiments, the selecting, based on the network topology information, at least one of the transmission nodes whose transmission distance to the initial node is one hop as a second candidate node, and storing the second candidate node in a second candidate sequence, includes: obtaining an adjacency value of the initial node based on an adjacency matrix; the adjacency matrix is used to characterize the link connection status between the transmission nodes, and the adjacency matrix is obtained according to the network topology information; based on the adjacency value, selecting the transmission node that is connected to the initial node as one hop as the second candidate node.
[0008] In some embodiments, the calculation of the connection weight ratio of the neighboring node includes: obtaining the number of the transmission nodes on the transmission path that have service initiation requirements; taking the sum of the number of nodes as the number of service connections on the neighboring node; obtaining the bandwidth weight of the neighboring node based on the node bandwidth capacity of the neighboring node; and obtaining the connection weight ratio based on the ratio of the number of service connections to the bandwidth weight.
[0009] In some embodiments, the data transmission through the target path includes: obtaining the target data priority of the target transmission data; obtaining the currently available time slot of the transmission node on the target path at the current transmission moment; obtaining the data to be transmitted of the transmission node on the target path at the current transmission moment, and the transmission priority of each of the data to be transmitted; if the target data priority is higher than the transmission priority, determining the first transmission time slot of the target transmission data and the second transmission time slot of the data to be transmitted according to the currently available time slot, the first transmission time slot is more than the second transmission time slot, and the target transmission data is transmitted using the first transmission time slot; if the target data priority is equal to the transmission priority, determining the third transmission time slot of the target transmission data and the fourth transmission time slot of the data to be transmitted according to the currently available time slot, the data with more data packets in the target transmission data and the data to be transmitted corresponds to more time slots, and the target transmission data is transmitted using the third transmission time slot.
[0010] In some embodiments, obtaining the currently available time slot of the transmission node on the target path at the current transmission moment includes: obtaining the first available time slot of the transmission node at the previous transmission moment on the target path; obtaining the second available time slot of the transmission node at the current transmission moment on the target path; obtaining a third available time slot according to a preset weight value and the first available time slot, and generating the currently available time slot based on the third time slot and the second available time slot.
[0011] In some embodiments, the method also includes: if the target data priority is equal to the transmission priority, generating a fifth transmission time slot for the target transmission data and a sixth transmission time slot for the data to be transmitted on the transmission node; the fifth transmission time slot and the sixth transmission time slot are alternately generated according to the currently available time slot; on the transmission node, transmitting the target transmission data according to the fifth transmission time slot.
[0012] To achieve the above-mentioned purpose, the second aspect of an embodiment of the present application proposes a data transmission system, including: a network information module, used to obtain network topology information, source nodes and destination nodes; the network topology information includes multiple transmission nodes; a transmission path module, used to traverse the transmission nodes to obtain at least one transmission path from the source node to the destination node, and the number of transmission hops between the source node and the destination node in the transmission path is the least; a target path module, used to take the transmission nodes adjacent to the source node on each of the transmission paths as neighbor nodes, calculate the connection weight ratio of the neighbor nodes, and select the transmission path corresponding to the smallest connection weight ratio as the target path, and transmit data through the target path.
[0013] To achieve the above-mentioned purpose, the third aspect of the embodiments of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the method described in the above-mentioned first aspect embodiment when executing the computer program.
[0014] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium, and the storage medium stores a computer program. When the computer program is executed by a processor, the method described in the embodiment of the first aspect above is implemented.
[0015] The data transmission method, system, electronic device and storage medium proposed in the present application have the following beneficial effects: obtaining network topology information, source nodes and destination nodes; the network topology information includes multiple transmission nodes, traversing the transmission nodes, obtaining at least one transmission path from the source node to the destination node, the transmission path has the least number of transmission hops between the source node and the destination node, taking the transmission nodes adjacent to the source node on each transmission path as neighbor nodes, calculating the connection weight ratio of the neighbor nodes, and selecting the transmission path corresponding to the smallest connection weight ratio as the target path, and transmitting data through the target path. By traversing the transmission nodes of the entire network and obtaining all the shortest paths from the source node to other nodes, the path selection can meet more requirements, avoiding the limitation of having only one shortest path, and selecting the target path according to the bandwidth and business conditions of each neighbor node, it can improve network load balancing and improve data transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a flow chart of a data transmission method provided in an embodiment of the present application;
[0017] Figure 2 yes Figure 1 Flow chart of step S102 in FIG.
[0018] Figure 3 is another flow chart of the data transmission method provided in the embodiment of the present application;
[0019] Figure 4 is a schematic diagram of an adjacency matrix provided in an embodiment of the present application;
[0020] Figure 5 is a schematic diagram of a network node link connection provided by an embodiment of the present application;
[0021] Figure 6 yes Figure 5 Flow chart of step S202 in FIG.
[0022] Figure 7 yes Figure 1 Flow chart of step S103 in FIG.
[0023] Figure 8 is a flow chart of selecting a target path provided by an embodiment of the present application;
[0024] Fig. 9 yes Figure 1 Another flow chart of step S103 in FIG.
[0025] Fig.10 yes Fig. 9 Flow chart of step S502 in FIG.
[0026] Fig.11 is another flow chart of the data transmission method provided in the embodiment of the present application;
[0027] Fig.12 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further 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.
[0029] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0031] A wireless ad hoc network is a wireless communication network consisting of a group of interconnected mobile devices or nodes that communicate directly through wireless connections without relying on infrastructure networks such as routers or base stations. Due to the limited wireless coverage of the nodes, data communication in a wireless ad hoc network usually needs to be relayed through multiple nodes. This multi-hop communication method can extend the network range and overcome the coverage limitations of a single node.
[0032] In the related art, the breadth-first search algorithm is used to find the shortest path in the network. If there are multiple paths with the same shortest path length, the breadth-first search algorithm can only find one of the paths. When building the routing table, it may cause some neighbor nodes to be overloaded, reducing data transmission efficiency.
[0033] Based on this, the embodiments of the present application provide a data transmission method, system, electronic device and storage medium, which can improve network load balancing and improve data transmission efficiency.
[0034] The data transmission method, system, electronic device and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the data transmission method in the embodiments of the present application is described.
[0035] The data transmission method in the embodiments of the present application can be illustrated by the following embodiments.
[0036] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first. For example, when obtaining user stored data and the user's cached data access request, the user's permission or consent will be obtained first. Moreover, the collection, use and processing of these data will comply with the relevant laws, regulations and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or separate consent will be obtained by means of a pop-up window or jumping to a confirmation page. After clearly obtaining the user's separate permission or separate consent, the necessary user-related data used to enable the normal operation of the embodiment of the present application will be obtained.
[0037] Figure 1 is an optional flowchart of the data transmission method provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S103.
[0038] Step S101, obtaining network topology information, source nodes and destination nodes; the network topology information includes multiple transmission nodes.
[0039] It is understood that the network topology information of a wireless ad hoc network describes the connection mode and layout between nodes in the wireless ad hoc network. Since the characteristic of a wireless ad hoc network is that nodes communicate directly with each other, the network topology is dynamic and can change adaptively according to the movement of nodes and joining or leaving the network. It describes the physical or logical relationship between nodes, such as star topology, bus topology, mesh topology, etc.
[0040] Exemplarily, the network topology information can be described by means of an adjacency matrix. The adjacency matrix is a two-dimensional matrix, in which the elements represent the connection relationship between nodes. The rows and columns of the matrix represent the nodes in the network, respectively, and the elements of the matrix represent the connection status between the nodes. 1 or 0 is usually used to represent the connection or disconnection state, where 1 indicates that there is a connection between the nodes and 0 indicates that there is no connection between the nodes. By analyzing the adjacency matrix, the topological structure information of the wireless ad hoc network can be obtained. For example, the direct neighbor relationship between nodes can be determined, available communication paths or routes can be found, and the connectivity of the network can be calculated. The adjacency matrix can also be used as input for other topology discovery algorithms and routing protocols for network management and optimization.
[0041] Exemplarily, a transmission node refers to a node in the network that is responsible for data transmission. They undertake the forwarding and routing functions of data packets. Transmission nodes play the role of a bridge in wireless ad hoc networks. They enable nodes to communicate directly and build ad hoc networks by cooperating with each other and forwarding data. The source node is the starting node that initiates data transmission in the network. It is the starting point of the data flow and sends the data packet to the destination node. The destination node is the terminal node that receives data in the network. It is the end point of the data flow and receives the data packet sent by the source node.
[0042] Step S102, traversing the transmission nodes, obtaining at least one transmission path from the source node to the destination node, wherein the number of transmission hops between the source node and the destination node in the transmission path is the least.
[0043] Exemplarily, the transmission nodes are traversed to obtain at least one shortest transmission path from the source node to the destination node. The implementation of traversing the transmission nodes may vary according to specific application scenarios and requirements. In practical applications, factors such as network topology, transmission delay, and bandwidth limitation need to be considered, and appropriate adjustments and optimizations should be made according to actual conditions.
[0044] Step S103, taking the transmission nodes adjacent to the source node on each transmission path as neighbor nodes, calculating the connection weight ratio of the neighbor nodes, and selecting the transmission path corresponding to the smallest connection weight ratio as the target path, and transmitting data through the target path.
[0045] It can be understood that after obtaining at least one transmission path, if there is only one transmission path, this path will be selected during data transmission; if there are multiple transmission paths, the entire path and the path with the largest bandwidth capacity of the neighboring node will be preferentially selected from all transmission paths, which can avoid using congested paths, improve the system transmission throughput and balance the load. And selecting neighboring nodes with less data occupancy can avoid the situation where a complete path has the smallest load, but the data volume of a single node is extremely high or even reaches the threshold, and the data occupancy of other nodes on the path is extremely low. The connection weight ratio of the neighboring node can be the ratio of the sum of the number of nodes with service initiation requirements on the link corresponding to the neighboring node to the node bandwidth capacity of the neighboring node.
[0046] The data transmission method proposed in the present application obtains network topology information, source nodes and destination nodes; the network topology information includes multiple transmission nodes, and the transmission nodes are traversed to obtain at least one transmission path from the source node to the destination node, and the number of transmission hops between the source node and the destination node in the transmission path is the least. The transmission nodes adjacent to the source node on each transmission path are used as neighbor nodes, the connection weight ratio of the neighbor nodes is calculated, and the transmission path corresponding to the smallest connection weight ratio is selected as the target path, and data is transmitted through the target path. By traversing the transmission nodes of the entire network and obtaining all the shortest paths from the source node to other nodes, the path selection can meet more requirements, avoiding the limitation of only one shortest path, and selecting the target path according to the bandwidth and business conditions of each neighbor node, which can improve network load balancing and improve data transmission efficiency.
[0047] See also Figure 2 In some embodiments, step S102 may include steps S201 to S204:
[0048] Step S201: Based on network topology information, at least one transmission node with a transmission distance of one hop from a source node is selected as a first candidate node, and the first candidate node is stored in an initial candidate sequence.
[0049] Exemplarily, an empty queue can be initialized, and an empty dictionary or list can be initialized to record the predecessor node of each node (i.e., the previous node on the path). An empty set can be initialized to record the nodes that have been visited to prevent repeated visits. The source node is added to the queue, and at least one transmission node with a transmission distance of one hop from the source node is added to the set, and the set is output as the initial candidate sequence.
[0050] Step S202, sequentially taking the transmission nodes in the initial sequence as the initial nodes, selecting at least one transmission node with a transmission distance of one hop from the initial node as the second candidate node based on the network topology information, and storing the second candidate node in the second candidate sequence; deduplicating the second candidate nodes in the second candidate sequence, taking the second candidate sequence as the initial sequence, and repeating this step until the destination node is selected as the second candidate node; the initial value of the initial sequence is the initial candidate sequence.
[0051] Exemplarily, a loop is entered, at which time the transmission node corresponding to the initial sequence is stored in the queue, and the initial value of the initial sequence is the initial candidate sequence, that is, the loop starts from the initial candidate sequence. A node is taken out from the queue as the current node. If the current node is the destination node, it means that the shortest path has been found and the loop can be ended. Otherwise, at least one transmission node with a transmission distance of one hop from the current node is traversed as a neighbor node. If the neighbor node has not been visited, it will be added to the queue as the second candidate node. At this time, the queue stores the second candidate sequence and is marked as visited. At the same time, the current node is set as the predecessor node of the neighbor node. If the destination node is still not found at the end of the loop, it means that the destination node cannot be reached from the source node. Through the above steps, the shortest transmission path from the source node to the destination node can be obtained. By backtracking the information of the predecessor node, it can be traced back from the destination node to the source node to obtain the sequence of transmission nodes on the shortest path.
[0052] For example, see Figure 3 In a specific embodiment, the current network topology information is obtained. Figure 4 The adjacency matrix form shown in the figure, where the two-dimensional array subscript maps the node address, and the matrix elements represent the link value between nodes. If there is a link connection, the link value is 1. The corresponding network is as follows Figure 5 As shown. Initialize an empty queue, HeadAddr is the address of the first node in the queue, and add the source node to the queue. Enqueue is used to record whether the node in the network has been queued; Dequeue is used to record whether the node in the network has been dequeued; AdjMatr[i][j] is the adjacency matrix, there is a link between node i and node j, the matrix element value is 1, and the rest is 0; HopCount[i] is used to count the shortest hop count from node i to the source node; FrontPoint[i] is used to store the previous hop node of the destination node, that is, the predecessor node; FrontCount is used to count the total number of predecessor nodes of the transmission node; AdjMatr[i][j] is the adjacency matrix, there is a link between node i and node j, the matrix element value is 1, and the rest is 0.
[0053] After the source node joins the queue, it is used as the head node of the queue. The hop count HopCount[i] of the source node is initialized to 0. All neighbor nodes are traversed according to the adjacency matrix, and the network address of one of the one-hop neighbor nodes is set to AdjAddr. The current one-hop neighbor node is traversed. If the node is not in the queue, the node is enqueued. Enqueue records the node entry and adds the node to an initialized set. The set is output as the initial candidate sequence. The source node is stored in FrontPoint[i] as the previous node of the current neighbor node, and the previous node count FrontCount is set to be plus one. The shortest hop count of the neighbor node AdjAddr to the source node is HopCount[AdjAddr] = HopCount[HeadAddr]+1. At this point, after all neighbor nodes of the source node are traversed, the source node is removed from the queue.
[0054] When entering the loop, the initial queue contains the corresponding transmission nodes in the initial candidate sequence. At least one transmission node with a transmission distance of one hop from the current node is selected from the transmission nodes as a neighbor node for traversal. If the neighbor node has not been visited, it will be added to the queue as the second candidate node, and the shortest hop count of the neighbor node from the source node is HopCount[AdjAddr]=HopCount[HeadAddr]+1. The head node of the queue traversed this time is used as the front node FrontPoint[i]=HeadAddr, and the front node count FrontCount is increased by one. If the neighbor node has been visited, compare whether the hop count is the minimum value. If not, skip the neighbor node for deduplication. If the neighbor node has been out of the queue, skip the neighbor node for deduplication. When all transmission nodes in the initial queue complete the traversal of the neighbor nodes, the second candidate sequence is obtained. The second candidate sequence is used as the new initial queue to repeat the steps until the destination node is selected as the second candidate node.
[0055] Step S203: obtaining a plurality of candidate sequences according to the storage time, the initial candidate sequence and at least one second candidate sequence.
[0056] Step S204, starting from the destination node, select a transmission node in the candidate sequence one by one in descending order until reaching the source node, and obtaining at least one transmission path.
[0057] It can be understood that new second candidate nodes are continuously generated and stored at different times during the loop process, and multiple candidate sequences are obtained based on the initial candidate sequence and the obtained second candidate sequence. The destination node can select transmission nodes from the candidate sequence layer by layer according to the transmission nodes recorded in the front node FrontPoint[i] and trace back until it reaches the source node, thereby obtaining the shortest transmission path from the source node to the destination node.
[0058] For example, Figure 5 In the network shown, assuming that the source node is the V0 node, at least one transmission node with a transmission distance of one hop from the source node is selected as the first candidate node based on the network topology information, and the first candidate nodes with a transmission distance of one hop from V0 are V1, V2 and V3, and the first candidate nodes are stored in the initial candidate sequence. The initial value of the initial sequence is the initial candidate sequence, that is, the initial values are V1, V2 and V3.
[0059] It can be understood that the transmission nodes in the initial sequence are taken as the initial nodes in turn, that is, V1, V2 and V3 are taken as the initial nodes in turn, and at least one transmission node with a transmission distance of one hop from the initial node is selected as the second candidate node based on the network topology information, and the second candidate node is stored in the second candidate sequence. When V1 is used as the initial node, the second candidate nodes are V0 and V7; when V2 is used as the initial node, the second candidate nodes are V0, V6, V7, and V11; when V3 is used as the initial candidate node, the second candidate nodes are V0, V4, and V6. The second candidate nodes in the second candidate sequence are deduplicated, and the transmission nodes that have been traversed are removed. At this time, the second candidate sequence is V4, V6, V11, and V7.
[0060] It is understandable that the second candidate sequences V4, V6, V11, and V7 are used as the initial sequences, and this step is repeated to obtain the second candidate sequences after deduplication as V15, V5, V13, V12, V10, and V8. This step is repeated until the destination node is selected as the second candidate node.
[0061] Exemplarily, assuming that the destination node is V11, when V2 is used as the initial node, the second candidate nodes are V0, V6, V7, and V11, and the destination node is selected as the second candidate node. According to the storage time, multiple candidate sequences are obtained based on the initial candidate sequence and at least one second candidate sequence. The initial candidate sequences are V1, V2, and V3, and the second candidate sequence obtained is V7, V6, and V11, and two candidate sequences are obtained. Starting from the destination node V11, in descending order, a transmission node is selected one by one in the candidate sequence until the source node is reached, and at least one transmission path is obtained, that is, a node V2 that can form a one-hop transmission path with V11 is selected in the sequence V1, V2, and V3, and the node V2 is then transmitted back to the source node V0, that is, the shortest path from the source node V0 to the destination node V11 is obtained, V0, V2, and V11.
[0062] See also Figure 6 In some embodiments, step S202 may include steps S301 to S302:
[0063] Step S301, obtaining the adjacency value of the initial node based on the adjacency matrix; the adjacency matrix is used to characterize the link connection status between transmission nodes, and the adjacency matrix is obtained according to the network topology information.
[0064] Step S302: Based on the adjacency value, a transmission node connected to the initial node as one hop is used as a second candidate node.
[0065] For example, based on the network topology information, the following can be constructed: Figure 3 The adjacency matrix shown is used to characterize the link connection status between transmission nodes, where the rows and columns of the matrix represent the numbers of transmission nodes. The elements in the adjacency matrix represent the connection relationship between transmission nodes. If there is a connection between two nodes, the corresponding matrix element is 1; if there is no connection between the two nodes, the matrix element is 0. By looking up the element in the row or column corresponding to the initial node in the adjacency matrix, the adjacency value of the initial node can be obtained. When the initial node is the V2 node, the adjacency value of V2 is obtained based on the adjacency matrix, and the transmission nodes V0, V6, V11, and V7 connected to V2 as one hop are obtained as the second candidate nodes.
[0066] See also Figure 7 In some embodiments, step S103 may include steps S401 to S404:
[0067] Step S401, obtaining the number of transmission nodes on the transmission path that have service initiation requirements.
[0068] Step S402: taking the sum of the number of nodes as the number of service connections on the neighboring nodes.
[0069] Step S403: obtaining the bandwidth weight of the neighboring node according to the node bandwidth capacity of the neighboring node.
[0070] Step S404, obtaining a connection weight ratio according to a ratio of the number of service connections to the bandwidth weight.
[0071] It can be understood that the transmission path is the path from the source node to the destination node, passing through a series of transmission nodes along the way. The service initiation demand refers to the service operation or request in the transmission network. Assume that there is a transmission path from the source node A through the transmission nodes B, C and D to the destination node E. In this transmission path, if only the transmission nodes B and D need to initiate the service demand, then the number of nodes with the service initiation demand on the transmission path is 2.
[0072] Exemplarily, the node bandwidth capacity represents the amount of data or resource capacity that the node can transmit per unit time. It is an indicator to measure the transmission capacity of the node, which can be expressed in bit rate (bps) or other units. The bandwidth weight is a weight value determined based on the node bandwidth capacity, which is used to measure the relative importance of the node in path selection or resource allocation. The bandwidth weight of the neighbor node is obtained according to the node bandwidth capacity of the neighbor node. The larger the node bandwidth capacity, the larger the corresponding bandwidth weight. For example, if the bandwidth capacity of node B is 100Mbps, the bandwidth capacity of node C is 200Mbps, and the bandwidth capacity of node D is 50Mbps, the bandwidth weight that can be calculated is: 'B': 100, 'C': 200, 'D': 50. In actual applications, more factors may be considered and more complex algorithms may be used to calculate the bandwidth weight.
[0073] For example, the connection weight ratio is obtained according to the ratio of the number of service connections to the bandwidth weight. Assuming that c represents the number of service connections, w represents the weight, and s represents the neighbor node, the connection weight ratio of the corresponding neighbor node is c(s) / w(s). Figure 8 ,When selecting the target path, the transmission path with the smallest c(s) / w(s) ratio is selected as the target path.
[0074] See also Fig. 9 In some embodiments, step S103 may include steps S501 to S505:
[0075] Step S501, obtaining the target data priority of the target transmission data.
[0076] Step S502: obtaining the currently available time slot of the transmission node on the target path at the current transmission time.
[0077] Step S503: Acquire the data to be transmitted of the transmission node on the target path at the current transmission time, and the transmission priority of each data to be transmitted.
[0078] Step S504, if the target data priority is higher than the transmission priority, determine the first transmission time slot of the target transmission data and the second transmission time slot of the data to be transmitted according to the currently available time slot, the first transmission time slot is greater than the second transmission time slot, and use the first transmission time slot to transmit the target transmission data.
[0079] Step S505, if the target data priority is equal to the transmission priority, determine the third transmission time slot of the target transmission data and the fourth transmission time slot of the data to be transmitted according to the currently available time slot, the data with more data packets in the target transmission data and the data to be transmitted corresponds to more time slots, and use the third transmission time slot to transmit the target transmission data.
[0080] It is understood that target transmission data refers to specific data or data streams that need to be transmitted in the network. Target data priority is an indicator used to measure the importance or priority of target transmission data relative to other data. The target data priority of target transmission data indicates the relative importance or priority of specific data or data streams during transmission. It is used to determine the order of data transmission, allocate resources, or perform network traffic management to meet the priority processing requirements of data. The target data priority of target transmission data can be indicated by setting multiple priority queues and placing data of different priorities in different queues, or by adding Quality of Service (QoS) tags or priority fields to data packets.
[0081] Exemplarily, the currently available time slot of the transmission node on the target path at the current transmission moment is obtained. In network transmission, the currently available time slot of the transmission node on the target path refers to the transmission resources or time window available on the node at the current transmission moment. It indicates the time period or resource allocation situation in which the node can perform transmission operations at the current moment.
[0082] It is understandable that the transmission node on the target path may already have business transmission, and the data to be transmitted of the transmission node on the target path at the current transmission moment and the transmission priority of each data to be transmitted are obtained. A network monitoring tool, a traffic analyzer or a network management system can be used to monitor the transmission nodes on the target path to help capture the ongoing business transmission on the transmission node. For the captured transmission data, data identification and classification are performed, and data packet analysis, protocol parsing or specific identification fields can be used to determine which data belongs to the data to be transmitted on the target path. Once the data to be transmitted is determined, a transmission priority mark is set for each data to be transmitted. These marks can be set in the header or specific fields of the data packet to indicate the priority of the data. The transmission priority can be determined based on application requirements, quality of service requirements or system policies. If there is no data to be transmitted, the transmission priority is set to the lowest priority.
[0083] Exemplarily, if the target data priority is higher than the transmission priority, the first transmission time slot of the target transmission data and the second transmission time slot of the data to be transmitted are determined according to the currently available time slots, the first transmission time slot is greater than the second transmission time slot, and the target transmission data is transmitted using the first transmission time slot. Assuming that node G needs to transmit the target transmission data to node F, and also needs to transmit the data to be transmitted to node E, and the target data priority of the target transmission data from node G to node F is higher than the transmission priority of the data to be transmitted, the first transmission time slot is allocated to the target transmission data, and the first transmission time slot is greater than the second transmission time slot allocated for the data to be transmitted. Since the priority of the target transmission data is high, the second transmission time slot of the data to be transmitted may be relatively short.
[0084] Exemplarily, if the target data priority is equal to the transmission priority, the third transmission time slot of the target transmission data and the fourth transmission time slot of the data to be transmitted are determined according to the currently available time slots, the data with more data packets in the target transmission data and the data to be transmitted corresponds to more time slots, and the target transmission data is transmitted using the third transmission time slot. According to the number of data packets in the target transmission data and the data to be transmitted, the data with more data packets is allocated to correspond to more transmission time slots. In this way, it can be ensured that during the transmission process, the data with more data packets has more transmission time slots to complete the transmission.
[0085] See also Fig.10 In some embodiments, step S502 further includes steps S601 to S602:
[0086] Step S601: Acquire the first available time slot of the transmission node at the previous transmission time on the target path.
[0087] Step S602: Acquire the second available time slot of the transmission node at the current transmission time on the target path.
[0088] Step S603: Obtain a third available time slot according to the preset weight value and the first available time slot, and generate a current available time slot based on the third available time slot and the second available time slot.
[0089] Exemplarily, in the previous resource allocation cycle, the resource allocated to the transmission node is the first available time slot. The third available time slot is obtained based on the preset weight value and the first available time slot, and the current available time slot is generated based on the third available time slot and the second available time slot to avoid a sudden drop or steep rise in resource allocation due to a sudden increase or drop in business volume, thereby adapting to the subsequent sudden situation. To avoid the problem of re-establishing the link due to the possibility that there is still business to be transmitted after a period of time, the number of resources in the previous round will be allocated as a weight, and the preset weight value can be set according to specific needs and experience to balance the relationship between past resource allocation and current resource needs. For example, the first available time slot of the transmission node at the previous transmission moment is 10 time slots, and the second available time slot of the transmission node at the current transmission moment is 2 time slots. At this time, the preset weight value can be set to 30% according to the experience value. At this time, the third available time slot is 10*0.3=3 time slots, and these 3 time slot resources are also allocated to the transmission node. At this time, the current available time slot is 2+3 time slots, thereby avoiding a sudden drop or steep rise in resource allocation.
[0090] See also Fig.11 , in some embodiments, Fig.10 The method further includes steps S701 to S702:
[0091] Step S701, if the target data priority is equal to the transmission priority, a fifth transmission time slot for the target transmission data and a sixth transmission time slot for the data to be transmitted are generated on the transmission node; the fifth transmission time slot and the sixth transmission time slot are generated alternately according to the currently available time slots.
[0092] Step S702: On the transmission node, target transmission data is transmitted according to the fifth transmission time slot.
[0093] For example, assuming that the target data priority is equal to the transmission priority, there are nodes 1, 2, and 3, and the transmission time slots can be allocated in an interleaved manner, such as node 1 is allocated in time slots 1, 4, 7, etc., node 2 is allocated in time slots 2, 5, 8, etc., and node 3 is allocated in time slots 3, 6, 9, etc. The transmission time slots of each node appear alternately in time, realizing interleaved resource allocation. Through interleaved resource allocation, each node obtains transmission time slots more evenly in time. This can help achieve transmission balance and avoid excessive concentration of a certain node, thereby improving overall transmission efficiency and resource utilization.
[0094] The embodiment of the present application also provides a data transmission system that can implement the above-mentioned data transmission method, and the data transmission system includes: a network information module, which is used to obtain network topology information, source nodes and destination nodes; the network topology information includes multiple transmission nodes; a transmission path module, which is used to traverse the transmission nodes to obtain at least one transmission path from the source node to the destination node, and the number of transmission hops between the source node and the destination node in the transmission path is the least; a target path module, which is used to take the transmission nodes adjacent to the source node on each transmission path as neighbor nodes, calculate the connection weight ratio of the neighbor nodes, and select the transmission path corresponding to the smallest connection weight ratio as the target path, and transmit data through the target path.
[0095] The specific implementation of the data transmission system is basically the same as the specific implementation of the data transmission method described above, and will not be repeated here. On the premise of meeting the requirements of the embodiments of the present application, the data transmission system can also be provided with other functional modules to implement the data transmission method in the above embodiments.
[0096] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above data transmission method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0097] See also Fig.12 , Fig.12 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0098] The processor 1201 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0099] The memory 1202 may be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1202 may store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1202, and the processor 1201 calls and executes the data transmission method of the embodiments of this application;
[0100] Input / output interface 1203, used to implement information input and output;
[0101] The communication interface 1204 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0102] A bus 1205 that transmits information between various components of the device (e.g., the processor 1201, the memory 1202, the input / output interface 1203, and the communication interface 1204);
[0103] The processor 1201 , the memory 1202 , the input / output interface 1203 and the communication interface 1204 are connected to each other in communication within the device via the bus 1205 .
[0104] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned data transmission method is implemented.
[0105] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0106] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0107] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0108] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0109] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0110] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0111] It should be understood that in the present application, "at least one (item)" and "several" refer to one or more, and "plurality" refers to two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent 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 or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0112] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the above 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. The mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0113] The units described above 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.
[0114] 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0115] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0116] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A data transmission method, characterized in that: The method comprises: Acquire network topology information, source nodes, and destination nodes; the network topology information includes multiple transmission nodes; Traversing the transmission nodes, obtaining at least one transmission path from the source node to the destination node, wherein the number of transmission hops between the source node and the destination node in the transmission path is the least; The transmission nodes adjacent to the source node on each of the transmission paths are taken as neighbor nodes, the number of the transmission nodes with service initiation requirements on the transmission paths is obtained, the sum of the number of nodes is taken as the number of service connections on the neighbor nodes, the bandwidth weight of the neighbor nodes is obtained according to the node bandwidth capacity of the neighbor nodes, the connection weight ratio is obtained according to the ratio of the number of service connections to the bandwidth weight, the transmission path corresponding to the smallest connection weight ratio is selected as the target path, and data is transmitted through the target path.
2. The data transmission method according to claim 1, characterized in that: The traversing the transmission nodes to obtain at least one transmission path from the source node to the destination node includes: Based on the network topology information, at least one of the transmission nodes having a transmission distance of one hop from the source node is selected as a first candidate node, and the first candidate node is stored in an initial candidate sequence; The transmission nodes in the initial sequence are sequentially used as initial nodes, and at least one of the transmission nodes with a transmission distance of one hop from the initial node is selected as a second candidate node based on the network topology information, and the second candidate node is stored in a second candidate sequence; the second candidate nodes in the second candidate sequence are deduplicated, and the second candidate sequence is used as the initial sequence, and this step is repeated until the destination node is selected as the second candidate node; the initial value of the initial sequence is the initial candidate sequence; Obtaining a plurality of candidate sequences according to the initial candidate sequence and at least one of the second candidate sequences according to the storage time; Starting from the destination node, one of the transmission nodes is selected in the candidate sequence one by one in descending order until the source node is reached, thereby obtaining at least one transmission path.
3. The data transmission method according to claim 2, characterized in that: The selecting, based on the network topology information, at least one of the transmission nodes with a transmission distance of one hop from the initial node as a second candidate node, and storing the second candidate node in a second candidate sequence includes: Acquiring an adjacency value of the initial node based on an adjacency matrix; the adjacency matrix is used to characterize the link connection status between the transmission nodes, and the adjacency matrix is obtained according to the network topology information; Based on the adjacency value, the transmission node connected to the initial node as one hop is used as the second candidate node.
4. The data transmission method according to claim 1, characterized in that: The transmitting data through the target path includes: Get the target data priority of the target transmission data; Obtaining a currently available time slot of the transmission node on the target path at a current transmission time; Acquire the data to be transmitted of the transmission node on the target path at the current transmission time, and the transmission priority of each of the data to be transmitted; If the target data priority is higher than the transmission priority, determining a first transmission time slot for the target transmission data and a second transmission time slot for the data to be transmitted according to the currently available time slot, the first transmission time slot being greater than the second transmission time slot, and using the first transmission time slot to transmit the target transmission data; If the target data priority is equal to the transmission priority, the third transmission time slot of the target transmission data and the fourth transmission time slot of the data to be transmitted are determined according to the currently available time slot, the target transmission data and the data to be transmitted have more data packets corresponding to more time slots, and the target transmission data is transmitted using the third transmission time slot.
5. The data transmission method according to claim 4, characterized in that: The obtaining of the currently available time slot of the transmission node on the target path at the current transmission time comprises: Acquire a first available time slot of the transmission node at a previous transmission time on the target path; Acquire a second available time slot of the transmission node at a current transmission time on the target path; A third available time slot is obtained according to a preset weight value and the first available time slot, and the current available time slot is generated based on the third available time slot and the second available time slot.
6. The data transmission method according to claim 5, characterized in that: The method further comprises: If the target data priority is equal to the transmission priority, generating a fifth transmission time slot for the target transmission data and a sixth transmission time slot for the data to be transmitted on the transmission node; the fifth transmission time slot and the sixth transmission time slot are generated alternately according to the currently available time slots; On the transmitting node, the target transmission data is transmitted according to the fifth transmission time slot.
7. A data transmission system, characterized in that: The system comprises: A network information module, used to obtain network topology information, source nodes and destination nodes; the network topology information includes multiple transmission nodes; A transmission path module, used to traverse the transmission nodes to obtain at least one transmission path from the source node to the destination node, wherein the number of transmission hops between the source node and the destination node in the transmission path is the least; The target path module is used to take the transmission nodes adjacent to the source node on each of the transmission paths as neighbor nodes, obtain the number of the transmission nodes with service initiation requirements on the transmission paths, take the sum of the number of nodes as the number of service connections on the neighbor nodes, obtain the bandwidth weight of the neighbor nodes according to the node bandwidth capacity of the neighbor nodes, obtain the connection weight ratio according to the ratio of the number of service connections to the bandwidth weight, and select the transmission path corresponding to the smallest connection weight ratio as the target path, and transmit data through the target path.
8. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the data transmission method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data transmission method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Route planning method and device and storage medium
CN116232985A
Load balancing information transmission method and device and storage medium
CN117042048A