Bluetooth multi-channel concurrent meter reading method and system of electricity consumption information acquisition terminal and medium

By dynamically evaluating the priority and channel usage of Bluetooth device meter reading tasks using a decision tree algorithm, the problem of low efficiency in Bluetooth device meter reading is solved, achieving efficient multi-channel meter reading and channel resource utilization, adapting to complex power environments, and being compatible with existing equipment.

CN121842541APending Publication Date: 2026-04-10SHANDONG LUNENG SOFTWARE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing technologies do not adequately consider authentication connections and sudden link interference during meter reading using Bluetooth devices, resulting in low efficiency in complex scenarios. Furthermore, some solutions require modifications to the traditional Bluetooth protocol to improve compatibility, increasing implementation costs.

Method used

A decision tree-guided dynamic weighted priority scoring algorithm is adopted to calculate the dynamic priority for each meter reading task block, intelligently allocate Bluetooth channel resources, dynamically adjust task priority and channel usage, and reduce connection authentication time.

Benefits of technology

It improves the efficiency of Bluetooth multi-channel concurrent meter reading, increases channel utilization, is compatible with existing devices, requires no modification to the traditional Bluetooth protocol, lowers the implementation threshold, and adapts to complex power environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121842541A_ABST
    Figure CN121842541A_ABST
Patent Text Reader

Abstract

The invention provides a Bluetooth multi-channel concurrent meter reading method and system of an electricity utilization information acquisition terminal and a medium, and belongs to the technical field of electricity utilization information acquisition, and the method comprises the steps that when a meter reading task reaches the execution starting time, a task block is generated for each Bluetooth device to be read in the meter reading task; calculating a dynamic priority for each task block based on a dynamic weighting priority scoring algorithm guided by a decision tree; dynamically allocating the Bluetooth channels to the corresponding task blocks according to the dynamic priorities of the task blocks and the busy and idle states of the Bluetooth channels; and performing authentication connection, data copying and reading or connection release operation of the Bluetooth device on the Bluetooth channel allocated to the task block. The task priority is dynamically evaluated through the decision tree model, the Bluetooth channel resources are intelligently allocated, the meter reading efficiency and the channel utilization rate are remarkably improved, and the method is compatible with existing equipment and adapts to a complex electric power environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of electricity consumption information collection technology, specifically relating to a Bluetooth multi-channel concurrent meter reading method, system, and medium for an electricity consumption information collection terminal. Background Technology

[0002] With the continuous advancement of smart distribution area construction, Bluetooth-based smart devices are increasingly widely used in the power sector due to their low power consumption, high compatibility, convenient connectivity, and high reliability. Timely and efficient collection of Bluetooth device status and data has become crucial.

[0003] Currently, electricity information collection terminals (such as concentrators) still primarily employ the traditional task-based meter reading model for data collection. As the demands for data dimensionality, timeliness, and granularity in the power industry continue to increase, conventional Bluetooth device meter reading strategies are no longer sufficient in terms of timeliness. Existing technologies, particularly some patents, mainly optimize task scheduling, link management, and meter fault handling during meter reading tasks. However, these optimizations do not fully consider the crucial step of authentication and connection before Bluetooth devices can read data, nor the vulnerability of Bluetooth links to sudden interference. Therefore, these scheduling strategies experience a sharp decline in efficiency in complex scenarios with a large number of Bluetooth devices and significant communication interference in the distribution area.

[0004] In addition, some other related patents have proposed cutting-edge solutions for Bluetooth networking and massive data reading, but these solutions usually require modification or extension of the traditional Bluetooth protocol, are incompatible with a large number of existing devices on the market, and have high implementation costs and barriers to entry.

[0005] Therefore, there is an urgent need for a method that can effectively address Bluetooth connection authentication overhead and sudden link interference while remaining compatible with existing devices, thereby improving the efficiency of multi-channel concurrent meter reading. Summary of the Invention

[0006] In a first aspect, embodiments of this application provide a Bluetooth multi-channel concurrent meter reading method for an electricity information collection terminal, comprising the following steps: S1. When the meter reading task reaches its start execution time, a task block is generated for each Bluetooth device to be read in the meter reading task; the data structure of the task block includes at least the Bluetooth device file, the static priority inherited from the meter reading task, the Bluetooth link status of the Bluetooth device, and the current working status of the Bluetooth device. S2. A decision tree-guided dynamic weighted priority scoring algorithm calculates a dynamic priority for each task block; S3. Based on the dynamic priority of each task block and the busy / idle status of each Bluetooth channel, dynamically allocate the Bluetooth channel to the corresponding task block; S4. Perform Bluetooth device authentication connection, data reading, or connection release operations on the Bluetooth channel assigned to the task block.

