Data polling scheduling method, device, equipment and storage medium
By setting the initial weight according to the data transmission success rate in the embedded system and performing weighted polling scheduling, the problem of low transmission efficiency of the Bluetooth communication link is solved and load balancing and efficient transmission are achieved.
Patent Information
- Application Number
- CN202310165209.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-02-24
AI Technical Summary
In embedded systems, the transmission efficiency of the Bluetooth communication link for sensor data decreases when the business volume is large, which can easily lead to abnormal reporting congestion.
By determining the data transmission status of the data collection device, setting the initial weight of the business flow queue according to the data transmission success rate, and using the weighted polling scheduling method, the grouped data is transmitted in a prioritized manner to ensure load balancing.
It improves business transmission efficiency, avoids transmission congestion, and achieves load balancing when business volume is abnormal.
Smart Images

Figure CN116155817B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission, and in particular to a data polling scheduling method and device, equipment and storage medium. Background Art
[0002] With the continuous improvement of embedded system functions and the continuous expansion of the market, more and more device status sensing devices in multiple scenarios are being applied to terminals. For example, sensing devices include but are not limited to temperature sensors, vibration sensors and other data acquisition devices, and terminals include but are not limited to concentrators, energy controllers and other electronic devices with data processing capabilities. Among them, these sensors collect environmental variables and promptly transmit data back to the terminal to monitor the working environment status of the terminal. This increases the link communication traffic of the Bluetooth carrier. If the change of environmental variables is abnormal at a certain moment, the terminal needs to increase the traffic volume to report to each sensor, which will inevitably cause abnormal reporting and other situations.
[0003] Therefore, there is an urgent need for a technical means to improve the problem of reduced service transmission efficiency when the traditional Bluetooth communication link transmits a large amount of service at a high rate. Summary of the invention
[0004] The main purpose of the present invention is to provide a data polling scheduling method and device, equipment and storage medium, which can solve the problem of reduced business transmission efficiency in the prior art.
[0005] To achieve the above object, the present invention provides a data polling scheduling method in a first aspect, the method comprising:
[0006] Determine the data transmission status of each data acquisition device, the data transmission status is used to reflect the data transmission success rate when the data acquisition device transmits data to the wireless communication device, each of the data acquisition devices corresponds to a service flow queue, each service flow queue includes a plurality of packet data and a data address of each packet data, and there is a wireless communication connection between the data acquisition device and the wireless communication device;
[0007] Determining an initial weight of the service flow queue using the data transmission success rate, wherein the initial weight is inversely proportional to the data transmission success rate;
[0008] A weighted round-robin scheduling process is performed on the packet data of each of the service flow queues according to the initial weight of each of the service flow queues and the data address, so as to determine the target transmission queue of the current data frame.
[0009] In a feasible implementation, performing weighted round-robin scheduling of packet data of each of the service flow queues according to the initial weight of each of the service flow queues and the data address to determine the target transmission queue of the current data frame includes:
[0010] Determine a target service flow queue corresponding to a maximum initial weight among the initial weights;
[0011] Read the packet data corresponding to the first data address in the target service flow queue to the preset transmission queue of the current data frame, update the target service flow queue, and record the polling number i=i+1;
[0012] The initial weight update process is performed using the maximum initial weight and the initial weights of each of the business flow queues to determine the updated initial weights of each of the business flow queues, and the step of determining the target business flow queue corresponding to the maximum weight in the initial weights is returned to execute until the polling number i is equal to the preset polling number threshold, thereby obtaining the target transmission queue of the current data frame.
[0013] In a feasible implementation, the initial weight is the sum of the static weight and the dynamic weight, and the determining the initial weight of the service flow queue by using the data transmission success rate includes:
[0014] Determining the static weight by using the data transmission success rate, wherein the static weight is inversely proportional to the data transmission success rate;
[0015] The initial weight is determined by using the static weight and the preset dynamic weight.
[0016] In a feasible implementation, the using the maximum initial weight and the initial weights of the service flow queues to perform initial weight update processing to determine the updated initial weights of the service flow queues includes:
[0017] Perform dynamic weight update processing of the target service flow queue by using the maximum initial weight and the static weight sum of each of the initial weights to determine the updated dynamic weight of the target service flow queue, where the updated dynamic weight is the difference between the maximum initial weight and the static weight sum;
[0018] The updated dynamic weight, the dynamic weights of the remaining service flow queues except the target service flow queue, and the static weight are used to perform initial weight update processing to determine the updated initial weight of each service flow queue.
[0019] In a feasible implementation, the device wireless communication device includes a Bluetooth device, and the determining of the data transmission status of each data acquisition device includes:
[0020] Controlling the Bluetooth device to send a broadcast call signal;
[0021] receiving a call-reading reply result of the broadcast call-reading signal returned by each data acquisition device, wherein the call-reading reply result at least includes a device type, a signal strength, and a signal-to-noise ratio of the data acquisition device;
[0022] The data transmission status of each data acquisition device is determined according to the device type, signal strength and signal-to-noise ratio.
[0023] In a feasible implementation, the method further includes:
[0024] Counting the number of business flow requests of different business flows, where the number of business flow requests is used to reflect the data reading demand of the business flow;
[0025] The preset value of the second weight is determined according to the number of business flow requests.
[0026] In a feasible implementation, the data acquisition device is used to collect operating data of the power equipment, and the method further includes:
[0027] The target transmission queue is uploaded to a preset host computer, and the host computer is used to perform data analysis based on the target transmission queue to determine the operating status of the power equipment.
[0028] To achieve the above object, the second aspect of the present invention provides a data polling scheduling device, the device comprising:
[0029] A state determination module is used to determine the data transmission state of each data acquisition device, wherein the data transmission state is used to reflect the data transmission success rate when the data acquisition device transmits data to the wireless communication device. Each of the data acquisition devices corresponds to a service flow queue, each service flow queue includes a plurality of packet data and a data address of each packet data, and a wireless communication connection is provided between the data acquisition device and the wireless communication device.
[0030] A weight determination module: used to determine the initial weight of the service flow queue using the data transmission success rate, wherein the initial weight is inversely proportional to the data transmission success rate;
[0031] Polling scheduling module: used to perform weighted polling scheduling processing on the packet data of each service flow queue according to the initial weight of each service flow queue and the data address, and determine the target transmission queue of the current data frame.
[0032] To achieve the above-mentioned purpose, the third aspect of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps shown in the first aspect and any feasible implementation method.
[0033] To achieve the above-mentioned purpose, the fourth aspect of the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps shown in the first aspect and any feasible implementation method.
[0034] The embodiments of the present invention have the following beneficial effects:
[0035] The present invention provides a data polling scheduling method, the method comprising: determining the data transmission state of each data acquisition device, the data transmission state is used to reflect the data transmission success rate when the data acquisition device transmits data to the wireless communication device, each data acquisition device corresponds to a service flow queue, each service flow queue includes a plurality of packet data and the data address of each packet data, and there is a wireless communication connection between the data acquisition device and the wireless communication device; using the data transmission success rate to determine the initial weight of the service flow queue, the initial weight is inversely proportional to the data transmission success rate; performing weighted polling scheduling processing on the packet data of each service flow queue according to the initial weight and data address of each service flow queue, and determining the target transmission queue of the current data frame. Through the above method, the initial weight of the service flow queue can be obtained according to the data transmission state of the data acquisition device, and then the weighted polling scheduling processing is performed according to the initial weight to obtain the target transmission queue of the current data frame. When the business volume is abnormal, the weighted polling scheduling can be realized according to the initial weight to prioritize the business flow queue, so as to achieve load balancing and improve the business transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] in:
[0038] Figure 1 A structural block diagram of a data polling scheduling system in an embodiment of the present invention;
[0039] Figure 2 A flowchart of a data polling scheduling method according to an embodiment of the present invention;
[0040] Figure 3A schematic diagram of polling scheduling of a service flow queue in an embodiment of the present invention;
[0041] Figure 4 Another flow chart of a data polling scheduling method according to an embodiment of the present invention;
[0042] Figure 5 It is a structural block diagram of a data polling scheduling device in an embodiment of the present invention;
[0043] Figure 6 4 is a structural block diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] See also Figure 1 , Figure 1 FIG. 1 is a structural block diagram of a data polling scheduling system according to an embodiment of the present invention. Figure 1 The polling scheduling system of the data shown includes a data acquisition device, a wireless communication device 102 and a host computer 103. There is a wireless communication connection between the data acquisition device, the wireless communication device 102 and the host computer 103. There can be multiple data acquisition devices. Therefore, the data acquisition device includes a data acquisition device 1011, a data acquisition device 1012, a data acquisition device 1013, ..., a data acquisition device 101n; further, the data acquisition device is used to collect data from the collection object. The data acquisition device includes but is not limited to an electrical signal collection device, a temperature collection device, a pressure collection device, and a flow collection device, etc. The collection object includes but is not limited to power facilities such as transformers; the wireless communication device 102 is used to provide a wireless communication connection channel so that the collected data can be transmitted wirelessly. The wireless communication device can be a Bluetooth communication module; the host computer is used to receive the collected data, monitor and analyze the collected data, and perform other data processing. For example, the operation status information of the collection object can be analyzed through data monitoring to know the operation status.
[0046] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of a data polling scheduling method according to an embodiment of the present invention. Figure 2 The method shown comprises the following steps:
[0047] 201. Determine the data transmission status of each data acquisition device, wherein the data transmission status is used to reflect the data transmission success rate when the data acquisition device transmits data to the wireless communication device, each of the data acquisition devices corresponds to a service flow queue, each service flow queue includes a plurality of packet data and a data address of each packet data, and a wireless communication connection is established between the data acquisition device and the wireless communication device;
[0048] It should be noted that the method can be applied to both terminals and servers. This embodiment is explained by applying to terminals as an example. The terminals include but are not limited to desktop terminals or mobile terminals. The mobile terminals can specifically be at least one of mobile phones, tablet computers, laptop computers, etc. The server can be implemented with an independent server or a server cluster composed of multiple servers. There are multiple data acquisition devices, each of which collects data on the collection object according to a preset sampling period. The collected data will be cached to generate a business flow queue. Each data acquisition device corresponds to a business flow queue FQn one by one. For example, an electrical signal acquisition device corresponds to an electrical signal business flow queue, a temperature acquisition device corresponds to a temperature business flow queue, a pressure acquisition device corresponds to a pressure business flow queue, and a flow acquisition device corresponds to a flow business flow queue. Among them, each business flow queue is composed of sampled data obtained according to a sampling period. The sampled data can also be called packet data of a business flow queue. Please refer to Figure 3 , Figure 3 FIG. 1 is a schematic diagram of polling scheduling of a service flow queue in an embodiment of the present invention. Figure 3 It includes four business flow queues: business flow queue FQ1, business flow queue FQ2, business flow queue FQ3 and business flow queue FQ4, and a target transmission queue DQ1 obtained through the above four business flow queues, wherein the business flow queue FQ1 includes packet data A1 and packet data A2...; the business flow queue FQ2 includes packet data B1 and packet data B2...; the business flow queue FQ3 includes packet data C1 and packet data C2...; the business flow queue FQ4 includes packet data D1 and packet data D2...; the target transmission queue DQ1 includes packet data B1, packet data A1, packet data B1, packet data C1...; wherein, the packet data of the business flow queue FQn is collected by the corresponding data collection device, and the packet data of the target transmission queue DQ1 is obtained by adopting the data polling scheduling method shown in this embodiment.
[0049] For example, Figure 3The first queue FQ1 is the electrical signal service, and each element A1, A2, etc. in it is the address of the data output by the electrical signal sensor; the second queue FQ2 is the temperature service, and each element B1, B2, etc. in it is the address of the data output by the temperature sensor; similarly, queues FQ3 and FQ4 are pressure service queues and flow service queues respectively. In summary: each service corresponds to a service queue, and the elements of the queue are the data addresses of the corresponding services, and each data address stores the corresponding packet data. Each service queue is sorted by a weighted polling algorithm according to the pre-defined service weights and sent to the departure queue, while the empty service queue does not participate in sorting and sending.
[0050] Understandably, Figure 3 This embodiment is described by taking one target transmission queue DQ1 as an example, but the present application does not limit the number of the target transmission queues DQ1, and the number of the target transmission queues DQ1 can be multiple.
[0051] Furthermore, in order to improve the service transmission efficiency when multiple data acquisition devices perform data transmission, it is necessary to determine the data transmission status of each data acquisition device, which is used to reflect the data transmission success rate when the data acquisition device transmits data to the wireless communication device, so as to determine whether the data transmission of each data acquisition device will be abnormal when multiple data acquisition devices perform data transmission. Furthermore, the data transmission success rate is proportional to the communication success rate. Therefore, the data transmission success rate can be measured by the communication success rate. For details, refer to the following formula:
[0052] Communication success rate = (number of transmissions - number of CRC failures) / number of transmissions × 100%.
[0053] 202. Determine an initial weight of the service flow queue using the data transmission success rate, where the initial weight is inversely proportional to the data transmission success rate;
[0054] Furthermore, different initial weights are assigned to different service flow queues through the data transmission success rate determined in step 201. The initial weight is inversely proportional to the data transmission success rate. The data transmission success rates of various data acquisition devices are compared. If the data transmission success rate of a certain data acquisition device is higher, the initial weight of the data acquisition device is lower than the initial weights of other data acquisition devices. Conversely, if the data transmission success rate of a certain data acquisition device is lower, the initial weight of the data acquisition device is higher than the initial weights of other data acquisition devices. The initial weight is used to reflect the data transmission resources of the service flow queue. The higher the initial weight, the more data transmission resources.
[0055] It should be noted that if the terminal needs to increase the business volume to report to each sensor due to abnormal changes in environmental variables at a certain moment, it will inevitably cause abnormal reporting congestion, etc. At this time, the data transmission success rate of the business flow queue with a large data volume will be lower than that of other small data volumes. After the weighting process is performed in step 202, it will have a higher initial weight and obtain more data transmission resources, thereby achieving load balancing.
[0056] 203. Perform weighted round-robin scheduling of the packet data of each of the service flow queues according to the initial weight of each of the service flow queues and the data address, and determine a target transmission queue for the current data frame.
[0057] Furthermore, the data addresses of different service flow queues can be output through different initial weights to achieve data transmission. Specifically, weighted polling scheduling processing is performed on the packet data of each service flow queue according to the initial weight of each service flow queue and the data address to determine the target transmission queue of the current data frame. For example, a service flow queue with a high initial weight obtains more data transmission resources, and a service flow queue with a low initial weight obtains more data transmission resources.
[0058] Exemplarily, in the traditional Bluetooth communication link transmission mode, when the business volume is large and the rate is high, the business transmission efficiency will be reduced. When the queue data is very large and the link rate is high, there are many empty queues that do not need to be forwarded. Therefore, in the presence of the above situation, the method of the present application is adopted, by distributing the business data using queues for cache storage, and numbering them according to different businesses, using a polling algorithm, and establishing a separate departure queue (transmission queue DQ) to store the data address of the packet data output by the non-empty queue. Sensors for different physical parameters can be divided into different businesses.
[0059] Although the polling scheduling method gives each non-empty business flow queue the same service opportunity to a certain extent, it is difficult for some queues to obtain more transmission opportunities when the business volume is high and heavy, and the communication success rate of the transmission signal is low. The weighted polling scheduling algorithm will give a higher weight W to the same business flow, so that transmission resources matching the weight can be obtained. For example, W packet data of the queue are sent, and different service volumes are allocated to different queues according to the importance, so as to achieve load balancing under high business volume. By setting a smooth weighted polling algorithm, continuous business information collection, if the environmental state remains unchanged, many duplicate messages will be generated, resulting in data redundancy, which reduces transmission efficiency, and sets message cache mechanism, sleep mode, etc.
[0060] It should be noted that according to the data transmission rules of the Bluetooth link, when the sensor service comes, each Bluetooth data acquisition service output terminal not only needs to configure the cache, but also needs to perform service scheduling. In order to improve the stability and efficiency of Bluetooth data transmission, traditional polling scheduling can give each non-empty service the same service opportunity, but when the service volume of some queues is heavy or the transmission success rate of Bluetooth signals is low, it is difficult to allow them to obtain more transmission opportunities. Therefore, a weighted polling system is added on the basis of polling so that each non-empty service flow queue and each FQ (service flow) have an integer weight Wi associated with it. When the service is sent to queue i, the Wi packet services of the queue are sent to improve the allocation of different terminal services to different queues.
[0061] Furthermore, weighted round-robin scheduling adds two departure queues (preset transmission queues) and the preset weights (initial weights) stored in the weight counter. One of the two departure queues is in an active state, and the other is in a standby state, responsible for arranging the next data frame transmission. When the service demand is large, at the beginning of a round of service flow, the counter initializes a weight, and then the two non-empty queues take turns to serve according to the weight value.
[0062] The present invention provides a data polling scheduling method, the method comprising: determining the data transmission state of each data acquisition device, the data transmission state is used to reflect the data transmission success rate when the data acquisition device transmits data to the wireless communication device, each data acquisition device corresponds to a service flow queue, each service flow queue includes a plurality of packet data and the data address of each packet data, and there is a wireless communication connection between the data acquisition device and the wireless communication device; using the data transmission success rate to determine the initial weight of the service flow queue, the initial weight is inversely proportional to the data transmission success rate; performing weighted polling scheduling processing on the packet data of each service flow queue according to the initial weight and data address of each service flow queue, and determining the target transmission queue of the current data frame. Through the above method, the initial weight of the service flow queue can be obtained according to the data transmission state of the data acquisition device, and then the weighted polling scheduling processing is performed according to the initial weight to obtain the target transmission queue of the current data frame. When the business volume is abnormal, the weighted polling scheduling can be realized according to the initial weight to prioritize the business flow queue, so as to achieve load balancing and improve the business transmission efficiency.
[0063] See also Figure 4 , Figure 4 FIG. 4 is another flow chart of a method for polling and scheduling data in an embodiment of the present invention. Figure 4 The method shown comprises the following steps:
[0064] 401. Determine the data transmission status of each data acquisition device, wherein the data transmission status is used to reflect the data transmission success rate when the data acquisition device transmits data to the wireless communication device, each of the data acquisition devices corresponds to a service flow queue, each service flow queue includes a plurality of packet data and a data address of each packet data, and a wireless communication connection is established between the data acquisition device and the wireless communication device;
[0065] It should be noted that the content of step 401 is the same as Figure 2 The contents of step 201 are similar and will not be described here to avoid repetition. Figure 2 The content of step 201 is shown.
[0066] In a feasible implementation, the device wireless communication device includes a Bluetooth device, and step 401 may include steps P01-P03:
[0067] P01, controlling the Bluetooth device to send a broadcast call signal;
[0068] P02, receiving the call-reading reply result of the broadcast call-reading signal returned by each data acquisition device, wherein the call-reading reply result at least includes the device type, signal strength and signal-to-noise ratio of the data acquisition device;
[0069] P03. Determine the data transmission status of each data acquisition device according to the device type, signal strength and signal-to-noise ratio.
[0070] It should be noted that in order to improve the accuracy of determining the data transmission status, the data transmission status can be judged by controlling the Bluetooth device to send a broadcast call signal in real time. The broadcast call signal is used to obtain the broadcast call result of the signal transmission characteristics related to the signal transmission, such as the device type, signal strength and signal-to-noise ratio of the data acquisition device, and the call reply result of the broadcast call signal returned by each data acquisition device. The broadcast call signal returned by each data acquisition device at least includes the device type of the data acquisition device, signal strength and signal-to-noise ratio, etc., which can reflect the communication status of the Bluetooth sensor. The data transmission status of each data acquisition device is determined according to the communication status signal quantities such as the device type, signal strength, signal-to-noise ratio and related communication success rate.
[0071] The Bluetooth communication success rate is measured by combining parameters such as sensor device type, signal strength, and signal-to-noise ratio, and the initial weight is set accordingly. A high weight is given to devices with low communication success rates, and the number of polling times is increased accordingly to improve the overall analog quantity acquisition effect of the terminal.
[0072] Exemplarily, in one business cycle, different status quantities of different sensors are identified through the broadcast call of the Bluetooth device, such as device type, signal strength RSSI, signal-to-noise ratio, etc. The call reply result is written into the terminal Bluetooth device storage area through the status word, and the initial weight is set according to the signal transmission status of different acquisition devices. If the data recalled from the signal of device B (temperature sensor) shows a signal strength of 4 and a signal-to-noise ratio of 10db, indicating that the signal communication success rate is low, the initial weight of the B device service is set to the maximum. In this way, the number of collection times of device B increases accordingly during the polling scheduling of this business cycle, thereby achieving balanced collection and all-round data collection.
[0073] 402. Determine an initial weight of the service flow queue using the data transmission success rate, where the initial weight is inversely proportional to the data transmission success rate;
[0074] It should be noted that step 402 and Figure 2 The contents of step 202 are similar and will not be described here to avoid repetition. Figure 2 The content of step 202 is shown.
[0075] In a feasible implementation, the initial weight is the sum of the static weight and the dynamic weight, and step 402 may include steps I01-I02:
[0076] I01. Determine the static weight by using the data transmission success rate, wherein the static weight is inversely proportional to the data transmission success rate;
[0077] I02. Determine the initial weight using the static weight and the preset dynamic weight.
[0078] It should be noted that in order to ensure the accuracy of the initial weight in each polling scheduling of the current data frame, the initial weight W is divided into two parts: static weight Weight and dynamic weight currentWeight. The initial weight is the sum of the static weight and the dynamic weight, wherein the static weight will not change due to each polling scheduling, and the static weight is inversely proportional to the data transmission success rate. The static weight is confirmed by the data transmission success rate, and the dynamic weight will change with each polling scheduling, so that the initial weight will change once each polling scheduling, wherein the dynamic weight of the first polling scheduling can be pre-set, and the preset value of the dynamic weight can be 0.
[0079] In a feasible implementation, the initial value of the dynamic weight may not be set to 0, and the preset value of the dynamic weight may also be set according to the demand for service flow requests of different service flow queues, so the method further includes the following steps U01-U02:
[0080] U01. Count the number of service flow requests of different service flows, where the number of service flow requests is used to reflect the data reading requirements of the service flows;
[0081] U02. Determine a preset value of the second weight according to the number of business flow requests.
[0082] It should be noted that different business flow request requirements are different, so different dynamic weights can be configured for different data acquisition devices, and initial dynamic weights can be assigned according to different business requests. Specifically, the number of business flow requests for different business flows is counted, and the number of business flow requests is used to reflect the data reading requirements of the business flows; the preset value of the second weight is determined according to the number of business flow requests. Exemplarily, if the number of business flow requests is large, the data reading requirements of the business flows are high, and then the preset value (preset value is also the initial value) of the dynamic weight of the corresponding business flow queue can be set to a higher value; if the number of business flow requests is small, the data reading requirements of the business flows are small, and then the preset value (preset value is also the initial value) of the dynamic weight of the corresponding business flow queue can be set to a lower value. No specific limitation is made here.
[0083] 403. Determine a target service flow queue corresponding to a maximum initial weight among the initial weights;
[0084] 404. Read the packet data corresponding to the first data address in the target service flow queue to the preset transmission queue of the current data frame, update the target service flow queue, and record the polling number i=i+1;
[0085] It should be noted that in order to ensure the efficiency of business transmission, the present application performs data reading for each polling schedule according to the size of the initial weight, so as to obtain the target transmission queue of the current data frame. Specifically, since the initial weight is inversely proportional to the data transmission success rate, and the data transmission success rate is inversely proportional to the data volume pressure, it is necessary to first determine the target business flow queue corresponding to the maximum initial weight among the initial weights, obtain the target business flow queue with the greatest data pressure, and perform data reading for this polling schedule, that is, to transmit the packet data of the target business flow queue to the preset transmission queue. Since the data has been transmitted to the preset transmission queue, it is necessary to update the target business flow queue, and record the polling number i=i+1 by setting the polling number i+1. Among them, the initial value of the polling number i can be 0 or 1, etc., which is not limited here.
[0086] 405. Perform initial weight update processing using the maximum initial weight and the initial weights of each of the service flow queues to determine the updated initial weights of each of the service flow queues, and return to execute the step of determining the target service flow queue corresponding to the maximum weight in the initial weights until the polling number i is equal to the preset polling number threshold, thereby obtaining the target transmission queue of the current data frame.
[0087] Furthermore, since the data of the target service flow queue will change after each polling scheduling, it is necessary to update the initial weight for the next polling scheduling. In this embodiment, the static weight remains unchanged during the polling scheduling cycle of a data frame, and the dynamic weight changes dynamically as the number of polling increases. Specifically, the initial weight update process is performed using the maximum initial weight and the initial weights of each of the service flow queues to determine the updated initial weights of each of the service flow queues, and the step of determining the target service flow queue corresponding to the maximum weight in the initial weight is returned to execute until the polling number i is equal to the preset polling number threshold, and the target transmission queue of the current data frame is obtained, wherein the preset polling number threshold is the maximum polling number in the polling scheduling cycle corresponding to a data frame, which can be 10 times or 20 times, etc., and can be set based on actual conditions, and this application is not limited here.
[0088] In a feasible implementation, step 405 may include steps Y01-Y02:
[0089] Y01, using the maximum initial weight and the static weight sum of each of the initial weights to perform dynamic weight update processing on the target service flow queue, and determining the updated dynamic weight of the target service flow queue, wherein the updated dynamic weight is the difference between the maximum initial weight and the static weight sum;
[0090] Y02. Perform initial weight update processing using the updated dynamic weights, the dynamic weights of the remaining service flow queues except the target service flow queue, and the static weights to determine the updated initial weights of each service flow queue.
[0091] Among them, since each polling only outputs the packet data address of the target service flow queue corresponding to the maximum initial weight, after each data output, it is necessary to first update the dynamic weight of the target service flow queue through step Y01. Exemplarily, the update of the dynamic weight of the target service flow queue can be the difference between the maximum initial weight and the sum of the weights of each initial weight. Finally, step Y02 is used to perform initial weight update processing using the updated dynamic weight, the dynamic weights of the remaining service flow queues except the target service flow queue, and the static weight to determine the updated initial weights of each service flow queue.
[0092] Continue with Figure 3 For example, the four service flow queues are service flow queues FQ1 to FQ4, where the dynamic weights currentWeight are all 0 and the static weights weight are: [3, 5, 1, 1];
[0093] Furthermore, the initial weight W = dynamic weight currentWeight + static weight weight, so the initial weights W are: [3, 5, 1, 1] respectively. Since the static weights do not change, the judgment of the weight size can also be regarded as the judgment of the dynamic weight size, where the dynamic weight currentWeight = dynamic weight currentWeight + static weight weight. Since the initial dynamic weight is 0, the dynamic weight currentWeight is [3, 5, 1, 1] at this time. At this time, the maximum initial weight MaxcurrentWeight is 5, so the target service flow queue is the service flow queue FQ2;
[0094] Therefore, during the first round-robin scheduling, the packet data B1 of FQ2 is output, and its dynamic weight currentWeight is updated, and the dynamic weight currentWeight = the maximum initial weight MaxcurrentWeight - the static weight sum(Weight) = 5 - (3 + 5 + 1 + 1) = -5. At this time, the updated dynamic weight is [-5]. At this time, the dynamic weights of each service flow queue temporarily become [3, -5, 1, 1].
[0095] Then, the initial weight of each service flow queue is updated, that is, the initial weight W = dynamic weight currentWeight + static weight weight; that is, the initial weight of FQ1 is updated to [3+3=6], the initial weight of FQ2 is updated to [(-5)+5=0], the initial weight of FQ3 is updated to [1+1=2], and the initial weight of FQ4 is updated to [(1+1=2], and finally, the initial weight W is [6, 0, 2, 2].
[0096] Furthermore, in the second round of polling scheduling, the target service flow queue is FQ1, and the above process is repeated. Finally, after this data transmission, the initial weight W is [-1, 5, 3, 3]. This process is repeated until the maximum number of polling times is reached, and the data polling scheduling of the current data frame ends.
[0097] For example, reference may be made to Table 1, which shows the updating process of each initial weight of four service flow queues when the preset polling number threshold is 10 times. In Table 1, the initial dynamic weight currentWeight is 0, the static weight weight is 3, 5, 1, 1, and Max (currentWeight) marks the maximum initial weight. Since the static weight remains unchanged, the maximum weight can actually be regarded as the maximum dynamic weight. The update of the initial weight can also be regarded as the update of the dynamic weight. Result represents the packet data of the target service flow queue, and sum (Weight) represents the static weight sum. Table 1 is as follows:
[0098] Table 1
[0099]
[0100]
[0101] It should be noted that the initial state is: A(3), B(5), C(1), D(1), where A: electrical signal; B: temperature; C: pressure; D: flow. It can be seen that after 10 pollings, the next cycle begins. Therefore, the business flow after one polling should be: BABCABDBAB frame, and the target transmission queue of the current data frame is obtained, among which the business of B temperature accounts for the largest proportion. Then, the data output can be dynamically realized according to the initial weight. Finally, the target transmission queue has 5 packet data B, 3 packet data A, and 5 packet data C and D. The weight ratio of each business is A:B:C:D=3:5:1:1, so that the data collected by a certain collector is the largest, and the dynamic weight distribution can be adjusted as needed to achieve the purpose of business load balancing and improve the stability of terminal Bluetooth sensor collection.
[0102] In a feasible implementation, the data acquisition device is used to collect operating data of the power equipment, and the method also includes: uploading the target transmission queue to a preset host computer, and the host computer is used to perform data analysis based on the target transmission queue to determine the operating status of the power equipment.
[0103] It is understandable that after obtaining the above-mentioned target transmission queue, the target transmission queue can be uploaded to the preset host computer, so that when the collection object is the power equipment, its operation data can be analyzed and the operation status can be monitored. An early warning can be issued when the operation status is abnormal. Different from the carrier communication of traditional data collection, the Bluetooth statistical analysis model is used for analysis, in which the operation status of the substation is analyzed by recording the environmental quantities of each Bluetooth sensor, and the hidden safety hazards of the substation operation are checked through various data. The Bluetooth system network collects characteristic status information of each sensor device, such as temperature, humidity, and environmental operation safety status. Bluetooth communication technology supports mobile Internet. Each acquisition module receives temperature data with a Bluetooth spiral antenna, is connected to the serial port of the host computer through a data bus, and uploads the processed various parameter data to the host computer. For example, for temperature parameters, after the wireless network communication module Bluetooth networking, the temperature receiving module is wirelessly networked with multiple temperature acquisition modules and transmitted in their respective business flows.
[0104] Furthermore, each counter will initialize its weight when a new data frame starts to be transmitted. When a new data packet arrives, if it is the first packet in the queue and the queue counter is zero, the queue number is written to the tail. If it is not the first packet in the queue, only its storage address is added to the tail of the corresponding service flow queue.
[0105] The present invention provides a data polling scheduling method, which includes: determining the data transmission status of each data acquisition device, the data transmission status is used to reflect the data transmission success rate when the data acquisition device transmits data to a wireless communication device, each data acquisition device corresponds to a business flow queue, each business flow queue includes a plurality of packet data and the data address of each packet data, and there is a wireless communication connection between the data acquisition device and the wireless communication device; using the data transmission success rate to determine the initial weight of the business flow queue, the initial weight is inversely proportional to the data transmission success rate; determining the target business flow queue corresponding to the maximum initial weight among the initial weights; reading the packet data corresponding to the first data address in the target business flow queue to the preset transmission queue of the current data frame, and updating the target business flow queue, and recording the polling number i=i+1; using the maximum initial weight and the initial weight of each business flow queue to perform initial weight update processing, determine the updated initial weight of each business flow queue, and return to execute the step of determining the target business flow queue corresponding to the maximum weight among the initial weights, until the polling number i is equal to the preset polling number threshold, and the target transmission queue of the current data frame is obtained. Through the above method, weighted polling scheduling of business flow queues can be implemented. The initial weight of the business flow queue is obtained according to the data transmission status of the data acquisition device, and then weighted polling scheduling is performed according to the initial weight to obtain the target transmission queue of the current data frame. When the business volume is abnormal, weighted polling scheduling can be implemented according to the initial weight to prioritize the business flows, thereby achieving load balancing and improving business transmission efficiency.
[0106] See also Figure 5 , Figure 5 FIG. 1 is a structural block diagram of a data polling scheduling device according to an embodiment of the present invention. Figure 5 The device shown comprises:
[0107] The state determination module 501 is used to determine the data transmission state of each data acquisition device, and the data transmission state is used to reflect the data transmission success rate when the data acquisition device transmits data to the wireless communication device. Each of the data acquisition devices corresponds to a service flow queue, and each service flow queue includes a plurality of packet data and a data address of each packet data. There is a wireless communication connection between the data acquisition device and the wireless communication device.
[0108] A weight determination module 502 is configured to determine an initial weight of the service flow queue using the data transmission success rate, wherein the initial weight is inversely proportional to the data transmission success rate;
[0109] The polling scheduling module 503 is used to perform weighted polling scheduling processing on the packet data of each of the service flow queues according to the initial weight of each of the service flow queues and the data address, and determine the target transmission queue of the current data frame.
[0110] It should be noted that Figure 5 The functions of each module in the device shown are Figure 2 The steps of the method shown are similar and will not be described here to avoid repetition. Figure 2 The steps of the method shown.
[0111] The present invention provides a data polling scheduling method, the method includes: a state determination module: used to determine the data transmission state of each data acquisition device, the data transmission state is used to reflect the data transmission success rate when the data acquisition device transmits data to the wireless communication device, each data acquisition device corresponds to a business flow queue, each business flow queue includes a number of packet data and the data address of each packet data, and there is a wireless communication connection between the data acquisition device and the wireless communication device; a weight determination module: used to determine the initial weight of the business flow queue using the data transmission success rate, and the initial weight is inversely proportional to the data transmission success rate; a polling scheduling module: used to perform weighted polling scheduling processing of the packet data of each business flow queue according to the initial weight and data address of each business flow queue, and determine the target transmission queue of the current data frame. Through the above method, the initial weight of the business flow queue can be obtained according to the data transmission state of the data acquisition device, and then the weighted polling scheduling processing is performed according to the initial weight to obtain the target transmission queue of the current data frame. When the business volume is abnormal, the weighted polling scheduling can be realized according to the initial weight to prioritize the business flow queue, so as to achieve load balancing and improve the business transmission efficiency.
[0112] Figure 6 FIG. 1 shows an internal structure diagram of a computer device in an embodiment. The computer device may be a terminal or a server. Figure 6 As shown, the computer device includes a processor, a memory and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the above method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can implement the above method. Those skilled in the art can understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0113] In one embodiment, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes Figure 2 or Figure 4 The steps of the method shown.
[0114] In one embodiment, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the processor executes Figure 2 or Figure 4 The steps of the method shown.
[0115] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0116] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0117] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data polling scheduling method, characterized in that: The method comprises: Determine the data transmission status of each data acquisition device, the data transmission status is used to reflect the data transmission success rate when the data acquisition device transmits data to the wireless communication device, each of the data acquisition devices corresponds to a service flow queue, each service flow queue includes a plurality of packet data and a data address of each packet data, and there is a wireless communication connection between the data acquisition device and the wireless communication device; Determining an initial weight of the service flow queue using the data transmission success rate, wherein the initial weight is inversely proportional to the data transmission success rate; Performing weighted round-robin scheduling processing on the packet data of each of the service flow queues according to the initial weight of each of the service flow queues and the data address to determine the target transmission queue of the current data frame includes: Determine a target service flow queue corresponding to a maximum initial weight among the initial weights; Read the packet data corresponding to the first data address in the target service flow queue to the preset transmission queue of the current data frame, update the target service flow queue, and record the polling number i=i+1; Performing initial weight update processing using the maximum initial weight and the initial weights of each of the service flow queues, determining the updated initial weights of each of the service flow queues, and returning to execute the step of determining the target service flow queue corresponding to the maximum initial weight in the initial weights until the polling number i is equal to the preset polling number threshold, thereby obtaining the target transmission queue of the current data frame; Wherein, the initial weight is the sum of the static weight and the dynamic weight, and the determining the initial weight of the service flow queue by using the data transmission success rate includes: Determining the static weight by using the data transmission success rate, wherein the static weight is inversely proportional to the data transmission success rate; Determine the initial weight using the static weight and the preset dynamic weight; The method of performing initial weight update processing by using the maximum initial weight and the initial weights of each of the service flow queues to determine the updated initial weights of each of the service flow queues includes: Perform dynamic weight update processing of the target service flow queue by using the maximum initial weight and the static weight sum of each of the initial weights to determine the updated dynamic weight of the target service flow queue, where the updated dynamic weight is the difference between the maximum initial weight and the static weight sum; Performing initial weight update processing using the updated dynamic weight, the dynamic weights of the remaining service flow queues except the target service flow queue, and the static weight to determine the updated initial weight of each service flow queue; The updated dynamic weight of each service flow queue in the remaining service flow queues is the sum of the current dynamic weight and the static weight of the service flow queue.
2. The method according to claim 1, characterized in that: The wireless communication device includes a Bluetooth device, and the step of determining the data transmission status of each data acquisition device includes: Controlling the Bluetooth device to send a broadcast call signal; receiving a call-reading reply result of the broadcast call-reading signal returned by each data acquisition device, wherein the call-reading reply result at least includes a device type, a signal strength, and a signal-to-noise ratio of the data acquisition device; The data transmission status of each data acquisition device is determined according to the device type, signal strength and signal-to-noise ratio.
3. The method according to claim 1, characterized in that: The method further comprises: Counting the number of business flow requests of different business flows, where the number of business flow requests is used to reflect the data reading demand of the business flow; The preset value of the dynamic weight is determined according to the number of business flow requests.
4. The method according to claim 1, characterized in that: The data acquisition device is used to collect operating data of the power equipment, and the method further includes: The target transmission queue is uploaded to a preset host computer, and the host computer is used to perform data analysis based on the target transmission queue to determine the operating status of the power equipment.
5. A data polling scheduling device, characterized in that: The device comprises: A state determination module is used to determine the data transmission state of each data acquisition device, wherein the data transmission state is used to reflect the data transmission success rate when the data acquisition device transmits data to the wireless communication device. Each of the data acquisition devices corresponds to a service flow queue, each service flow queue includes a plurality of packet data and a data address of each packet data, and a wireless communication connection is provided between the data acquisition device and the wireless communication device. A weight determination module: used to determine the initial weight of the service flow queue using the data transmission success rate, wherein the initial weight is inversely proportional to the data transmission success rate; Polling scheduling module: used to perform weighted polling scheduling processing of packet data of each service flow queue according to the initial weight of each service flow queue and the data address, and determine the target transmission queue of the current data frame; Among them, the polling scheduling module is specifically used to determine the target business flow queue corresponding to the maximum initial weight among each of the initial weights; read the packet data corresponding to the first data address in the target business flow queue to the preset transmission queue of the current data frame, and update the target business flow queue, and record the polling number i=i+1; use the maximum initial weight and the initial weights of each of the business flow queues to perform initial weight update processing, determine the updated initial weights of each of the business flow queues, and return to execute the step of determining the target business flow queue corresponding to the maximum initial weight among the initial weights, until the polling number i is equal to the preset polling number threshold, and the target transmission queue of the current data frame is obtained; Wherein, the initial weight is the sum of the static weight and the dynamic weight, and the weight determination module is specifically used to: determine the static weight using the data transmission success rate, and the static weight is inversely proportional to the data transmission success rate; determine the initial weight using the static weight and the preset dynamic weight; Among them, the initial weight update processing is performed using the maximum initial weight and the initial weight of each of the business flow queues to determine the updated initial weight of each of the business flow queues, including: using the maximum initial weight and the static weight sum of each of the initial weights to perform dynamic weight update processing on the target business flow queue to determine the updated dynamic weight of the target business flow queue, wherein the updated dynamic weight is the difference between the maximum initial weight and the static weight sum; using the updated dynamic weight, the dynamic weights of the remaining business flow queues except the target business flow queue, and the static weight to perform initial weight update processing to determine the updated initial weight of each of the business flow queues; wherein the updated dynamic weight of each business flow queue in the remaining business flow queues is the sum of the current dynamic weight and the static weight of the business flow queue.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 4.
7. A computer device comprising a memory and a processor, characterized in that: The memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 4.