[0007] Furthermore, the specific steps of step S1 are as follows: S11. Monitor the meter reading task queue. When a meter reading task reaches the preset start time, retrieve the corresponding meter reading task from the task queue. S12. Parse the meter reading task and obtain a list of all Bluetooth devices to be read in the meter reading task; S13. For each Bluetooth device in the Bluetooth device list, create a corresponding task block. The data structure of the task block also records the number of retries of the task block, with an initial value of 0. S14. Send all generated task blocks to the task scheduler for unified management.

[0008] Furthermore, the specific steps of step S2 are as follows: S21. Based on the Bluetooth link status and current working status in the data structure of the task block, classify the task block into a predefined category using a decision tree algorithm, and output a basic weight coefficient corresponding to the category. ; S22. Based on the task block's basic weight coefficient Combined with the number of retries and the static priority inherited from the meter reading task. Calculate dynamic priority for task blocks :

[0009] in, The static priority inherited by the task block; These are the basic weight coefficients output by the decision tree algorithm; This represents the current number of retries for this task block. This is the preset threshold for the maximum number of retries allowed.

[0010] Furthermore, in step S21, the execution logic of the decision tree algorithm is as follows: If the Bluetooth link status of the Bluetooth device is normal and the current working state is executing, it is classified as Class A with a basic weight coefficient of P1. If the Bluetooth link status of the Bluetooth device is normal and the current working state is waiting, it is classified as category B, and the basic weight coefficient is P2. If the Bluetooth link status of a Bluetooth device is abnormal and the reason for the abnormality is a response timeout, it is classified as category C, and the basic weight coefficient P3 is used. If the Bluetooth link status of a Bluetooth device is abnormal and the reason for the abnormality is connection failure, it is classified as category D, and the basic weight coefficient is P4. Among them, P1>P2>P3>P4.

[0011] Furthermore, the specific steps of step S3 are as follows: S31. When the task scheduler receives a new task block, it triggers the calculation of dynamic priority in step S2; S32. Determine the current working status of the Bluetooth device associated with the new task block; If the process is to wait, proceed to step S33; If not executed, proceed to step S36; S33. Check if there is an available Bluetooth channel; If so, proceed to step S34; If not, proceed to step S35; S34. Select an available Bluetooth channel and assign it to the new task block, and enter the command to proceed to step S4 to perform the authentication connection operation; S35. Sort all executing task blocks by dynamic priority and find the task block with the lowest dynamic priority; If the dynamic priority of the new task block is higher than the corresponding lowest priority, the Bluetooth channel of the task block with the lowest dynamic priority is preempted, and an instruction is output to step S4 to release the original Bluetooth device connection and authenticate the Bluetooth device associated with the new task block. S36. Compare the dynamic priority of the new task block with the dynamic priority of the currently executing task block associated with the same Bluetooth device; if the dynamic priority of the new task block is higher, then preempt the execution right of the corresponding Bluetooth channel.

[0012] Furthermore, in step S34, S35 or S36, when a task block releases the Bluetooth channel due to preemption or occupies the Bluetooth channel due to allocation, the task scheduler recalculates the dynamic priority of all task blocks in a waiting state related to the Bluetooth device currently involved in the handover.

[0013] Furthermore, step S3 also includes a scheduling step after the task is completed or times out: S37. When the task scheduler receives a notification that a task block has been read and completed, it dynamically prioritizes all unrunning task blocks and assigns the newly released Bluetooth channel to the task block with the highest dynamic priority. If the Bluetooth device associated with the task block with the highest dynamic priority is inconsistent with the Bluetooth device currently connected to the currently assigned Bluetooth channel, it outputs an instruction to step S4 to perform a Bluetooth device switching operation. S38. When the task scheduler receives a notification that a certain task block has timed out, it increments the number of retries for the corresponding task block by one, dynamically prioritizes all task blocks to be executed, assigns the newly released Bluetooth channel to the task block with the highest dynamic priority, and outputs an instruction to step S4 to perform the authentication connection operation.

[0014] Furthermore, the specific steps of step S4 are as follows: S41. The link manager receives instructions from the task scheduler, including instructions to connect, read, release, or switch; S42. Operate the corresponding Bluetooth channel and Bluetooth device according to the instructions: Perform Bluetooth authentication connection, read data, disconnect to release the Bluetooth channel, or disconnect the current Bluetooth device and connect to a new Bluetooth device; S43. Feedback the operation results to the task scheduler: If the data reading is complete, the task scheduler is notified to destroy the corresponding task block. If a communication timeout or connection failure occurs, the task scheduler is notified to update the Bluetooth link status of the corresponding task block and trigger retry logic.

[0015] Secondly, embodiments of this application also provide a Bluetooth multi-channel concurrent meter reading system for an electricity information collection terminal, used to implement the method described in the first aspect, including: The task block generation module is used to generate a task block for each Bluetooth device to be read in the meter reading task when the start execution time of the meter reading task arrives. The data structure of the task block includes at least the Bluetooth device file, the static priority inherited from the meter reading task, the Bluetooth link status of the Bluetooth device, and the current working status of the Bluetooth device. A task scheduler, used to receive task blocks, includes: The dynamic priority calculation unit is used for a decision tree-guided dynamic weighted priority scoring algorithm to calculate a dynamic priority for each task block. The scheduling decision unit is used to generate channel allocation instructions based on the dynamic priority of each task block and the busy / idle status of each Bluetooth channel. The link manager is used to receive the channel allocation instruction and perform Bluetooth device authentication connection, data reading, or connection release operations on the specified Bluetooth channel; Multiple Bluetooth channels, controlled by a link manager, are used to establish connections and communicate data with external Bluetooth devices.

[0016] Thirdly, embodiments of this application also provide a storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it implements the steps of the Bluetooth multi-channel concurrent meter reading method of the electricity information collection terminal as described in the first aspect.

[0017] As can be seen from the above technical solutions, this application has the following advantages: The Bluetooth multi-channel concurrent meter reading method, system, and medium provided in this application effectively address Bluetooth connection authentication overhead and sudden link interference, improving the efficiency of multi-channel concurrent meter reading; it is compatible with existing equipment, requiring no modification or extension of the traditional Bluetooth protocol, thus reducing implementation costs and barriers; through a dynamic weighted priority scoring algorithm, it intelligently evaluates task priorities, achieving reasonable allocation and scheduling of resources; it improves the effective utilization rate of Bluetooth channels and reduces connection authentication time during task switching. Attached Figure Description

[0018] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the Bluetooth multi-channel concurrent meter reading method of the electricity information collection terminal of the present invention.

[0020] Figure 2 This is a schematic diagram of the collaborative process of the Bluetooth multi-channel concurrent meter reading method of the electricity information collection terminal of the present invention.

[0021] Figure 3 This is a flowchart of the task block scheduling process of the present invention.

[0022] Figure 4 This is a schematic diagram of the Bluetooth multi-channel concurrent meter reading system of the electricity information collection terminal of the present invention. Detailed Implementation

[0023] In the embodiments of this application, the electricity consumption information collection terminal refers to a device deployed in a transformer substation for collecting and uploading information such as electricity data, including but not limited to concentrators and collectors. For ease of understanding, the following detailed description will primarily focus on concentrators as a preferred embodiment of the electricity consumption information collection terminal. Those skilled in the art will understand that the methods, systems, and media provided in this application are also applicable to other electricity consumption information collection terminals with multi-channel Bluetooth communication capabilities.

[0024] The various embodiments of this disclosure will be described more fully in the following detailed description of the specific steps of the Bluetooth multi-channel concurrent meter reading method for the electricity information collection terminal. This disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of this disclosure to the specific embodiments disclosed herein, but rather this disclosure should be understood to cover all adjustments, equivalents, and / or alternatives falling within the spirit and scope of the various embodiments of this disclosure.

[0025] For example, with the construction of smart distribution areas, Bluetooth technology is increasingly being used in the field of power equipment data acquisition due to its advantages such as low power consumption and high compatibility. However, the traditional meter reading mode is not timely enough to meet the power business's demand for improved data dimensions, timeliness, and precision. Existing optimization technologies mostly focus on task scheduling, link management, and meter fault handling, but do not fully consider the authentication and connection steps before Bluetooth devices read data and the characteristics of Bluetooth links being susceptible to sudden interference, resulting in a significant reduction in efficiency in complex scenarios with numerous Bluetooth devices and strong communication interference. Although some cutting-edge solutions propose new ideas for Bluetooth networking and massive data reading, they often require modification of traditional Bluetooth protocols, resulting in poor compatibility with existing devices on the market, which increases implementation costs and barriers to entry.

[0026] To address the aforementioned issues, this embodiment provides a Bluetooth multi-channel concurrent meter reading method for an electricity information collection terminal. By dynamically evaluating task priorities through a decision tree model and intelligently allocating Bluetooth channel resources, it significantly improves meter reading efficiency and channel utilization, is compatible with existing equipment, and adapts to complex power environments.

[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0028] Please see Figure 1 The diagram shows a flowchart of a Bluetooth multi-channel concurrent meter reading method for an electricity information collection terminal in a specific embodiment. The method includes the following steps: S1. When the meter reading task reaches its start execution time, a task block is generated for each Bluetooth device to be read in the meter reading task; the data structure of the task block includes at least the Bluetooth device file, the static priority inherited from the meter reading task, the Bluetooth link status of the Bluetooth device, and the current working status of the Bluetooth device. It should be noted that the Bluetooth module of the concentrator (i.e., the electricity information collection terminal in this embodiment) has multiple channels, each of which can independently connect to a Bluetooth device and perform data reading. Multiple channels can work in parallel. When there are few Bluetooth devices that need to be read, each device can be assigned a fixed channel. At this time, the communication load is low and the requirements for scheduling are not high. When the number of Bluetooth devices increases and exceeds the total number of channels, it is impossible to assign a fixed channel to each device. Therefore, it is necessary to perform time-division multiplexing of each Bluetooth channel. By switching the devices connected to the channel, the data reading of all Bluetooth devices can be achieved. When there are many Bluetooth devices and the concentrator has many meter reading tasks within a time window, it is necessary to continuously switch the connected devices of the Bluetooth channel to achieve data reading. Each device connection during device switching will have an authentication process, which leads to a decrease in the effective utilization rate of the Bluetooth channel. In this embodiment, the task block is the smallest unit of scheduling. Its life cycle is the execution cycle of this meter reading task. If all data items have been read, the scheduling unit can end this task block in advance. The data structure of the task block also records the number of retries (initial value is 0) and the number of Bluetooth channel acquisitions. S2. A decision tree-guided dynamic weighted priority scoring algorithm calculates a dynamic priority for each task block; It should be noted that the decision tree-guided dynamic weighted priority scoring algorithm can calculate dynamic priorities in real time based on the link status and working status of Bluetooth devices, ensuring that high-priority tasks are executed first. S3. Based on the dynamic priority of each task block and the busy / idle status of each Bluetooth channel, dynamically allocate the Bluetooth channel to the corresponding task block; It should be noted that the channel is dynamically allocated based on dynamic priority and the busy / idle status of the Bluetooth channel, which improves the utilization rate of the Bluetooth channel and avoids channel idleness and waste. S4. Perform Bluetooth device authentication connection, data reading, or connection release operations on the Bluetooth channel assigned to the task block; It should be noted that performing authentication connection, data reading, or connection release operations on the Bluetooth channel assigned to the task block enables efficient data acquisition from Bluetooth devices.

[0029] This embodiment improves meter reading efficiency and Bluetooth channel utilization by intelligently allocating channel resources through real-time evaluation of Bluetooth device link status and task priority. At the same time, it is compatible with existing Bluetooth protocols, requiring no modification to traditional equipment, greatly reducing the implementation threshold and adapting to the needs of complex power environments.

[0030] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, in order to fully illustrate the specific implementation process in this embodiment, another Bluetooth multi-channel concurrent meter reading method for an electricity information collection terminal is provided, which includes the following steps: S1. When the meter reading task reaches its start time, a task block is generated for each Bluetooth device to be read in the meter reading task; the data structure of the task block includes at least the Bluetooth device file, the static priority inherited from the meter reading task, the Bluetooth link status of the Bluetooth device, and the current working status of the Bluetooth device; the specific steps of step S1 are as follows: S11. Monitor the meter reading task queue. When a meter reading task reaches the preset start time, retrieve the corresponding meter reading task from the task queue. S12. Parse the meter reading task and obtain a list of all Bluetooth devices to be read in the meter reading task; S13. Create a corresponding task block for each Bluetooth device in the Bluetooth device list. The data structure of the task block also records the number of retries of the task block, with an initial value of 0 and the number of Bluetooth channel acquisitions. S14. Send all generated task blocks to the task scheduler for unified management; S2. A decision tree-guided dynamic weighted priority scoring algorithm is used to calculate a dynamic priority for each task block; the specific steps of step S2 are as follows: S21. Based on the Bluetooth link status and current working status in the data structure of the task block, classify the task block into a predefined category using a decision tree algorithm, and output a basic weight coefficient corresponding to the category. In step S21, the execution logic of the decision tree algorithm is as follows: If the Bluetooth link status of the Bluetooth device is normal and the current working state is executing, it is classified as Class A with a basic weight coefficient of P1. If the Bluetooth link status of the Bluetooth device is normal and the current working state is waiting, it is classified as category B, and the basic weight coefficient is P2. If the Bluetooth link status of a Bluetooth device is abnormal and the reason for the abnormality is a response timeout, it is classified as category C, and the basic weight coefficient P3 is used. If the Bluetooth link status of a Bluetooth device is abnormal and the reason for the abnormality is connection failure, it is classified as category D, and the basic weight coefficient is P4. Among them, P1>P2>P3>P4; For example, in step S21, the core logic of the decision tree algorithm is based on the characteristics of Bluetooth communication, such as the need for access authentication and sudden link interference, to classify the two relatively frequently changing dynamic features of link status and running status, handle nonlinear relationships, transform complex logic into simple categories, and avoid complex calculations. The specific decision path and the correspondence between the basic coefficients are shown in the table below, and the execution logic is shown in Table 1 below: Table 1

[0031] If the Bluetooth link status of the Bluetooth device is normal and the current working state is executing, it is classified as Class A with a basic weight coefficient of 1.0. If the Bluetooth link status of the Bluetooth device is normal and the current working state is waiting, it is classified as category B, and the basic weight coefficient is 0.9. If the Bluetooth link status of a Bluetooth device is abnormal and the reason for the abnormality is a response timeout, it is classified as Class C, and the basic weight coefficient is 0.4. If the Bluetooth link status of a Bluetooth device is abnormal and the reason for the abnormality is connection failure (authentication failure), it is classified as category D, and the basic weight coefficient is 0.2. S22. Based on the task block's basic weight coefficient Combined with the number of retries and the static priority inherited from the meter reading task. Calculate dynamic priority for task blocks :

[0032] in, The static priority inherited by the task block (value range 1-255, the larger the number, the higher the priority). These are the basic weight coefficients output by the decision tree algorithm (e.g., values ​​of 1.0, 0.9, 0.4, and 0.2). This represents the current number of retries for this task block. The preset maximum number of retries allowed (e.g., preset to 5); Specific tasks such as Figure 2 As shown in Table 2: Table 2

[0033] As can be seen from Table 2, the results of the above examples show that: Task 1 is in the best condition, with the highest score, and is currently running without retries. It should be scheduled first. Task 2 has the highest static priority, but because it is in a waiting state, it requires authentication to switch. Its dynamic priority is lower than that of Task 1, which is in line with the scheduling logic of reducing authentication time. Task 3 had two retries, which was too many. As a result, the score was significantly reduced due to the retry penalty factor. This was to avoid wasting resources on high-difficulty copying tasks. Task 4 is a serious anomaly due to link connection failure. Its base coefficient is low. Even though its static priority is high, its dynamic priority is still the lowest. Therefore, the channel resources it occupies can be released first. S3. Based on the dynamic priority of each task block and the busy / idle status of each Bluetooth channel, dynamically allocate the Bluetooth channel to the corresponding task block; like Figure 3 As shown, the specific steps of step S3 are as follows: S31. When the task scheduler receives a new task block, it triggers the calculation of dynamic priority in step S2; S32. Determine the current working status of the Bluetooth device associated with the new task block; If the process is to wait, proceed to step S33; If not executed, proceed to step S36; S33. Check if there is an available Bluetooth channel; If so, proceed to step S34; If not, proceed to step S35; S34. Select an idle Bluetooth channel and assign it to the new task block, and enter the instruction to proceed to step S4 to perform the authentication connection operation; at the same time, update the working state of the Bluetooth device to execute, and recalculate the dynamic priority of all task blocks related to the Bluetooth device that are in a waiting state; S35. Sort all executing task blocks by dynamic priority and find the task block with the lowest dynamic priority; If the dynamic priority of the new task block is higher than the corresponding lowest priority, the Bluetooth channel of the task block with the lowest dynamic priority is preempted, and an instruction is output to step S4 to release the original Bluetooth device connection and authenticate the Bluetooth device associated with the new task block; at the same time, the dynamic priority of all task blocks that are in a waiting state and are related to the original Bluetooth device and the new Bluetooth device are recalculated. S36. Compare the dynamic priority of the new task block with the dynamic priority of the currently executing task block associated with the same Bluetooth device; if the dynamic priority of the new task block is higher, then preempt the execution right of the corresponding Bluetooth channel (i.e., execute the new task block directly without switching devices); if the dynamic priority of the new task block is lower, then this scheduling ends. In step S34, S35 or S36, when a task block releases the Bluetooth channel due to preemption or occupies the Bluetooth channel due to allocation, the task scheduler recalculates the dynamic priority of all task blocks in a waiting state that are related to the Bluetooth device currently involved in the handover. Step S3 also includes a scheduling step after the task is completed or times out: S37. When the task scheduler receives a notification that a task block has been read and completed, it dynamically prioritizes all unrunning task blocks and assigns the newly released Bluetooth channel to the task block with the highest dynamic priority. If the Bluetooth device associated with the task block with the highest dynamic priority is inconsistent with the Bluetooth device currently connected to the currently assigned Bluetooth channel, it outputs an instruction to step S4 to perform a Bluetooth device switching operation. When the task scheduler receives a notification that a task block has completed copying, if the task block has completed copying all data items, it will directly destroy the task block. Then, it will dynamically prioritize all non-running task blocks (excluding task blocks whose associated devices are executing on other channels) and assign the newly released Bluetooth channel to the task block with the highest dynamic priority. If the Bluetooth device associated with the task block with the highest dynamic priority is different from the Bluetooth device currently connected to the currently assigned Bluetooth channel, it will output an instruction to step S4 to perform a Bluetooth device switching operation (disconnect the original connection and authenticate the new connection), and update the original device status to inactive and the new device status to active. At the same time, it will recalculate the dynamic priority of all task blocks that are in a waiting state related to the original device and the new device. S38. When the task scheduler receives a notification that a task block has timed out, it increments the number of retries for the corresponding task block by one, and dynamically prioritizes all task blocks to be executed (excluding task blocks that are being executed by the associated device on all channels). It then assigns the newly released Bluetooth channel to the task block with the highest dynamic priority and outputs an instruction to step S4 to perform the authentication connection operation. At the same time, it updates the status of the new device to "executed" and the status of the original device to "not executed", and recalculates the dynamic priority of all task blocks related to the original device and the new device that are in a waiting state. S4. Perform Bluetooth device authentication connection (if the number of Bluetooth channel acquisitions recorded by the task block is ≥2, the authentication process time can be shortened), data reading, or connection release operations on the Bluetooth channel assigned to the task block; the specific steps of step S4 are as follows: S41. The link manager receives instructions from the task scheduler, including instructions to connect, read, release, or switch; S42. Operate the corresponding Bluetooth channel and Bluetooth device according to the instructions: Perform Bluetooth authentication connection, read data, disconnect to release the Bluetooth channel, or disconnect the current Bluetooth device and connect to a new Bluetooth device; S43. Feedback the operation results to the task scheduler: If data copying is complete, notify the task scheduler to destroy the corresponding task block (if all data items have been completed). If a communication timeout or connection failure occurs, the task scheduler is notified to update the Bluetooth link status of the corresponding task block (if the connection fails, it is updated to "Abnormal - Connection Failure") and trigger the retry logic (i.e., proceed to step S38).

[0034] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0035] like Figure 4As shown, the following is an embodiment of the Bluetooth multi-channel concurrent meter reading system for the electricity information collection terminal provided in this disclosure. This system and the Bluetooth multi-channel concurrent meter reading method for the electricity information collection terminal in the above embodiments belong to the same inventive concept. For details not described in detail in the embodiments of the Bluetooth multi-channel concurrent meter reading system for the electricity information collection terminal, please refer to the embodiments of the Bluetooth multi-channel concurrent meter reading method for the above-mentioned electricity information collection terminal.

[0036] The system includes: The task block generation module is used to generate a task block for each Bluetooth device to be read in the meter reading task when the start execution time of the meter reading task arrives. The data structure of the task block includes at least the Bluetooth device file, the static priority inherited from the meter reading task, the Bluetooth link status of the Bluetooth device, and the current working status of the Bluetooth device. A task scheduler, used to receive task blocks, includes: The dynamic priority calculation unit is used for a decision tree-guided dynamic weighted priority scoring algorithm to calculate a dynamic priority for each task block. The scheduling decision unit is used to generate channel allocation instructions based on the dynamic priority of each task block and the busy / idle status of each Bluetooth channel. The link manager is used to receive the channel allocation instruction and perform Bluetooth device authentication connection, data reading, or connection release operations on the specified Bluetooth channel; Multiple Bluetooth channels, controlled by a link manager, are used to establish connections and communicate data with external Bluetooth devices.

[0037] This embodiment achieves intelligent allocation of channel resources through the task block generation module, task scheduler, link manager, and interactive collaboration of various Bluetooth channels, thereby improving meter reading efficiency and Bluetooth channel utilization. It is compatible with existing Bluetooth protocols, requires no modification to traditional equipment, greatly reduces the implementation threshold, and adapts to the needs of complex power environments.

[0038] The Bluetooth multi-channel concurrent meter reading method for the electricity information collection terminal provided in this application embodiment can be applied to electronic devices. Those skilled in the art will understand that the electronic device structure involved in the embodiments of this invention does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. In the embodiments of this invention, the electronic device includes, but is not limited to, laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of this application described and / or claimed herein.

[0039] Electronic devices may include processors, external memory interfaces, internal memory, universal serial bus (USB) interfaces, charging management modules, power management modules, batteries, wireless communication modules, audio modules, speakers, microphones, sensor modules, buttons, cameras, displays, and SIM card interfaces, etc.

[0040] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0041] A processor may include one or more processing units, such as a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0042] The processor can serve as the nerve center and command center of an electronic device. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.

[0043] The processor may also include memory for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. This memory can store instructions or data that the processor has just used or that are used repeatedly. If the processor needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces processor latency, and thus improves system efficiency.

[0044] The aforementioned electronic device implements the Bluetooth multi-channel concurrent meter reading method of the electricity information collection terminal of this application. When the meter reading task reaches its start execution time, a task block is generated for each Bluetooth device to be read in the meter reading task. The data structure of the task block includes at least a Bluetooth device file, a static priority inherited from the meter reading task, the Bluetooth link status of the Bluetooth device, and the current working status of the Bluetooth device. A dynamic priority is calculated for each task block based on a decision tree-guided dynamic weighted priority scoring algorithm. According to the dynamic priority of each task block and the busy / idle status of each Bluetooth channel, the Bluetooth channel is dynamically allocated to the corresponding task block. The technical solution of performing Bluetooth device authentication connection, data reading, or connection release operations on the Bluetooth channels allocated to the task blocks achieves the beneficial effects of dynamically evaluating task priorities through a decision tree model, intelligently allocating Bluetooth channel resources, significantly improving meter reading efficiency and channel utilization, being compatible with existing equipment, and adapting to complex power environments.

[0045] The storage medium provided in this application stores a program product that enables a Bluetooth multi-channel concurrent meter reading method for an electricity information collection terminal.

[0046] The Bluetooth multi-channel concurrent meter reading method for the electricity information collection terminal includes: when the meter reading task reaches its start execution time, generating a task block for each Bluetooth device to be read in the meter reading task; the data structure of the task block includes at least a Bluetooth device file, a static priority inherited from the meter reading task, the Bluetooth link status of the Bluetooth device, and the current working status of the Bluetooth device; calculating a dynamic priority for each task block based on a decision tree-guided dynamic weighted priority scoring algorithm; dynamically allocating Bluetooth channels to the corresponding task blocks according to the dynamic priority of each task block and the busy / idle status of each Bluetooth channel; and performing Bluetooth device authentication connection, data reading, or connection release operations on the Bluetooth channels allocated to the task blocks.

[0047] In some possible implementations, the Bluetooth multi-channel concurrent meter reading method of the electricity information collection terminal of this disclosure can be implemented as a program product, which includes program code. When the program product is run on a terminal device, the program code is used to cause the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.

[0048] The storage medium disclosed herein may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0049] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A Bluetooth multi-channel concurrent meter reading method for an electricity information collection terminal, characterized in that, Includes the following steps: S1. When the meter reading task reaches its start execution time, a task block is generated for each Bluetooth device to be read in the meter reading task; the data structure of the task block includes at least the Bluetooth device file, the static priority inherited from the meter reading task, the Bluetooth link status of the Bluetooth device, and the current working status of the Bluetooth device. S2. A decision tree-guided dynamic weighted priority scoring algorithm calculates a dynamic priority for each task block; S3. Based on the dynamic priority of each task block and the busy / idle status of each Bluetooth channel, dynamically allocate the Bluetooth channel to the corresponding task block; S4. Perform Bluetooth device authentication connection, data reading, or connection release operations on the Bluetooth channel assigned to the task block.

2. The Bluetooth multi-channel concurrent meter reading method for the electricity information collection terminal according to claim 1, characterized in that, The specific steps of step S1 are as follows: S11. Monitor the meter reading task queue. When a meter reading task reaches the preset start time, retrieve the corresponding meter reading task from the task queue. S12. Parse the meter reading task and obtain a list of all Bluetooth devices to be read in the meter reading task; S13. For each Bluetooth device in the Bluetooth device list, create a corresponding task block. The data structure of the task block also records the number of retries of the task block, with an initial value of 0. S14. Send all generated task blocks to the task scheduler for unified management.

3. The Bluetooth multi-channel concurrent meter reading method for the electricity information collection terminal according to claim 2, characterized in that, The specific steps of step S2 are as follows: S21. Based on the Bluetooth link status and current working status in the data structure of the task block, classify the task block into a predefined category using a decision tree algorithm, and output a basic weight coefficient corresponding to the category. ; S22. Based on the task block's basic weight coefficient Combined with the number of retries and the static priority inherited from the meter reading task. Calculate dynamic priority for task blocks : in, The static priority inherited by the task block; These are the basic weight coefficients output by the decision tree algorithm; This represents the current number of retries for this task block. This is the preset threshold for the maximum number of retries allowed.

4. The Bluetooth multi-channel concurrent meter reading method for the electricity information collection terminal according to claim 3, characterized in that, In step S21, the execution logic of the decision tree algorithm is as follows: If the Bluetooth link status of the Bluetooth device is normal and the current working state is executing, it is classified as Class A with a basic weight coefficient of P1. If the Bluetooth link status of the Bluetooth device is normal and the current working state is waiting, it is classified as category B, and the basic weight coefficient is P2. If the Bluetooth link status of a Bluetooth device is abnormal and the reason for the abnormality is a response timeout, it is classified as category C, and the basic weight coefficient P3 is used. If the Bluetooth link status of a Bluetooth device is abnormal and the reason for the abnormality is connection failure, it is classified as category D, and the basic weight coefficient is P4. Among them, P1>P2>P3>P4.

5. The Bluetooth multi-channel concurrent meter reading method for the electricity information collection terminal according to claim 3, characterized in that, The specific steps of step S3 are as follows: S31. When the task scheduler receives a new task block, it triggers the calculation of dynamic priority in step S2; S32. Determine the current working status of the Bluetooth device associated with the new task block; If the process is to wait, proceed to step S33; If not executed, proceed to step S36; S33. Check if there is an available Bluetooth channel; If so, proceed to step S34; If not, proceed to step S35; S34. Select an available Bluetooth channel and assign it to the new task block, and enter the command to proceed to step S4 to perform the authentication connection operation; S35. Sort all executing task blocks by dynamic priority and find the task block with the lowest dynamic priority; If the dynamic priority of the new task block is higher than the corresponding lowest priority, the Bluetooth channel of the task block with the lowest dynamic priority is preempted, and an instruction is output to step S4 to release the original Bluetooth device connection and authenticate the Bluetooth device associated with the new task block. S36. Compare the dynamic priority of the new task block with the dynamic priority of the currently executing task block associated with the same Bluetooth device; if the dynamic priority of the new task block is higher, then preempt the execution right of the corresponding Bluetooth channel.

6. The Bluetooth multi-channel concurrent meter reading method for the electricity information collection terminal according to claim 5, characterized in that, In step S34, S35, or S36, when a task block releases the Bluetooth channel due to preemption or occupies the Bluetooth channel due to allocation, the task scheduler recalculates the dynamic priority of all task blocks in a waiting state related to the Bluetooth device currently involved in the handover.

7. The Bluetooth multi-channel concurrent meter reading method for the electricity information collection terminal according to claim 5, characterized in that, Step S3 also includes a scheduling step after the task is completed or times out: S37. When the task scheduler receives a notification that a task block has been read and completed, it dynamically prioritizes all unrunning task blocks and assigns the newly released Bluetooth channel to the task block with the highest dynamic priority. If the Bluetooth device associated with the task block with the highest dynamic priority is inconsistent with the Bluetooth device currently connected to the currently assigned Bluetooth channel, it outputs an instruction to step S4 to perform a Bluetooth device switching operation. S38. When the task scheduler receives a notification that a certain task block has timed out, it increments the number of retries for the corresponding task block by one, dynamically prioritizes all task blocks to be executed, assigns the newly released Bluetooth channel to the task block with the highest dynamic priority, and outputs an instruction to step S4 to perform the authentication connection operation.

8. The Bluetooth multi-channel concurrent meter reading method for the electricity information collection terminal according to claim 1, characterized in that, The specific steps of step S4 are as follows: S41. The link manager receives instructions from the task scheduler, including instructions to connect, read, release, or switch; S42. Operate the corresponding Bluetooth channel and Bluetooth device according to the instructions: Perform Bluetooth authentication connection, read data, disconnect to release the Bluetooth channel, or disconnect the current Bluetooth device and connect to a new Bluetooth device; S43. Feedback the operation results to the task scheduler: If the data reading is complete, the task scheduler is notified to destroy the corresponding task block. If a communication timeout or connection failure occurs, the task scheduler is notified to update the Bluetooth link status of the corresponding task block and trigger retry logic.

9. A Bluetooth multi-channel concurrent meter reading system for an electricity information collection terminal, used to implement the method described in any one of claims 1 to 8, characterized in that, include: The task block generation module is used to generate a task block for each Bluetooth device to be read in the meter reading task when the start execution time of the meter reading task arrives. The data structure of the task block includes at least the Bluetooth device file, the static priority inherited from the meter reading task, the Bluetooth link status of the Bluetooth device, and the current working status of the Bluetooth device. A task scheduler, used to receive task blocks, includes: The dynamic priority calculation unit is used for a decision tree-guided dynamic weighted priority scoring algorithm to calculate a dynamic priority for each task block. The scheduling decision unit is used to generate channel allocation instructions based on the dynamic priority of each task block and the busy / idle status of each Bluetooth channel. The link manager is used to receive the channel allocation instruction and perform Bluetooth device authentication connection, data reading, or connection release operations on the specified Bluetooth channel; Multiple Bluetooth channels, controlled by a link manager, are used to establish connections and communicate data with external Bluetooth devices.

10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the Bluetooth multi-channel concurrent meter reading method of the electricity information collection terminal as described in any one of claims 1 to 8.